Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

SingleParticleGun Class Reference

#include <SingleParticleGun.h>

Inheritance diagram for SingleParticleGun:

GenModule GenModule List of all members.

Public Member Functions

virtual StatusCode callGenerator ()
virtual StatusCode callGenerator ()
StatusCode execute ()
StatusCode execute ()
virtual StatusCode fillEvt (GenEvent *evt)
virtual StatusCode fillEvt (GenEvent *evt)
StatusCode finalize ()
StatusCode finalize ()
virtual StatusCode genFinalize ()
virtual StatusCode genFinalize ()
virtual StatusCode genInitialize ()
virtual StatusCode genInitialize ()
virtual StatusCode genuserInitialize ()
virtual StatusCode genuserInitialize ()
StatusCode initialize ()
StatusCode initialize ()
 SingleParticleGun (const std::string &name, ISvcLocator *pSvcLocator)
 SingleParticleGun (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~SingleParticleGun ()
virtual ~SingleParticleGun ()

Protected Member Functions

void StripPartons (GenEvent *evt)
void StripPartons (GenEvent *evt)
void StripPartonsInit (void)
void StripPartonsInit (void)

Protected Attributes

std::vector< int > m_AllPartons
std::vector< int > m_AllPartons
bool m_fixedMode
double m_meanInteractions
HepPDT::ParticleDataTable * m_particleTable
HepPDT::ParticleDataTable * m_particleTable
CLHEP::RandPoisson * m_pPoissonGenerator
CLHEP::RandPoisson * m_pPoissonGenerator
CLHEP::HepRandomEngine * m_pRandomEngine
CLHEP::HepRandomEngine * m_pRandomEngine
int m_randomSeed
bool m_StripPartonSwitch
std::vector< int > m_StripVector
std::vector< int > m_StripVector

Private Member Functions

double generateValue (int mode, double val, double sigma, double min, double max)
double generateValue (int mode, double val, double sigma, double min, double max)

Private Attributes

int m_EGenMode
int m_Emode
int m_events
HepLorentzVector m_fourMom
HepLorentzVector m_fourPos
double m_mass
double m_maxE
double m_maxPhi
double m_maxPt
double m_maxTheta
double m_minE
double m_minPhi
double m_minPt
double m_minTheta
int m_pdgCode
int m_PhiGenMode
int m_PtGenMode
double m_requestedE
double m_requestedPhi
double m_requestedPt
double m_requestedT
double m_requestedTheta
double m_requestedX
double m_requestedY
double m_requestedZ
std::vector< long int > m_seeds
std::vector< long int > m_seeds
double m_sigmaE
double m_sigmaPhi
double m_sigmaPt
double m_sigmaTheta
int m_ThetaGenMode
IBesRndmGenSvcp_BesRndmGenSvc
IBesRndmGenSvcp_BesRndmGenSvc

Constructor & Destructor Documentation

SingleParticleGun::SingleParticleGun const std::string &  name,
ISvcLocator *  pSvcLocator
 

00034   : GenModule(name,pSvcLocator)
00035 {
00036 //--------------------------------------------------------------------------  
00037   declareProperty("Mode",m_Emode =  SingleEnergyMode::PtMode);
00038   // in PtMode user specifies Pt theta and phi
00039   // in EMode user specifies E, theta and phi 
00040   // defaults are set so that something is always generated
00041 
00042   declareProperty("Pt",m_requestedPt = 5.0); 
00043   declareProperty("E",m_requestedE = 5.0); 
00044   declareProperty("Phi",m_requestedPhi = 0.0);  
00045   declareProperty("Theta",m_requestedTheta = 3.14/4.0);  
00046 
00047   declareProperty("VertexX",m_requestedX = 0.0); 
00048   declareProperty("VertexY",m_requestedY = 0.0); 
00049   declareProperty("VertexZ",m_requestedZ = 0.0); 
00050   declareProperty("Time",m_requestedT = 0.0); 
00051 
00052   declareProperty("MinPt",m_minPt = 1.); 
00053   declareProperty("MinE",m_minE = 1.); 
00054   declareProperty("MinTheta",m_minTheta = 0.); 
00055   declareProperty("MinPhi",m_minPhi = 0.); 
00056 
00057   declareProperty("MaxPt",m_maxPt = 100.); 
00058   declareProperty("MaxE",m_maxE = 100.); 
00059   declareProperty("MaxTheta",m_maxTheta=pi); 
00060   declareProperty("MaxPhi",m_maxPhi = twopi); 
00061 
00062   declareProperty("SigmaPt",m_sigmaPt = 0.1); 
00063   declareProperty("SigmaE",m_sigmaE = 0.1); 
00064 
00065   declareProperty("SigmaTheta",m_sigmaTheta= 0.1); 
00066   declareProperty("SigmaPhi",m_sigmaPhi = 0.1); 
00067 
00068   declareProperty("ModePt",m_PtGenMode = SingleParticleGunGenMode::FixedMode); 
00069   declareProperty("ModeE",m_EGenMode = SingleParticleGunGenMode::FixedMode); 
00070   declareProperty("ModeTheta",m_ThetaGenMode=SingleParticleGunGenMode::FixedMode); 
00071 
00072   declareProperty("ModePhi",m_PhiGenMode=SingleParticleGunGenMode::FixedMode);
00073   // specifies type of distribution
00074 
00075   declareProperty("PdgCode",m_pdgCode=211);
00076 }

SingleParticleGun::~SingleParticleGun  )  [virtual]
 

00079                                       {
00080 //--------------------------------------------------------------------------
00081 //   if(m_pFlatGenerator)  delete m_pFlatGenerator;
00082 //   if(m_pGaussGenerator) delete m_pGaussGenerator;
00083 }

SingleParticleGun::SingleParticleGun const std::string &  name,
ISvcLocator *  pSvcLocator
 

virtual SingleParticleGun::~SingleParticleGun  )  [virtual]
 


Member Function Documentation

virtual StatusCode SingleParticleGun::callGenerator  )  [virtual]
 

Reimplemented from GenModule.

StatusCode SingleParticleGun::callGenerator  )  [virtual]
 

Reimplemented from GenModule.

00156                                             {
00157 //---------------------------------------------------------------------------
00158 
00159   ++m_events;
00160   // Save the random number seeds in the event
00161   CLHEP::HepRandomEngine*       engine  =       p_BesRndmGenSvc->GetEngine("SINGLE");
00162   const long*           s       =       engine->getSeeds();
00163   m_seeds.clear();
00164   m_seeds.push_back(s[0]);
00165   m_seeds.push_back(s[1]);
00166 
00167  // Generate values for pt, theta and phi
00168  //
00169   double pt,phi,theta,E,px,py,pz,p;
00170   switch(m_Emode){
00171 
00172   case SingleEnergyMode::PtMode:
00173  pt = generateValue(m_PtGenMode,m_requestedPt, m_sigmaPt, 
00174                            m_minPt, m_maxPt);
00175  theta = generateValue(m_ThetaGenMode,m_requestedTheta, m_sigmaTheta, 
00176                            m_minTheta, m_maxTheta);
00177  phi = generateValue(m_PhiGenMode,m_requestedPhi, m_sigmaPhi, 
00178                            m_minPhi, m_maxPhi);
00179 
00180  // Transform to x,y,z coordinates
00181  //
00182  px = pt*cos(phi);
00183  py = pt*sin(phi);
00184  pz = pt/tan(theta);
00185  m_fourMom.setVectM(Hep3Vector(px,py,pz),m_mass);
00186  m_fourPos.set(m_requestedX,m_requestedY,m_requestedZ,m_requestedT);
00187  return StatusCode::SUCCESS;
00188 
00189  case SingleEnergyMode::EMode:
00190  E = generateValue(m_EGenMode,m_requestedE, m_sigmaE, 
00191                            m_minE, m_maxE);
00192  theta = generateValue(m_ThetaGenMode,m_requestedTheta, m_sigmaTheta, 
00193                            m_minTheta, m_maxTheta);
00194  phi = generateValue(m_PhiGenMode,m_requestedPhi, m_sigmaPhi, 
00195                            m_minPhi, m_maxPhi);
00196 
00197  // Transform to x,y,z coordinates
00198  //
00199  if(E*E-m_mass*m_mass < 0.){
00200  MsgStream log(messageService(), name());
00201  log << MSG::ERROR  << "You have Generated a Tachyon!! Increase energy or change particle ID" << endreq;   
00202 return StatusCode::FAILURE;
00203  }
00204  p=sqrt(E*E-m_mass*m_mass);
00205  px = p*sin(theta)*cos(phi);
00206  py = p*sin(theta)*sin(phi);
00207  pz = p*cos(theta);
00208 
00209  m_fourMom.setVectM(Hep3Vector(px,py,pz),m_mass);
00210  m_fourPos.set(m_requestedX,m_requestedY,m_requestedZ,m_requestedT);
00211  return StatusCode::SUCCESS;
00212 }  
00213  return StatusCode::SUCCESS;
00214 }

StatusCode GenModule::execute  )  [inherited]
 

StatusCode GenModule::execute  )  [inherited]
 

00125                               {
00126   //---------------------------------------------------------------------------
00127     
00128   int numToGenerate;
00129   StatusCode status;
00130 
00131   MsgStream log(messageService(), name());
00132 
00133   log << MSG::DEBUG << "GenModule::execute()" << endreq;
00134 
00135   // Decide how many interactions to generate
00136   if(m_fixedMode)  {
00137     numToGenerate = (int) m_meanInteractions;
00138   }
00139   else {
00140     numToGenerate = m_pPoissonGenerator->fire();
00141   }
00142 
00143   // Generate as many interactions as requested
00144   for(int i=0; i<numToGenerate; i++) {
00145 
00146     // Call the code that generates an event
00147     status = this->callGenerator();
00148 
00149     // Create the MC event and send the GeneratorEvent stored in it to fillEvt
00150     GenEvent* evt = new GenEvent(1,1);
00151     status = this->fillEvt(evt);
00152 
00153     // Strip out the requested partons here.
00154     if (m_StripPartonSwitch)    StripPartons(evt);
00155     
00156     // Check if the McCollection already exists
00157     SmartDataPtr<McGenEventCol> anMcCol(eventSvc(), "/Event/Gen");
00158     if (anMcCol!=0) {
00159       // Add event to existing collection
00160       MsgStream log(messageService(), name());
00161       log << MSG::INFO << "Add McGenEvent to existing collection" << endreq;
00162       McGenEvent* mcEvent = new McGenEvent(evt);
00163       anMcCol->push_back(mcEvent);
00164     }
00165     else {
00166       // Create Collection and add  to the transient store
00167       McGenEventCol *mcColl = new McGenEventCol;
00168       McGenEvent* mcEvent = new McGenEvent(evt);
00169       mcColl->push_back(mcEvent);
00170 
00171       StatusCode sc = eventSvc()->registerObject("/Event/Gen",mcColl);
00172 
00173       if (sc != StatusCode::SUCCESS) {
00174         MsgStream log(messageService(), name());
00175         log << MSG::ERROR << "Could not register McGenEvent" << endreq;
00176         delete mcColl;
00177         delete evt;
00178         delete mcEvent;
00179         return StatusCode::FAILURE;
00180       }
00181       else {
00182 //        std::cout << " McGenEventCol made and stored" << std::endl;
00183       }
00184       
00185     }
00186   }
00187 
00188   // now call the incident service and set the signal.
00189   IIncidentSvc *incSvc;
00190   service("IncidentSvc",incSvc);
00191   incSvc->fireIncident( Incident( name(), "McGenEvent Generated") );
00192 
00193   return status;
00194 }

virtual StatusCode SingleParticleGun::fillEvt GenEvent *  evt  )  [virtual]
 

Reimplemented from GenModule.

StatusCode SingleParticleGun::fillEvt GenEvent *  evt  )  [virtual]
 

Reimplemented from GenModule.

00223                                                    {
00224 //---------------------------------------------------------------------------
00225   // Note:  The vertex is owned by the event so the event is responsible
00226   // for deleting its memory
00227   evt->set_event_number(m_events); // Set the event number
00228   GenVertex* v1 = new GenVertex(m_fourPos);
00229 
00230   std::cout << " SingleParticleGun::fillEvt --> " <<std::endl;
00231   std::cout << " Event number:: " << m_events << std::endl; 
00232   std::cout << " vertex.x = " << m_fourPos.x() 
00233             << " vertex.y = " << m_fourPos.y() 
00234             << " vertex.z = " << m_fourPos.z() 
00235             << " vertex.t = " << m_fourPos.t() <<  std::endl;
00236 
00237   std::cout << " momentum.x = " << m_fourMom.x() 
00238             << " momentum.y = " << m_fourMom.y() 
00239             << " momentum.z = " << m_fourMom.z() 
00240             << " momentum.t = " << m_fourMom.t() <<  std::endl;
00241  
00242   evt->add_vertex( v1 );
00243 
00244  
00245   v1->add_particle_out( new GenParticle( m_fourMom, m_pdgCode,1) );
00246 
00247   std::cout << " particles_size = " << evt->particles_size() 
00248             << " vertices_size = " << evt->vertices_size()
00249             << std::endl;
00250 
00251   evt->set_signal_process_id(SINGLE);
00252   evt->set_random_states(m_seeds);
00253  
00254  return StatusCode::SUCCESS;
00255 }

StatusCode GenModule::finalize  )  [inherited]
 

StatusCode GenModule::finalize  )  [inherited]
 

00197                                {
00198   //---------------------------------------------------------------------------
00199 
00200   StatusCode status = this->genFinalize();
00201 
00202   return status;
00203 }

double SingleParticleGun::generateValue int  mode,
double  val,
double  sigma,
double  min,
double  max
[private]
 

double SingleParticleGun::generateValue int  mode,
double  val,
double  sigma,
double  min,
double  max
[private]
 

00259                                          {
00260 //---------------------------------------------------------------------------
00261   double tmp;
00262   int i = 0;
00263   CLHEP::HepRandomEngine* engine = p_BesRndmGenSvc->GetEngine("SINGLE");
00264   const int maxtries = 100;
00265   switch (mode) {
00266   case SingleParticleGunGenMode::FixedMode:
00267     return val;
00268   case SingleParticleGunGenMode::GaussMode:
00269     tmp = max+1.0;
00270     i = 0;
00271     do{
00272 //        tmp = m_pGaussGenerator->fire((HepDouble) val,(HepDouble) sigma);
00273        tmp = RandGauss::shoot(engine, (HepDouble) val,(HepDouble) sigma);
00274        i++;
00275     } while ( (tmp<min) || (tmp > max) && (i < maxtries));
00276     if(i>maxtries) {
00277        MsgStream log(messageService(), name());
00278        log << MSG::ERROR << "Cant generate value in range (min, max) "
00279            << val << "\t" << min << "\t" << max << endreq;
00280     }
00281     return tmp;
00282   case SingleParticleGunGenMode::FlatMode:
00283 //     tmp = m_pFlatGenerator->fire((HepDouble) min,(HepDouble) max);
00284     tmp = RandFlat::shoot(engine, (HepDouble) min,(HepDouble) max);
00285     return tmp;
00286   default:
00287     MsgStream log(messageService(), name());
00288     log << MSG::ERROR  << "Unknown Generation Mode" << endreq;
00289     return 0.;
00290   }
00291 }

virtual StatusCode SingleParticleGun::genFinalize  )  [virtual]
 

Reimplemented from GenModule.

StatusCode SingleParticleGun::genFinalize  )  [virtual]
 

Reimplemented from GenModule.

00217                                           {
00218 //---------------------------------------------------------------------------
00219  return StatusCode::SUCCESS;
00220 }

virtual StatusCode SingleParticleGun::genInitialize  )  [virtual]
 

Reimplemented from GenModule.

StatusCode SingleParticleGun::genInitialize  )  [virtual]
 

Reimplemented from GenModule.

00086                                             {
00087 //---------------------------------------------------------------------------
00088 
00089  // Create the flat and gaussian generators
00090  //
00091 
00092  MsgStream log(messageService(), name());
00093 
00094  static const bool CREATEIFNOTTHERE(true);
00095  StatusCode RndmStatus = service("BesRndmGenSvc", p_BesRndmGenSvc, CREATEIFNOTTHERE);
00096  if (!RndmStatus.isSuccess() || 0 == p_BesRndmGenSvc)
00097  {
00098    log << MSG::ERROR << " Could not initialize Random Number Service" << endreq;
00099    return RndmStatus;
00100  }      
00101 
00102  // Get the mass of the particle to be generated
00103  //
00104  const HepPDT::ParticleData* particle = m_particleTable->particle(HepPDT::ParticleID(abs(m_pdgCode)));
00105  m_mass = particle->mass().value();
00106 
00107  // 
00108  // Make sure the parameters are in a sensible range...
00109  //
00110  switch (m_Emode){
00111  case SingleEnergyMode::PtMode:
00112  if(!m_PtGenMode && (m_minPt > m_requestedPt || m_maxPt < m_requestedPt)
00113       || m_maxPt < m_minPt ) {
00114    log << MSG:: ERROR << " Pt min and max out of range.  \n" <<
00115        "     Will set Pt mode to Fixed!!!" << endreq;
00116    m_PtGenMode = SingleParticleGunGenMode::FixedMode;
00117  }
00118  if(!m_ThetaGenMode && (m_minTheta > m_requestedTheta || m_maxTheta < m_requestedTheta) 
00119       || m_maxTheta < m_minTheta ) {
00120    log << MSG:: ERROR << " Theta min and max out of range. \n" <<
00121        "     Will set Theta mode to Fixed!!!" << endreq;
00122    m_ThetaGenMode = SingleParticleGunGenMode::FixedMode;
00123  }
00124  if(!m_PhiGenMode && (m_minPhi > m_requestedPhi || m_maxPhi < m_requestedPhi)
00125       || m_maxPhi < m_minPhi ) {
00126    log << MSG:: ERROR << " Phi min and max out of range.  \n" <<
00127        "     Will set Phi mode to Fixed!!!" << endreq;
00128    m_PhiGenMode = SingleParticleGunGenMode::FixedMode;
00129  }
00130  break;
00131  case SingleEnergyMode::EMode:
00132  if(!m_EGenMode && (m_minE > m_requestedE || m_maxE < m_requestedE)
00133       || m_maxE < m_minE ) {
00134    log << MSG:: ERROR << " E min and max out of range.  \n" <<
00135        "     Will set E mode to Fixed!!!" << endreq;
00136    m_EGenMode = SingleParticleGunGenMode::FixedMode;
00137  }
00138  if(!m_ThetaGenMode && (m_minTheta > m_requestedTheta || m_maxTheta < m_requestedTheta) 
00139       || m_maxTheta < m_minTheta ) {
00140    log << MSG:: ERROR << " Theta min and max out of range. \n" <<
00141        "     Will set Theta mode to Fixed!!!" << endreq;
00142    m_ThetaGenMode = SingleParticleGunGenMode::FixedMode;
00143  }
00144  if(!m_PhiGenMode && (m_minPhi > m_requestedPhi || m_maxPhi < m_requestedPhi)
00145       || m_maxPhi < m_minPhi ) {
00146    log << MSG:: ERROR << " Phi min and max out of range.  \n" <<
00147        "     Will set Phi mode to Fixed!!!" << endreq;
00148    m_PhiGenMode = SingleParticleGunGenMode::FixedMode;
00149  }break;
00150  }
00151   m_events = 0;
00152  return StatusCode::SUCCESS;
00153 }

virtual StatusCode GenModule::genuserInitialize  )  [virtual, inherited]
 

StatusCode GenModule::genuserInitialize  )  [virtual, inherited]
 

00212                                         { 
00213   //---------------------------------------------------------------------------
00214   return StatusCode::SUCCESS;
00215 }

StatusCode GenModule::initialize  )  [inherited]
 

StatusCode GenModule::initialize  )  [inherited]
 

00063                                 {
00064   //---------------------------------------------------------------------------
00065 
00066   // Inform the user what the mode and conditions are:
00067   MsgStream log(messageService(), name());
00068 
00069   // Initialize StripPartons variables
00070   if (m_StripVector[0] > 0) {
00071     StripPartonsInit();
00072   } else {
00073     m_StripPartonSwitch =       false;
00074     m_StripVector.clear();
00075   }
00076 
00077    
00078   // Get the Particle Properties Service
00079   IPartPropSvc* p_PartPropSvc;
00080   //static const bool CREATEIFNOTTHERE(true);
00081   //StatusCode PartPropStatus = service("PartPropSvc", p_PartPropSvc, CREATEIFNOTTHERE);
00082   StatusCode PartPropStatus = service("PartPropSvc", p_PartPropSvc);
00083   if (!PartPropStatus.isSuccess() || 0 == p_PartPropSvc) {
00084     log << MSG::ERROR << " Could not initialize Particle Properties Service" << endreq;
00085     return PartPropStatus;
00086   }      
00087 
00088   m_particleTable = p_PartPropSvc->PDT();
00089   
00090   m_pRandomEngine = new Ranlux64Engine(m_randomSeed);
00091 
00092   if(m_fixedMode) {
00093     if(m_meanInteractions == 1.0) {
00094       log << MSG::INFO << "Standard Initialization:  Single Interaction Mode "
00095           << endreq;
00096     }
00097     else {
00098       log << MSG::INFO << "Fixed Number of Interactions per Event is: "
00099           << m_meanInteractions << endreq;
00100     }
00101   }
00102   else {
00103     m_pPoissonGenerator = new RandPoisson(*m_pRandomEngine, 
00104                                           m_meanInteractions);
00105 
00106     log << MSG::INFO << 
00107       "Poisson Distribution of Interactions per Event with Mean: "
00108         << m_meanInteractions << endreq;
00109   }
00110   // Initialize the generator itself
00111   StatusCode status = this->genInitialize();
00112   if (status.isFailure()) {
00113     log << MSG::ERROR << "Could not initialize Generator properly" << endreq;
00114     return status;
00115   }  
00116   StatusCode  status1 = this->genuserInitialize();
00117   if (status1.isFailure()) {
00118     log << MSG::ERROR << "Could not initialize user part properly" << endreq;
00119     return status1;
00120   } 
00121   return status;
00122 }

void GenModule::StripPartons GenEvent *  evt  )  [protected, inherited]
 

void GenModule::StripPartons GenEvent *  evt  )  [protected, inherited]
 

00275 {
00276   //    for ( HepMC::GenEvent::particle_iterator p = evt->particles_begin();
00277   //              p != evt->particles_end(); ++p )
00278   //    {
00279   //  //            std::cout << " PDG, BAR " << (*p)->pdg_id() << " " << (*p)->barcode() << std::endl;
00280   //        if ( std::find(m_StripVector.begin(),
00281   //                       m_StripVector.end(),
00282   //                       (*p)->pdg_id()) != m_StripVector.end() )
00283   //        {
00284   //  //                std::cout << " REMOVING " << (*p)->pdg_id() << " " << (*p)->barcode() << std::endl;
00285   //            HepMC::GenVertex*       pvtx    =       (*p)->production_vertex();
00286   //            HepMC::GenVertex*       evtx    =       (*p)->end_vertex();
00287   //            if (pvtx) pvtx->remove_particle(*p);
00288   //            if (evtx) evtx->remove_particle(*p);
00289   //            delete  *p;
00290   //        }
00291             
00292   //    }
00293         
00294   // Loop on all vertices of the event and remove the particle from the vertex
00295   for ( HepMC::GenEvent::vertex_iterator vtx = evt->vertices_begin();
00296         vtx != evt->vertices_end(); ++vtx ) {
00297     // Loop on all children particles and remove the ones that should be stripped out
00298     for ( HepMC::GenVertex::particle_iterator p = (*vtx)-> particles_begin(HepMC::children);
00299           p != (*vtx)->particles_end(HepMC::children);
00300           ++p ){
00301       if ( std::find(m_StripVector.begin(),
00302                      m_StripVector.end(),
00303                      (*p)->pdg_id()) != m_StripVector.end() ) {
00304         if ( (*p)->end_vertex() ) (*p)->end_vertex()->remove_particle(*p);
00305         if ( (*p)->production_vertex() ) (*p)->production_vertex()->remove_particle(*p);
00306         delete *p;
00307       }
00308     }
00309     // Loop on all parents particles and remove the ones that should be stripped out
00310     for ( HepMC::GenVertex::particle_iterator p = (*vtx)-> particles_begin(HepMC::parents);
00311           p != (*vtx)->particles_end(HepMC::parents);
00312           ++p ) {
00313       if ( std::find(m_StripVector.begin(),
00314                      m_StripVector.end(),
00315                      (*p)->pdg_id()) != m_StripVector.end() ) {
00316         if ( (*p)->end_vertex() ) (*p)->end_vertex()->remove_particle(*p);
00317         if ( (*p)->production_vertex() ) (*p)->production_vertex()->remove_particle(*p);
00318         delete *p;
00319       }
00320     }
00321   }
00322 }

void GenModule::StripPartonsInit void   )  [protected, inherited]
 

void GenModule::StripPartonsInit void   )  [protected, inherited]
 

00237 {
00238   MsgStream log(messageService(), name());
00239 
00240   for (int i = 1; i < 9; ++i) { m_AllPartons.push_back(i); m_AllPartons.push_back(-i); } // Quarks
00241   m_AllPartons.push_back(21); // gluon
00242 
00243   m_StripPartonSwitch = true;
00244   m_StripVector.erase(m_StripVector.begin(), m_StripVector.begin()+1);
00245   // When the user specifies only the StripPartonSwitch or gives a Particle Code
00246   // which is NOT a parton then strip ALL partons
00247   if (m_StripVector.size() == 0) {
00248     log << MSG::INFO << " !!!! NO SPECIFIC PARTON FOR STRIPOUT WAS REQUESTED => STRIPOUT ALL "
00249         << endreq;
00250     m_StripVector = m_AllPartons;
00251   } else {
00252     bool        value_ok        =       true;
00253     std::vector<int>::const_iterator    i =     m_StripVector.begin();
00254     do {
00255       if ( std::find(m_AllPartons.begin(),
00256                      m_AllPartons.end(),
00257                      *i) == m_AllPartons.end() ) value_ok = false;
00258       ++i;
00259     } while (i != m_StripVector.end() && value_ok);
00260     if (!value_ok) {
00261       log << MSG::INFO << " !!!! ILEGAL PDG-ID FOR STRIPOUT WAS REQUESTED => STRIPOUT ALL "
00262           << endreq;
00263       m_StripVector = m_AllPartons;
00264     }
00265   }
00266   log << MSG::INFO << " THE FOLLOWING PARTON(S) WILL BE STRIPED OUT ";
00267   for (std::vector<int>::const_iterator ip = m_StripVector.begin(); ip != m_StripVector.end(); ++ip)
00268     log << *ip << "  ";
00269   log << endreq;
00270   
00271 }


Member Data Documentation

std::vector<int> GenModule::m_AllPartons [protected, inherited]
 

std::vector<int> GenModule::m_AllPartons [protected, inherited]
 

int SingleParticleGun::m_EGenMode [private]
 

int SingleParticleGun::m_Emode [private]
 

int SingleParticleGun::m_events [private]
 

bool GenModule::m_fixedMode [protected, inherited]
 

HepLorentzVector SingleParticleGun::m_fourMom [private]
 

HepLorentzVector SingleParticleGun::m_fourPos [private]
 

double SingleParticleGun::m_mass [private]
 

double SingleParticleGun::m_maxE [private]
 

double SingleParticleGun::m_maxPhi [private]
 

double SingleParticleGun::m_maxPt [private]
 

double SingleParticleGun::m_maxTheta [private]
 

double GenModule::m_meanInteractions [protected, inherited]
 

double SingleParticleGun::m_minE [private]
 

double SingleParticleGun::m_minPhi [private]
 

double SingleParticleGun::m_minPt [private]
 

double SingleParticleGun::m_minTheta [private]
 

HepPDT::ParticleDataTable* GenModule::m_particleTable [protected, inherited]
 

HepPDT::ParticleDataTable* GenModule::m_particleTable [protected, inherited]
 

int SingleParticleGun::m_pdgCode [private]
 

int SingleParticleGun::m_PhiGenMode [private]
 

CLHEP::RandPoisson* GenModule::m_pPoissonGenerator [protected, inherited]
 

CLHEP::RandPoisson* GenModule::m_pPoissonGenerator [protected, inherited]
 

CLHEP::HepRandomEngine* GenModule::m_pRandomEngine [protected, inherited]
 

CLHEP::HepRandomEngine* GenModule::m_pRandomEngine [protected, inherited]
 

int SingleParticleGun::m_PtGenMode [private]
 

int GenModule::m_randomSeed [protected, inherited]
 

double SingleParticleGun::m_requestedE [private]
 

double SingleParticleGun::m_requestedPhi [private]
 

double SingleParticleGun::m_requestedPt [private]
 

double SingleParticleGun::m_requestedT [private]
 

double SingleParticleGun::m_requestedTheta [private]
 

double SingleParticleGun::m_requestedX [private]
 

double SingleParticleGun::m_requestedY [private]
 

double SingleParticleGun::m_requestedZ [private]
 

std::vector<long int> SingleParticleGun::m_seeds [private]
 

std::vector<long int> SingleParticleGun::m_seeds [private]
 

double SingleParticleGun::m_sigmaE [private]
 

double SingleParticleGun::m_sigmaPhi [private]
 

double SingleParticleGun::m_sigmaPt [private]
 

double SingleParticleGun::m_sigmaTheta [private]
 

bool GenModule::m_StripPartonSwitch [protected, inherited]
 

std::vector<int> GenModule::m_StripVector [protected, inherited]
 

std::vector<int> GenModule::m_StripVector [protected, inherited]
 

int SingleParticleGun::m_ThetaGenMode [private]
 

IBesRndmGenSvc* SingleParticleGun::p_BesRndmGenSvc [private]
 

IBesRndmGenSvc* SingleParticleGun::p_BesRndmGenSvc [private]
 


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 18:49:44 2011 for BOSS6.5.5 by  doxygen 1.3.9.1