Atlfast::AtlfastC Class Reference

Applies efficiencies and mis-identifications to the usual Atlfast output. More...

#include <AtlfastC.h>

Collaboration diagram for Atlfast::AtlfastC:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 AtlfastC (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~AtlfastC ()
StatusCode ApplyEfficiency (std::vector< ReconstructedParticle * >, ReconstructedParticleCollection *, Interpolator *, int)
StatusCode ApplyEfficiency (std::vector< Jet * >, ReconstructedParticleCollection *, Interpolator *, int)
StatusCode ApplyEfficiency (std::vector< ReconstructedParticle * >, JetCollection *, Interpolator *)
StatusCode ApplyEfficiency (std::vector< Jet * >, JetCollection *, Interpolator *)
double getEfficiencyMatrixElement (double, double, Interpolator *)
StatusCode initialize ()
StatusCode execute ()
StatusCode finalize ()

Private Member Functions

JetcreateJet (const ReconstructedParticle *rp)

Private Attributes

bool m_ApplyElecElecEff
bool m_ApplyElecPhotEff
bool m_ApplyElecMuonEff
bool m_ApplyPhotPhotEff
bool m_ApplyPhotElecEff
bool m_ApplyPhotMuonEff
bool m_ApplyMuonElecEff
bool m_ApplyMuonPhotEff
bool m_ApplyMuonMuonEff
bool m_ApplyJetJetEff
bool m_ApplyJetElecEff
bool m_ApplyJetPhotEff
bool m_ApplyJetMuonEff
bool m_ApplyElecJetEff
bool m_ApplyPhotJetEff
bool m_ApplyMuonJetEff
bool m_notInit
TesIOm_tesIO
HepRandomEngine * m_pRandomEngine
RandFlat * m_pRandFlatGenerator
std::vector< ReconstructedParticle * > originalElectrons
std::vector< ReconstructedParticle * > originalPhotons
std::vector< ReconstructedParticle * > originalMuons
std::vector< Jet * > originalJets
ReconstructedParticleCollectionm_AtlfastCElectrons
ReconstructedParticleCollectionm_AtlfastCPhotons
ReconstructedParticleCollectionm_AtlfastCMuons
JetCollectionm_AtlfastCJets
int ptnum
int etanum
std::vector< ReconstructedParticle
* >::const_iterator 
m_it
std::vector< Jet * >::const_iterator j_it
std::string m_inputeLocation
std::string m_inputphotonLocation
std::string m_inputmuonLocation
std::string m_inputjetLocation
std::string m_outputeLocation
std::string m_outputphotonLocation
std::string m_outputmuonLocation
std::string m_outputjetLocation
std::string m_mcLocation
std::string m_elecelecEfile
std::string m_elecphotEfile
std::string m_elecmuonEfile
std::string m_photelecEfile
std::string m_photphotEfile
std::string m_photmuonEfile
std::string m_muonelecEfile
std::string m_muonphotEfile
std::string m_muonmuonEfile
std::string m_jetjetEfile
std::string m_jetelecEfile
std::string m_jetphotEfile
std::string m_jetmuonEfile
std::string m_elecjetEfile
std::string m_photjetEfile
std::string m_muonjetEfile
Interpolatorm_electron_interpolator
Interpolatorm_photon_interpolator
Interpolatorm_muon_interpolator
Interpolatorm_jet_interpolator
Interpolatorm_elecphot_interpolator
Interpolatorm_elecmuon_interpolator
Interpolatorm_elecjet_interpolator
Interpolatorm_photelec_interpolator
Interpolatorm_photmuon_interpolator
Interpolatorm_photjet_interpolator
Interpolatorm_muonelec_interpolator
Interpolatorm_muonphot_interpolator
Interpolatorm_muonjet_interpolator
Interpolatorm_jetelec_interpolator
Interpolatorm_jetphot_interpolator
Interpolatorm_jetmuon_interpolator

Detailed Description

Applies efficiencies and mis-identifications to the usual Atlfast output.

This produces a more realistic set of output physics objects, featuring fakes. Electrons, photons, muons and jets are considered.

Definition at line 71 of file AtlfastC.h.


Constructor & Destructor Documentation

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

Standard Athena-Algorithm constructor

Definition at line 50 of file AtlfastC.cxx.

00051     : Algorithm( name, pSvcLocator )
00052     , m_tesIO( 0 )
00053     , m_pRandomEngine( 0 )
00054     , m_pRandFlatGenerator( 0 )
00055     , m_AtlfastCJets( 0 )
00056     , m_electron_interpolator( 0 )
00057     , m_photon_interpolator( 0 )
00058     , m_muon_interpolator( 0 )
00059     , m_jet_interpolator( 0 )
00060     , m_elecphot_interpolator( 0 )
00061     , m_elecmuon_interpolator( 0 )
00062     , m_elecjet_interpolator( 0 )
00063     , m_photelec_interpolator( 0 )
00064     , m_photmuon_interpolator( 0 )
00065     , m_photjet_interpolator( 0 )
00066     , m_muonelec_interpolator( 0 )
00067     , m_muonphot_interpolator( 0 )
00068     , m_muonjet_interpolator( 0 )
00069     , m_jetelec_interpolator( 0 )
00070     , m_jetphot_interpolator( 0 )
00071     , m_jetmuon_interpolator( 0 )
00072 {
00073      //Default private parameters
00074     
00075     m_ApplyElecElecEff  =  true;
00076     m_ApplyElecPhotEff  =  true;
00077     m_ApplyElecMuonEff  =  true;
00078     m_ApplyPhotPhotEff  =  true;
00079     m_ApplyPhotElecEff  =  true; 
00080     m_ApplyPhotMuonEff  =  true; 
00081     m_ApplyMuonPhotEff  =  true;
00082     m_ApplyMuonElecEff  =  true; 
00083     m_ApplyMuonMuonEff  =  true;
00084     m_ApplyJetJetEff    =  true;
00085     m_ApplyJetPhotEff   =  true;
00086     m_ApplyJetElecEff   =  true; 
00087     m_ApplyJetMuonEff   =  true;
00088     m_ApplyPhotJetEff   =  false;
00089     m_ApplyElecJetEff   =  false; 
00090     m_ApplyMuonJetEff   =  false;
00091  
00092 
00093 
00094  
00095     
00096     // Default paths for entities in the TES
00097     m_inputeLocation         = "/Event/AtlfastIsolatedElectrons";
00098     m_inputphotonLocation    = "/Event/AtlfastIsolatedPhotons";
00099     m_inputmuonLocation      = "/Event/AtlfastIsolatedMuons" ;
00100     m_inputjetLocation       = "/Event/AtlfastJets" ;
00101     // input from AtlfastB jets
00102     //    m_inputjetLocation       = "/Event/AtlfastCalJets" ;
00103 
00104     m_outputeLocation        = "/Event/AtlfastCElectrons";
00105     m_outputphotonLocation   = "/Event/AtlfastCPhotons";
00106     m_outputmuonLocation     = "/Event/AtlfastCMuons" ;
00107     m_outputjetLocation      = "/Event/AtlfastCJets" ;
00108 
00109 
00110     m_elecelecEfile          = "atlfastDatafiles/electron_electronEff.dat";
00111     m_elecphotEfile          = "atlfastDatafiles/electron_photonEff.dat";
00112     m_elecmuonEfile          = "atlfastDatafiles/electron_muid_muonEff.dat";
00113     m_elecjetEfile           = "atlfastDatafiles/electron_ktjetEff.dat";
00114     //    m_elecmuonEfile          = "atlfastDatafiles/electron_staco_muonEff.dat";
00115     m_photelecEfile          = "atlfastDatafiles/photon_electronEff.dat";
00116     m_photphotEfile          = "atlfastDatafiles/photon_photonEff.dat";
00117     m_photmuonEfile          = "atlfastDatafiles/photon_muid_muonEff.dat";
00118     m_photjetEfile           = "atlfastDatafiles/photon_ktjetEff.dat";
00119     //    m_photmuonEfile          = "atlfastDatafiles/photon_staco_muonEff.dat";
00120     m_muonelecEfile          = "atlfastDatafiles/muon_electronEff.dat";
00121     m_muonphotEfile          = "atlfastDatafiles/muon_photonEff.dat";
00122     m_muonmuonEfile          = "atlfastDatafiles/muon_muid_muonEff.dat";
00123     m_muonjetEfile           = "atlfastDatafiles/muon_ktjetEff.dat";
00124     //    m_muonmuonEfile          = "atlfastDatafiles/muon_staco_muonEff.dat";
00125     m_jetelecEfile           = "atlfastDatafiles/ktjet_electronEff.dat";
00126     m_jetphotEfile           = "atlfastDatafiles/ktjet_photonEff.dat";
00127     m_jetmuonEfile           = "atlfastDatafiles/ktjet_muid_muonEff.dat";
00128     m_jetjetEfile            = "atlfastDatafiles/ktjet_ktjetEff.dat";
00129     //    m_jetmuonEfile          = "atlfastDatafiles/jet_staco_muonEff.dat";
00130 
00131 
00132     // This is how you declare the paramemters to Gaudi so that
00133     // they can be over-written via the job options file
00134         
00135     declareProperty( "InputeLocation",           m_inputeLocation ) ;
00136     declareProperty( "InputphotonLocation",      m_inputphotonLocation ) ;
00137     declareProperty( "InputmuonLocation",        m_inputmuonLocation ) ;
00138     declareProperty( "InputjetLocation",         m_inputjetLocation ) ;
00139 
00140     declareProperty( "OutputeLocation",          m_outputeLocation ) ;
00141     declareProperty( "OutputphotonLocation",     m_outputphotonLocation ) ;
00142     declareProperty( "OutputmuonLocation",       m_outputmuonLocation ) ;
00143     declareProperty( "OutputjetLocation",        m_outputjetLocation ) ;
00144     
00145     declareProperty( "ApplyElecElecEff",         m_ApplyElecElecEff);
00146     declareProperty( "ApplyElecPhotEff",         m_ApplyElecPhotEff);
00147     declareProperty( "ApplyElecMuonEff",         m_ApplyElecMuonEff);
00148     declareProperty( "ApplyPhotPhotEff",         m_ApplyPhotPhotEff);
00149     declareProperty( "ApplyPhotElecEff",         m_ApplyPhotElecEff);
00150     declareProperty( "ApplyPhotMuonEff",         m_ApplyPhotMuonEff);
00151     declareProperty( "ApplyMuonElecEff",         m_ApplyMuonElecEff);
00152     declareProperty( "ApplyMuonPhotEff",         m_ApplyMuonPhotEff);
00153     declareProperty( "ApplyMuonMuonEff",         m_ApplyMuonMuonEff);
00154     declareProperty( "ApplyJetElecEff",          m_ApplyJetElecEff);
00155     declareProperty( "ApplyJetPhotEff",          m_ApplyJetPhotEff);
00156     declareProperty( "ApplyJetMuonEff",          m_ApplyJetMuonEff);
00157     declareProperty( "ApplyJetJetEff",           m_ApplyJetJetEff);
00158     declareProperty( "ApplyElecJetEff",          m_ApplyElecJetEff);
00159     declareProperty( "ApplyPhotJetEff",          m_ApplyPhotJetEff);
00160     declareProperty( "ApplyMuonJetEff",          m_ApplyMuonJetEff);
00161 
00162 
00163 
00164     declareProperty( "ElecElecFile", m_elecelecEfile);
00165     declareProperty( "ElecPhotFile", m_elecphotEfile);
00166     declareProperty( "ElecMuonFile", m_elecmuonEfile);
00167     declareProperty( "PhotElecFile", m_photelecEfile);
00168     declareProperty( "PhotPhotFile", m_photphotEfile);
00169     declareProperty( "PhotMuonFile", m_photmuonEfile);
00170     declareProperty( "MuonElecFile", m_muonelecEfile);
00171     declareProperty( "MuonPhotFile", m_muonphotEfile);
00172     declareProperty( "MuonMuonFile", m_muonmuonEfile);
00173     declareProperty( "JetElecFile", m_jetelecEfile);
00174     declareProperty( "JetPhotFile", m_jetphotEfile);
00175     declareProperty( "JetMuonFile", m_jetmuonEfile);
00176     declareProperty( "JetJetFile",  m_jetjetEfile);
00177     declareProperty( "ElecJetFile", m_elecjetEfile);
00178     declareProperty( "PhotJetFile", m_photjetEfile);
00179     declareProperty( "MuonJetFile", m_muonjetEfile);
00180 
00181   }

Atlfast::AtlfastC::~AtlfastC (  )  [virtual]

Virtual destructor

Definition at line 183 of file AtlfastC.cxx.

00183                       {
00184     
00185     MsgStream log( messageService(), name() ) ;
00186     log << MSG::DEBUG << "Destructor" << endreq;
00187     if( m_tesIO) {
00188       delete m_tesIO;
00189     }
00190     if( m_pRandomEngine) {
00191       delete m_pRandomEngine;
00192     }
00193     if( m_pRandFlatGenerator) {
00194       delete m_pRandFlatGenerator;
00195     }
00196 
00197     //    delete dummy_cluster ;
00198 
00199   }


Member Function Documentation

Jet * Atlfast::AtlfastC::createJet ( const ReconstructedParticle rp  )  [private]

Definition at line 661 of file AtlfastC.cxx.

00661                                                         {
00662     
00663     Jet* jet = 0;
00664     MsgStream log( messageService(), name() );
00665     HepLorentzVector vec = rp->momentum();
00666 
00667     //No smearing applied - jets keep their particle smearing.
00668     
00669     // Get associations of ReconstructedParticle 
00670     const IAOO* iaooRP = rp;
00671     TypeVisitor tv =
00672       ContainerDispatcher( iaooRP->begin(), iaooRP->end(), TypeVisitor() );
00673     
00674     // Select the vector of Clusters (should just be one)
00675     std::vector<const Cluster*> cv = tv.typeVector(Cluster());
00676     log << MSG::INFO << "TypeVisitor found " << cv.size() 
00677         << " Clusters in this ReconstructedParticle" << endreq;
00678     
00679     if ( cv.size() == 1 ){
00680       Cluster* ic = const_cast<Cluster*>(cv[0]);
00681       jet = new Jet(vec, *ic);
00682       log << MSG::INFO << "Unsmeared Cluster: " << *ic << endreq;
00683       log << MSG::INFO << "Smeared Jet      : " << jet << endreq ;
00684     }
00685 
00686     return jet;
00687     
00688   }  

StatusCode Atlfast::AtlfastC::ApplyEfficiency ( std::vector< ReconstructedParticle * >  ,
ReconstructedParticleCollection ,
Interpolator ,
int   
)

Creates new vector of RPs by applying efficiencies to input RP collection.

Definition at line 514 of file AtlfastC.cxx.

00514                                                                                                                                                                             {
00515    
00516     MsgStream log( messageService(), name() ) ;     
00517     //Apply randomized particle to particle efficiency
00518     log<<MSG::DEBUG<<"Applying randomized efficiency...."<<endreq;
00519     
00520     for(m_it=OriginalList.begin(); m_it<OriginalList.end();++m_it){
00521       
00522       log<<MSG::DEBUG<<"In the particle particle loop...."<<endreq;
00523       
00524       double recopt=(*m_it)->pT();
00525       double recoeta=(*m_it)->eta();
00526       //      int pdgid=(*m_it)->pdg_id();
00527       
00528       double randnum=m_pRandFlatGenerator->shoot(m_pRandomEngine);
00529       
00530       // pass the pt, eta, pdg_id to something else...      
00531       double epsilon_ij = getEfficiencyMatrixElement(recopt, recoeta, InterpolatorName );
00532       
00533       if(randnum < epsilon_ij){
00534         log<<MSG::DEBUG<<"in-out: " << **m_it << endreq;
00535         // to make a reconstructed particle and give it a different pdg_id:
00536         ReconstructedParticle* candidate = new ReconstructedParticle ( pdgidnew /*m_particleType*/, (*m_it)->momentum(), (*m_it)->truth() );            
00537         NewList->push_back(candidate);
00538         log<<MSG::DEBUG<<"particle put in new collection"<<endreq;
00539       }
00540     }
00541     return StatusCode::SUCCESS;
00542 
00543   }

StatusCode Atlfast::AtlfastC::ApplyEfficiency ( std::vector< Jet * >  ,
ReconstructedParticleCollection ,
Interpolator ,
int   
)

Creates new vector of Jets by applying efficiencies to input RP collection.

Definition at line 545 of file AtlfastC.cxx.

00545                                                                                                                                                           {
00546    
00547     MsgStream log( messageService(), name() ) ;     
00548     //Apply randomized jet to particle
00549     log<<MSG::DEBUG<<"Applying randomized efficiency...."<<endreq;
00550     
00551     for(j_it=OriginalList.begin(); j_it<OriginalList.end();++j_it){
00552       
00553       log<<MSG::DEBUG<<"In the jet particle loop...."<<endreq;
00554       
00555       double recopt=(*j_it)->pT();
00556       double recoeta=(*j_it)->eta();
00557       //      int pdgid=(*m_it)->pdg_id();
00558       
00559       double randnum=m_pRandFlatGenerator->shoot(m_pRandomEngine);
00560       
00561       // pass the pt, eta, pdg_id to something else...      
00562       double epsilon_ij = getEfficiencyMatrixElement(recopt, recoeta, InterpolatorName );
00563       
00564       if(randnum < epsilon_ij){
00565         log<<MSG::DEBUG<<"in-out: " << **j_it << endreq;
00566         // to make a reconstructed particle and give it a different pdg_id:
00567         HepMC::GenParticle* dummy_truth(0) ;
00568         ReconstructedParticle* candidate = new ReconstructedParticle ( pdgidnew /*m_particleType*/, (*j_it)->momentum() , dummy_truth);         
00569         NewList->push_back(candidate);
00570         log<<MSG::DEBUG<<"particle put in new collection"<<endreq;
00571       }
00572     }
00573     return StatusCode::SUCCESS;
00574 
00575   }

StatusCode Atlfast::AtlfastC::ApplyEfficiency ( std::vector< ReconstructedParticle * >  ,
JetCollection ,
Interpolator  
)

Creates new vector of RPs by applying efficiencies to input Jet collection.

Definition at line 577 of file AtlfastC.cxx.

00577                                                                                                                                              {
00578    
00579     MsgStream log( messageService(), name() ) ;     
00580     //Apply randomized particle to jet efficiency
00581     log<<MSG::DEBUG<<"Applying randomized efficiency...."<<endreq;
00582     
00583     for(m_it=OriginalList.begin(); m_it<OriginalList.end();++m_it){
00584       
00585       log<<MSG::DEBUG<<"In the particle jet loop...."<<endreq;
00586       
00587       double recopt=(*m_it)->pT();
00588       double recoeta=(*m_it)->eta();
00589       //      int pdgid=(*m_it)->pdg_id();
00590       
00591       double randnum=m_pRandFlatGenerator->shoot(m_pRandomEngine);
00592       
00593       // pass the pt, eta, pdg_id to something else...      
00594       double epsilon_ij = getEfficiencyMatrixElement(recopt, recoeta, InterpolatorName );
00595       
00596       if(randnum < epsilon_ij){
00597         log<<MSG::DEBUG<<"in-out: " << **m_it << endreq;
00598 
00599         Jet* candidate = this->createJet(*m_it);
00600         NewList->push_back(candidate);
00601 
00602         log<<MSG::DEBUG<<"particle put in new collection"<<endreq;
00603       }
00604     }
00605     return StatusCode::SUCCESS;
00606 
00607   }

StatusCode Atlfast::AtlfastC::ApplyEfficiency ( std::vector< Jet * >  ,
JetCollection ,
Interpolator  
)

Creates new vector of Jets by applying efficiencies to input Jet collection.

Definition at line 609 of file AtlfastC.cxx.

00609                                                                                                                           {
00610    
00611     MsgStream log( messageService(), name() ) ;     
00612     //Apply randomized jet to jet efficiency
00613     log<<MSG::DEBUG<<"Applying randomized efficiency...."<<endreq;
00614     
00615     for(j_it=OriginalList.begin(); j_it<OriginalList.end();++j_it){
00616       
00617       log<<MSG::DEBUG<<"In the jet jet loop...."<<endreq;
00618       
00619       double recopt=(*j_it)->pT();
00620       double recoeta=(*j_it)->eta();
00621       //      int pdgid=(*m_it)->pdg_id();
00622       
00623       double randnum=m_pRandFlatGenerator->shoot(m_pRandomEngine);
00624       
00625       // pass the pt, eta, pdg_id to something else...      
00626       double epsilon_ij = getEfficiencyMatrixElement(recopt, recoeta, InterpolatorName );
00627       
00628       if(randnum < epsilon_ij){
00629         log<<MSG::DEBUG<<"in-out: " << **j_it << endreq;
00630         // to make a reconstructed particle and give it a different pdg_id:
00631 
00632 
00633         Jet* candidate = new Jet ( **j_it );            
00634         NewList->push_back(candidate);
00635         log<<MSG::DEBUG<<"particle put in new collection"<<endreq;
00636       }
00637     }
00638     return StatusCode::SUCCESS;
00639 
00640   }

double Atlfast::AtlfastC::getEfficiencyMatrixElement ( double  ,
double  ,
Interpolator  
)

Computes efficiency by interpolating in pt and eta

Definition at line 642 of file AtlfastC.cxx.

00642                                                                                                   {
00643     MsgStream log( messageService(), name() ) ;
00644  
00645     double Efficiency = 0;
00646 
00647     deque<double> input_values;
00648     input_values.push_back(pt/GeV);
00649     input_values.push_back(fabs(eta));
00650     
00651     
00652     Efficiency = InterpolatorName->interpolate(input_values);
00653 
00654     //    log<<MSG::ERROR << "pt" << pt/GeV <<  "eta" << eta << "eff is " << Efficiency <<endreq;
00655 
00656     return Efficiency;
00657   }

StatusCode Atlfast::AtlfastC::initialize (  ) 

Standard Athena-Algorithm initialize

Definition at line 207 of file AtlfastC.cxx.

00207                                  {
00208     MsgStream log( messageService(), name() ) ;
00209     log << MSG::DEBUG << "instantiating an AtlfastC" << endreq;
00210     
00211 
00212      m_elecelecEfile = PathResolver::find_file (m_elecelecEfile, "DATAPATH"); 
00213      m_elecphotEfile = PathResolver::find_file (m_elecphotEfile, "DATAPATH");  
00214      m_elecmuonEfile = PathResolver::find_file (m_elecmuonEfile, "DATAPATH");  
00215      m_photelecEfile = PathResolver::find_file (m_photelecEfile, "DATAPATH"); 
00216      m_photphotEfile = PathResolver::find_file (m_photphotEfile, "DATAPATH"); 
00217      m_photmuonEfile = PathResolver::find_file (m_photmuonEfile, "DATAPATH");  
00218      m_muonelecEfile = PathResolver::find_file (m_muonelecEfile, "DATAPATH"); 
00219      m_muonphotEfile = PathResolver::find_file (m_muonphotEfile, "DATAPATH");  
00220      m_muonmuonEfile = PathResolver::find_file (m_muonmuonEfile, "DATAPATH");  
00221      m_jetelecEfile  = PathResolver::find_file (m_jetelecEfile, "DATAPATH"); 
00222      m_jetphotEfile  = PathResolver::find_file (m_jetphotEfile, "DATAPATH");  
00223      m_jetmuonEfile  = PathResolver::find_file (m_jetmuonEfile, "DATAPATH");  
00224      m_jetjetEfile   = PathResolver::find_file (m_jetjetEfile, "DATAPATH");  
00225      m_elecjetEfile  = PathResolver::find_file (m_elecjetEfile, "DATAPATH"); 
00226      m_photjetEfile  = PathResolver::find_file (m_photjetEfile, "DATAPATH");  
00227      m_muonjetEfile  = PathResolver::find_file (m_muonjetEfile, "DATAPATH");  
00228 
00229      log << MSG::DEBUG << " m_elecelecEfile after PathResolver" << m_elecelecEfile << endreq;
00230      log << MSG::DEBUG << " m_elecphotEfile after PathResolver" << m_elecphotEfile << endreq;
00231      log << MSG::DEBUG << " m_photelecEfile after PathResolver" << m_photelecEfile << endreq;
00232      log << MSG::DEBUG << " m_photphotEfile after PathResolver" << m_photphotEfile << endreq;
00233 
00234      m_electron_interpolator = new Interpolator(m_elecelecEfile);
00235      m_photon_interpolator =   new Interpolator(m_photphotEfile);
00236      m_muon_interpolator =     new Interpolator(m_muonmuonEfile);
00237      m_jet_interpolator =      new Interpolator(m_jetjetEfile);
00238      m_elecphot_interpolator = new Interpolator(m_elecphotEfile);
00239      m_elecmuon_interpolator = new Interpolator(m_elecmuonEfile);
00240      m_elecjet_interpolator  = new Interpolator(m_elecjetEfile);
00241      m_photelec_interpolator = new Interpolator(m_photelecEfile);
00242      m_photmuon_interpolator = new Interpolator(m_photmuonEfile);
00243      m_photjet_interpolator = new Interpolator(m_photjetEfile);
00244      m_muonelec_interpolator = new Interpolator(m_muonelecEfile);
00245      m_muonphot_interpolator = new Interpolator(m_muonphotEfile);
00246      m_muonjet_interpolator = new Interpolator(m_muonjetEfile);
00247      m_jetelec_interpolator = new Interpolator(m_jetelecEfile);
00248      m_jetphot_interpolator = new Interpolator(m_jetphotEfile);
00249      m_jetmuon_interpolator = new Interpolator(m_jetmuonEfile);
00250 
00251     //Flat random number generator
00252     //get the Global Event Data using singleton pattern
00253 
00254     GlobalEventData* ged = GlobalEventData::Instance();
00255     int randSeed = ged->randSeed() ;
00256     // load the location of the MC in StoreGate
00257     m_mcLocation       = ged -> mcLocation();
00258 
00259     m_tesIO= new TesIO(m_mcLocation, ged->justHardScatter());
00260 
00261     m_pRandomEngine = new Ranlux64Engine(randSeed);
00262     m_pRandFlatGenerator=new RandFlat(*m_pRandomEngine);
00263     
00264     
00265     HeaderPrinter hp("AtlfastC:", log);
00266     
00267     hp.add("TES Locations:              "); 
00268     hp.add( "Electrons from                      ",m_inputeLocation ) ;
00269     hp.add( "Photons from                        ",m_inputphotonLocation ) ;
00270     hp.add( "Muons from                          ",m_inputmuonLocation ) ;
00271     hp.add( "Jets from                           ",m_inputjetLocation ) ;
00272 
00273     hp.add( "Electrons after efficiency & mis-id ",m_outputeLocation ) ;
00274     hp.add( "Photons after efficiency & mis-id   ",m_outputphotonLocation ) ;
00275     hp.add( "Muons after efficiency & mis-id     ",m_outputmuonLocation ) ;
00276     hp.add( "Jets after efficiency & mis-id      ",m_outputjetLocation ) ;
00277     
00278     hp.add( "Apply ElecElec Efficiency            ",         m_ApplyElecElecEff);
00279     hp.add( "Apply ElecPhot Mis id                ",         m_ApplyElecPhotEff);
00280     hp.add( "Apply ElecMuon Mis id                ",         m_ApplyElecMuonEff);
00281     hp.add( "Apply PhotPhot Efficiency            ",         m_ApplyPhotPhotEff);
00282     hp.add( "Apply PhotElec Mis id                ",         m_ApplyPhotElecEff);
00283     hp.add( "Apply PhotMuon Mis id                ",         m_ApplyPhotMuonEff);
00284     hp.add( "Apply MuonPhot Efficiency            ",         m_ApplyMuonPhotEff);
00285     hp.add( "Apply MuonElec Mis id                ",         m_ApplyMuonElecEff);
00286     hp.add( "Apply MuonMuon Mis id                ",         m_ApplyMuonMuonEff);
00287     hp.add( "Apply JetJet Efficiency             ",         m_ApplyJetJetEff);
00288     hp.add( "Apply JetPhot Mis id                ",         m_ApplyJetPhotEff);
00289     hp.add( "Apply JetElec Mis id                ",         m_ApplyJetElecEff);
00290     hp.add( "Apply JetMuon Mis id                ",         m_ApplyJetMuonEff);
00291     hp.add( "Apply PhotJet Mis id                ",         m_ApplyPhotJetEff);
00292     hp.add( "Apply ElecJet Mis id                ",         m_ApplyElecJetEff);
00293     hp.add( "Apply MuonJet Mis id                ",         m_ApplyMuonJetEff);
00294 
00295     hp.print();
00296     
00297     return StatusCode::SUCCESS ;
00298   }  

StatusCode Atlfast::AtlfastC::execute (  ) 

Standard Athena-Algorithm execute

Definition at line 317 of file AtlfastC.cxx.

00317                               {
00318     
00319 
00320     StatusCode sc;
00321     MsgStream log( messageService(), name() ) ;  
00322     
00323     log << MSG::DEBUG<<"In execute"<<endreq;
00324     originalElectrons.clear();
00325     originalPhotons.clear();
00326     originalJets.clear();
00327     originalMuons.clear();
00328 
00329     if( ! m_tesIO->copy<ReconstructedParticleCollection>( originalElectrons, m_inputeLocation ) ) {
00330       log << MSG::INFO << "No Electrons in TES " << endreq;
00331     }  
00332     
00333     if( ! m_tesIO->copy<ReconstructedParticleCollection>( originalPhotons, m_inputphotonLocation ) ) {
00334       log << MSG::INFO << "No Photons in TES " << endreq;
00335       
00336     } 
00337     
00338     if( ! m_tesIO->copy<JetCollection>( originalJets, m_inputjetLocation ) ) {
00339       log << MSG::INFO << "No Jets in TES " << endreq;
00340     }  
00341     
00342     if( ! m_tesIO->copy<ReconstructedParticleCollection>( originalMuons, m_inputmuonLocation ) ) {
00343       log << MSG::INFO << "No Muons in TES " << endreq;
00344       
00345     }  
00346      
00347      m_AtlfastCElectrons = new ReconstructedParticleCollection;
00348      m_AtlfastCPhotons   = new ReconstructedParticleCollection;
00349      m_AtlfastCMuons     = new ReconstructedParticleCollection;
00350      m_AtlfastCJets      = new JetCollection;
00351      
00352 
00353      if(m_ApplyElecElecEff && originalElectrons.size()!=0 ){
00354        sc=ApplyEfficiency(originalElectrons,m_AtlfastCElectrons,m_electron_interpolator,11) ;
00355        if(!sc){
00356          log << MSG::ERROR<<"Error in Electron Electron Element"<<endreq;
00357          return StatusCode::FAILURE;
00358        }
00359      }
00360      
00361      if(m_ApplyElecPhotEff && originalElectrons.size()!=0 ){
00362        sc=ApplyEfficiency(originalElectrons,m_AtlfastCPhotons,m_elecphot_interpolator,22) ;
00363        if(!sc){ 
00364          log << MSG::ERROR<<"Error in Electron Photon Element"<<endreq;
00365          return StatusCode::FAILURE;
00366        }
00367      }
00368      
00369      if(m_ApplyElecMuonEff && originalElectrons.size()!=0 ){
00370        sc=ApplyEfficiency(originalElectrons,m_AtlfastCMuons,m_elecmuon_interpolator,13) ;
00371        if(!sc){ 
00372          log << MSG::ERROR<<"Error in Electron Muon Element"<<endreq;
00373          return StatusCode::FAILURE;
00374        }
00375      }
00376 
00377      if(m_ApplyElecJetEff && originalElectrons.size()!=0 ){
00378        sc=ApplyEfficiency(originalElectrons,m_AtlfastCJets,m_elecjet_interpolator) ;
00379        if(!sc){ 
00380          log << MSG::ERROR<<"Error in Electron Jet Element"<<endreq;
00381          return StatusCode::FAILURE;
00382        }
00383      }
00384           
00385      if(m_ApplyPhotElecEff && originalPhotons.size()!=0 ){
00386        sc=ApplyEfficiency(originalPhotons,m_AtlfastCElectrons,m_photelec_interpolator,11) ;
00387        if(!sc){ 
00388          log << MSG::ERROR<<"Error in Photon Electron Element"<<endreq;
00389          return StatusCode::FAILURE;
00390        }
00391      }
00392 
00393      if(m_ApplyPhotPhotEff && originalPhotons.size()!=0 ){
00394        sc=ApplyEfficiency(originalPhotons,m_AtlfastCPhotons,m_photon_interpolator,22) ;
00395        if(!sc){
00396          log << MSG::ERROR<<"Error in Photon Photon Element"<<endreq;
00397          return StatusCode::FAILURE;
00398        }
00399      }
00400 
00401      if(m_ApplyPhotMuonEff && originalPhotons.size()!=0 ){
00402        sc=ApplyEfficiency(originalPhotons,m_AtlfastCMuons,m_photmuon_interpolator,13) ;
00403        if(!sc){ 
00404          log << MSG::ERROR<<"Error in Photon Muon Element"<<endreq;
00405          return StatusCode::FAILURE;
00406        }
00407      }
00408 
00409      if(m_ApplyPhotJetEff && originalPhotons.size()!=0 ){
00410        sc=ApplyEfficiency(originalPhotons,m_AtlfastCJets,m_photjet_interpolator) ;
00411        if(!sc){ 
00412          log << MSG::ERROR<<"Error in Photon Jet Element"<<endreq;
00413          return StatusCode::FAILURE;
00414        }
00415      }
00416 
00417      if(m_ApplyMuonElecEff && originalMuons.size()!=0 ){
00418        sc=ApplyEfficiency(originalMuons,m_AtlfastCElectrons,m_muonelec_interpolator,11) ;
00419        if(!sc){ 
00420          log << MSG::ERROR<<"Error in Muon Electron Element"<<endreq;
00421          return StatusCode::FAILURE;
00422        }
00423      }
00424 
00425      if(m_ApplyMuonPhotEff && originalMuons.size()!=0 ){
00426        sc=ApplyEfficiency(originalMuons,m_AtlfastCPhotons,m_muonphot_interpolator,22) ;
00427        if(!sc){
00428          log << MSG::ERROR<<"Error in Muon Photon Element"<<endreq;
00429          return StatusCode::FAILURE;
00430        }
00431      }
00432 
00433      if(m_ApplyMuonMuonEff && originalMuons.size()!=0 ){
00434        sc=ApplyEfficiency(originalMuons,m_AtlfastCMuons,m_muon_interpolator,13) ;
00435        if(!sc){ 
00436          log << MSG::ERROR<<"Error in Muon Muon Element"<<endreq;
00437          return StatusCode::FAILURE;
00438        }
00439      }
00440 
00441      if(m_ApplyMuonJetEff && originalMuons.size()!=0 ){
00442        sc=ApplyEfficiency(originalMuons,m_AtlfastCJets,m_muonjet_interpolator) ;
00443        if(!sc){ 
00444          log << MSG::ERROR<<"Error in Muon Jet Element"<<endreq;
00445          return StatusCode::FAILURE;
00446        }
00447      }
00448 
00449      if(m_ApplyJetElecEff && originalJets.size()!=0 ){
00450        sc=ApplyEfficiency(originalJets,m_AtlfastCElectrons,m_jetelec_interpolator,11) ;
00451        if(!sc){
00452          log << MSG::ERROR<<"Error in Jet Electron Element"<<endreq;
00453          return StatusCode::FAILURE;
00454        }
00455      }
00456      
00457      if(m_ApplyJetPhotEff && originalJets.size()!=0 ){
00458        sc=ApplyEfficiency(originalJets,m_AtlfastCPhotons,m_jetphot_interpolator,22) ;
00459        if(!sc){ 
00460          log << MSG::ERROR<<"Error in Jet Photon Element"<<endreq;
00461          return StatusCode::FAILURE;
00462        }
00463      }
00464      
00465      if(m_ApplyJetMuonEff && originalJets.size()!=0 ){
00466        sc=ApplyEfficiency(originalJets,m_AtlfastCMuons,m_elecmuon_interpolator,13) ;
00467        if(!sc){ 
00468          log << MSG::ERROR<<"Error in Jet Muon Element"<<endreq;
00469          return StatusCode::FAILURE;
00470        }
00471      }
00472      
00473      if(m_ApplyJetJetEff && originalJets.size()!=0 ){
00474        sc=ApplyEfficiency(originalJets,m_AtlfastCJets,m_jet_interpolator) ;
00475        if(!sc){ 
00476          log << MSG::ERROR<<"Error in Jet Jet Element"<<endreq;
00477          return StatusCode::FAILURE;
00478        }
00479      }
00480      
00481 
00482      
00483      TesIoStat stat;
00484      stat = m_tesIO->store( m_AtlfastCElectrons, m_outputeLocation);
00485      if(!stat){
00486        log << MSG::ERROR << "Could not store AtlfastC electrons"<< endreq;
00487        return stat;
00488      }
00489      
00490      stat = m_tesIO->store( m_AtlfastCPhotons, m_outputphotonLocation);
00491      if(!stat){
00492        log << MSG::ERROR << "Could not store AtlfastC photons"<< endreq;
00493        return stat;
00494      }
00495      stat = m_tesIO->store( m_AtlfastCMuons, m_outputmuonLocation);
00496      if(!stat){
00497        log << MSG::ERROR << "Could not store AtlfastC muons"<< endreq;
00498        return stat;
00499      }
00500      stat = m_tesIO->store( m_AtlfastCJets, m_outputjetLocation);
00501      if(!stat){
00502        log << MSG::ERROR << "Could not store AtlfastC jets"<< endreq;
00503        return stat;
00504      }
00505      
00506      
00507      
00508      return StatusCode::SUCCESS; 
00509   }

StatusCode Atlfast::AtlfastC::finalize (  ) 

Standard Athena-Algorithm finalize

Definition at line 305 of file AtlfastC.cxx.

00305                                {
00306     
00307     MsgStream log( messageService(), name() ) ;
00308     log << MSG::INFO << "finalizing" << endreq;    
00309     return StatusCode::SUCCESS ;
00310   }


Member Data Documentation

bool Atlfast::AtlfastC::m_ApplyElecElecEff [private]

Definition at line 79 of file AtlfastC.h.

bool Atlfast::AtlfastC::m_ApplyElecPhotEff [private]

Definition at line 80 of file AtlfastC.h.

bool Atlfast::AtlfastC::m_ApplyElecMuonEff [private]

Definition at line 81 of file AtlfastC.h.

bool Atlfast::AtlfastC::m_ApplyPhotPhotEff [private]

Definition at line 82 of file AtlfastC.h.

bool Atlfast::AtlfastC::m_ApplyPhotElecEff [private]

Definition at line 83 of file AtlfastC.h.

bool Atlfast::AtlfastC::m_ApplyPhotMuonEff [private]

Definition at line 84 of file AtlfastC.h.

bool Atlfast::AtlfastC::m_ApplyMuonElecEff [private]

Definition at line 85 of file AtlfastC.h.

bool Atlfast::AtlfastC::m_ApplyMuonPhotEff [private]

Definition at line 86 of file AtlfastC.h.

bool Atlfast::AtlfastC::m_ApplyMuonMuonEff [private]

Definition at line 87 of file AtlfastC.h.

bool Atlfast::AtlfastC::m_ApplyJetJetEff [private]

Definition at line 88 of file AtlfastC.h.

bool Atlfast::AtlfastC::m_ApplyJetElecEff [private]

Definition at line 89 of file AtlfastC.h.

bool Atlfast::AtlfastC::m_ApplyJetPhotEff [private]

Definition at line 90 of file AtlfastC.h.

bool Atlfast::AtlfastC::m_ApplyJetMuonEff [private]

Definition at line 91 of file AtlfastC.h.

bool Atlfast::AtlfastC::m_ApplyElecJetEff [private]

Definition at line 92 of file AtlfastC.h.

bool Atlfast::AtlfastC::m_ApplyPhotJetEff [private]

Definition at line 93 of file AtlfastC.h.

bool Atlfast::AtlfastC::m_ApplyMuonJetEff [private]

Definition at line 94 of file AtlfastC.h.

bool Atlfast::AtlfastC::m_notInit [private]

Definition at line 103 of file AtlfastC.h.

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

Definition at line 104 of file AtlfastC.h.

HepRandomEngine* Atlfast::AtlfastC::m_pRandomEngine [private]

Definition at line 106 of file AtlfastC.h.

RandFlat* Atlfast::AtlfastC::m_pRandFlatGenerator [private]

Definition at line 107 of file AtlfastC.h.

std::vector<ReconstructedParticle*> Atlfast::AtlfastC::originalElectrons [private]

Definition at line 111 of file AtlfastC.h.

std::vector<ReconstructedParticle*> Atlfast::AtlfastC::originalPhotons [private]

Definition at line 112 of file AtlfastC.h.

std::vector<ReconstructedParticle*> Atlfast::AtlfastC::originalMuons [private]

Definition at line 113 of file AtlfastC.h.

std::vector<Jet*> Atlfast::AtlfastC::originalJets [private]

Definition at line 114 of file AtlfastC.h.

ReconstructedParticleCollection* Atlfast::AtlfastC::m_AtlfastCElectrons [private]

Definition at line 116 of file AtlfastC.h.

ReconstructedParticleCollection* Atlfast::AtlfastC::m_AtlfastCPhotons [private]

Definition at line 117 of file AtlfastC.h.

ReconstructedParticleCollection* Atlfast::AtlfastC::m_AtlfastCMuons [private]

Definition at line 118 of file AtlfastC.h.

JetCollection* Atlfast::AtlfastC::m_AtlfastCJets [private]

Definition at line 119 of file AtlfastC.h.

int Atlfast::AtlfastC::ptnum [private]

Definition at line 121 of file AtlfastC.h.

int Atlfast::AtlfastC::etanum [private]

Definition at line 121 of file AtlfastC.h.

std::vector<ReconstructedParticle*>::const_iterator Atlfast::AtlfastC::m_it [private]

Definition at line 122 of file AtlfastC.h.

std::vector<Jet*>::const_iterator Atlfast::AtlfastC::j_it [private]

Definition at line 123 of file AtlfastC.h.

std::string Atlfast::AtlfastC::m_inputeLocation [private]

Definition at line 132 of file AtlfastC.h.

std::string Atlfast::AtlfastC::m_inputphotonLocation [private]

Definition at line 133 of file AtlfastC.h.

std::string Atlfast::AtlfastC::m_inputmuonLocation [private]

Definition at line 134 of file AtlfastC.h.

std::string Atlfast::AtlfastC::m_inputjetLocation [private]

Definition at line 135 of file AtlfastC.h.

std::string Atlfast::AtlfastC::m_outputeLocation [private]

Definition at line 137 of file AtlfastC.h.

std::string Atlfast::AtlfastC::m_outputphotonLocation [private]

Definition at line 138 of file AtlfastC.h.

std::string Atlfast::AtlfastC::m_outputmuonLocation [private]

Definition at line 139 of file AtlfastC.h.

std::string Atlfast::AtlfastC::m_outputjetLocation [private]

Definition at line 140 of file AtlfastC.h.

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

Definition at line 143 of file AtlfastC.h.

std::string Atlfast::AtlfastC::m_elecelecEfile [private]

Definition at line 145 of file AtlfastC.h.

std::string Atlfast::AtlfastC::m_elecphotEfile [private]

Definition at line 146 of file AtlfastC.h.

std::string Atlfast::AtlfastC::m_elecmuonEfile [private]

Definition at line 147 of file AtlfastC.h.

std::string Atlfast::AtlfastC::m_photelecEfile [private]

Definition at line 148 of file AtlfastC.h.

std::string Atlfast::AtlfastC::m_photphotEfile [private]

Definition at line 149 of file AtlfastC.h.

std::string Atlfast::AtlfastC::m_photmuonEfile [private]

Definition at line 150 of file AtlfastC.h.

std::string Atlfast::AtlfastC::m_muonelecEfile [private]

Definition at line 151 of file AtlfastC.h.

std::string Atlfast::AtlfastC::m_muonphotEfile [private]

Definition at line 152 of file AtlfastC.h.

std::string Atlfast::AtlfastC::m_muonmuonEfile [private]

Definition at line 153 of file AtlfastC.h.

std::string Atlfast::AtlfastC::m_jetjetEfile [private]

Definition at line 154 of file AtlfastC.h.

std::string Atlfast::AtlfastC::m_jetelecEfile [private]

Definition at line 155 of file AtlfastC.h.

std::string Atlfast::AtlfastC::m_jetphotEfile [private]

Definition at line 156 of file AtlfastC.h.

std::string Atlfast::AtlfastC::m_jetmuonEfile [private]

Definition at line 157 of file AtlfastC.h.

std::string Atlfast::AtlfastC::m_elecjetEfile [private]

Definition at line 158 of file AtlfastC.h.

std::string Atlfast::AtlfastC::m_photjetEfile [private]

Definition at line 159 of file AtlfastC.h.

std::string Atlfast::AtlfastC::m_muonjetEfile [private]

Definition at line 160 of file AtlfastC.h.

Interpolator* Atlfast::AtlfastC::m_electron_interpolator [private]

Definition at line 162 of file AtlfastC.h.

Interpolator* Atlfast::AtlfastC::m_photon_interpolator [private]

Definition at line 163 of file AtlfastC.h.

Interpolator* Atlfast::AtlfastC::m_muon_interpolator [private]

Definition at line 164 of file AtlfastC.h.

Interpolator* Atlfast::AtlfastC::m_jet_interpolator [private]

Definition at line 165 of file AtlfastC.h.

Interpolator* Atlfast::AtlfastC::m_elecphot_interpolator [private]

Definition at line 166 of file AtlfastC.h.

Interpolator* Atlfast::AtlfastC::m_elecmuon_interpolator [private]

Definition at line 167 of file AtlfastC.h.

Interpolator* Atlfast::AtlfastC::m_elecjet_interpolator [private]

Definition at line 168 of file AtlfastC.h.

Interpolator* Atlfast::AtlfastC::m_photelec_interpolator [private]

Definition at line 169 of file AtlfastC.h.

Interpolator* Atlfast::AtlfastC::m_photmuon_interpolator [private]

Definition at line 170 of file AtlfastC.h.

Interpolator* Atlfast::AtlfastC::m_photjet_interpolator [private]

Definition at line 171 of file AtlfastC.h.

Interpolator* Atlfast::AtlfastC::m_muonelec_interpolator [private]

Definition at line 172 of file AtlfastC.h.

Interpolator* Atlfast::AtlfastC::m_muonphot_interpolator [private]

Definition at line 173 of file AtlfastC.h.

Interpolator* Atlfast::AtlfastC::m_muonjet_interpolator [private]

Definition at line 174 of file AtlfastC.h.

Interpolator* Atlfast::AtlfastC::m_jetelec_interpolator [private]

Definition at line 175 of file AtlfastC.h.

Interpolator* Atlfast::AtlfastC::m_jetphot_interpolator [private]

Definition at line 176 of file AtlfastC.h.

Interpolator* Atlfast::AtlfastC::m_jetmuon_interpolator [private]

Definition at line 177 of file AtlfastC.h.


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