#include <StandardNtupleMaker.h>
Collaboration diagram for Atlfast::StandardNtupleMaker:
Public Methods | |
StandardNtupleMaker (const std::string &name, ISvcLocator *pSvcLocator) | |
Constructor: A constructor of this form must be provided. | |
~StandardNtupleMaker () | |
StatusCode | initialize () |
StatusCode | execute () |
StatusCode | finalize () |
Protected Attributes | |
NTuple::Item< long > | m_isub |
Items for the column wise n-tuple Miscs. | |
NTuple::Item< long > | m_njetb |
NTuple::Item< long > | m_njetc |
NTuple::Item< long > | m_njettau |
NTuple::Item< float > | m_pxmiss |
NTuple::Item< float > | m_pymiss |
NTuple::Item< float > | m_pxnue |
NTuple::Item< float > | m_pynue |
NTuple::Item< long > | m_njet |
Jets. | |
NTuple::Array< long > | m_codejet |
NTuple::Array< float > | m_pxjet |
NTuple::Array< float > | m_pyjet |
NTuple::Array< float > | m_pzjet |
NTuple::Array< float > | m_eejet |
NTuple::Array< float > | m_ptcalo |
NTuple::Array< float > | m_ptbjet |
NTuple::Array< float > | m_ptujet |
NTuple::Item< long > | m_njetB |
AtlfastB (=corrected) Jets. | |
NTuple::Array< long > | m_codejetB |
NTuple::Array< float > | m_pxjetB |
NTuple::Array< float > | m_pyjetB |
NTuple::Array< float > | m_pzjetB |
NTuple::Array< float > | m_eejetB |
NTuple::Item< long > | m_nele |
Electrons. | |
NTuple::Array< long > | m_codeele |
NTuple::Array< float > | m_pxele |
NTuple::Array< float > | m_pyele |
NTuple::Array< float > | m_pzele |
NTuple::Array< float > | m_eeele |
NTuple::Item< long > | m_nmuo |
Muons. | |
NTuple::Array< long > | m_codemuo |
NTuple::Array< float > | m_pxmuo |
NTuple::Array< float > | m_pymuo |
NTuple::Array< float > | m_pzmuo |
NTuple::Array< float > | m_eemuo |
NTuple::Item< long > | m_nmux |
NTuple::Array< long > | m_codemux |
NTuple::Array< float > | m_pxmux |
NTuple::Array< float > | m_pymux |
NTuple::Array< float > | m_pzmux |
NTuple::Array< float > | m_eemux |
NTuple::Item< long > | m_npho |
Photons. | |
NTuple::Array< long > | m_codepho |
NTuple::Array< float > | m_pxpho |
NTuple::Array< float > | m_pypho |
NTuple::Array< float > | m_pzpho |
NTuple::Array< float > | m_eepho |
NTuple::Item< long > | m_ntra |
Tracks. | |
NTuple::Array< long > | m_kpTruth |
NTuple::Array< long > | m_kfTruth |
NTuple::Array< long > | m_kpm1tra |
NTuple::Array< long > | m_kfm1tra |
NTuple::Array< long > | m_kpm2tra |
NTuple::Array< long > | m_kfm2tra |
NTuple::Array< long > | m_kpm3tra |
NTuple::Array< long > | m_kfm3tra |
NTuple::Array< long > | m_kpm4tra |
NTuple::Array< long > | m_kfm4tra |
NTuple::Array< long > | m_kpm5tra |
NTuple::Array< long > | m_kfm5tra |
NTuple::Array< long > | m_kpm6tra |
NTuple::Array< long > | m_kfm6tra |
NTuple::Array< float > | m_d0Track |
NTuple::Array< float > | m_z0Track |
NTuple::Array< float > | m_phiTrack |
NTuple::Array< float > | m_cotTrack |
NTuple::Array< float > | m_ptInvTrack |
NTuple::Array< float > | m_d0Truth |
NTuple::Array< float > | m_z0Truth |
NTuple::Array< float > | m_phiTruth |
NTuple::Array< float > | m_cotTruth |
NTuple::Array< float > | m_ptInvTruth |
NTuple::Array< float > | m_corr11tra |
NTuple::Array< float > | m_corr12tra |
NTuple::Array< float > | m_corr13tra |
NTuple::Array< float > | m_corr14tra |
NTuple::Array< float > | m_corr15tra |
NTuple::Array< float > | m_corr22tra |
NTuple::Array< float > | m_corr23tra |
NTuple::Array< float > | m_corr24tra |
NTuple::Array< float > | m_corr25tra |
NTuple::Array< float > | m_corr33tra |
NTuple::Array< float > | m_corr34tra |
NTuple::Array< float > | m_corr35tra |
NTuple::Array< float > | m_corr44tra |
NTuple::Array< float > | m_corr45tra |
NTuple::Array< float > | m_corr55tra |
NTuple::Item< long > | m_npart |
Particle. | |
NTuple::Array< long > | m_kppart |
NTuple::Array< long > | m_kspart |
NTuple::Array< long > | m_kfpart |
NTuple::Array< long > | m_kpmoth |
NTuple::Array< long > | m_kfmoth |
NTuple::Array< float > | m_pxpart |
NTuple::Array< float > | m_pypart |
NTuple::Array< float > | m_pzpart |
NTuple::Array< float > | m_eepart |
NTuple::Item< long > | m_nbphys |
Bphys. | |
NTuple::Array< long > | m_kbphys |
NTuple::Array< long > | m_kfbphys |
NTuple::Array< long > | m_pxphys |
NTuple::Array< long > | m_pybphys |
NTuple::Array< long > | m_pzbphys |
NTuple::Array< long > | m_eebphys |
NTuple::Array< long > | m_vxphys |
NTuple::Array< long > | m_vybphys |
NTuple::Array< long > | m_vzbphys |
NTuple::Tuple * | p_nt1 |
Private Types | |
typedef std::vector< HepMC::GenParticle * > | t_MC_particleCollection |
typedef std::vector< HepMC::GenParticle * >::iterator | t_MC_particleIterator |
Private Methods | |
std::pair< int, int > | getParentCodes (MCparticleCollection::const_iterator &) |
method to get particle parents. | |
Private Attributes | |
long | m_nEvents |
Counters for event processing. | |
TesIO * | m_tesIO |
std::string | m_atlfastEventLocation |
member variables pointing to locations in the TES | |
std::string | m_jetLocation |
std::string | m_jetBLocation |
std::string | m_electronLocation |
std::string | m_isolatedMuonLocation |
std::string | m_nonIsolatedMuonLocation |
std::string | m_photonLocation |
std::string | m_trackLocation |
std::string | m_mcTruthLocation |
std::string | m_bPhysicsLocation |
std::string | m_triggerLocation |
std::string | m_eventHeaderLocation |
JetRecalibrator * | m_jetCal |
|
Definition at line 121 of file StandardNtupleMaker.h. |
|
Definition at line 122 of file StandardNtupleMaker.h. |
|
Constructor: A constructor of this form must be provided.
Definition at line 52 of file StandardNtupleMaker.cxx. References m_atlfastEventLocation, m_bPhysicsLocation, m_electronLocation, m_eventHeaderLocation, m_isolatedMuonLocation, m_jetBLocation, m_jetLocation, m_mcTruthLocation, m_nonIsolatedMuonLocation, and m_photonLocation.
00053 : Algorithm(name, pSvcLocator) { 00054 00055 m_atlfastEventLocation = "/Event/Atlfast"; 00056 m_jetLocation = "/Event/AtlfastJets"; 00057 m_jetBLocation = "/Event/AtlfastBJets"; 00058 m_electronLocation = "/Event/AtlfastIsolatedElectrons"; 00059 m_isolatedMuonLocation = "/Event/AtlfastIsolatedMuons"; 00060 m_nonIsolatedMuonLocation = "/Event/AtlfastNonIsolatedMuons"; 00061 m_photonLocation = "/Event/AtlfastIsolatedPhotons"; 00062 // m_trackLocation = DEFAULT_trackLocation; 00063 m_mcTruthLocation = "/Event/McEventCollection"; 00064 m_bPhysicsLocation = "/Event/AtlfastBPhysics"; 00065 // m_triggerLocation = DEFAULT_triggerLocation; 00066 m_eventHeaderLocation = "/Event/AtlfastEventHeader"; 00067 00068 declareProperty( "AtlfastEventLocation", m_atlfastEventLocation ); 00069 declareProperty( "JetLocation", m_jetLocation ); 00070 declareProperty( "JetBLocation", m_jetBLocation ); 00071 declareProperty( "ElectronLocation", m_electronLocation ); 00072 declareProperty( "IsolatedMuonLocation", m_isolatedMuonLocation ); 00073 declareProperty( "NonIsolatedMuonLocation", m_nonIsolatedMuonLocation ); 00074 declareProperty( "PhotonLocation", m_photonLocation ); 00075 // declareProperty( "TrackLocation", m_trackLocation ); 00076 declareProperty( "McTruthLocation", m_mcTruthLocation ); 00077 declareProperty( "BPhysicsLocation", m_bPhysicsLocation ); 00078 // declareProperty( "TriggerLocation",m_triggerLocation ); 00079 declareProperty( "EventHeaderLocation", m_eventHeaderLocation ); 00080 00081 00082 } |
|
Definition at line 84 of file StandardNtupleMaker.cxx. References m_jetCal, and m_tesIO.
|
|
Definition at line 91 of file StandardNtupleMaker.cxx. References m_codeele, m_codejet, m_codejetB, m_codemuo, m_codemux, m_codepho, m_eeele, m_eejet, m_eejetB, m_eemuo, m_eemux, m_eepart, m_eepho, m_electronLocation, m_eventHeaderLocation, m_isolatedMuonLocation, m_isub, m_jetCal, m_jetLocation, m_kfmoth, m_kfpart, m_kpmoth, m_kppart, m_kspart, m_mcTruthLocation, m_nele, m_nEvents, m_njet, m_njetb, m_njetB, m_njetc, m_njettau, m_nmuo, m_nmux, m_nonIsolatedMuonLocation, m_npart, m_npho, m_photonLocation, m_ptbjet, m_ptcalo, m_ptujet, m_pxele, m_pxjet, m_pxjetB, m_pxmiss, m_pxmuo, m_pxmux, m_pxnue, m_pxpart, m_pxpho, m_pyele, m_pyjet, m_pyjetB, m_pymiss, m_pymuo, m_pymux, m_pynue, m_pypart, m_pypho, m_pzele, m_pzjet, m_pzjetB, m_pzmuo, m_pzmux, m_pzpart, m_pzpho, and m_tesIO.
00091 { 00092 MsgStream log(msgSvc(), name()); 00093 log << MSG::DEBUG << "Initialising SNM" << endreq; 00094 StatusCode status; 00095 00096 m_nEvents = 0; 00097 // 00098 log << MSG::DEBUG << "Ntuple call 51" << endreq; 00099 NTuple::Directory* col = 0; 00100 log << MSG::DEBUG << "About to open ntuple file" << endreq; 00101 NTupleFilePtr file1(ntupleSvc(), "/NTUPLES/FILE1"); 00102 if ( file1 ) { 00103 log << MSG::DEBUG << "Opened ntuple file" << endreq; 00104 if ( !(col=ntupleSvc()->createDirectory("/NTUPLES/FILE1/Atlfast")) ) { 00105 log << MSG::ERROR << "Cannot create directory /NTUPLES/FILE1/Atlfast" 00106 << endreq; 00107 return StatusCode::FAILURE; 00108 }else{ 00109 log << MSG::DEBUG << "Created ntuple directory" << endreq; 00110 } 00111 } 00112 else { 00113 log << MSG::ERROR << "Cannot access file /NTUPLES/FILE1" << endreq; 00114 return StatusCode::FAILURE; 00115 } 00116 // First: A column wise N tuple 00117 NTuplePtr nt1(ntupleSvc(), "/NTUPLES/FILE1/Atlfast/51"); 00118 if ( !nt1 ) { // Check if already booked 00119 nt1 = ntupleSvc()->book (col, 51, CLID_ColumnWiseTuple, "Atlfast51"); 00120 if ( nt1 ) { 00121 log << MSG::DEBUG << "booked ntuple " << endreq; 00122 // Add an index column 00123 // Electrons 00124 status = nt1->addItem ("PLEPTONS/NELE" , m_nele, 0, 12 ); 00125 status = nt1->addItem ("PLEPTONS/KFELE" , m_nele, m_codeele); 00126 status = nt1->addItem ("PLEPTONS/PXELE" , m_nele, m_pxele); 00127 status = nt1->addItem ("PLEPTONS/PYELE" , m_nele, m_pyele); 00128 status = nt1->addItem ("PLEPTONS/PZELE" , m_nele, m_pzele); 00129 status = nt1->addItem ("PLEPTONS/EEELE" , m_nele, m_eeele); 00130 // Photons 00131 status = nt1->addItem ("PPHOTONS/NPHO" , m_npho, 0, 12 ); 00132 status = nt1->addItem ("PPHOTONS/KFPHO" , m_npho, m_codepho); 00133 status = nt1->addItem ("PPHOTONS/PXPHO" , m_npho, m_pxpho); 00134 status = nt1->addItem ("PPHOTONS/PYPHO" , m_npho, m_pypho); 00135 status = nt1->addItem ("PPHOTONS/PZPHO" , m_npho, m_pzpho); 00136 status = nt1->addItem ("PPHOTONS/EEPHO" , m_npho, m_eepho); 00137 // Muons (isolated) 00138 status = nt1->addItem ("PLEPTONS/NMUO" , m_nmuo, 0, 12 ); 00139 status = nt1->addItem ("PLEPTONS/KFMUO" , m_nmuo, m_codemuo); 00140 status = nt1->addItem ("PLEPTONS/PXMUO" , m_nmuo, m_pxmuo); 00141 status = nt1->addItem ("PLEPTONS/PYMUO" , m_nmuo, m_pymuo); 00142 status = nt1->addItem ("PLEPTONS/PZMUO" , m_nmuo, m_pzmuo); 00143 status = nt1->addItem ("PLEPTONS/EEMUO" , m_nmuo, m_eemuo); 00144 // MuonsX (non-isolated) 00145 status = nt1->addItem ("PMUXS/NMUX" , m_nmux, 0, 12 ); 00146 status = nt1->addItem ("PMUXS/KFMUX" , m_nmux, m_codemux); 00147 status = nt1->addItem ("PMUXS/PXMUX" , m_nmux, m_pxmux); 00148 status = nt1->addItem ("PMUXS/PYMUX" , m_nmux, m_pymux); 00149 status = nt1->addItem ("PMUXS/PZMUX" , m_nmux, m_pzmux); 00150 status = nt1->addItem ("PMUXS/EEMUX" , m_nmux, m_eemux); 00151 // Jets 00152 status = nt1->addItem ("PPJETS/NJET" , m_njet, 0, 40 ); 00153 status = nt1->addItem ("PPJETS/KFJET" , m_njet, m_codejet); 00154 status = nt1->addItem ("PPJETS/PXJET" , m_njet, m_pxjet); 00155 status = nt1->addItem ("PPJETS/PYJET" , m_njet, m_pyjet); 00156 status = nt1->addItem ("PPJETS/PZJET" , m_njet, m_pzjet); 00157 status = nt1->addItem ("PPJETS/EEJET" , m_njet, m_eejet); 00158 status = nt1->addItem ("PPJETS/PTcalo" , m_njet, m_ptcalo); 00159 status = nt1->addItem ("PPJETS/PTbjet" , m_njet, m_ptbjet); 00160 status = nt1->addItem ("PPJETS/PTujet" , m_njet, m_ptujet); 00161 // Jets calibrated by AtlfastB 00162 status = nt1->addItem ("PPJETS/NJETB" , m_njetB, 0, 40 ); 00163 status = nt1->addItem ("PPJETS/KFJETB" , m_njetB, m_codejetB); 00164 status = nt1->addItem ("PPJETS/PXJETB" , m_njetB, m_pxjetB); 00165 status = nt1->addItem ("PPJETS/PYJETB" , m_njetB, m_pyjetB); 00166 status = nt1->addItem ("PPJETS/PZJETB" , m_njetB, m_pzjetB); 00167 status = nt1->addItem ("PPJETS/EEJETB" , m_njetB, m_eejetB); 00168 // History 00169 // History 00170 status = nt1->addItem ("PHISTORY/NPART" , m_npart, 0, 40 ); 00171 status = nt1->addItem ("PHISTORY/KPPART" , m_npart, m_kppart); 00172 status = nt1->addItem ("PHISTORY/KSPART" , m_npart, m_kspart); 00173 status = nt1->addItem ("PHISTORY/KFPART" , m_npart, m_kfpart); 00174 status = nt1->addItem ("PHISTORY/KPMOTH" , m_npart, m_kpmoth); 00175 status = nt1->addItem ("PHISTORY/KFMOTH" , m_npart, m_kfmoth); 00176 status = nt1->addItem ("PHISTORY/PXPART" , m_npart, m_pxpart); 00177 status = nt1->addItem ("PHISTORY/PYPART" , m_npart, m_pypart); 00178 status = nt1->addItem ("PHISTORY/PZPART" , m_npart, m_pzpart); 00179 status = nt1->addItem ("PHISTORY/EEPART" , m_npart, m_eepart); 00180 00181 //status = nt1->addItem ("PHISTORY/NPART" , m_npart, 0, 40 ); 00182 //status = nt1->addItem ("PHISTORY/KFPART" , m_npart, m_kfpart); 00183 //status = nt1->addItem ("PHISTORY/PXPART" , m_npart, m_pxpart); 00184 //status = nt1->addItem ("PHISTORY/PYPART" , m_npart, m_pypart); 00185 //status = nt1->addItem ("PHISTORY/PZPART" , m_npart, m_pzpart); 00186 //status = nt1->addItem ("PHISTORY/EEPART" , m_npart, m_eepart); 00187 // Missing 00188 status = nt1->addItem ("INFO/ISUB" , m_isub); 00189 status = nt1->addItem ("INFO/JETB" , m_njetb); 00190 status = nt1->addItem ("INFO/JETC" , m_njetc); 00191 status = nt1->addItem ("INFO/JETTAU" , m_njettau); 00192 status = nt1->addItem ("PMISSING/PXMISS" , m_pxmiss); 00193 status = nt1->addItem ("PMISSING/PYMISS" , m_pymiss); 00194 status = nt1->addItem ("PMISSING/PXNUE" , m_pxnue); 00195 status = nt1->addItem ("PMISSING/PYNUE" , m_pynue); 00196 //tracks 00197 //status = nt1->addItem ("PTRACKS/NTRA" , m_ntra, 0, 500 ); 00198 //status = nt1->addItem ("PTRACKS/KPTRA" , m_ntra, m_kpTruth); 00199 //status = nt1->addItem ("PTRACKS/KFTRA" , m_ntra, m_kfTruth); 00200 // 00201 //status = nt1->addItem ("PTRACKS/KPM1TRA" , m_ntra, m_kpm1tra); 00202 //status = nt1->addItem ("PTRACKS/KFM1TRA" , m_ntra, m_kfm1tra); 00203 //status = nt1->addItem ("PTRACKS/KPM2TRA" , m_ntra, m_kpm2tra); 00204 //status = nt1->addItem ("PTRACKS/KFM2TRA" , m_ntra, m_kfm2tra); 00205 //status = nt1->addItem ("PTRACKS/KPM3TRA" , m_ntra, m_kpm3tra); 00206 //status = nt1->addItem ("PTRACKS/KFM3TRA" , m_ntra, m_kfm3tra); 00207 //status = nt1->addItem ("PTRACKS/KPM4TRA" , m_ntra, m_kpm4tra); 00208 //status = nt1->addItem ("PTRACKS/KFM4TRA" , m_ntra, m_kfm4tra); 00209 //status = nt1->addItem ("PTRACKS/KPM5TRA" , m_ntra, m_kpm5tra); 00210 //status = nt1->addItem ("PTRACKS/KFM5TRA" , m_ntra, m_kfm5tra); 00211 //status = nt1->addItem ("PTRACKS/KPM6TRA" , m_ntra, m_kpm6tra); 00212 //status = nt1->addItem ("PTRACKS/KFM6TRA" , m_ntra, m_kfm6tra); 00213 // 00214 //status = nt1->addItem ("PTRACKS/D0TRA " , m_ntra, m_d0Truth); 00215 //status = nt1->addItem ("PTRACKS/Z0TRA " , m_ntra, m_z0Truth); 00216 //status = nt1->addItem ("PTRACKS/PHITRA " , m_ntra, m_phiTruth); 00217 //status = nt1->addItem ("PTRACKS/COTTRA " , m_ntra, m_cotTruth); 00218 //status = nt1->addItem ("PTRACKS/PTINVTRA " , m_ntra, m_ptInvTruth); 00219 // 00220 //status = nt1->addItem ("PTRACKS/D0TRACRU " , m_ntra, m_d0Track); 00221 //status = nt1->addItem ("PTRACKS/Z0TRACRU " , m_ntra, m_z0Track); 00222 //status = nt1->addItem ("PTRACKS/PHITRACRU " , m_ntra, m_phiTrack); 00223 //status = nt1->addItem ("PTRACKS/COTTRACRU " , m_ntra, m_cotTrack); 00224 //status = nt1->addItem ("PTRACKS/PTINVTRACRU " , m_ntra, m_ptInvTrack); 00225 // 00226 //status = nt1->addItem ("PTRACKS/CORR11TRA " , m_ntra, m_corr11tra); 00227 //status = nt1->addItem ("PTRACKS/CORR21TRA " , m_ntra, m_corr12tra); 00228 //status = nt1->addItem ("PTRACKS/CORR31TRA " , m_ntra, m_corr13tra); 00229 //status = nt1->addItem ("PTRACKS/CORR41TRA " , m_ntra, m_corr14tra); 00230 //status = nt1->addItem ("PTRACKS/CORR51TRA " , m_ntra, m_corr15tra); 00231 //status = nt1->addItem ("PTRACKS/CORR22TRA " , m_ntra, m_corr22tra); 00232 //status = nt1->addItem ("PTRACKS/CORR23TRA " , m_ntra, m_corr23tra); 00233 //status = nt1->addItem ("PTRACKS/CORR24TRA " , m_ntra, m_corr24tra); 00234 //status = nt1->addItem ("PTRACKS/CORR25TRA " , m_ntra, m_corr25tra); 00235 //status = nt1->addItem ("PTRACKS/CORR33TRA " , m_ntra, m_corr33tra); 00236 //status = nt1->addItem ("PTRACKS/CORR34TRA " , m_ntra, m_corr34tra); 00237 //status = nt1->addItem ("PTRACKS/CORR34TRA " , m_ntra, m_corr34tra); 00238 //status = nt1->addItem ("PTRACKS/CORR35TRA " , m_ntra, m_corr35tra); 00239 //status = nt1->addItem ("PTRACKS/CORR44TRA " , m_ntra, m_corr44tra); 00240 //status = nt1->addItem ("PTRACKS/CORR45TRA " , m_ntra, m_corr45tra); 00241 //status = nt1->addItem ("PTRACKS/CORR55TRA " , m_ntra, m_corr55tra); 00242 } 00243 else { // did not manage to book the N tuple.... 00244 return StatusCode::FAILURE; 00245 } 00246 } 00247 00248 m_jetCal = new JetRecalibrator(); 00249 log<<MSG::DEBUG<<"returning sith status"<< status<<endreq; 00250 // m_tesIO = new TesIO(eventDataService()); 00251 m_tesIO = new TesIO(); 00252 00253 HeaderPrinter hp("Atlfast StandardNtuleMaker:", log); 00254 hp.add("MC location ", m_mcTruthLocation); 00255 hp.add("Electron Location ", m_electronLocation); 00256 hp.add("Photon Location ", m_photonLocation); 00257 hp.add("Isolated Muon Location ", m_isolatedMuonLocation); 00258 hp.add("Non-Isolated Muon Location ", m_nonIsolatedMuonLocation); 00259 hp.add("Jet Location ", m_jetLocation); 00260 hp.add("EventHeaderLocation ", m_eventHeaderLocation ); 00261 hp.print(); 00262 // declareProperty( "TriggerLocation",m_triggerLocation ); 00263 00264 00265 return StatusCode::SUCCESS; 00266 } |
|
Definition at line 269 of file StandardNtupleMaker.cxx. References Atlfast::JetRecalibrator::bCalibrate(), getParentCodes(), m_codeele, m_codejet, m_codejetB, m_codemuo, m_codemux, m_codepho, m_eeele, m_eejet, m_eejetB, m_eemuo, m_eemux, m_eepart, m_eepho, m_electronLocation, m_isolatedMuonLocation, m_isub, m_jetBLocation, m_jetCal, m_jetLocation, m_kfmoth, m_kfpart, m_kpmoth, m_kppart, m_kspart, m_nele, m_nEvents, m_njet, m_njetb, m_njetB, m_njetc, m_njettau, m_nmuo, m_nmux, m_nonIsolatedMuonLocation, m_npart, m_npho, m_photonLocation, m_ptbjet, m_ptcalo, m_ptujet, m_pxele, m_pxjet, m_pxjetB, m_pxmiss, m_pxmuo, m_pxmux, m_pxnue, m_pxpart, m_pxpho, m_pyele, m_pyjet, m_pyjetB, m_pymiss, m_pymuo, m_pymux, m_pynue, m_pypart, m_pypho, m_pzele, m_pzjet, m_pzjetB, m_pzmuo, m_pzmux, m_pzpart, m_pzpho, m_tesIO, and Atlfast::JetRecalibrator::uCalibrate().
00269 { 00270 // This just makes the code below a bit easier to read (and type) 00271 MsgStream log(msgSvc(), name()); 00272 log << MSG::DEBUG << "****Start execute()****" << endreq; 00273 00274 // Counter of events processed 00275 if( m_nEvents % 50 == 0) { 00276 log << MSG::INFO << " processing event number " 00277 << m_nEvents << endreq; 00278 } 00279 00280 m_nEvents++; 00281 00282 StatusCode status; 00283 00284 //------------------- 00285 // Retrieve Electrons 00286 //------------------- 00287 std::vector<ReconstructedParticle*> rp; 00288 if(!m_tesIO->copy<ReconstructedParticleCollection>(rp,m_electronLocation)){ 00289 log <<MSG::DEBUG << "Could not find Electrons"<<endreq; 00290 } 00291 log << MSG::DEBUG << "processing Electrons: " <<rp.size()<< endreq; 00292 00293 std::vector<ReconstructedParticle*>::const_iterator irp = rp.begin(); 00294 00295 m_nele = 0; 00296 for (; irp != rp.end(); ++irp) { 00297 m_codeele[m_nele] = (*irp)->pdg_id(); 00298 m_pxele[m_nele] = (*irp)->momentum().px(); 00299 m_pyele[m_nele] = (*irp)->momentum().py(); 00300 m_pzele[m_nele] = (*irp)->momentum().pz(); 00301 m_eeele[m_nele] = (*irp)->momentum().e(); 00302 if (++m_nele == m_nele->range().distance() ) { 00303 log << MSG::WARNING << "Electron list truncated in Ntuple" << endreq; 00304 break; 00305 } 00306 } 00307 00308 //------------------- 00309 // Retrieve Photons 00310 //------------------- 00311 00312 rp.clear(); 00313 if(!m_tesIO->copy <ReconstructedParticleCollection>(rp, m_photonLocation)){ 00314 log <<MSG::DEBUG << "Could not find Photons"<<endreq; 00315 } 00316 log << MSG::DEBUG << "processing Photons: " <<rp.size()<< endreq; 00317 00318 irp = rp.begin(); 00319 00320 m_npho = 0; 00321 for (; irp != rp.end(); ++irp) { 00322 m_codepho[m_npho] = (*irp)->pdg_id(); 00323 m_pxpho[m_npho] = (*irp)->momentum().px(); 00324 m_pypho[m_npho] = (*irp)->momentum().py(); 00325 m_pzpho[m_npho] = (*irp)->momentum().pz(); 00326 m_eepho[m_npho] = (*irp)->momentum().e(); 00327 if (++m_npho == m_npho->range().distance() ) { 00328 log << MSG::WARNING << "Photon list truncated in Ntuple" << endreq; 00329 break; 00330 } 00331 } 00332 00333 //------------------- 00334 // Retrieve Isolated Muons 00335 //------------------- 00336 00337 rp.clear(); 00338 if(!m_tesIO->copy 00339 <ReconstructedParticleCollection>(rp, m_isolatedMuonLocation)){ 00340 log <<MSG::DEBUG << "Could not find Isolated Muons"<<endreq; 00341 } 00342 log << MSG::DEBUG << "Isolated Muons: " <<rp.size()<< endreq; 00343 00344 irp = rp.begin(); 00345 00346 m_nmuo = 0; 00347 00348 for (; irp != rp.end(); ++irp) { 00349 m_codemuo[m_nmuo] = (*irp)->pdg_id(); 00350 m_pxmuo[m_nmuo] = (*irp)->momentum().px(); 00351 m_pymuo[m_nmuo] = (*irp)->momentum().py(); 00352 m_pzmuo[m_nmuo] = (*irp)->momentum().pz(); 00353 m_eemuo[m_nmuo] = (*irp)->momentum().e(); 00354 if (++m_nmuo == m_nmuo->range().distance() ) { 00355 log << MSG::WARNING 00356 << "Isolated Muon list truncated in Ntuple" << endreq; 00357 break; 00358 } 00359 } 00360 00361 //------------------- 00362 // Retrieve NonIsolated Muons 00363 //------------------- 00364 00365 rp.clear(); 00366 if(!m_tesIO->copy 00367 <ReconstructedParticleCollection >(rp, m_nonIsolatedMuonLocation)){ 00368 log <<MSG::DEBUG << "Could not find non Isolated muons"<<endreq; 00369 } 00370 log << MSG::DEBUG << "NonIsolated Muons: " <<rp.size()<< endreq; 00371 irp = rp.begin(); 00372 00373 m_nmux = 0; 00374 00375 for (; irp != rp.end(); ++irp) { 00376 m_codemux[m_nmux] = (*irp)->pdg_id(); 00377 m_pxmux[m_nmux] = (*irp)->momentum().px(); 00378 m_pymux[m_nmux] = (*irp)->momentum().py(); 00379 m_pzmux[m_nmux] = (*irp)->momentum().pz(); 00380 m_eemux[m_nmux] = (*irp)->momentum().e(); 00381 if (++m_nmux == m_nmux->range().distance() ) { 00382 log << MSG::WARNING 00383 << "Non-isolated Muon list truncated in Ntuple" << endreq; 00384 break; 00385 } 00386 } 00387 00388 //------------------- 00389 // Retrieve Jets 00390 //------------------- 00391 00392 std::vector<Jet*> jv; 00393 if(!m_tesIO->copy<JetCollection >(jv, m_jetLocation)){ 00394 log <<MSG::DEBUG << "Could not find Jets"<<endreq; 00395 } 00396 log << MSG::DEBUG << "Processing Jets: " <<jv.size()<< endreq; 00397 00398 std::vector<Jet*>::const_iterator ijv = jv.begin(); 00399 00400 m_njet = 0; 00401 00402 for (; ijv != jv.end(); ++ijv) { 00403 m_codejet[m_njet]= (*ijv)->pdg_id(); 00404 m_pxjet[m_njet] = (*ijv)->px(); 00405 m_pyjet[m_njet] = (*ijv)->py(); 00406 m_pzjet[m_njet] = (*ijv)->pz(); 00407 m_eejet[m_njet] = (*ijv)->e(); 00408 m_ptcalo[m_njet] = (*ijv)->pT(); 00409 m_ptbjet[m_njet] = m_jetCal->bCalibrate( (*ijv)->pT() ); 00410 m_ptujet[m_njet] = m_jetCal->uCalibrate( (*ijv)->pT() ); 00411 if ( ++m_njet == m_njet->range().distance() ) break; 00412 } 00413 log << MSG::DEBUG << " Jets in ntuple" << endreq; 00414 00415 00416 //------------------- 00417 // Retrieve AtlfastB Jets 00418 //------------------- 00419 00420 std::vector<Jet*> jvb; 00421 if(!m_tesIO->copy<JetCollection >(jvb, m_jetBLocation)){ 00422 log <<MSG::DEBUG << "Could not find AtlfastB Jets"<<endreq; 00423 } 00424 log << MSG::DEBUG << "Processing AtlfastB Jets: " <<jvb.size()<< endreq; 00425 00426 ijv = jvb.begin(); 00427 00428 m_njetB = 0; 00429 00430 for (; ijv != jvb.end(); ++ijv) { 00431 m_codejetB[m_njetB]= (*ijv)->pdg_id(); 00432 m_pxjetB[m_njetB] = (*ijv)->px(); 00433 m_pyjetB[m_njetB] = (*ijv)->py(); 00434 m_pzjetB[m_njetB] = (*ijv)->pz(); 00435 m_eejetB[m_njetB] = (*ijv)->e(); 00436 if ( ++m_njetB == m_njetB->range().distance() ) break; 00437 } 00438 log << MSG::DEBUG << " AtlfastB Jets in ntuple" << endreq; 00439 00440 //------------------- 00441 // Retrieve Status 21 quarks (fudged with final state collector FIXME) 00442 //------------------- 00443 //***PS std::vector<HepMC::GenParticle*> mc; 00444 //***PS m_tesIO->getMC( mc, m_mcTruthLocation, &isf) ; 00445 //***PS 00446 //***PS log << MSG::DEBUG << "Processing partons" <<mc.size()<< endreq; 00447 //***PS 00448 //***PS std::vector<HepMC::GenParticle*>::const_iterator imc = mc.begin(); 00449 00450 MCparticleCollection mc; 00451 // TesIoStat stat = m_tesIO->getMC(mc, &isf); 00452 00453 HepMC_helper::All* all= new HepMC_helper::All; 00454 TesIoStat stat = m_tesIO->getMC(mc, all); 00455 delete all; 00456 00457 if(stat){ 00458 log << MSG::DEBUG << " found MC truth" << endreq; 00459 }else{ 00460 log << MSG::ERROR << " MC truth not found in TES" << endreq; 00461 } 00462 00463 MCparticleCollection::const_iterator imc = mc.begin(); 00464 m_npart=0; 00465 00466 HepMC_helper::IsStatusxx isf(3); 00467 00468 for(;imc != mc.end(); ++imc){ 00469 if(isf(*imc)){ 00470 m_kppart[m_npart] = (*imc)->barcode(); 00471 m_kspart[m_npart] = (*imc)->status()%100; 00472 m_kfpart[m_npart] = (*imc)->pdg_id(); 00473 std::pair<int, int> parentCodes = getParentCodes(imc); 00474 m_kfmoth[m_npart] = parentCodes.first; 00475 m_kpmoth[m_npart] = parentCodes.second; 00476 //}else{ 00477 m_pxpart[m_npart] = (*imc)->momentum().x(); 00478 m_pypart[m_npart] = (*imc)->momentum().y(); 00479 m_pzpart[m_npart] = (*imc)->momentum().z(); 00480 m_eepart[m_npart] = (*imc)->momentum().e(); 00481 ++m_npart; 00482 } 00483 00484 if ( m_npart == m_npart->range().distance() ) break; 00485 00486 // m_kfpart[m_npart] = (*imc)->pdg_id(); 00487 // m_pxpart[m_npart] = (*imc)->momentum().x(); 00488 // m_pypart[m_npart] = (*imc)->momentum().y(); 00489 // m_pzpart[m_npart] = (*imc)->momentum().z(); 00490 // m_eepart[m_npart] = (*imc)->momentum().e(); 00491 } 00492 00493 log << MSG::DEBUG << " Particles in ntuple" << endreq; 00494 00495 const DataHandle<EventHeader> theEventHeader; 00496 if(!(m_tesIO->getDH(theEventHeader))){ 00497 log << MSG::ERROR<<"Could not find the event header in the TES"<<endreq; 00498 } 00499 00500 if(theEventHeader.isValid()){ 00501 m_isub = 0; 00502 m_njetb = theEventHeader->nBJets(); 00503 m_njetc = theEventHeader->nCJets(); 00504 m_njettau= theEventHeader->nTauJets(); 00505 m_pxmiss = theEventHeader->pMiss().x(); 00506 m_pymiss = theEventHeader->pMiss().y(); 00507 m_pxnue = theEventHeader->pEscaped().x(); 00508 m_pynue = theEventHeader->pEscaped().y(); 00509 } else { 00510 log << MSG::ERROR << " Invalid EventHeader data handle" << endreq; 00511 } 00512 00513 log << MSG::DEBUG << " EventHeader quantities are in ntuple" << endreq; 00514 00515 // Write out ntuples 00516 00517 log << MSG::DEBUG << "Writing ntuple part 51" << endreq; 00518 status = ntupleSvc()->writeRecord("/NTUPLES/FILE1/Atlfast/51"); 00519 if ( !status.isSuccess() ) log <<MSG::ERROR 00520 <<"Cannot fill id 51" 00521 <<endreq; 00522 log << MSG::DEBUG << "Done all the ntuple writing" << endreq; 00523 return StatusCode::SUCCESS; 00524 } |
|
Definition at line 544 of file StandardNtupleMaker.cxx. References m_nEvents.
00544 { 00545 00546 MsgStream log(msgSvc(), name()); 00547 log << MSG::INFO << " Number of events processed = " << m_nEvents << endreq; 00548 00549 return StatusCode::SUCCESS; 00550 } |
|
method to get particle parents. return contains pdg id, barcode returns (0,0) if parent is unavailable. Definition at line 526 of file StandardNtupleMaker.cxx. Referenced by execute().
00527 { 00528 00529 HepMC::GenVertex* gv = (*imc)->production_vertex(); 00530 if ( gv == 0 ){ return std::pair<int, int>(0,0);} 00531 00532 if ( gv->particles_in_size() == 0 ) { return std::pair<int, int>(0,0); } 00533 00534 HepMC::GenVertex::particle_iterator 00535 pi = gv->particles_begin(HepMC::parents); 00536 if( *pi == 0 ){ return std::pair<int, int>(0,0); } 00537 00538 00539 return std::pair<int, int>( (*pi)->pdg_id(), (*pi)->barcode() ); 00540 } |
|
Items for the column wise n-tuple Miscs.
Definition at line 30 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 31 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 31 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 31 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 32 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 32 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 32 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 32 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Jets.
Definition at line 34 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 35 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 36 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 36 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 36 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 36 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 37 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 37 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 37 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
AtlfastB (=corrected) Jets.
Definition at line 39 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 40 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 41 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 41 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 41 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 41 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Electrons.
Definition at line 43 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 44 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 45 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 45 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 45 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 45 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Muons.
Definition at line 47 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 48 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 49 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 49 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 49 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 49 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 50 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 51 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 52 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 52 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 52 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 52 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Photons.
Definition at line 54 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 55 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 56 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 56 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 56 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 56 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Tracks.
Definition at line 58 of file StandardNtupleMaker.h. |
|
Definition at line 59 of file StandardNtupleMaker.h. |
|
Definition at line 59 of file StandardNtupleMaker.h. |
|
Definition at line 60 of file StandardNtupleMaker.h. |
|
Definition at line 60 of file StandardNtupleMaker.h. |
|
Definition at line 61 of file StandardNtupleMaker.h. |
|
Definition at line 61 of file StandardNtupleMaker.h. |
|
Definition at line 62 of file StandardNtupleMaker.h. |
|
Definition at line 62 of file StandardNtupleMaker.h. |
|
Definition at line 63 of file StandardNtupleMaker.h. |
|
Definition at line 63 of file StandardNtupleMaker.h. |
|
Definition at line 64 of file StandardNtupleMaker.h. |
|
Definition at line 64 of file StandardNtupleMaker.h. |
|
Definition at line 65 of file StandardNtupleMaker.h. |
|
Definition at line 65 of file StandardNtupleMaker.h. |
|
Definition at line 66 of file StandardNtupleMaker.h. |
|
Definition at line 66 of file StandardNtupleMaker.h. |
|
Definition at line 66 of file StandardNtupleMaker.h. |
|
Definition at line 66 of file StandardNtupleMaker.h. |
|
Definition at line 66 of file StandardNtupleMaker.h. |
|
Definition at line 67 of file StandardNtupleMaker.h. |
|
Definition at line 67 of file StandardNtupleMaker.h. |
|
Definition at line 67 of file StandardNtupleMaker.h. |
|
Definition at line 67 of file StandardNtupleMaker.h. |
|
Definition at line 67 of file StandardNtupleMaker.h. |
|
Definition at line 68 of file StandardNtupleMaker.h. |
|
Definition at line 68 of file StandardNtupleMaker.h. |
|
Definition at line 68 of file StandardNtupleMaker.h. |
|
Definition at line 68 of file StandardNtupleMaker.h. |
|
Definition at line 68 of file StandardNtupleMaker.h. |
|
Definition at line 69 of file StandardNtupleMaker.h. |
|
Definition at line 69 of file StandardNtupleMaker.h. |
|
Definition at line 69 of file StandardNtupleMaker.h. |
|
Definition at line 69 of file StandardNtupleMaker.h. |
|
Definition at line 70 of file StandardNtupleMaker.h. |
|
Definition at line 70 of file StandardNtupleMaker.h. |
|
Definition at line 70 of file StandardNtupleMaker.h. |
|
Definition at line 71 of file StandardNtupleMaker.h. |
|
Definition at line 71 of file StandardNtupleMaker.h. |
|
Definition at line 71 of file StandardNtupleMaker.h. |
|
Particle.
Definition at line 73 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 74 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 74 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 74 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 75 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 75 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 76 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 76 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 76 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 76 of file StandardNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Bphys.
Definition at line 78 of file StandardNtupleMaker.h. |
|
Definition at line 79 of file StandardNtupleMaker.h. |
|
Definition at line 79 of file StandardNtupleMaker.h. |
|
Definition at line 80 of file StandardNtupleMaker.h. |
|
Definition at line 80 of file StandardNtupleMaker.h. |
|
Definition at line 80 of file StandardNtupleMaker.h. |
|
Definition at line 80 of file StandardNtupleMaker.h. |
|
Definition at line 81 of file StandardNtupleMaker.h. |
|
Definition at line 81 of file StandardNtupleMaker.h. |
|
Definition at line 81 of file StandardNtupleMaker.h. |
|
Definition at line 85 of file StandardNtupleMaker.h. |
|
Counters for event processing.
Definition at line 100 of file StandardNtupleMaker.h. Referenced by execute(), finalize(), and initialize(). |
|
Definition at line 101 of file StandardNtupleMaker.h. Referenced by execute(), initialize(), and ~StandardNtupleMaker(). |
|
member variables pointing to locations in the TES
Definition at line 104 of file StandardNtupleMaker.h. Referenced by StandardNtupleMaker(). |
|
Definition at line 105 of file StandardNtupleMaker.h. Referenced by execute(), initialize(), and StandardNtupleMaker(). |
|
Definition at line 106 of file StandardNtupleMaker.h. Referenced by execute(), and StandardNtupleMaker(). |
|
Definition at line 107 of file StandardNtupleMaker.h. Referenced by execute(), initialize(), and StandardNtupleMaker(). |
|
Definition at line 108 of file StandardNtupleMaker.h. Referenced by execute(), initialize(), and StandardNtupleMaker(). |
|
Definition at line 109 of file StandardNtupleMaker.h. Referenced by execute(), initialize(), and StandardNtupleMaker(). |
|
Definition at line 110 of file StandardNtupleMaker.h. Referenced by execute(), initialize(), and StandardNtupleMaker(). |
|
Definition at line 111 of file StandardNtupleMaker.h. |
|
Definition at line 112 of file StandardNtupleMaker.h. Referenced by initialize(), and StandardNtupleMaker(). |
|
Definition at line 113 of file StandardNtupleMaker.h. Referenced by StandardNtupleMaker(). |
|
Definition at line 114 of file StandardNtupleMaker.h. |
|
Definition at line 115 of file StandardNtupleMaker.h. Referenced by initialize(), and StandardNtupleMaker(). |
|
Definition at line 119 of file StandardNtupleMaker.h. Referenced by execute(), initialize(), and ~StandardNtupleMaker(). |