CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T > Struct Template Reference

Public Member Functions

void bookHistograms (DQMStore &dqmStore)
 
void fillHistograms (int numJets, const edm::Event &evt, double evtWeight)
 
 leptonEfficiencyT (int minJets, int maxJets, const edm::InputTag &srcGen, const std::string &cutGen, const edm::InputTag &srcRec, const std::string &cutRec, double dRmatch, const std::string &dqmDirectory)
 
 ~leptonEfficiencyT ()
 

Public Attributes

StringCutObjectSelector
< reco::Candidate > * 
cutGen_
 
StringCutObjectSelector< T > * cutRec_
 
std::string dqmDirectory_
 
double dRmatch_
 
MonitorElementhistogramDenominatorEta_
 
MonitorElementhistogramDenominatorPhi_
 
MonitorElementhistogramDenominatorPt_
 
MonitorElementhistogramNumeratorEta_
 
MonitorElementhistogramNumeratorPhi_
 
MonitorElementhistogramNumeratorPt_
 
MonitorElementhistogramNumGenLeptons_
 
MonitorElementhistogramNumRecLeptons_
 
int maxJets_
 
int minJets_
 
edm::InputTag srcGen_
 
edm::InputTag srcRec_
 

Detailed Description

template<typename T>
struct MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >

Definition at line 1065 of file MCEmbeddingValidationAnalyzer.h.

Constructor & Destructor Documentation

template<typename T>
MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::leptonEfficiencyT ( int  minJets,
int  maxJets,
const edm::InputTag srcGen,
const std::string &  cutGen,
const edm::InputTag srcRec,
const std::string &  cutRec,
double  dRmatch,
const std::string &  dqmDirectory 
)
inline

Definition at line 1067 of file MCEmbeddingValidationAnalyzer.h.

References MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::cutGen_, MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::cutRec_, MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::dqmDirectory_, MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::maxJets_, and MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::minJets_.

1069  : minJets_(minJets),
1070  maxJets_(maxJets),
1071  srcGen_(srcGen),
1072  cutGen_(0),
1073  srcRec_(srcRec),
1074  cutRec_(0),
1075  dRmatch_(dRmatch)
1076  {
1077  if ( cutGen != "" ) cutGen_ = new StringCutObjectSelector<reco::Candidate>(cutGen);
1078  if ( cutRec != "" ) cutRec_ = new StringCutObjectSelector<T>(cutRec);
1079  dqmDirectory_ = dqmDirectory;
1080  if ( minJets_ < 0 && maxJets_ < 0 ) dqmDirectory_.append("");
1081  else if ( maxJets_ < 0 ) dqmDirectory_.append(Form("_numJetsGe%i", minJets_));
1082  else if ( minJets_ < 0 ) dqmDirectory_.append(Form("_numJetsLe%i", maxJets_));
1083  else if ( maxJets_ == minJets_ ) dqmDirectory_.append(Form("_numJetsEq%i", minJets_));
1084  else dqmDirectory_.append(Form("_numJets%ito%i", minJets_, maxJets_));
1085  }
StringCutObjectSelector< reco::Candidate > * cutGen_

Member Function Documentation

template<typename T>
void MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::bookHistograms ( DQMStore dqmStore)
inline

Definition at line 1091 of file MCEmbeddingValidationAnalyzer.h.

References DQMStore::book1D(), MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::dqmDirectory_, MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::histogramDenominatorEta_, MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::histogramDenominatorPhi_, MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::histogramDenominatorPt_, MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::histogramNumeratorEta_, MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::histogramNumeratorPhi_, MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::histogramNumeratorPt_, MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::histogramNumGenLeptons_, MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::histogramNumRecLeptons_, Pi, and DQMStore::setCurrentFolder().

1092  {
1093  dqmStore.setCurrentFolder(dqmDirectory_.data());
1094  histogramNumGenLeptons_ = dqmStore.book1D("numGenLeptons", "numGenLeptons", 10, -0.5, 9.5);
1095  histogramNumRecLeptons_ = dqmStore.book1D("numRecLeptons", "numRecLeptons", 10, -0.5, 9.5);
1096  histogramNumeratorPt_ = dqmStore.book1D("numeratorPt", "numeratorPt", 250, 0., 250.);
1097  histogramDenominatorPt_ = dqmStore.book1D("denominatorPt", "denominatorPt", 250, 0., 250.);
1098  histogramNumeratorEta_ = dqmStore.book1D("numeratorEta", "numeratorEta", 198, -9.9, +9.9);
1099  histogramDenominatorEta_ = dqmStore.book1D("denominatorEta", "denominatorEta", 198, -9.9, +9.9);
1100  histogramNumeratorPhi_ = dqmStore.book1D("numeratorPhi", "numeratorPhi", 72, -TMath::Pi(), +TMath::Pi());
1101  histogramDenominatorPhi_ = dqmStore.book1D("denominatorPhi", "denominatorPhi", 72, -TMath::Pi(), +TMath::Pi());
1102  }
const double Pi
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:872
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
template<typename T>
void MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::fillHistograms ( int  numJets,
const edm::Event evt,
double  evtWeight 
)
inline

Definition at line 1103 of file MCEmbeddingValidationAnalyzer.h.

References MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::cutGen_, MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::cutRec_, deltaR(), PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::dRmatch_, MonitorElement::Fill(), edm::Event::getByLabel(), MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::histogramDenominatorEta_, MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::histogramDenominatorPhi_, MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::histogramDenominatorPt_, MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::histogramNumeratorEta_, MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::histogramNumeratorPhi_, MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::histogramNumeratorPt_, MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::histogramNumGenLeptons_, MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::histogramNumRecLeptons_, trackerHitRTTI::isMatched(), MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::maxJets_, MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::minJets_, MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::srcGen_, and MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::srcRec_.

1105  {
1106  if ( (minJets_ == -1 || numJets >= minJets_) &&
1107  (maxJets_ == -1 || numJets <= maxJets_) ) {
1109  edm::Handle<CandidateView> genLeptons;
1110  evt.getByLabel(srcGen_, genLeptons);
1111  histogramNumGenLeptons_->Fill(genLeptons->size(), evtWeight);
1112  typedef std::vector<T> recLeptonCollection;
1114  evt.getByLabel(srcRec_, recLeptons);
1115  histogramNumRecLeptons_->Fill(recLeptons->size(), evtWeight);
1116  for ( CandidateView::const_iterator genLepton = genLeptons->begin();
1117  genLepton != genLeptons->end(); ++genLepton ) {
1118  if ( cutGen_ && !(*cutGen_)(*genLepton) ) continue;
1119  bool isMatched = false;
1120  for ( typename recLeptonCollection::const_iterator recLepton = recLeptons->begin();
1121  recLepton != recLeptons->end(); ++recLepton ) {
1122  if ( cutRec_ && !(*cutRec_)(*recLepton) ) continue;
1123  double dR = deltaR(genLepton->p4(), recLepton->p4());
1124  if ( dR < dRmatch_ ) isMatched = true;
1125  }
1126  histogramDenominatorPt_->Fill(genLepton->pt(), evtWeight);
1127  histogramDenominatorEta_->Fill(genLepton->eta(), evtWeight);
1128  histogramDenominatorPhi_->Fill(genLepton->phi(), evtWeight);
1129  if ( isMatched ) {
1130  histogramNumeratorPt_->Fill(genLepton->pt(), evtWeight);
1131  histogramNumeratorEta_->Fill(genLepton->eta(), evtWeight);
1132  histogramNumeratorPhi_->Fill(genLepton->phi(), evtWeight);
1133  }
1134  }
1135  }
1136  }
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
StringCutObjectSelector< reco::Candidate > * cutGen_
void Fill(long long x)
edm::View< reco::Candidate > CandidateView
bool isMatched(TrackingRecHit const &hit)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17

Member Data Documentation

template<typename T>
std::string MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::dqmDirectory_
template<typename T>
double MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::dRmatch_
template<typename T>
MonitorElement* MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::histogramDenominatorEta_
template<typename T>
MonitorElement* MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::histogramDenominatorPhi_
template<typename T>
MonitorElement* MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::histogramDenominatorPt_
template<typename T>
MonitorElement* MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::histogramNumeratorEta_
template<typename T>
MonitorElement* MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::histogramNumeratorPhi_
template<typename T>
MonitorElement* MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::histogramNumeratorPt_
template<typename T>
MonitorElement* MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::histogramNumGenLeptons_
template<typename T>
MonitorElement* MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::histogramNumRecLeptons_
template<typename T>
int MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::maxJets_
template<typename T>
int MCEmbeddingValidationAnalyzer::leptonEfficiencyT< T >::minJets_