CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes | Static Private Attributes
FMGLfromL3EfficiencyHandler Class Reference

#include <FMGLfromL3EfficiencyHandler.h>

Public Member Functions

 FMGLfromL3EfficiencyHandler (const RandomEngine *engine)
 
bool kill (const SimTrack &)
 
 ~FMGLfromL3EfficiencyHandler ()
 

Private Attributes

float Effic_Eta [nEtaBins]
 
const RandomEnginerandom
 

Static Private Attributes

static const int nEtaBins =60
 

Detailed Description

Definition at line 13 of file FMGLfromL3EfficiencyHandler.h.

Constructor & Destructor Documentation

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().

12  : random(engine) {
13 
14  std::string fname = "FastSimulation/ParamL3MuonProducer/data/efficiencyGL_L3.data";
15  std::string path(getenv("CMSSW_SEARCH_PATH"));
16  FileInPath f1(path,fname);
17 
18  if ( f1() == 0) {
19  std::cout << "File " << fname << " not found in " << path << std::endl;
20  throw Genexception(" efficiency list not found for FMGLfromL3EfficiencyHandler.");
21  } else {
22  // The following should be on LogInfo
23  //std::cout << "Reading " << f1.name() << std::endl;
24  }
25  std::ifstream & listfile = *f1();
26 
27  double eff=0.;
28  int nent;
29  listfile >> nent;
30  if (nent != nEtaBins) {
31  std::cout << " *** ERROR -> FMGLfromL3EfficiencyHandler : nEta bins "
32  << nent << " instead of " << nEtaBins << std::endl;
33  }
34  for (int i=0; i<nEtaBins; i++) {
35  listfile >> eff;
36  Effic_Eta[i]=eff;
37  }
38 
39 }
int i
Definition: DBlmapReader.cc:9
int path() const
Definition: HLTadd.h:3
string fname
main script
tuple cout
Definition: gather_cfg.py:41
FMGLfromL3EfficiencyHandler::~FMGLfromL3EfficiencyHandler ( )

Definition at line 41 of file FMGLfromL3EfficiencyHandler.cc.

References Effic_Eta.

41  {
42  delete Effic_Eta;
43 }

Member Function Documentation

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.

45  {
46 
47  // At least eight hit in the tracker : To be tuned !!!
48  //if ( aTrack.recHits().size() < 8 ) return false;
49 
50  // At least zero reconstructed Pixel hits : To be tuned !!!
51  //int seed = 0;
52  //for ( unsigned i=1; i<6; ++i )
53  // if ( aTrack.isARecHit(i) ) ++seed;
54  //if ( seed < 0 ) return false;
55 
56  double myEffEta=0. , myEff;
57  // double myCorrection=1.;
58 
59  // Eta dependence :
60  double eta = fabs(aTrack.momentum().eta());
61  if (eta < 2.40) {
62  int iEtaBin = (int) ( (eta/2.40) * nEtaBins);
63  myEffEta = Effic_Eta[iEtaBin];
64  } else return false;
65 
66  /*
67  double pt = aTrack.momentum().pt();
68  if (eta<1.04) {
69  if (pt>40.) myEffPt = 0.9583 - pt*5.82726e-05;
70  else if (pt>4.10) myEffPt = 0.952*(1.-exp(-(pt-4.072)));
71  myCorrection = 1.115;
72  }
73  else if (eta<2.07) {
74  if (pt>173.) myEffPt = 0.991 - pt*3.46562e-05;
75  else if (pt>3.10) myEffPt = 0.985*(1.-exp(-(pt-3.061)));
76  myCorrection = 1.034;
77  }
78  else if (eta<2.40) {
79  if (pt>26.) myEffPt = 0.9221 - pt*7.75139e-05;
80  else if (pt>3.00) myEffPt = 0.927*(1.-exp(-sqrt(pt-1.617)));
81  myCorrection = 1.157;
82  }
83  else return false;
84  */
85 
86  // myEff = myEffEta*myEffPt*myCorrection;
87  myEff = myEffEta;
88  double prob = random->flatShoot();
89  return (myEff > prob) ;
90 
91 }
T eta() const
double flatShoot(double xmin=0.0, double xmax=1.0) const
Definition: RandomEngine.h:30
const math::XYZTLorentzVectorD & momentum() const
particle info...
Definition: CoreSimTrack.h:36

Member Data Documentation

float FMGLfromL3EfficiencyHandler::Effic_Eta[nEtaBins]
private
const int FMGLfromL3EfficiencyHandler::nEtaBins =60
staticprivate

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().