CMS 3D CMS Logo

FMGLfromL3EfficiencyHandler Class Reference

#include <FastSimulation/ParamL3MuonProducer/interface/FMGLfromL3EfficiencyHandler.h>

List of all members.

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 GenMuonPlsPt100GeV_cfg::cout, Effic_Eta, lat::endl(), f1, mergeAndRegister_online::fname, i, FileInPath::name(), nEtaBins, and path().

00012   : random(engine) {
00013 
00014   std::string fname = "FastSimulation/ParamL3MuonProducer/data/efficiencyGL_L3.data";
00015   std::string path(getenv("CMSSW_SEARCH_PATH"));
00016   FileInPath f1(path,fname);
00017  
00018   if ( f1() == 0) {
00019     std::cout << "File " << fname << " not found in " << path << std::endl;
00020     throw Genexception(" efficiency list not found for FMGLfromL3EfficiencyHandler.");
00021   } else {
00022     std::cout << "Reading " << f1.name() << std::endl;
00023   }
00024   std::ifstream & listfile = *f1();
00025   
00026   double eff=0.;
00027   int nent;
00028   listfile >> nent;
00029   if (nent != nEtaBins) { 
00030     std::cout << " *** ERROR -> FMGLfromL3EfficiencyHandler : nEta bins " 
00031               << nent << " instead of " << nEtaBins << std::endl;
00032   }
00033   for (int i=0; i<nEtaBins; i++) {
00034     listfile >> eff;
00035     Effic_Eta[i]=eff;
00036   }
00037 
00038 }

FMGLfromL3EfficiencyHandler::~FMGLfromL3EfficiencyHandler (  ) 

Definition at line 40 of file FMGLfromL3EfficiencyHandler.cc.

References Effic_Eta.

00040                                                          {
00041   delete Effic_Eta;
00042 }


Member Function Documentation

bool FMGLfromL3EfficiencyHandler::kill ( const SimTrack aTrack  ) 

Definition at line 44 of file FMGLfromL3EfficiencyHandler.cc.

References Effic_Eta, eta, RandomEngine::flatShoot(), int, CoreSimTrack::momentum(), nEtaBins, and random.

00044                                                               {
00045 
00046   // At least eight hit in the tracker : To be tuned !!!
00047   //if ( aTrack.recHits().size() < 8 ) return false;
00048 
00049   // At least zero reconstructed  Pixel hits : To be tuned !!!
00050   //int seed = 0;
00051   //for ( unsigned i=1; i<6; ++i ) 
00052   //  if ( aTrack.isARecHit(i) ) ++seed;
00053   //if ( seed < 0 ) return false;
00054 
00055   double myEffEta=0. ,  myEff;
00056   // double myCorrection=1.;
00057 
00058   // Eta dependence : 
00059   double eta = fabs(aTrack.momentum().eta());
00060   if (eta < 2.40) {
00061     int iEtaBin = (int) ( (eta/2.40) * nEtaBins);
00062     myEffEta = Effic_Eta[iEtaBin];
00063   } else return false;
00064 
00065   /*
00066   double pt = aTrack.momentum().pt();
00067   if (eta<1.04) {
00068     if (pt>40.) myEffPt = 0.9583 - pt*5.82726e-05;
00069     else if (pt>4.10) myEffPt = 0.952*(1.-exp(-(pt-4.072)));
00070     myCorrection = 1.115;
00071   }
00072   else if (eta<2.07) {
00073     if (pt>173.) myEffPt = 0.991 - pt*3.46562e-05;
00074     else if (pt>3.10) myEffPt = 0.985*(1.-exp(-(pt-3.061)));
00075     myCorrection = 1.034;
00076   }
00077   else if (eta<2.40) {
00078     if (pt>26.) myEffPt = 0.9221 - pt*7.75139e-05;
00079     else if (pt>3.00) myEffPt = 0.927*(1.-exp(-sqrt(pt-1.617)));
00080     myCorrection = 1.157;
00081   }
00082   else return false;
00083   */
00084 
00085   //  myEff = myEffEta*myEffPt*myCorrection;
00086   myEff = myEffEta;
00087   double prob = random->flatShoot();
00088   return (myEff > prob) ;
00089 
00090 }


Member Data Documentation

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


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:20:59 2009 for CMSSW by  doxygen 1.5.4