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::leptonL1TriggerEfficiencyT1T2< T1, T2 > Struct Template Reference

Public Member Functions

void bookHistograms (DQMStore &dqmStore)
 
void fillHistograms (int numJets, const edm::Event &evt, double evtWeight)
 
 leptonL1TriggerEfficiencyT1T2 (int minJets, int maxJets, const edm::InputTag &srcRef, const std::string &cutRef, const edm::InputTag &srcL1, const std::string &cutL1, double dRmatch, const std::string &dqmDirectory)
 
 ~leptonL1TriggerEfficiencyT1T2 ()
 

Public Attributes

StringCutObjectSelector< T2 > * cutL1_
 
StringCutObjectSelector< T1 > * cutRef_
 
std::string dqmDirectory_
 
double dRmatch_
 
MonitorElementhistogramDenominatorEta_
 
MonitorElementhistogramDenominatorPhi_
 
MonitorElementhistogramDenominatorPt_
 
MonitorElementhistogramNumeratorEta_
 
MonitorElementhistogramNumeratorPhi_
 
MonitorElementhistogramNumeratorPt_
 
int maxJets_
 
int minJets_
 
edm::InputTag srcL1_
 
edm::InputTag srcRef_
 

Detailed Description

template<typename T1, typename T2>
struct MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >

Definition at line 1171 of file MCEmbeddingValidationAnalyzer.h.

Constructor & Destructor Documentation

template<typename T1, typename T2>
MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >::leptonL1TriggerEfficiencyT1T2 ( int  minJets,
int  maxJets,
const edm::InputTag srcRef,
const std::string &  cutRef,
const edm::InputTag srcL1,
const std::string &  cutL1,
double  dRmatch,
const std::string &  dqmDirectory 
)
inline

Definition at line 1173 of file MCEmbeddingValidationAnalyzer.h.

References MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >::cutL1_, MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >::cutRef_, MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >::dqmDirectory_, MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >::maxJets_, and MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >::minJets_.

1175  : minJets_(minJets),
1176  maxJets_(maxJets),
1177  srcRef_(srcRef),
1178  cutRef_(0),
1179  srcL1_(srcL1),
1180  cutL1_(0),
1181  dRmatch_(dRmatch)
1182  {
1183  if ( cutRef != "" ) cutRef_ = new StringCutObjectSelector<T1>(cutRef);
1184  if ( cutL1 != "" ) cutL1_ = new StringCutObjectSelector<T2>(cutL1);
1185  dqmDirectory_ = dqmDirectory;
1186  if ( minJets_ < 0 && maxJets_ < 0 ) dqmDirectory_.append("");
1187  else if ( maxJets_ < 0 ) dqmDirectory_.append(Form("_numJetsGe%i", minJets_));
1188  else if ( minJets_ < 0 ) dqmDirectory_.append(Form("_numJetsLe%i", maxJets_));
1189  else if ( maxJets_ == minJets_ ) dqmDirectory_.append(Form("_numJetsEq%i", minJets_));
1190  else dqmDirectory_.append(Form("_numJets%ito%i", minJets_, maxJets_));
1191  }
template<typename T1, typename T2>
MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >::~leptonL1TriggerEfficiencyT1T2 ( )
inline

Member Function Documentation

template<typename T1, typename T2>
void MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >::bookHistograms ( DQMStore dqmStore)
inline

Definition at line 1197 of file MCEmbeddingValidationAnalyzer.h.

References DQMStore::book1D(), MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >::dqmDirectory_, MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >::histogramDenominatorEta_, MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >::histogramDenominatorPhi_, MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >::histogramDenominatorPt_, MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >::histogramNumeratorEta_, MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >::histogramNumeratorPhi_, MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >::histogramNumeratorPt_, Pi, and DQMStore::setCurrentFolder().

1198  {
1199  dqmStore.setCurrentFolder(dqmDirectory_.data());
1200  histogramNumeratorPt_ = dqmStore.book1D("numeratorPt", "numeratorPt", 250, 0., 250.);
1201  histogramDenominatorPt_ = dqmStore.book1D("denominatorPt", "denominatorPt", 250, 0., 250.);
1202  histogramNumeratorEta_ = dqmStore.book1D("numeratorEta", "numeratorEta", 198, -9.9, +9.9);
1203  histogramDenominatorEta_ = dqmStore.book1D("denominatorEta", "denominatorEta", 198, -9.9, +9.9);
1204  histogramNumeratorPhi_ = dqmStore.book1D("numeratorPhi", "numeratorPhi", 72, -TMath::Pi(), +TMath::Pi());
1205  histogramDenominatorPhi_ = dqmStore.book1D("denominatorPhi", "denominatorPhi", 72, -TMath::Pi(), +TMath::Pi());
1206  }
const double Pi
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:954
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:667
template<typename T1, typename T2>
void MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >::fillHistograms ( int  numJets,
const edm::Event evt,
double  evtWeight 
)
inline

Definition at line 1207 of file MCEmbeddingValidationAnalyzer.h.

References MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >::cutL1_, MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >::cutRef_, deltaR(), PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >::dRmatch_, MonitorElement::Fill(), edm::Event::getByLabel(), MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >::histogramDenominatorEta_, MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >::histogramDenominatorPhi_, MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >::histogramDenominatorPt_, MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >::histogramNumeratorEta_, MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >::histogramNumeratorPhi_, MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >::histogramNumeratorPt_, trackerHitRTTI::isMatched(), MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >::maxJets_, MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >::minJets_, MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >::srcL1_, and MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >::srcRef_.

1209  {
1210  if ( (minJets_ == -1 || numJets >= minJets_) &&
1211  (maxJets_ == -1 || numJets <= maxJets_) ) {
1212  typedef std::vector<T1> refLeptonCollection;
1214  evt.getByLabel(srcRef_, refLeptons);
1215  typedef std::vector<T2> l1LeptonCollection;
1217  evt.getByLabel(srcL1_, l1Leptons);
1218  for ( typename refLeptonCollection::const_iterator refLepton = refLeptons->begin();
1219  refLepton != refLeptons->end(); ++refLepton ) {
1220  if ( cutRef_ && !(*cutRef_)(*refLepton) ) continue;
1221  bool isMatched = false;
1222  for ( typename l1LeptonCollection::const_iterator l1Lepton = l1Leptons->begin();
1223  l1Lepton != l1Leptons->end(); ++l1Lepton ) {
1224  if ( cutL1_ && !(*cutL1_)(*l1Lepton) ) continue;
1225  double dR = deltaR(refLepton->p4(), l1Lepton->p4());
1226  if ( dR < dRmatch_ ) isMatched = true;
1227  }
1228  histogramDenominatorPt_->Fill(refLepton->pt(), evtWeight);
1229  histogramDenominatorEta_->Fill(refLepton->eta(), evtWeight);
1230  histogramDenominatorPhi_->Fill(refLepton->phi(), evtWeight);
1231  if ( isMatched ) {
1232  histogramNumeratorPt_->Fill(refLepton->pt(), evtWeight);
1233  histogramNumeratorEta_->Fill(refLepton->eta(), evtWeight);
1234  histogramNumeratorPhi_->Fill(refLepton->phi(), evtWeight);
1235  }
1236  }
1237  }
1238  }
void Fill(long long x)
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 T1, typename T2>
StringCutObjectSelector<T2>* MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >::cutL1_
template<typename T1, typename T2>
StringCutObjectSelector<T1>* MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >::cutRef_
template<typename T1, typename T2>
std::string MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >::dqmDirectory_
template<typename T1, typename T2>
double MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >::dRmatch_
template<typename T1, typename T2>
MonitorElement* MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >::histogramDenominatorEta_
template<typename T1, typename T2>
MonitorElement* MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >::histogramDenominatorPhi_
template<typename T1, typename T2>
MonitorElement* MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >::histogramDenominatorPt_
template<typename T1, typename T2>
MonitorElement* MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >::histogramNumeratorEta_
template<typename T1, typename T2>
MonitorElement* MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >::histogramNumeratorPhi_
template<typename T1, typename T2>
MonitorElement* MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >::histogramNumeratorPt_
template<typename T1, typename T2>
int MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >::maxJets_
template<typename T1, typename T2>
int MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >::minJets_
template<typename T1, typename T2>
edm::InputTag MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >::srcL1_
template<typename T1, typename T2>
edm::InputTag MCEmbeddingValidationAnalyzer::leptonL1TriggerEfficiencyT1T2< T1, T2 >::srcRef_