#include <FML1EfficiencyHandler.h>
Public Member Functions | |
FML1EfficiencyHandler (const RandomEngine *engine) | |
Constructor (read in the parametrizations from a data file) | |
bool | kill (const SimpleL1MuGMTCand *) |
reject tracks according to parametrized algorithmic efficiency | |
~FML1EfficiencyHandler () | |
Destructor. | |
Private Member Functions | |
double | dumpingfactor (int ieta, float pt) |
double | tuningfactor (int ieta) |
Private Attributes | |
double | Effic_Eta [nEtaBins] |
double | Effic_Phi_Barrel [nPhiBins] |
double | Effic_Phi_Endcap [nPhiBins] |
double | Effic_Phi_Extern [nPhiBins] |
const RandomEngine * | random |
Static Private Attributes | |
static const int | nEtaBins = 120 |
static const int | nPhiBins = 100 |
Class to deal with L1 muon efficiency as a function of eta, phi and pt.
Definition at line 15 of file FML1EfficiencyHandler.h.
FML1EfficiencyHandler::FML1EfficiencyHandler | ( | const RandomEngine * | engine | ) |
Constructor (read in the parametrizations from a data file)
Definition at line 13 of file FML1EfficiencyHandler.cc.
References gather_cfg::cout, Effic_Eta, Effic_Phi_Barrel, Effic_Phi_Endcap, Effic_Phi_Extern, connectstrParser::f1, alignmentValidation::fname, i, nEtaBins, nPhiBins, and path().
: random(engine){ string fname = "FastSimulation/Muons/data/efficiencyL1.data"; // std::string path(std::getenv("CMSSW_SEARCH__PATH")); 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 FML1EfficiencyHandler."); } else { // The following should be on LogDebug //std::cout << "Reading " << f1.name() << std::endl; } std::ifstream & listfile = *f1(); double eff=0.; for (int i=0; i<nEtaBins; i++) { listfile >> eff; Effic_Eta[i]=eff; } int iStart=nEtaBins; for (int i=iStart; i<iStart+nPhiBins; i++) { listfile >> eff; Effic_Phi_Barrel[i-iStart]=eff; } iStart += nPhiBins; for (int i=iStart; i<iStart+nPhiBins; i++) { listfile >> eff; Effic_Phi_Endcap[i-iStart]=eff; } iStart += nPhiBins; for (int i=iStart; i<iStart+nPhiBins; i++) { listfile >> eff; Effic_Phi_Extern[i-iStart]=eff; } }
FML1EfficiencyHandler::~FML1EfficiencyHandler | ( | ) |
double FML1EfficiencyHandler::dumpingfactor | ( | int | ieta, |
float | pt | ||
) | [inline, private] |
Definition at line 57 of file FML1EfficiencyHandler.h.
References funct::exp().
Referenced by kill().
bool FML1EfficiencyHandler::kill | ( | const SimpleL1MuGMTCand * | aMuon | ) |
reject tracks according to parametrized algorithmic efficiency
Definition at line 55 of file FML1EfficiencyHandler.cc.
References dumpingfactor(), Effic_Eta, Effic_Phi_Barrel, Effic_Phi_Endcap, Effic_Phi_Extern, RandomEngine::flatShoot(), SimpleL1MuGMTCand::getMomentum(), M_PI, nEtaBins, nPhiBins, colinearityKinematic::Phi, reco::tau::disc::Pt(), random, mathSSE::sqrt(), and tuningfactor().
Referenced by ParamL3MuonProducer::produce(), and FastL1MuonProducer::produce().
{ double myEffEta=0. , myEffPhi=0. , myEff; double AbsEta = fabs(aMuon->getMomentum().eta()); double Phi = aMuon->getMomentum().phi(); double Pt = std::sqrt(aMuon->getMomentum().perp2()); // efficiency as a function of |eta| if (AbsEta < 2.40) { int iEtaBin = (int) ( (AbsEta/2.40) * nEtaBins); myEffEta = Effic_Eta[iEtaBin]; } else { myEffEta = 0.0; } // efficiency as a function of phi and combined efficiency: if (Phi < 0.) {Phi = 2* M_PI + Phi; } int iPhiBin = (int) ((Phi/(2*M_PI)) * nPhiBins); int ieta = 0; if (AbsEta < 1.04) { myEffPhi = Effic_Phi_Barrel[iPhiBin]; myEff = myEffEta * myEffPhi * tuningfactor(0); ieta = 0; } else if (AbsEta < 2.07) { myEffPhi = Effic_Phi_Endcap[iPhiBin]; myEff = myEffEta * myEffPhi * tuningfactor(1); ieta = 1; } else if (AbsEta < 2.40) { myEffPhi = Effic_Phi_Extern[iPhiBin]; myEff = myEffEta * myEffPhi * tuningfactor(2); ieta = 2; } else { myEff = 0. ; } // Drop of efficiency at the lowest Pt's: if (Pt<6) myEff *= dumpingfactor(ieta,Pt); double prob = random->flatShoot(); return (myEff > prob); }
double FML1EfficiencyHandler::tuningfactor | ( | int | ieta | ) | [inline, private] |
Definition at line 40 of file FML1EfficiencyHandler.h.
References tests::test_DownloadDQM::tf.
Referenced by kill().
double FML1EfficiencyHandler::Effic_Eta[nEtaBins] [private] |
Definition at line 34 of file FML1EfficiencyHandler.h.
Referenced by FML1EfficiencyHandler(), and kill().
double FML1EfficiencyHandler::Effic_Phi_Barrel[nPhiBins] [private] |
Definition at line 35 of file FML1EfficiencyHandler.h.
Referenced by FML1EfficiencyHandler(), and kill().
double FML1EfficiencyHandler::Effic_Phi_Endcap[nPhiBins] [private] |
Definition at line 36 of file FML1EfficiencyHandler.h.
Referenced by FML1EfficiencyHandler(), and kill().
double FML1EfficiencyHandler::Effic_Phi_Extern[nPhiBins] [private] |
Definition at line 37 of file FML1EfficiencyHandler.h.
Referenced by FML1EfficiencyHandler(), and kill().
const int FML1EfficiencyHandler::nEtaBins = 120 [static, private] |
Definition at line 32 of file FML1EfficiencyHandler.h.
Referenced by FML1EfficiencyHandler(), and kill().
const int FML1EfficiencyHandler::nPhiBins = 100 [static, private] |
Definition at line 33 of file FML1EfficiencyHandler.h.
Referenced by FML1EfficiencyHandler(), and kill().
const RandomEngine* FML1EfficiencyHandler::random [private] |
Definition at line 31 of file FML1EfficiencyHandler.h.
Referenced by kill().