#include <FMGLfromL3EfficiencyHandler.h>
Public Member Functions | |
FMGLfromL3EfficiencyHandler (const RandomEngine *engine) | |
bool | kill (const SimTrack &) |
~FMGLfromL3EfficiencyHandler () | |
Private Attributes | |
float | Effic_Eta [nEtaBins] |
const RandomEngine * | random |
Static Private Attributes | |
static const int | nEtaBins = 60 |
Definition at line 13 of file FMGLfromL3EfficiencyHandler.h.
FMGLfromL3EfficiencyHandler::FMGLfromL3EfficiencyHandler | ( | const RandomEngine * | engine | ) |
Definition at line 11 of file FMGLfromL3EfficiencyHandler.cc.
References gather_cfg::cout, Effic_Eta, connectstrParser::f1, alignmentValidation::fname, i, nEtaBins, and path().
: random(engine) { std::string fname = "FastSimulation/ParamL3MuonProducer/data/efficiencyGL_L3.data"; std::string path(getenv("CMSSW_SEARCH_PATH")); FileInPath f1(path,fname); if ( f1() == 0) { std::cout << "File " << fname << " not found in " << path << std::endl; throw Genexception(" efficiency list not found for FMGLfromL3EfficiencyHandler."); } else { // The following should be on LogInfo //std::cout << "Reading " << f1.name() << std::endl; } std::ifstream & listfile = *f1(); double eff=0.; int nent; listfile >> nent; if (nent != nEtaBins) { std::cout << " *** ERROR -> FMGLfromL3EfficiencyHandler : nEta bins " << nent << " instead of " << nEtaBins << std::endl; } for (int i=0; i<nEtaBins; i++) { listfile >> eff; Effic_Eta[i]=eff; } }
FMGLfromL3EfficiencyHandler::~FMGLfromL3EfficiencyHandler | ( | ) |
Definition at line 41 of file FMGLfromL3EfficiencyHandler.cc.
References Effic_Eta.
{ delete Effic_Eta; }
bool FMGLfromL3EfficiencyHandler::kill | ( | const SimTrack & | aTrack | ) |
Definition at line 45 of file FMGLfromL3EfficiencyHandler.cc.
References Effic_Eta, eta(), RandomEngine::flatShoot(), CoreSimTrack::momentum(), nEtaBins, and random.
{ // At least eight hit in the tracker : To be tuned !!! //if ( aTrack.recHits().size() < 8 ) return false; // At least zero reconstructed Pixel hits : To be tuned !!! //int seed = 0; //for ( unsigned i=1; i<6; ++i ) // if ( aTrack.isARecHit(i) ) ++seed; //if ( seed < 0 ) return false; double myEffEta=0. , myEff; // double myCorrection=1.; // Eta dependence : double eta = fabs(aTrack.momentum().eta()); if (eta < 2.40) { int iEtaBin = (int) ( (eta/2.40) * nEtaBins); myEffEta = Effic_Eta[iEtaBin]; } else return false; /* double pt = aTrack.momentum().pt(); if (eta<1.04) { if (pt>40.) myEffPt = 0.9583 - pt*5.82726e-05; else if (pt>4.10) myEffPt = 0.952*(1.-exp(-(pt-4.072))); myCorrection = 1.115; } else if (eta<2.07) { if (pt>173.) myEffPt = 0.991 - pt*3.46562e-05; else if (pt>3.10) myEffPt = 0.985*(1.-exp(-(pt-3.061))); myCorrection = 1.034; } else if (eta<2.40) { if (pt>26.) myEffPt = 0.9221 - pt*7.75139e-05; else if (pt>3.00) myEffPt = 0.927*(1.-exp(-sqrt(pt-1.617))); myCorrection = 1.157; } else return false; */ // myEff = myEffEta*myEffPt*myCorrection; myEff = myEffEta; double prob = random->flatShoot(); return (myEff > prob) ; }
float FMGLfromL3EfficiencyHandler::Effic_Eta[nEtaBins] [private] |
Definition at line 25 of file FMGLfromL3EfficiencyHandler.h.
Referenced by FMGLfromL3EfficiencyHandler(), kill(), and ~FMGLfromL3EfficiencyHandler().
const int FMGLfromL3EfficiencyHandler::nEtaBins = 60 [static, private] |
Definition at line 24 of file FMGLfromL3EfficiencyHandler.h.
Referenced by FMGLfromL3EfficiencyHandler(), and kill().
const RandomEngine* FMGLfromL3EfficiencyHandler::random [private] |
Definition at line 23 of file FMGLfromL3EfficiencyHandler.h.
Referenced by kill().