#include <ReconstructedParticleDumper.h>
Collaboration diagram for Atlfast::ReconstructedParticleDumper:
Public Member Functions | |
ReconstructedParticleDumper (const std::string &name, ISvcLocator *pSvcLocator) | |
virtual | ~ReconstructedParticleDumper () |
virtual StatusCode | initialize () |
virtual StatusCode | execute () |
virtual StatusCode | finalize () |
Private Attributes | |
TesIO * | m_tesIO |
std::string | m_mcLocation |
bool | m_writePDG |
bool | m_writeFourVector |
bool | m_writeEta |
bool | m_writePhi |
bool | m_writePt |
bool | m_writeEt |
bool | m_writeMt |
bool | m_writeTruth |
std::string | m_inputLocation |
Definition at line 48 of file ReconstructedParticleDumper.h.
Atlfast::ReconstructedParticleDumper::ReconstructedParticleDumper | ( | const std::string & | name, | |
ISvcLocator * | pSvcLocator | |||
) |
Definition at line 33 of file ReconstructedParticleDumper.cxx.
00034 : Algorithm( name, pSvcLocator ){ 00035 00036 00037 // Default paths for entities in the TES 00038 m_inputLocation = "/Event/Atlfast/ReconstructedParticle"; 00039 00040 m_writePDG = true; 00041 m_writeFourVector = true; 00042 m_writeEta = true; 00043 m_writePhi = true; 00044 m_writePt = true; 00045 m_writeEt = false; 00046 m_writeMt = false; 00047 m_writeTruth = true; 00048 00049 declareProperty( "InputLocation", m_inputLocation ) ; 00050 00051 declareProperty( "WritePDG", m_writePDG ); 00052 declareProperty( "WriteFourVector", m_writeFourVector ); 00053 declareProperty( "WriteEta", m_writeEta ); 00054 declareProperty( "WritePhi", m_writePhi ); 00055 declareProperty( "WritePt", m_writePt ); 00056 declareProperty( "WriteEt", m_writeEt ); 00057 declareProperty( "WriteMt", m_writeMt ); 00058 declareProperty( "WriteTruth", m_writeTruth ); 00059 00060 }
Atlfast::ReconstructedParticleDumper::~ReconstructedParticleDumper | ( | ) | [virtual] |
StatusCode Atlfast::ReconstructedParticleDumper::initialize | ( | ) | [virtual] |
Definition at line 70 of file ReconstructedParticleDumper.cxx.
00070 { 00071 //MsgStream log( messageService(), name() ) ; 00072 00073 // .. put any initialisation in here... 00074 00075 // will need to build an appropriate smearer object here 00076 // when tools become avialble we will instead just pass an appropriate 00077 // tool via job options 00078 00079 GlobalEventData* ged = GlobalEventData::Instance(); 00080 // load the location of the MC in StoreGate 00081 m_mcLocation = ged -> mcLocation(); 00082 00083 00084 // m_tesIO = new TesIO(eventDataService()); 00085 m_tesIO = new TesIO(m_mcLocation, ged->justHardScatter()); 00086 00087 return StatusCode::SUCCESS ; 00088 }
StatusCode Atlfast::ReconstructedParticleDumper::execute | ( | ) | [virtual] |
Definition at line 106 of file ReconstructedParticleDumper.cxx.
00106 { 00107 //................................ 00108 // make a message logging stream 00109 00110 MsgStream log( messageService(), name() ) ; 00111 00112 //............................. 00113 // Make some locals stores which be used to keep pointers to 00114 // all of the entities from the event store which are needed by 00115 // this algorithm. These are all local and are typedefed in this class 00116 00117 //t_reconstructedParticleCollection myParticles ; 00118 //............................... 00119 // Extract the input particles which are to be tested for isolation. 00120 00121 00122 std::vector<ReconstructedParticle*> particles; 00123 if(!m_tesIO->copy<ReconstructedParticleCollection > 00124 (particles, m_inputLocation)){ 00125 log << MSG::INFO 00126 << "No reconstructed particles in TES at " 00127 << m_inputLocation 00128 << endreq ; 00129 return StatusCode::FAILURE ; 00130 } 00131 log << MSG::INFO << particles.size() 00132 << " Reconstructed particles retrieved from TES at " 00133 << m_inputLocation 00134 << endreq; 00135 00136 00137 00138 int count = 0; 00139 std::vector<ReconstructedParticle*>::const_iterator particle = 00140 particles.begin(); 00141 for (; particle != particles.end(); ++particle) { 00142 count++; 00143 log << MSG::INFO << count; 00144 if (m_writePDG) { 00145 log << " PDG " << (*particle)->pdg_id(); 00146 } 00147 if (m_writeFourVector) { 00148 log << " px " << (*particle)->momentum().px() 00149 << " py " << (*particle)->momentum().py() 00150 << " pz " << (*particle)->momentum().pz() 00151 << " e " << (*particle)->momentum().e(); 00152 } 00153 if (m_writeEta) { 00154 log << " eta " << (*particle)->eta(); 00155 } 00156 if (m_writePhi) { 00157 log << " phi " << (*particle)->phi(); 00158 } 00159 if (m_writePt) { 00160 log << " pt " << (*particle)->pT(); 00161 } 00162 if (m_writeEt) { 00163 log << " et " << (*particle)->eT(); 00164 } 00165 if (m_writeMt) { 00166 log << " mt " << (*particle)->mT(); 00167 } 00168 if (m_writeTruth) { 00169 log << " MC truth " << (*particle)->truth()->momentum(); 00170 } 00171 00172 log << endreq; 00173 00174 // Now print any associations 00175 TypeVisitor tv = SimpleAssocsDispatcher( *particle, TypeVisitor()); 00176 Cluster c; 00177 log << " it has " << (tv.typeVector( Cluster() )).size() 00178 << " associated clusters " << endreq; 00179 /* 00180 std::vector<IAOO*> v; 00181 v.push_back(*particle); 00182 AssocTypeRecoverer atr(v.begin(), v.end()); 00183 Cluster c; 00184 log << " it has " << (atr.typeVector( c ))->size() 00185 << " associated clusters " << endreq; 00186 */ 00187 } 00188 00189 return StatusCode::SUCCESS; 00190 }
StatusCode Atlfast::ReconstructedParticleDumper::finalize | ( | ) | [virtual] |
Definition at line 94 of file ReconstructedParticleDumper.cxx.
00094 { 00095 // .. put any finalisation in here... 00096 00097 return StatusCode::SUCCESS ; 00098 }
Definition at line 81 of file ReconstructedParticleDumper.h.
std::string Atlfast::ReconstructedParticleDumper::m_mcLocation [private] |
Definition at line 83 of file ReconstructedParticleDumper.h.
bool Atlfast::ReconstructedParticleDumper::m_writePDG [private] |
Definition at line 89 of file ReconstructedParticleDumper.h.
bool Atlfast::ReconstructedParticleDumper::m_writeFourVector [private] |
Definition at line 90 of file ReconstructedParticleDumper.h.
bool Atlfast::ReconstructedParticleDumper::m_writeEta [private] |
Definition at line 91 of file ReconstructedParticleDumper.h.
bool Atlfast::ReconstructedParticleDumper::m_writePhi [private] |
Definition at line 92 of file ReconstructedParticleDumper.h.
bool Atlfast::ReconstructedParticleDumper::m_writePt [private] |
Definition at line 93 of file ReconstructedParticleDumper.h.
bool Atlfast::ReconstructedParticleDumper::m_writeEt [private] |
Definition at line 94 of file ReconstructedParticleDumper.h.
bool Atlfast::ReconstructedParticleDumper::m_writeMt [private] |
Definition at line 95 of file ReconstructedParticleDumper.h.
bool Atlfast::ReconstructedParticleDumper::m_writeTruth [private] |
Definition at line 96 of file ReconstructedParticleDumper.h.
std::string Atlfast::ReconstructedParticleDumper::m_inputLocation [private] |
Definition at line 104 of file ReconstructedParticleDumper.h.