#include <TrackMaker.h>
Collaboration diagram for Atlfast::TrackMaker:
Public Methods | |
TrackMaker (const std::string &name, ISvcLocator *pSvcLocator) | |
virtual | ~TrackMaker () |
virtual StatusCode | initialize () |
virtual StatusCode | execute () |
virtual StatusCode | finalize () |
Private Methods | |
virtual Track * | create (const HepMC::GenParticle *) |
virtual bool | isAcceptable (Track *) |
TrackTrajectory | extractTrajectory (const HepMC::GenParticle *) |
Private Attributes | |
double | m_vlMax |
double | m_vtMax |
double | m_mcPtMin |
double | m_mcEtaMax |
bool | m_doSmearing |
double | m_bField |
string | m_muConfig |
TesIO * | m_tesIO |
HepMC_helper::IMCselector * | m_ncutter |
TrackSmearer * | m_smearer |
HepMC::ParticleDataTable | m_particleTable |
std::string | m_MC_eventLocation |
std::string | m_outputLocation |
|
Definition at line 40 of file TrackMaker.cxx. References m_bField, m_doSmearing, m_MC_eventLocation, m_mcEtaMax, m_mcPtMin, m_muConfig, m_outputLocation, m_vlMax, and m_vtMax.
00041 : Algorithm( name, pSvcLocator ), m_smearer(NULL){ 00042 00043 // Setting the parameter defaults - these can be changed by user via 00044 // jobOptions 00045 m_mcPtMin = 0.5; 00046 m_mcEtaMax = 2.5; 00047 m_vlMax = 40.0; 00048 m_vtMax = 3.0; 00049 m_doSmearing = true; 00050 m_bField = 2.0; 00051 m_muConfig = "000"; 00052 00053 // Default paths for entities in the TES 00054 m_MC_eventLocation = "/Event/McEventCollection"; 00055 m_outputLocation = "/Event/AtlfastTracks"; 00056 00057 // Declare the paramemters to Athena so that 00058 // they can be over-written via the job options file 00059 declareProperty( "McPtMinimum", m_mcPtMin ) ; 00060 declareProperty( "McEtaMaximum", m_mcEtaMax ) ; 00061 declareProperty( "vlMaximum", m_vlMax ) ; 00062 declareProperty( "vtMaximum", m_vtMax ) ; 00063 declareProperty( "DoSmearing", m_doSmearing ); 00064 declareProperty( "Bfield", m_bField ); 00065 declareProperty( "MC_eventLocation", m_MC_eventLocation ) ; 00066 declareProperty( "OutputLocation", m_outputLocation ) ; 00067 declareProperty( "MuonConfiguration", m_muConfig ); 00068 } |
|
Definition at line 73 of file TrackMaker.cxx. References m_ncutter, and m_tesIO.
|
|
Definition at line 87 of file TrackMaker.cxx. References Atlfast::GlobalEventData::lumi(), m_bField, m_doSmearing, m_MC_eventLocation, m_mcEtaMax, m_mcPtMin, m_muConfig, m_ncutter, m_outputLocation, m_particleTable, m_smearer, m_tesIO, m_vlMax, m_vtMax, and Atlfast::GlobalEventData::randSeed().
00087 { 00088 MsgStream log( messageService(), name() ) ; 00089 00090 // Make a particle properties table. This will become a Gaudi service. 00091 HepMC::IO_PDG_ParticleDataTable pdg_io("PDGTABLE"); 00092 m_particleTable = *pdg_io.read_particle_data_table(); 00093 m_particleTable.make_antiparticles_from_particles(); 00094 00095 //======================================================= 00096 // Set up NCutter to select the required HepMC::GenParticles 00097 HepMC_helper::IMCselector* charged = new 00098 HepMC_helper::IsCharged() ; 00099 HepMC_helper::IMCselector* cuts = new 00100 HepMC_helper::MCCuts( m_mcPtMin, m_mcEtaMax ) ; 00101 HepMC_helper::IMCselector* finalState = new 00102 HepMC_helper::IsFinalState(); 00103 vector<HepMC_helper::IMCselector*> selectors; 00104 selectors.push_back(finalState); 00105 selectors.push_back(charged); 00106 selectors.push_back(cuts); 00107 00108 m_ncutter = new HepMC_helper::NCutter(selectors); 00109 00110 delete cuts; 00111 delete charged; 00112 delete finalState; 00113 //======================================================= 00114 00115 m_tesIO = new TesIO(); 00116 00117 //get the Global Event Data from singleton pattern 00118 GlobalEventData* ged = GlobalEventData::Instance(); 00119 int lumi = ged->lumi(); 00120 int randSeed = ged->randSeed() ; 00121 m_smearer = new TrackSmearer(m_muConfig, randSeed, log); 00122 log << MSG::DEBUG << "got lumi " << endreq; 00123 HeaderPrinter hp("Atlfast Track Maker:", log); 00124 hp.add("Luminosity ", lumi); 00125 hp.add("Minimum four-vector Pt ", m_mcPtMin); 00126 hp.add("Maximum four-vector Eta ", m_mcEtaMax); 00127 hp.add("Maximum Transverse Vertex ", m_vtMax); 00128 hp.add("Maximum Longitudinal Vertex ", m_vlMax); 00129 hp.add("Do Smearing ", m_doSmearing); 00130 hp.add("B Field ", m_bField); 00131 hp.add("Muon Configuration ", m_muConfig); 00132 hp.add("Random Number Seed ", randSeed); 00133 hp.add("MC location ", m_MC_eventLocation); 00134 hp.add("Output Location ", m_outputLocation); 00135 hp.print(); 00136 log << MSG::INFO << "Initialised successfully " << endreq ; 00137 return StatusCode::SUCCESS ; 00138 } |
|
Definition at line 169 of file TrackMaker.cxx. References create(), isAcceptable(), m_ncutter, m_outputLocation, and m_tesIO.
00169 { 00170 00171 //................................ 00172 // make a message logging stream 00173 00174 MsgStream log( messageService(), name() ) ; 00175 log << MSG::DEBUG << "Execute() " << endreq; 00176 00177 00178 //......................................................... 00179 // We now need to access the HepMC event record(s) in the event store 00180 // and iterate over them to extract HepMC::GenParticles. 00181 // This method will only select the particles which are required 00182 // and add them to a local store (mcParticles) 00183 00184 MCparticleCollection mcParticles ; 00185 TesIoStat stat; 00186 std::string message; 00187 00188 stat = m_tesIO->getMC( mcParticles, m_ncutter ); 00189 message = stat? "Found MCparitcles in TES":"No MC particles found in TES"; 00190 log<<MSG::DEBUG << message <<" "<<mcParticles.size()<<endreq; 00191 // ...................... 00192 // Make a container object which will store pointers to all isolated 00193 // Tracks which are successfully created. Since it is going to go 00194 // into the event store, it has to be a special Athena container. 00195 // This is typedefined in an include file 00196 00197 TrackCollection* tracks = new TrackCollection ; 00198 00199 00200 //......................................................... 00201 // From each mc Track create a reconstructed Track. 00202 // If all requirements are satisfied add to the collection 00203 00204 Track* candidate ; 00205 MCparticleCollectionCIter src ; 00206 00207 for( src = mcParticles.begin() ; src != mcParticles.end() ; ++src ) { 00208 00209 log << MSG::DEBUG << *src << endreq; 00210 candidate = this->create( *src ); 00211 log << MSG::DEBUG << "Created: " << candidate << endreq; 00212 00213 if( this->isAcceptable( candidate ) ) { 00214 log << MSG::DEBUG << "Passed cuts" << endreq; 00215 tracks->push_back( candidate ) ; 00216 log << MSG::DEBUG << "pushed back track" <<endreq; 00217 } 00218 else { 00219 log << MSG::DEBUG << "Failed cuts" << endreq; 00220 delete candidate ; 00221 } 00222 } 00223 00224 //...................................... 00225 // Register any Tracks which have been successfilly created in the 00226 // transient event store. If there are none then we delete the empty list. 00227 00228 stat = m_tesIO->store(tracks, m_outputLocation); 00229 message = stat? "Stored tracks in TES":"Error storing tracks in TES"; 00230 log<<MSG::DEBUG << message <<" "<<tracks->size()<<endreq; 00231 00232 return stat; 00233 00234 } |
|
Definition at line 144 of file TrackMaker.cxx.
00144 { 00145 00146 MsgStream log( messageService(), name() ) ; 00147 00148 log << MSG::INFO << "Finalised successfully " << endreq ; 00149 00150 return StatusCode::SUCCESS ; 00151 } |
|
Definition at line 250 of file TrackMaker.cxx. References extractTrajectory(), m_smearer, and Atlfast::TrackSmearer::smear(). Referenced by execute().
00250 { 00251 00252 MsgStream log( messageService(), name() ) ; 00253 // Construct the Trajectory parameters corresponding to the source particle 00254 TrackTrajectory originalTrajectory = this->extractTrajectory( src ) ; 00255 00256 if (m_doSmearing) { 00257 00258 // Ask our Smearer make a smeared set of Trajectory parameters 00259 // If this needs to be different for different particles then 00260 // it can be done here. Best method of dispatching to be decided later 00261 Track myTrack(originalTrajectory, src); 00262 Track smearedTrack = m_smearer->smear(myTrack); 00263 00264 // Return a new track 00265 Track* newTrack = new Track( smearedTrack ); 00266 return newTrack; 00267 } 00268 else 00269 { 00270 // Just return the track with unsmeared four-momentum 00271 return new Track( originalTrajectory, src ) ; 00272 } 00273 } |
|
Definition at line 287 of file TrackMaker.cxx. References m_vlMax, and m_vtMax. Referenced by execute().
00287 { 00288 HepPoint3D vertex = candidate->trajectory().startPoint(); 00289 int pdg = abs(candidate->pdg_id() ); 00290 if ( vertex.z() > m_vlMax ) return false; 00291 00292 // test track for vl and vt 00293 if ( pdg == 11 || pdg == 13) { 00294 if ( vertex.perp() > m_vtMax ) return false; 00295 } 00296 return true ; 00297 } |
|
Definition at line 302 of file TrackMaker.cxx. References m_bField, and m_particleTable. Referenced by create().
00302 { 00303 // look up vertex 00304 Hep3Vector vertex = (particle->production_vertex())->position().getV(); 00305 // Get 4-momentum and explicitly convert to 3-momentum 00306 Hep3Vector threeMomentum = particle->momentum().getV() ; 00307 // Obtain charge of particle 00308 HepMC::ParticleData* data = m_particleTable[particle->pdg_id()] ; 00309 double charge = data->charge() ; 00310 00311 return TrackTrajectory( threeMomentum, vertex, charge, m_bField ) ; 00312 00313 } |
|
Definition at line 94 of file TrackMaker.h. Referenced by initialize(), isAcceptable(), and TrackMaker(). |
|
Definition at line 95 of file TrackMaker.h. Referenced by initialize(), isAcceptable(), and TrackMaker(). |
|
Definition at line 96 of file TrackMaker.h. Referenced by initialize(), and TrackMaker(). |
|
Definition at line 97 of file TrackMaker.h. Referenced by initialize(), and TrackMaker(). |
|
Definition at line 98 of file TrackMaker.h. Referenced by initialize(), and TrackMaker(). |
|
Definition at line 99 of file TrackMaker.h. Referenced by extractTrajectory(), initialize(), and TrackMaker(). |
|
Definition at line 100 of file TrackMaker.h. Referenced by initialize(), and TrackMaker(). |
|
Definition at line 109 of file TrackMaker.h. Referenced by execute(), initialize(), and ~TrackMaker(). |
|
Definition at line 110 of file TrackMaker.h. Referenced by execute(), initialize(), and ~TrackMaker(). |
|
Definition at line 122 of file TrackMaker.h. Referenced by create(), and initialize(). |
|
Definition at line 123 of file TrackMaker.h. Referenced by extractTrajectory(), and initialize(). |
|
Definition at line 133 of file TrackMaker.h. Referenced by initialize(), and TrackMaker(). |
|
Definition at line 134 of file TrackMaker.h. Referenced by execute(), initialize(), and TrackMaker(). |