#include <EventHeaderMaker.h>
Collaboration diagram for Atlfast::EventHeaderMaker:
Public Methods | |
EventHeaderMaker (const std::string &name, ISvcLocator *pSvcLocator) | |
Standard Athena-Algorithm Constructor. | |
virtual | ~EventHeaderMaker () |
Default Destructor. | |
StatusCode | initialize () |
Standard Athena-Algorithm method. | |
StatusCode | execute () |
Standard Athena-Algorithm method. | |
StatusCode | finalize () |
Standard Athena-Algorithm method. | |
Private Methods | |
template<class Collection> int | numberInList (std::string tesAddress) |
finds out how many entries are in a TES list | |
int | numberJetFlavor (std::string tesAddress, int) |
finds out how many numbers of jets by flavor | |
HepLorentzVector | missingMomentum (MsgStream &) |
calculate the reconstructed missing momentum | |
HepLorentzVector | escapedMomentum (MsgStream &) |
calculated the momentum of escaping particles from MC truth | |
template<class Collection> HepLorentzVector | momentumSum (std::string tesAddress) |
returns the summed momentum of a list of IKinematic objects in the TES | |
template<class Type> HepLorentzVector | smearAndSum (std::string tesAddress, Type dummy) |
returns the summed momentum of a list of IKinematic objects in the TES | |
template<class Collection, class AssType> HepLorentzVector | assocMomentumSum (std::string tesAddress) |
returns the summed momentum of a list of associated IKinematic objects in the TES | |
HepLorentzVector | unusedClusterSum () |
summed momentum of unused clusters | |
HepLorentzVector | unusedMuonSum () |
summed momentum of unused non-isolated muons | |
HepLorentzVector | unusedCellSum () |
smeared + summed p of unused cells above cut | |
Private Attributes | |
std::string | m_electronLocation |
std::string | m_photonLocation |
std::string | m_isolatedMuonLocation |
std::string | m_nonIsolatedMuonLocation |
std::string | m_jetLocation |
std::string | m_cellLocation |
std::string | m_clusterLocation |
std::string | m_mcTruthLocation |
std::string | m_outputLocation |
std::string | m_missingMomentumLocation |
bool | m_testMode |
double | m_beamEnergy |
std::vector< int > | m_escapingParticles |
int | m_lumi |
double | m_barrelForwardEta |
TesIO * | m_tesIO |
HepMC_helper::IMCselector * | m_visibleToAtlas |
Definition at line 65 of file EventHeaderMaker.h.
|
Standard Athena-Algorithm Constructor.
Definition at line 51 of file EventHeaderMaker.cxx.
00052 : Algorithm( name, pSvcLocator ){ 00053 00054 // Default paths for entities in the TES 00055 m_electronLocation = "/Event/AtlfastIsolatedElectrons"; 00056 m_photonLocation = "/Event/AtlfastIsolatedPhotons"; 00057 m_isolatedMuonLocation = "/Event/AtlfastIsolatedMuons"; 00058 m_nonIsolatedMuonLocation = "/Event/AtlfastNonIsolatedMuons"; 00059 m_jetLocation = "/Event/AtlfastJets"; 00060 m_cellLocation = "/Event/AtlfastCells"; 00061 m_clusterLocation = "/Event/AtlfastClusters"; 00062 m_mcTruthLocation = "/Event/McEventCollection"; 00063 m_outputLocation = "/Event/AtlfastEventHeader"; 00064 m_missingMomentumLocation = "/Event/AtlfastMissingMomentum"; 00065 m_beamEnergy = 7000.0; 00066 m_testMode = false; 00067 00068 00069 00070 declareProperty( "MissingMomentumLocation", m_missingMomentumLocation ) ; 00071 declareProperty( "ElectronLocation", m_electronLocation ) ; 00072 declareProperty( "PhotonLocation", m_photonLocation ); 00073 declareProperty( "IsolatedMuonLocation", m_isolatedMuonLocation ); 00074 declareProperty( "NonIsolatedMuonLocation", m_nonIsolatedMuonLocation ); 00075 declareProperty( "JetLocation", m_jetLocation ); 00076 declareProperty( "McTruthLocation", m_mcTruthLocation ); 00077 declareProperty( "OutputLocation", m_outputLocation ); 00078 declareProperty( "BeamEnergy", m_beamEnergy ); 00079 00080 declareProperty( "TestMode", m_testMode ) ; 00081 00082 00083 00084 } |
|
Default Destructor.
Definition at line 90 of file EventHeaderMaker.cxx. References m_tesIO.
00090 { 00091 delete m_tesIO; 00092 } |
|
Standard Athena-Algorithm method.
Definition at line 97 of file EventHeaderMaker.cxx. References m_barrelForwardEta, m_beamEnergy, m_cellLocation, m_clusterLocation, m_electronLocation, m_escapingParticles, m_isolatedMuonLocation, m_jetLocation, m_lumi, m_mcTruthLocation, m_missingMomentumLocation, m_nonIsolatedMuonLocation, m_outputLocation, m_photonLocation, m_tesIO, m_testMode, and m_visibleToAtlas.
00098 { 00099 // .. put any initialisation in here... 00100 MsgStream log(messageService(), name()); 00101 log << MSG::DEBUG << "in initialize()" << endreq; 00102 00103 //set up the list of particles which are considered as "escaping" 00104 m_escapingParticles.push_back(ParticleCodes::NU_E); 00105 m_escapingParticles.push_back(ParticleCodes::NU_MU); 00106 m_escapingParticles.push_back(ParticleCodes::NU_TAU); 00107 00108 // m_tesIO = new TesIO(eventDataService()); 00109 m_tesIO = new TesIO(); 00110 00111 //get the Global Event Data from singleton pattern 00112 GlobalEventData* ged = GlobalEventData::Instance(); 00113 m_visibleToAtlas = ged -> visibleToAtlas(); 00114 m_lumi = ged -> lumi(); 00115 m_barrelForwardEta = ged -> barrelForwardEta(); 00116 HeaderPrinter hp("Atlfast EventHeader Maker:", log); 00117 hp.add("TestMode ", m_testMode); 00118 hp.add("EndCap Begins at (eta) ", m_barrelForwardEta); 00119 hp.add("Luminosity ", m_lumi); 00120 hp.add("Beam Energy ", m_beamEnergy); 00121 hp.add("MC location ", m_mcTruthLocation); 00122 hp.add("Electron Location ", m_electronLocation); 00123 hp.add("Photon Location ", m_photonLocation); 00124 hp.add("Isolated Muon Location ", m_isolatedMuonLocation); 00125 hp.add("Non-Isolated Muon Location ", m_nonIsolatedMuonLocation); 00126 hp.add("Jet Location ", m_jetLocation); 00127 hp.add("Cell Location ", m_cellLocation); 00128 hp.add("Cluster Location ", m_clusterLocation); 00129 hp.add("Unused cell+cluster sum ", m_missingMomentumLocation); 00130 hp.add("Output Location ", m_outputLocation); 00131 hp.print(); 00132 00133 00134 00135 00136 return StatusCode::SUCCESS ; 00137 } |
|
Standard Athena-Algorithm method.
Definition at line 154 of file EventHeaderMaker.cxx. References escapedMomentum(), m_jetLocation, m_outputLocation, m_tesIO, missingMomentum(), and numberJetFlavor().
00155 { 00156 00157 //................................ 00158 // make a message logging stream 00159 00160 MsgStream log( messageService(), name() ) ; 00161 log << MSG::DEBUG << "Executing " << endreq; 00162 std::string mess; 00163 00164 00165 00166 // 00167 // Check each particle list in turn and get the number of entries 00168 // 00169 int nElectrons = 00170 numberInList<ReconstructedParticleCollection>(m_electronLocation); 00171 int nPhotons = 00172 numberInList<ReconstructedParticleCollection>(m_photonLocation); 00173 int nIsolatedMuons = 00174 numberInList<ReconstructedParticleCollection>(m_isolatedMuonLocation); 00175 int nNonIsolatedMuons = 00176 numberInList<ReconstructedParticleCollection>(m_nonIsolatedMuonLocation); 00177 int nJets = numberInList<JetCollection>(m_jetLocation); 00178 int nBJets = numberJetFlavor(m_jetLocation, 00179 ParticleCodes::BQUARK); 00180 int nCJets = numberJetFlavor(m_jetLocation, 00181 ParticleCodes::CQUARK); 00182 int nTauJets = numberJetFlavor(m_jetLocation, 00183 ParticleCodes::TAU); 00184 nTauJets += numberJetFlavor(m_jetLocation, 00185 -ParticleCodes::TAU); 00186 00187 log << MSG::DEBUG << "Electrons: " << nElectrons << endreq; 00188 log << MSG::DEBUG << "Photons: " << nPhotons << endreq; 00189 log << MSG::DEBUG << "IsolatedMuons: " << nIsolatedMuons << endreq; 00190 log << MSG::DEBUG << "NonIsolatedMuons: " << nNonIsolatedMuons << endreq; 00191 log << MSG::DEBUG << "Jets: " << nJets << endreq; 00192 00193 00194 // Event Shape variable calculations 00195 00196 double jetCircularity = 0.0; //FIXME not written yet 00197 double eventCircularity = 0.0; //FIXME not written yet 00198 double thrust = 0.0; //FIXME not written yet 00199 double oblateness = 0.0; //FIXME not written yet 00200 00201 //missing momentum 00202 HepLorentzVector pMiss = missingMomentum(log); 00203 00204 log << MSG::DEBUG << "Missing momentum " <<pMiss<<endreq; 00205 00206 HepLorentzVector pEscaped = escapedMomentum(log); 00207 00208 log << MSG::DEBUG << "Escaped momentum " << pEscaped<<endreq; 00209 00210 EventHeader* header = 00211 new EventHeader( 00212 nElectrons, 00213 nIsolatedMuons, 00214 nNonIsolatedMuons, 00215 nPhotons, 00216 nJets, 00217 nBJets, 00218 nCJets, 00219 nTauJets, 00220 jetCircularity, 00221 eventCircularity, 00222 thrust, 00223 oblateness, 00224 pMiss, 00225 pEscaped); 00226 00227 TesIoStat stat = m_tesIO->store(header,m_outputLocation) ; 00228 std::string message = stat? "Stored Evt Header":"Failed to Evt Header"; 00229 log<<MSG::DEBUG<<message<<endreq; 00230 return stat; 00231 00232 } |
|
Standard Athena-Algorithm method.
Definition at line 142 of file EventHeaderMaker.cxx.
00143 { 00144 // .. put any finalisation in here... 00145 MsgStream log( messageService(), name() ) ; 00146 log << MSG::INFO << "finalizing " << endreq; 00147 00148 return StatusCode::SUCCESS ; 00149 } |
|
finds out how many entries are in a TES list
Definition at line 168 of file EventHeaderMaker.h. References m_tesIO.
00168 { 00169 DataHandle<Collection> dh; 00170 if( !m_tesIO->getDH(dh, tesAddress) ) throw "Error in numberInList"; 00171 return dh->size(); 00172 // Collection aList; 00173 // if( !m_tesIO->copy<(aList, tesAddress) ) throw "Error in numberInList"; 00174 //if( !m_tesIO->get(aList) ) throw "Error in numberInList"; 00175 // return aList.size(); 00176 } |
|
finds out how many numbers of jets by flavor
Definition at line 182 of file EventHeaderMaker.h. References m_tesIO. Referenced by execute().
00184 { 00185 std::vector<Jet*> theJets; 00186 int temp=0; 00187 if(m_tesIO->copy<JetCollection >(theJets, tesAddress)){ 00188 //if(m_tesIO->get(theJets)){ 00189 std::vector<Jet*>::const_iterator jet = theJets.begin(); 00190 for (; jet != theJets.end(); ++jet) { 00191 if( (*jet)->pdg_id()==flavor ) ++temp; 00192 } 00193 } 00194 return temp; 00195 } |
|
calculate the reconstructed missing momentum
Definition at line 236 of file EventHeaderMaker.cxx. References m_beamEnergy, m_missingMomentumLocation, and m_tesIO. Referenced by execute().
00236 { 00237 00238 HepLorentzVector unused(0., 0., 0., 0.); 00239 const DataHandle<MissingMomentum> mm; 00240 TesIoStat stat = m_tesIO->getDH(mm,m_missingMomentumLocation ); 00241 if(!stat){ 00242 log << MSG::WARNING<<"Could Not Find Missing momentum in TES"<<endreq; 00243 return unused; 00244 } 00245 log << MSG::DEBUG<<"Found Missing Momentum in TES"<<endreq; 00246 00247 unused = mm->momentum(); 00248 00249 HepLorentzVector temp(0.0,0.0,0.0,0.0); 00250 00251 00252 temp = unused 00253 + momentumSum<ReconstructedParticleCollection> (m_electronLocation) 00254 + momentumSum<ReconstructedParticleCollection> (m_photonLocation) 00255 + momentumSum<ReconstructedParticleCollection> (m_isolatedMuonLocation) 00256 + momentumSum<JetCollection> (m_jetLocation) 00257 + momentumSum<ReconstructedParticleCollection> (m_nonIsolatedMuonLocation) 00258 - assocMomentumSum<JetCollection, ReconstructedParticle> (m_jetLocation) 00259 ; 00260 00261 log<<MSG::DEBUG 00262 <<"Total Imbalanced momentum " 00263 <<temp 00264 <<endreq; 00265 00266 00267 00268 if(m_testMode){ 00269 HepLorentzVector totCluster = 00270 momentumSum<ClusterCollection> (m_clusterLocation); 00271 00272 HepLorentzVector clusterAssE = 00273 assocMomentumSum<ReconstructedParticleCollection, Cluster> 00274 (m_electronLocation); 00275 00276 HepLorentzVector clusterAssP = 00277 assocMomentumSum<ReconstructedParticleCollection, Cluster> 00278 (m_photonLocation); 00279 00280 HepLorentzVector clusterAssM = 00281 assocMomentumSum<ReconstructedParticleCollection, Cluster> 00282 (m_isolatedMuonLocation); 00283 00284 HepLorentzVector clusterAssJ = 00285 assocMomentumSum<JetCollection, Cluster>(m_jetLocation); 00286 00287 HepLorentzVector clusterDiff = totCluster- 00288 clusterAssJ- 00289 clusterAssE- 00290 clusterAssM- 00291 clusterAssP; 00292 00293 HepLorentzVector totCell = 00294 momentumSum<ITwoCptCellCollection>(m_cellLocation); 00295 00296 HepLorentzVector cellAssCluster = 00297 assocMomentumSum<ClusterCollection, Cell>(m_clusterLocation); 00298 00299 HepLorentzVector cellDiff = totCell-cellAssCluster; 00300 00301 HepLorentzVector diffS = clusterDiff+cellDiff-unused; 00302 00303 00304 00305 log<<MSG::DEBUG<<"Total cluster "<<totCluster<<endreq; 00306 log<<MSG::DEBUG<<"Clus Ass Jet "<<clusterAssJ<<endreq; 00307 log<<MSG::DEBUG<<"Clus Ass El "<<clusterAssE<<endreq; 00308 log<<MSG::DEBUG<<"Clus Ass Mu "<<clusterAssM<<endreq; 00309 log<<MSG::DEBUG<<"Clus Ass Ph "<<clusterAssP<<endreq; 00310 log<<MSG::DEBUG<<"Clus diff "<<clusterDiff<<endreq; 00311 log<<MSG::DEBUG<<"Total Cell "<<totCell<<endreq; 00312 log<<MSG::DEBUG<<"Cell Ass Clus "<<cellAssCluster<<endreq; 00313 log<<MSG::DEBUG<<"Clus diff "<<cellDiff<<endreq; 00314 log<<MSG::DEBUG<<"Cell+Clus diff "<<cellDiff<<endreq; 00315 log<<MSG::DEBUG<<"Unused "<<unused<<endreq; 00316 log<<MSG::DEBUG<<"diff "<<diffS<<endreq; 00317 00318 log<<MSG::DEBUG<<endreq; 00319 00320 assert( diffS.rho() <0.001); 00321 00322 00323 00324 00325 00326 HepLorentzVector temp2 = 00327 momentumSum<ReconstructedParticleCollection> (m_electronLocation) 00328 + momentumSum<ReconstructedParticleCollection> (m_photonLocation) 00329 + momentumSum<ReconstructedParticleCollection> (m_isolatedMuonLocation) 00330 + momentumSum<JetCollection> (m_jetLocation) 00331 + momentumSum<ClusterCollection> (m_clusterLocation) 00332 + momentumSum<ITwoCptCellCollection> (m_cellLocation) 00333 + momentumSum<ReconstructedParticleCollection> (m_nonIsolatedMuonLocation) 00334 00335 - assocMomentumSum<ReconstructedParticleCollection, Cluster> 00336 (m_electronLocation) 00337 00338 - assocMomentumSum<ReconstructedParticleCollection, Cluster> 00339 (m_photonLocation) 00340 00341 - assocMomentumSum<ReconstructedParticleCollection, Cluster> 00342 (m_nonIsolatedMuonLocation) 00343 00344 - assocMomentumSum<JetCollection, Cluster> 00345 (m_jetLocation) 00346 00347 - assocMomentumSum<JetCollection, ReconstructedParticle> 00348 (m_jetLocation) 00349 00350 - assocMomentumSum<ClusterCollection, Cell> 00351 (m_clusterLocation); 00352 00353 00354 assert( (temp-temp2).rho() <0.001); 00355 } 00356 00357 // calculate missing momentum from the reconstructed sum of momenta: 00358 // 00359 temp.setPx( -temp.px() ); 00360 temp.setPy( -temp.py() ); 00361 temp.setPz( -temp.pz() ); 00362 temp.setE( 2.0*m_beamEnergy - temp.e() ); 00363 00364 return temp; 00365 } |
|
calculated the momentum of escaping particles from MC truth
Definition at line 372 of file EventHeaderMaker.cxx. References m_tesIO, and m_visibleToAtlas. Referenced by execute().
00372 { 00373 00374 HepLorentzVector temp(0.0,0.0,0.0,0.0); 00375 00376 MCparticleCollection mcParticles; 00377 TesIoStat stat = m_tesIO->getMC( mcParticles, m_visibleToAtlas ) ; 00378 std::string mess = 00379 stat? "MC particles retrieved":"MC particles retrieve failed"; 00380 log<<MSG::DEBUG<<mess<<endreq; 00381 00382 00383 MCparticleCollection::const_iterator part = mcParticles.begin(); 00384 for (;part != mcParticles.end(); ++part) { 00385 temp += (*part)->momentum(); 00386 } 00387 00388 return temp; 00389 } |
|
returns the summed momentum of a list of IKinematic objects in the TES
Definition at line 201 of file EventHeaderMaker.h. References m_tesIO.
00201 { 00202 // 00203 // Collection aList; 00204 // 00205 // if(!m_tesIO->copy 00206 // <Collection, 00207 // Collection> 00208 // (aList, tesAddress) ){throw "Error in momentumSum"; 00209 // } 00210 // 00211 // HepLorentzVector temp(0.0,0.0,0.0,0.0); 00212 // typename Collection::const_iterator iter = aList.begin(); 00213 // 00214 // for (; iter != aList.end(); ++iter) temp += (*iter)->momentum(); 00215 HepLorentzVector temp(0.0,0.0,0.0,0.0); 00216 00217 DataHandle<Collection> dh; 00218 if( !m_tesIO->getDH(dh, tesAddress) ) throw "Error in numberInList"; 00219 00220 typename Collection::const_iterator iter = dh->begin(); 00221 typename Collection::const_iterator end = dh->end(); 00222 00223 for (; iter != end; ++iter) temp += (*iter)->momentum(); 00224 00225 return temp; 00226 } |
|
returns the summed momentum of a list of IKinematic objects in the TES
|
|
returns the summed momentum of a list of associated IKinematic objects in the TES
Definition at line 232 of file EventHeaderMaker.h. References m_tesIO.
00232 { 00233 00234 HepLorentzVector temp(0.0,0.0,0.0,0.0); 00235 00236 DataHandle<Collection> dh; 00237 if( !m_tesIO->getDH(dh, tesAddress) ) throw "Error in assocMomentumSum"; 00238 00239 typename Collection::const_iterator iter = dh->begin(); 00240 typename Collection::const_iterator end = dh->end(); 00241 00242 for (; iter != end; ++iter){ 00243 IAssociationManager* ia = *iter; 00244 AssType assType; 00245 std::vector<const AssType*> aList = ia->associations(assType); 00246 typename std::vector<const AssType*>::const_iterator aIter = aList.begin(); 00247 for(; aIter<aList.end(); ++aIter) temp+=(*aIter)->momentum(); 00248 } 00249 return temp; 00250 } |
|
summed momentum of unused clusters
|
|
summed momentum of unused non-isolated muons
|
|
smeared + summed p of unused cells above cut
|
|
Definition at line 136 of file EventHeaderMaker.h. Referenced by initialize(). |
|
Definition at line 137 of file EventHeaderMaker.h. Referenced by initialize(). |
|
Definition at line 138 of file EventHeaderMaker.h. Referenced by initialize(). |
|
Definition at line 139 of file EventHeaderMaker.h. Referenced by initialize(). |
|
Definition at line 140 of file EventHeaderMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 141 of file EventHeaderMaker.h. Referenced by initialize(). |
|
Definition at line 142 of file EventHeaderMaker.h. Referenced by initialize(). |
|
Definition at line 143 of file EventHeaderMaker.h. Referenced by initialize(). |
|
Definition at line 144 of file EventHeaderMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 145 of file EventHeaderMaker.h. Referenced by initialize(), and missingMomentum(). |
|
Definition at line 148 of file EventHeaderMaker.h. Referenced by initialize(). |
|
Definition at line 149 of file EventHeaderMaker.h. Referenced by initialize(), and missingMomentum(). |
|
Definition at line 150 of file EventHeaderMaker.h. Referenced by initialize(). |
|
Definition at line 153 of file EventHeaderMaker.h. Referenced by initialize(). |
|
Definition at line 158 of file EventHeaderMaker.h. Referenced by initialize(). |
|
Definition at line 160 of file EventHeaderMaker.h. Referenced by assocMomentumSum(), escapedMomentum(), execute(), initialize(), missingMomentum(), momentumSum(), numberInList(), numberJetFlavor(), and ~EventHeaderMaker(). |
|
Definition at line 161 of file EventHeaderMaker.h. Referenced by escapedMomentum(), and initialize(). |