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 1072 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 1074 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_.

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

Member Function Documentation

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

Definition at line 1098 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().

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

Definition at line 1110 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_.

1112  {
1113  if ( (minJets_ == -1 || numJets >= minJets_) &&
1114  (maxJets_ == -1 || numJets <= maxJets_) ) {
1116  edm::Handle<CandidateView> genLeptons;
1117  evt.getByLabel(srcGen_, genLeptons);
1118  histogramNumGenLeptons_->Fill(genLeptons->size(), evtWeight);
1119  typedef std::vector<T> recLeptonCollection;
1121  evt.getByLabel(srcRec_, recLeptons);
1122  histogramNumRecLeptons_->Fill(recLeptons->size(), evtWeight);
1123  for ( CandidateView::const_iterator genLepton = genLeptons->begin();
1124  genLepton != genLeptons->end(); ++genLepton ) {
1125  if ( cutGen_ && !(*cutGen_)(*genLepton) ) continue;
1126  bool isMatched = false;
1127  for ( typename recLeptonCollection::const_iterator recLepton = recLeptons->begin();
1128  recLepton != recLeptons->end(); ++recLepton ) {
1129  if ( cutRec_ && !(*cutRec_)(*recLepton) ) continue;
1130  double dR = deltaR(genLepton->p4(), recLepton->p4());
1131  if ( dR < dRmatch_ ) isMatched = true;
1132  }
1133  histogramDenominatorPt_->Fill(genLepton->pt(), evtWeight);
1134  histogramDenominatorEta_->Fill(genLepton->eta(), evtWeight);
1135  histogramDenominatorPhi_->Fill(genLepton->phi(), evtWeight);
1136  if ( isMatched ) {
1137  histogramNumeratorPt_->Fill(genLepton->pt(), evtWeight);
1138  histogramNumeratorEta_->Fill(genLepton->eta(), evtWeight);
1139  histogramNumeratorPhi_->Fill(genLepton->phi(), evtWeight);
1140  }
1141  }
1142  }
1143  }
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:418
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81

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_