Atlfast::CBNT_Atlfast Class Reference

Puts flat Atlfast information into an Combined Ntuple. More...

#include <CBNT_Atlfast.h>

Collaboration diagram for Atlfast::CBNT_Atlfast:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 CBNT_Atlfast (const std::string &name, ISvcLocator *pSvcLocator)
 ~CBNT_Atlfast ()
StatusCode initialize ()
StatusCode execute ()
StatusCode finalize ()

Private Member Functions

StatusCode accessNtuple ()
std::pair< int, int > getParentCodes (MCparticleCollection::const_iterator &)

Private Attributes

std::string m_NtupleLocID
NTuple::Tuple * m_ntPtr
TesIOm_tesIO
std::string m_atlfastEventLocation
 member variables pointing to locations in the TES
std::string m_jetLocation
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
bool m_fillIsolatedElectrons
bool m_fillIsolatedPhotons
bool m_fillIsolatedMuons
bool m_fillNonIsolatedMuons
bool m_fillJets
bool m_fillHistory
bool m_fillEventData
std::string m_mcLocation
NTuple::Item< long > m_isub
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< float > m_sumET
NTuple::Item< float > m_mcWeight0
NTuple::Item< float > m_mcWeight1
NTuple::Item< float > m_mcWeight2
NTuple::Item< long > m_njet
NTuple::Array< long > m_jetlabel
NTuple::Array< float > m_bjetdR
NTuple::Array< float > m_cjetdR
NTuple::Array< float > m_taujetdR
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_ucorr
NTuple::Array< float > m_btag
NTuple::Array< float > m_bcorr
NTuple::Array< float > m_tautag
NTuple::Array< float > m_taucorr
NTuple::Array< float > m_tau1ptag
NTuple::Array< float > m_tau3ptag
NTuple::Array< float > m_tau1p3pcorr
NTuple::Item< long > m_nele
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
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
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_npart
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
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

Detailed Description

Puts flat Atlfast information into an Combined Ntuple.

This is done by looping over the various output collections from Atlfast and filling ntuple branches.

Definition at line 17 of file CBNT_Atlfast.h.


Constructor & Destructor Documentation

Atlfast::CBNT_Atlfast::CBNT_Atlfast ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Standard Athena-Algorithm Constructor

Definition at line 42 of file CBNT_Atlfast.cxx.

00043                                                        : 
00044     Algorithm(name, pSvcLocator),
00045     m_NtupleLocID("/FILE1/CBNT/3333"),
00046     m_ntPtr(0),
00047     m_tesIO(0)
00048   {
00049     m_atlfastEventLocation    = "/Event/Atlfast";
00050     m_jetLocation             = "/Event/AtlfastJets";
00051     m_electronLocation        = "/Event/AtlfastIsolatedElectrons";
00052     m_isolatedMuonLocation    = "/Event/AtlfastIsolatedMuons";
00053     m_nonIsolatedMuonLocation = "/Event/AtlfastNonIsolatedMuons";
00054     m_photonLocation          = "/Event/AtlfastIsolatedPhotons";
00055     m_mcTruthLocation         = "/Event/McEventCollection";
00056     m_bPhysicsLocation        = "/Event/AtlfastBPhysics";
00057     m_eventHeaderLocation     = "/Event/AtlfastEventHeader";
00058 
00059     m_fillIsolatedElectrons = true;
00060     m_fillIsolatedPhotons = true;
00061     m_fillIsolatedMuons = true;
00062     m_fillNonIsolatedMuons = true;
00063     m_fillJets = true;
00064     m_fillHistory = false;
00065     m_fillEventData = true;
00066 
00067     declareProperty( "AtlfastEventLocation",    m_atlfastEventLocation );
00068     declareProperty( "JetLocation",             m_jetLocation );
00069     declareProperty( "ElectronLocation",        m_electronLocation );
00070     declareProperty( "IsolatedMuonLocation",    m_isolatedMuonLocation );
00071     declareProperty( "NonIsolatedMuonLocation", m_nonIsolatedMuonLocation );
00072     declareProperty( "PhotonLocation",          m_photonLocation );
00073     declareProperty( "McTruthLocation",         m_mcTruthLocation );
00074     declareProperty( "BPhysicsLocation",        m_bPhysicsLocation );
00075     declareProperty( "EventHeaderLocation",     m_eventHeaderLocation );
00076     declareProperty( "NtupleLocID",             m_NtupleLocID);
00077     declareProperty( "FillIsolatedElectrons",   m_fillIsolatedElectrons);
00078     declareProperty( "FillIsolatedPhotons",     m_fillIsolatedPhotons);
00079     declareProperty( "FillIsolatedMuons",       m_fillIsolatedMuons);
00080     declareProperty( "FillNonIsolatedMuons",    m_fillNonIsolatedMuons);
00081     declareProperty( "FillJets",                m_fillJets);
00082     declareProperty( "FillHistory",             m_fillHistory);
00083     declareProperty( "FillEventData",           m_fillEventData);
00084     
00085   }

Atlfast::CBNT_Atlfast::~CBNT_Atlfast (  ) 

Default destructor

Definition at line 86 of file CBNT_Atlfast.cxx.

00086                              {
00087     if (m_tesIO) delete m_tesIO;
00088   }


Member Function Documentation

StatusCode Atlfast::CBNT_Atlfast::initialize (  ) 

Standard Athena-Algorithm initialize

Definition at line 92 of file CBNT_Atlfast.cxx.

00092                                    {
00093 
00094   StatusCode sc;
00095   
00096   MsgStream log(messageService(), name());
00097   
00098   // access already booked ntuple m_NtupleLocID
00099   sc = accessNtuple();
00100   if (sc.isFailure()) {
00101     log << MSG::ERROR << "Problem accessing ntuple" << endreq;
00102     return StatusCode::FAILURE;
00103   }
00104   
00105   NTuple::Tuple* nt=m_ntPtr;
00106   
00107   //check the properties
00108   
00109   //declare more variables
00110   
00111   log << MSG::DEBUG << "declare more variables" << endreq;
00112   
00113   // Electrons
00114   if(m_fillIsolatedElectrons){
00115     sc = nt->addItem ("ATLFAST/NELE"      , m_nele, 0, 12 );
00116     sc = nt->addItem ("ATLFAST/KFELE"     , m_nele, m_codeele);
00117     sc = nt->addItem ("ATLFAST/PXELE"     , m_nele, m_pxele);
00118     sc = nt->addItem ("ATLFAST/PYELE"     , m_nele, m_pyele);
00119     sc = nt->addItem ("ATLFAST/PZELE"     , m_nele, m_pzele);
00120     sc = nt->addItem ("ATLFAST/EEELE"     , m_nele, m_eeele);
00121   }
00122   // Photons
00123   if(m_fillIsolatedPhotons){
00124     sc = nt->addItem ("ATLFAST/NPHO"      , m_npho, 0, 12 );
00125     sc = nt->addItem ("ATLFAST/KFPHO"     , m_npho, m_codepho);
00126     sc = nt->addItem ("ATLFAST/PXPHO"     , m_npho, m_pxpho);
00127     sc = nt->addItem ("ATLFAST/PYPHO"     , m_npho, m_pypho);
00128     sc = nt->addItem ("ATLFAST/PZPHO"     , m_npho, m_pzpho);
00129     sc = nt->addItem ("ATLFAST/EEPHO"     , m_npho, m_eepho);
00130   }
00131   // Muons (isolated)
00132   if(m_fillIsolatedMuons){
00133     sc = nt->addItem ("ATLFAST/NMUO"      , m_nmuo, 0, 12 );
00134     sc = nt->addItem ("ATLFAST/KFMUO"     , m_nmuo, m_codemuo);
00135     sc = nt->addItem ("ATLFAST/PXMUO"     , m_nmuo, m_pxmuo);
00136     sc = nt->addItem ("ATLFAST/PYMUO"     , m_nmuo, m_pymuo);
00137     sc = nt->addItem ("ATLFAST/PZMUO"     , m_nmuo, m_pzmuo);
00138     sc = nt->addItem ("ATLFAST/EEMUO"     , m_nmuo, m_eemuo);
00139   }
00140   // MuonsX (non-isolated)
00141   if(m_fillNonIsolatedMuons){
00142     sc = nt->addItem ("ATLFAST/NMUX"      , m_nmux, 0, 12 );
00143     sc = nt->addItem ("ATLFAST/KFMUX"     , m_nmux, m_codemux);
00144     sc = nt->addItem ("ATLFAST/PXMUX"     , m_nmux, m_pxmux);
00145     sc = nt->addItem ("ATLFAST/PYMUX"     , m_nmux, m_pymux);
00146     sc = nt->addItem ("ATLFAST/PZMUX"     , m_nmux, m_pzmux);
00147     sc = nt->addItem ("ATLFAST/EEMUX"     , m_nmux, m_eemux);
00148   }
00149   // Jets
00150    if(m_fillJets){
00151      sc = nt->addItem ("ATLFAST/NJET"       , m_njet, 0, 40 );
00152      sc = nt->addItem ("ATLFAST/KFJET"      , m_njet, m_jetlabel);
00153      sc = nt->addItem ("ATLFAST/PXJET"      , m_njet, m_pxjet);
00154      sc = nt->addItem ("ATLFAST/PYJET"      , m_njet, m_pyjet);
00155      sc = nt->addItem ("ATLFAST/PZJET"      , m_njet, m_pzjet);
00156      sc = nt->addItem ("ATLFAST/EEJET"      , m_njet, m_eejet);
00157      sc = nt->addItem ("ATLFAST/BJETDR"     , m_njet, m_bjetdR);
00158      sc = nt->addItem ("ATLFAST/CJETDR"     , m_njet, m_cjetdR);
00159      sc = nt->addItem ("ATLFAST/TAUJETDR"   , m_njet, m_taujetdR);
00160      sc = nt->addItem ("ATLFAST/PTCALO"     , m_njet, m_ptcalo);
00161      sc = nt->addItem ("ATLFAST/UCORR"      , m_njet, m_ucorr);
00162      sc = nt->addItem ("ATLFAST/BTAG"       , m_njet, m_btag);
00163      sc = nt->addItem ("ATLFAST/BCORR"      , m_njet, m_bcorr);
00164      sc = nt->addItem ("ATLFAST/TAUTAG"     , m_njet, m_tautag);
00165      sc = nt->addItem ("ATLFAST/TAUCORR"    , m_njet, m_taucorr);
00166      sc = nt->addItem ("ATLFAST/TAU1PTAG"   , m_njet, m_tau1ptag);
00167      sc = nt->addItem ("ATLFAST/TAU3PTAG"   , m_njet, m_tau3ptag);
00168      sc = nt->addItem ("ATLFAST/TAU1P3PCORR", m_njet, m_tau1p3pcorr);
00169    }
00170    // History
00171    if(m_fillHistory){
00172      sc = nt->addItem ("ATLFAST/NPART"     , m_npart, 0, 40 );
00173      sc = nt->addItem ("ATLFAST/KPPART"    , m_npart, m_kppart);
00174      sc = nt->addItem ("ATLFAST/KSPART"    , m_npart, m_kspart);
00175      sc = nt->addItem ("ATLFAST/KFPART"    , m_npart, m_kfpart);
00176      sc = nt->addItem ("ATLFAST/KPMOTH"    , m_npart, m_kpmoth);
00177      sc = nt->addItem ("ATLFAST/KFMOTH"    , m_npart, m_kfmoth);
00178      sc = nt->addItem ("ATLFAST/PXPART"    , m_npart, m_pxpart);
00179      sc = nt->addItem ("ATLFAST/PYPART"    , m_npart, m_pypart);
00180      sc = nt->addItem ("ATLFAST/PZPART"    , m_npart, m_pzpart);
00181      sc = nt->addItem ("ATLFAST/EEPART"    , m_npart, m_eepart);
00182    }
00183    // Missing
00184    if(m_fillEventData){
00185      sc = nt->addItem ("ATLFAST/ISUB"      , m_isub);
00186      sc = nt->addItem ("ATLFAST/JETB"      , m_njetb);
00187      sc = nt->addItem ("ATLFAST/JETC"      , m_njetc);
00188      sc = nt->addItem ("ATLFAST/JETTAU"    , m_njettau);
00189      sc = nt->addItem ("ATLFAST/PXMISS"    , m_pxmiss);
00190      sc = nt->addItem ("ATLFAST/PYMISS"    , m_pymiss);
00191      sc = nt->addItem ("ATLFAST/PXNUE"     , m_pxnue);
00192      sc = nt->addItem ("ATLFAST/PYNUE"     , m_pynue);
00193      sc = nt->addItem ("ATLFAST/SUMET"     , m_sumET);
00194      sc = nt->addItem ("ATLFAST/WEIGHT0"   , m_mcWeight0);
00195      sc = nt->addItem ("ATLFAST/WEIGHT1"   , m_mcWeight1);
00196      sc = nt->addItem ("ATLFAST/WEIGHT2"   , m_mcWeight2);
00197    }
00198    
00199    if (sc.isFailure()) {
00200      log << MSG::ERROR << "Problem adding item to ntuple" << endreq;
00201      return StatusCode::FAILURE;
00202    }
00203    
00204   //get the Global Event Data using singleton pattern
00205   GlobalEventData* ged = GlobalEventData::Instance();
00206   // load the location of the MC in StoreGate
00207   m_mcLocation       = ged -> mcLocation();
00208   m_tesIO = new TesIO(m_mcLocation, ged->justHardScatter());
00209   
00210   HeaderPrinter hp("Atlfast CBNT NtupleMaker:", log);
00211   hp.add("MC location                 ", m_mcTruthLocation);
00212   hp.add("Electron Location           ", m_electronLocation);
00213   hp.add("Photon   Location           ", m_photonLocation);
00214   hp.add("Isolated Muon Location      ", m_isolatedMuonLocation);
00215   hp.add("Non-Isolated Muon Location  ", m_nonIsolatedMuonLocation);
00216   hp.add("Jet Location                ", m_jetLocation);
00217   hp.add("EventHeaderLocation         ", m_eventHeaderLocation );
00218   hp.print();
00219   return StatusCode::SUCCESS;
00220 
00221 }

StatusCode Atlfast::CBNT_Atlfast::execute (  ) 

Standard Athena-Algorithm execute

Definition at line 226 of file CBNT_Atlfast.cxx.

00226                                 {
00227 
00228   MsgStream log(messageService(), name());
00229   log << MSG::DEBUG << "in execute() ..." << endreq;
00230 
00231   log << MSG::DEBUG << " -> retrieving all Atlfast stuff"<< endreq;
00232 
00233 
00234 
00235 
00236   //-------------------
00237   // Retrieve Electrons 
00238   //-------------------
00239   std::vector<ReconstructedParticle*> rp;
00240   std::vector<ReconstructedParticle*>::const_iterator irp; 
00241   if(m_fillIsolatedElectrons){
00242     if(!m_tesIO->copy<ReconstructedParticleCollection>(rp,m_electronLocation)){
00243       log <<MSG::DEBUG << "Could not find Electrons"<<endreq;
00244     }
00245     log << MSG::DEBUG << "processing Electrons: " <<rp.size()<< endreq;
00246   
00247     irp = rp.begin();
00248 
00249     m_nele = 0;
00250     for (; irp != rp.end(); ++irp) {
00251       m_codeele[m_nele] = (*irp)->pdg_id();
00252       m_pxele[m_nele]   = (*irp)->momentum().px();
00253       m_pyele[m_nele]   = (*irp)->momentum().py();
00254       m_pzele[m_nele]   = (*irp)->momentum().pz();
00255       m_eeele[m_nele]   = (*irp)->momentum().e();
00256       if (++m_nele == m_nele->range().distance() ) {
00257         log << MSG::WARNING << "Electron list truncated in Ntuple" << endreq;
00258         break;
00259       }
00260     }
00261   }else{
00262     log << MSG::DEBUG << "Isolated-Electrons switched off!" << endreq;
00263   }
00264   //-------------------
00265   // Retrieve Photons 
00266   //-------------------
00267   rp.clear();
00268   if(m_fillIsolatedPhotons){
00269     if(!m_tesIO->copy <ReconstructedParticleCollection>(rp, m_photonLocation)){
00270       log <<MSG::DEBUG << "Could not find Photons"<<endreq;
00271     }
00272     log << MSG::DEBUG << "processing Photons: " <<rp.size()<< endreq;
00273     
00274     irp  = rp.begin();
00275     
00276     m_npho = 0;
00277     for (; irp != rp.end(); ++irp) {
00278       m_codepho[m_npho] = (*irp)->pdg_id();
00279       m_pxpho[m_npho]   = (*irp)->momentum().px();
00280       m_pypho[m_npho]   = (*irp)->momentum().py();
00281       m_pzpho[m_npho]   = (*irp)->momentum().pz();
00282       m_eepho[m_npho]   = (*irp)->momentum().e();
00283       if (++m_npho == m_npho->range().distance() ) {
00284         log << MSG::WARNING << "Photon list truncated in Ntuple" << endreq;
00285         break;
00286       }
00287     }
00288   }else{
00289     log << MSG::DEBUG << "Isolated-Photons switched off!" << endreq;
00290   }
00291   //-------------------
00292   // Retrieve Isolated Muons
00293   //-------------------
00294   rp.clear();
00295   if(m_fillIsolatedMuons){
00296     if(!m_tesIO->copy
00297        <ReconstructedParticleCollection>(rp, m_isolatedMuonLocation)){
00298       log <<MSG::DEBUG << "Could not find Isolated Muons"<<endreq;
00299     }
00300     log << MSG::DEBUG << "Isolated Muons: " <<rp.size()<< endreq;
00301   
00302     irp  = rp.begin();
00303     
00304     m_nmuo = 0;
00305     for (; irp != rp.end(); ++irp) {
00306       m_codemuo[m_nmuo] = (*irp)->pdg_id();
00307       m_pxmuo[m_nmuo]   = (*irp)->momentum().px();
00308       m_pymuo[m_nmuo]   = (*irp)->momentum().py();
00309       m_pzmuo[m_nmuo]   = (*irp)->momentum().pz();
00310       m_eemuo[m_nmuo]   = (*irp)->momentum().e();
00311       if (++m_nmuo == m_nmuo->range().distance() ) {
00312         log << MSG::WARNING 
00313             << "Isolated Muon list truncated in Ntuple" << endreq;
00314         break;
00315       }
00316     }
00317   }else{
00318     log << MSG::DEBUG << "Isolated-Muons switched off!" << endreq;
00319   }
00320 
00321   //-------------------
00322   // Retrieve NonIsolated Muons
00323   //-------------------
00324   rp.clear();
00325   if(m_fillNonIsolatedMuons){
00326     if(!m_tesIO->copy
00327        <ReconstructedParticleCollection >(rp, m_nonIsolatedMuonLocation)){
00328       log <<MSG::DEBUG << "Could not find non Isolated muons"<<endreq;
00329     }
00330     log << MSG::DEBUG << "NonIsolated Muons: " <<rp.size()<< endreq;
00331     irp  = rp.begin();
00332     
00333     m_nmux = 0;
00334     
00335     for (; irp != rp.end(); ++irp) {
00336       m_codemux[m_nmux] = (*irp)->pdg_id();
00337       m_pxmux[m_nmux]   = (*irp)->momentum().px();
00338       m_pymux[m_nmux]   = (*irp)->momentum().py();
00339       m_pzmux[m_nmux]   = (*irp)->momentum().pz();
00340       m_eemux[m_nmux]   = (*irp)->momentum().e();
00341       if (++m_nmux == m_nmux->range().distance() ) {
00342         log << MSG::WARNING 
00343             << "Non-isolated Muon list truncated in Ntuple" << endreq;
00344         break;
00345       }
00346     }
00347   }else{
00348     log << MSG::DEBUG << "NonIsolated-Muons switched off!" << endreq;
00349   }
00350   //-------------------
00351   // Retrieve Jets
00352   //-------------------
00353   
00354   std::vector<Jet*> jv;
00355   std::vector<Jet*>::const_iterator ijv; 
00356   if(m_fillJets){
00357     if(!m_tesIO->copy<JetCollection >(jv, m_jetLocation)){
00358       log <<MSG::DEBUG << "Could not find Jets"<<endreq;
00359     }
00360     log << MSG::DEBUG << "Processing Jets: " <<jv.size()<< endreq;
00361     
00362     ijv = jv.begin();
00363     
00364     m_njet = 0;
00365     
00366     for (; ijv != jv.end(); ++ijv) {
00367       m_jetlabel[m_njet]    = (*ijv)->pdg_id();
00368       m_pxjet[m_njet]       = (*ijv)->px();
00369       m_pyjet[m_njet]       = (*ijv)->py();
00370       m_pzjet[m_njet]       = (*ijv)->pz();
00371       m_eejet[m_njet]       = (*ijv)->e();
00372       m_bjetdR[m_njet]      = (*ijv)->getdRbquark();
00373       m_cjetdR[m_njet]      = (*ijv)->getdRcquark();
00374       m_taujetdR[m_njet]    = (*ijv)->getdRhadtau();
00375       m_ptcalo[m_njet]      = (*ijv)->pT();
00376       m_ucorr[m_njet]       = (*ijv)->lTagCorrFactor();
00377       m_btag[m_njet]        = (*ijv)->isBTagged() ? 1. : 0.;
00378       m_bcorr[m_njet]       = (*ijv)->bTagCorrFactor();
00379       m_tautag[m_njet]      = (*ijv)->isTauTagged("Standard") ? 1. : 0.;
00380       m_taucorr[m_njet]     = (*ijv)->tauTagCorrFactor("Tau");
00381       m_tau1ptag[m_njet]    = (*ijv)->isTauTagged("Tau1P3P:1prong") ? 1. : 0.;
00382       m_tau3ptag[m_njet]    = (*ijv)->isTauTagged("Tau1P3P:3prong") ? 1. : 0.;
00383       m_tau1p3pcorr[m_njet] = (*ijv)->tauTagCorrFactor("Tau1P3P");
00384       if ( ++m_njet == m_njet->range().distance() ) {break;}
00385     }
00386     log << MSG::DEBUG << " Jets in ntuple" << endreq;
00387   }else{
00388     log << MSG::DEBUG << "Atlfast Jets switched off!" << endreq;
00389   }
00390   
00391   if(m_fillHistory){
00392     MCparticleCollection mc;
00393   
00394     HepMC_helper::All* all= new  HepMC_helper::All;
00395     TesIoStat stat = m_tesIO->getMC(mc, all);
00396     delete all;
00397   
00398     if(stat){
00399       log << MSG::DEBUG << " found MC truth" << endreq;
00400     }else{
00401       log << MSG::ERROR << " MC truth not found in TES" << endreq;
00402     }
00403 
00404     MCparticleCollection::const_iterator imc = mc.begin();
00405     m_npart=0;
00406   
00407     HepMC_helper::IsStatusxx isf(3);
00408   
00409     for(;imc != mc.end(); ++imc){
00410       if(isf(*imc)){
00411         m_kppart[m_npart]  = (*imc)->barcode();
00412         m_kspart[m_npart]  = (*imc)->status()%100;
00413         m_kfpart[m_npart]  = (*imc)->pdg_id();
00414         std::pair<int, int> parentCodes = getParentCodes(imc);
00415         m_kfmoth[m_npart]  = parentCodes.first;      
00416         m_kpmoth[m_npart]  = parentCodes.second;
00417         m_pxpart[m_npart]  = (*imc)->momentum().x();
00418         m_pypart[m_npart]  = (*imc)->momentum().y();
00419         m_pzpart[m_npart]  = (*imc)->momentum().z();
00420         m_eepart[m_npart]  = (*imc)->momentum().e();
00421         ++m_npart;
00422       }
00423     
00424       if ( m_npart == m_npart->range().distance() ) break;
00425     }
00426   
00427     log << MSG::DEBUG << " Particles in ntuple" << endreq;      
00428   }else{
00429     log << MSG::DEBUG << "Atlfast History switched off!" << endreq;
00430   }
00431 
00432   if(m_fillEventData){
00433     const EventHeader* theEventHeader(0);
00434     if(!(m_tesIO->getDH(theEventHeader))){
00435       log << MSG::ERROR<<"Could not find the event header in the TES"<<endreq;
00436     }
00437   
00438     if(theEventHeader){
00439       m_isub    = 0;
00440       m_njetb   = theEventHeader->nBJets();
00441       m_njetc   = theEventHeader->nCJets();
00442       m_njettau = theEventHeader->nTauJets();
00443       m_pxmiss  = theEventHeader->pMiss().x();
00444       m_pymiss  = theEventHeader->pMiss().y();
00445       m_pxnue   = theEventHeader->pEscaped().x();
00446       m_pynue   = theEventHeader->pEscaped().y();
00447       m_sumET   = theEventHeader->sumET();
00448       
00449       MCweightContainer weights = theEventHeader->firstFewWeights(3);
00450       m_mcWeight0 = weights[0];
00451       m_mcWeight1 = weights[1];
00452       m_mcWeight2 = weights[2];
00453     } else {
00454       log << MSG::ERROR << " Invalid EventHeader data handle" << endreq;
00455     }
00456     
00457     log << MSG::DEBUG << " EventHeader quantities are in ntuple" << endreq;
00458   }else{
00459     log << MSG::DEBUG << "Atlfast History switched off!" << endreq;
00460   }
00461   
00462   return StatusCode::SUCCESS;
00463   
00464 }

StatusCode Atlfast::CBNT_Atlfast::finalize (  ) 

Standard Athena-Algorithm finalize

Definition at line 485 of file CBNT_Atlfast.cxx.

00485                                   {
00486     //  MsgStream log(messageService(), name());
00487     //log << MSG::INFO << "in finalize() ..." << endreq;
00488   return StatusCode::SUCCESS;
00489 }

StatusCode Atlfast::CBNT_Atlfast::accessNtuple (  )  [private]

Definition at line 493 of file CBNT_Atlfast.cxx.

00493                                       {
00494   MsgStream log(messageService(), name());
00495   
00496   //try to access it  
00497   NTuplePtr nt(ntupleService(),"/NTUPLES"+m_NtupleLocID);
00498   
00499   if (nt) 
00500     {
00501       m_ntPtr=nt;
00502       log << MSG::INFO << "Ntuple " <<m_NtupleLocID 
00503           << " reaccessed! " << endreq;
00504       return StatusCode::SUCCESS;
00505     } else
00506       {
00507         log << MSG::FATAL << "Cannot reaccess " << m_NtupleLocID << endreq;
00508         return StatusCode::FAILURE;
00509       }
00510 }

std::pair< int, int > Atlfast::CBNT_Atlfast::getParentCodes ( MCparticleCollection::const_iterator &   )  [private]

Definition at line 467 of file CBNT_Atlfast.cxx.

00468                                           {
00469     
00470     HepMC::GenVertex* gv = (*imc)->production_vertex();
00471     if ( gv == 0 ){ return std::pair<int, int>(0,0);}
00472     
00473     if ( gv->particles_in_size() == 0 ) { return std::pair<int, int>(0,0); }
00474 
00475     HepMC::GenVertex::particle_iterator 
00476       pi = gv->particles_begin(HepMC::parents);
00477     if( *pi == 0 ){ return std::pair<int, int>(0,0); }
00478       
00479 
00480     return std::pair<int, int>( (*pi)->pdg_id(), (*pi)->barcode() );
00481   }


Member Data Documentation

std::string Atlfast::CBNT_Atlfast::m_NtupleLocID [private]

Definition at line 35 of file CBNT_Atlfast.h.

NTuple::Tuple* Atlfast::CBNT_Atlfast::m_ntPtr [private]

Definition at line 36 of file CBNT_Atlfast.h.

TesIO* Atlfast::CBNT_Atlfast::m_tesIO [private]

Definition at line 39 of file CBNT_Atlfast.h.

std::string Atlfast::CBNT_Atlfast::m_atlfastEventLocation [private]

member variables pointing to locations in the TES

Definition at line 42 of file CBNT_Atlfast.h.

std::string Atlfast::CBNT_Atlfast::m_jetLocation [private]

Definition at line 43 of file CBNT_Atlfast.h.

std::string Atlfast::CBNT_Atlfast::m_electronLocation [private]

Definition at line 44 of file CBNT_Atlfast.h.

std::string Atlfast::CBNT_Atlfast::m_isolatedMuonLocation [private]

Definition at line 45 of file CBNT_Atlfast.h.

std::string Atlfast::CBNT_Atlfast::m_nonIsolatedMuonLocation [private]

Definition at line 46 of file CBNT_Atlfast.h.

std::string Atlfast::CBNT_Atlfast::m_photonLocation [private]

Definition at line 47 of file CBNT_Atlfast.h.

std::string Atlfast::CBNT_Atlfast::m_trackLocation [private]

Definition at line 48 of file CBNT_Atlfast.h.

std::string Atlfast::CBNT_Atlfast::m_mcTruthLocation [private]

Definition at line 49 of file CBNT_Atlfast.h.

std::string Atlfast::CBNT_Atlfast::m_bPhysicsLocation [private]

Definition at line 50 of file CBNT_Atlfast.h.

std::string Atlfast::CBNT_Atlfast::m_triggerLocation [private]

Definition at line 51 of file CBNT_Atlfast.h.

std::string Atlfast::CBNT_Atlfast::m_eventHeaderLocation [private]

Definition at line 52 of file CBNT_Atlfast.h.

bool Atlfast::CBNT_Atlfast::m_fillIsolatedElectrons [private]

Definition at line 54 of file CBNT_Atlfast.h.

bool Atlfast::CBNT_Atlfast::m_fillIsolatedPhotons [private]

Definition at line 55 of file CBNT_Atlfast.h.

bool Atlfast::CBNT_Atlfast::m_fillIsolatedMuons [private]

Definition at line 56 of file CBNT_Atlfast.h.

bool Atlfast::CBNT_Atlfast::m_fillNonIsolatedMuons [private]

Definition at line 57 of file CBNT_Atlfast.h.

bool Atlfast::CBNT_Atlfast::m_fillJets [private]

Definition at line 58 of file CBNT_Atlfast.h.

bool Atlfast::CBNT_Atlfast::m_fillHistory [private]

Definition at line 59 of file CBNT_Atlfast.h.

bool Atlfast::CBNT_Atlfast::m_fillEventData [private]

Definition at line 60 of file CBNT_Atlfast.h.

std::string Atlfast::CBNT_Atlfast::m_mcLocation [private]

Definition at line 63 of file CBNT_Atlfast.h.

NTuple::Item<long> Atlfast::CBNT_Atlfast::m_isub [private]

Definition at line 66 of file CBNT_Atlfast.h.

NTuple::Item<long> Atlfast::CBNT_Atlfast::m_njetb [private]

Definition at line 67 of file CBNT_Atlfast.h.

NTuple::Item<long> Atlfast::CBNT_Atlfast::m_njetc [private]

Definition at line 67 of file CBNT_Atlfast.h.

NTuple::Item<long> Atlfast::CBNT_Atlfast::m_njettau [private]

Definition at line 67 of file CBNT_Atlfast.h.

NTuple::Item<float> Atlfast::CBNT_Atlfast::m_pxmiss [private]

Definition at line 68 of file CBNT_Atlfast.h.

NTuple::Item<float> Atlfast::CBNT_Atlfast::m_pymiss [private]

Definition at line 68 of file CBNT_Atlfast.h.

NTuple::Item<float> Atlfast::CBNT_Atlfast::m_pxnue [private]

Definition at line 68 of file CBNT_Atlfast.h.

NTuple::Item<float> Atlfast::CBNT_Atlfast::m_pynue [private]

Definition at line 68 of file CBNT_Atlfast.h.

NTuple::Item<float> Atlfast::CBNT_Atlfast::m_sumET [private]

Definition at line 68 of file CBNT_Atlfast.h.

NTuple::Item<float> Atlfast::CBNT_Atlfast::m_mcWeight0 [private]

Definition at line 69 of file CBNT_Atlfast.h.

NTuple::Item<float> Atlfast::CBNT_Atlfast::m_mcWeight1 [private]

Definition at line 69 of file CBNT_Atlfast.h.

NTuple::Item<float> Atlfast::CBNT_Atlfast::m_mcWeight2 [private]

Definition at line 69 of file CBNT_Atlfast.h.

NTuple::Item<long> Atlfast::CBNT_Atlfast::m_njet [private]

Definition at line 71 of file CBNT_Atlfast.h.

NTuple::Array<long> Atlfast::CBNT_Atlfast::m_jetlabel [private]

Definition at line 72 of file CBNT_Atlfast.h.

NTuple::Array<float> Atlfast::CBNT_Atlfast::m_bjetdR [private]

Definition at line 73 of file CBNT_Atlfast.h.

NTuple::Array<float> Atlfast::CBNT_Atlfast::m_cjetdR [private]

Definition at line 73 of file CBNT_Atlfast.h.

NTuple::Array<float> Atlfast::CBNT_Atlfast::m_taujetdR [private]

Definition at line 73 of file CBNT_Atlfast.h.

NTuple::Array<float> Atlfast::CBNT_Atlfast::m_pxjet [private]

Definition at line 74 of file CBNT_Atlfast.h.

NTuple::Array<float> Atlfast::CBNT_Atlfast::m_pyjet [private]

Definition at line 74 of file CBNT_Atlfast.h.

NTuple::Array<float> Atlfast::CBNT_Atlfast::m_pzjet [private]

Definition at line 74 of file CBNT_Atlfast.h.

NTuple::Array<float> Atlfast::CBNT_Atlfast::m_eejet [private]

Definition at line 74 of file CBNT_Atlfast.h.

NTuple::Array<float> Atlfast::CBNT_Atlfast::m_ptcalo [private]

Definition at line 75 of file CBNT_Atlfast.h.

NTuple::Array<float> Atlfast::CBNT_Atlfast::m_ucorr [private]

Definition at line 75 of file CBNT_Atlfast.h.

NTuple::Array<float> Atlfast::CBNT_Atlfast::m_btag [private]

Definition at line 76 of file CBNT_Atlfast.h.

NTuple::Array<float> Atlfast::CBNT_Atlfast::m_bcorr [private]

Definition at line 76 of file CBNT_Atlfast.h.

NTuple::Array<float> Atlfast::CBNT_Atlfast::m_tautag [private]

Definition at line 77 of file CBNT_Atlfast.h.

NTuple::Array<float> Atlfast::CBNT_Atlfast::m_taucorr [private]

Definition at line 77 of file CBNT_Atlfast.h.

NTuple::Array<float> Atlfast::CBNT_Atlfast::m_tau1ptag [private]

Definition at line 78 of file CBNT_Atlfast.h.

NTuple::Array<float> Atlfast::CBNT_Atlfast::m_tau3ptag [private]

Definition at line 78 of file CBNT_Atlfast.h.

NTuple::Array<float> Atlfast::CBNT_Atlfast::m_tau1p3pcorr [private]

Definition at line 78 of file CBNT_Atlfast.h.

NTuple::Item<long> Atlfast::CBNT_Atlfast::m_nele [private]

Definition at line 80 of file CBNT_Atlfast.h.

NTuple::Array<long> Atlfast::CBNT_Atlfast::m_codeele [private]

Definition at line 81 of file CBNT_Atlfast.h.

NTuple::Array<float> Atlfast::CBNT_Atlfast::m_pxele [private]

Definition at line 82 of file CBNT_Atlfast.h.

NTuple::Array<float> Atlfast::CBNT_Atlfast::m_pyele [private]

Definition at line 82 of file CBNT_Atlfast.h.

NTuple::Array<float> Atlfast::CBNT_Atlfast::m_pzele [private]

Definition at line 82 of file CBNT_Atlfast.h.

NTuple::Array<float> Atlfast::CBNT_Atlfast::m_eeele [private]

Definition at line 82 of file CBNT_Atlfast.h.

NTuple::Item<long> Atlfast::CBNT_Atlfast::m_nmuo [private]

Definition at line 84 of file CBNT_Atlfast.h.

NTuple::Array<long> Atlfast::CBNT_Atlfast::m_codemuo [private]

Definition at line 85 of file CBNT_Atlfast.h.

NTuple::Array<float> Atlfast::CBNT_Atlfast::m_pxmuo [private]

Definition at line 86 of file CBNT_Atlfast.h.

NTuple::Array<float> Atlfast::CBNT_Atlfast::m_pymuo [private]

Definition at line 86 of file CBNT_Atlfast.h.

NTuple::Array<float> Atlfast::CBNT_Atlfast::m_pzmuo [private]

Definition at line 86 of file CBNT_Atlfast.h.

NTuple::Array<float> Atlfast::CBNT_Atlfast::m_eemuo [private]

Definition at line 86 of file CBNT_Atlfast.h.

NTuple::Item<long> Atlfast::CBNT_Atlfast::m_nmux [private]

Definition at line 87 of file CBNT_Atlfast.h.

NTuple::Array<long> Atlfast::CBNT_Atlfast::m_codemux [private]

Definition at line 88 of file CBNT_Atlfast.h.

NTuple::Array<float> Atlfast::CBNT_Atlfast::m_pxmux [private]

Definition at line 89 of file CBNT_Atlfast.h.

NTuple::Array<float> Atlfast::CBNT_Atlfast::m_pymux [private]

Definition at line 89 of file CBNT_Atlfast.h.

NTuple::Array<float> Atlfast::CBNT_Atlfast::m_pzmux [private]

Definition at line 89 of file CBNT_Atlfast.h.

NTuple::Array<float> Atlfast::CBNT_Atlfast::m_eemux [private]

Definition at line 89 of file CBNT_Atlfast.h.

NTuple::Item<long> Atlfast::CBNT_Atlfast::m_npho [private]

Definition at line 91 of file CBNT_Atlfast.h.

NTuple::Array<long> Atlfast::CBNT_Atlfast::m_codepho [private]

Definition at line 92 of file CBNT_Atlfast.h.

NTuple::Array<float> Atlfast::CBNT_Atlfast::m_pxpho [private]

Definition at line 93 of file CBNT_Atlfast.h.

NTuple::Array<float> Atlfast::CBNT_Atlfast::m_pypho [private]

Definition at line 93 of file CBNT_Atlfast.h.

NTuple::Array<float> Atlfast::CBNT_Atlfast::m_pzpho [private]

Definition at line 93 of file CBNT_Atlfast.h.

NTuple::Array<float> Atlfast::CBNT_Atlfast::m_eepho [private]

Definition at line 93 of file CBNT_Atlfast.h.

NTuple::Item<long> Atlfast::CBNT_Atlfast::m_npart [private]

Definition at line 95 of file CBNT_Atlfast.h.

NTuple::Array<long> Atlfast::CBNT_Atlfast::m_kppart [private]

Definition at line 96 of file CBNT_Atlfast.h.

NTuple::Array<long> Atlfast::CBNT_Atlfast::m_kspart [private]

Definition at line 96 of file CBNT_Atlfast.h.

NTuple::Array<long> Atlfast::CBNT_Atlfast::m_kfpart [private]

Definition at line 96 of file CBNT_Atlfast.h.

NTuple::Array<long> Atlfast::CBNT_Atlfast::m_kpmoth [private]

Definition at line 97 of file CBNT_Atlfast.h.

NTuple::Array<long> Atlfast::CBNT_Atlfast::m_kfmoth [private]

Definition at line 97 of file CBNT_Atlfast.h.

NTuple::Array<float> Atlfast::CBNT_Atlfast::m_pxpart [private]

Definition at line 98 of file CBNT_Atlfast.h.

NTuple::Array<float> Atlfast::CBNT_Atlfast::m_pypart [private]

Definition at line 98 of file CBNT_Atlfast.h.

NTuple::Array<float> Atlfast::CBNT_Atlfast::m_pzpart [private]

Definition at line 98 of file CBNT_Atlfast.h.

NTuple::Array<float> Atlfast::CBNT_Atlfast::m_eepart [private]

Definition at line 98 of file CBNT_Atlfast.h.

NTuple::Item<long> Atlfast::CBNT_Atlfast::m_nbphys [private]

Definition at line 100 of file CBNT_Atlfast.h.

NTuple::Array<long> Atlfast::CBNT_Atlfast::m_kbphys [private]

Definition at line 101 of file CBNT_Atlfast.h.

NTuple::Array<long> Atlfast::CBNT_Atlfast::m_kfbphys [private]

Definition at line 101 of file CBNT_Atlfast.h.

NTuple::Array<long> Atlfast::CBNT_Atlfast::m_pxphys [private]

Definition at line 102 of file CBNT_Atlfast.h.

NTuple::Array<long> Atlfast::CBNT_Atlfast::m_pybphys [private]

Definition at line 102 of file CBNT_Atlfast.h.

NTuple::Array<long> Atlfast::CBNT_Atlfast::m_pzbphys [private]

Definition at line 102 of file CBNT_Atlfast.h.

NTuple::Array<long> Atlfast::CBNT_Atlfast::m_eebphys [private]

Definition at line 102 of file CBNT_Atlfast.h.

NTuple::Array<long> Atlfast::CBNT_Atlfast::m_vxphys [private]

Definition at line 103 of file CBNT_Atlfast.h.

NTuple::Array<long> Atlfast::CBNT_Atlfast::m_vybphys [private]

Definition at line 103 of file CBNT_Atlfast.h.

NTuple::Array<long> Atlfast::CBNT_Atlfast::m_vzbphys [private]

Definition at line 103 of file CBNT_Atlfast.h.


The documentation for this class was generated from the following files:
Generated on Mon Sep 24 14:19:35 2007 for AtlfastAlgs by  doxygen 1.5.1