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::leptonDistributionT< T > Struct Template Reference

Public Member Functions

void bookHistograms (DQMStore &dqmStore)
 
void fillHistograms (int numJets, const edm::Event &evt, double evtWeight)
 
 leptonDistributionT (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)
 
 ~leptonDistributionT ()
 

Public Attributes

StringCutObjectSelector
< reco::Candidate > * 
cutGen_
 
StringCutObjectSelector< T > * cutRec_
 
std::string dqmDirectory_
 
double dRmatch_
 
MonitorElementhistogramGenLeptonEta_
 
MonitorElementhistogramGenLeptonPhi_
 
MonitorElementhistogramGenLeptonPt_
 
MonitorElementhistogramNumGenLeptons_
 
MonitorElementhistogramNumRecLeptons_
 
MonitorElementhistogramRecLeptonEta_
 
MonitorElementhistogramRecLeptonPhi_
 
MonitorElementhistogramRecLeptonPt_
 
MonitorElementhistogramRecMinusGenLeptonEta_
 
MonitorElementhistogramRecMinusGenLeptonPhi_
 
MonitorElementhistogramRecMinusGenLeptonPt_
 
MonitorElementhistogramRecMinusGenLeptonPt_div_genLeptonPt_
 
int maxJets_
 
int minJets_
 
edm::InputTag srcGen_
 
edm::InputTag srcRec_
 

Detailed Description

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

Definition at line 636 of file MCEmbeddingValidationAnalyzer.h.

Constructor & Destructor Documentation

template<typename T>
MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::leptonDistributionT ( 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 638 of file MCEmbeddingValidationAnalyzer.h.

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

640  : minJets_(minJets),
641  maxJets_(maxJets),
642  srcGen_(srcGen),
643  cutGen_(0),
644  srcRec_(srcRec),
645  cutRec_(0),
646  dRmatch_(dRmatch),
647  dqmDirectory_(dqmDirectory)
648  {
649  if ( cutGen != "" ) cutGen_ = new StringCutObjectSelector<reco::Candidate>(cutGen);
650  if ( cutRec != "" ) cutRec_ = new StringCutObjectSelector<T>(cutRec);
651  dqmDirectory_ = dqmDirectory;
652  if ( minJets_ < 0 && maxJets_ < 0 ) dqmDirectory_.append("");
653  else if ( maxJets_ < 0 ) dqmDirectory_.append(Form("_numJetsGe%i", minJets_));
654  else if ( minJets_ < 0 ) dqmDirectory_.append(Form("_numJetsLe%i", maxJets_));
655  else if ( maxJets_ == minJets_ ) dqmDirectory_.append(Form("_numJetsEq%i", minJets_));
656  else dqmDirectory_.append(Form("_numJets%ito%i", minJets_, maxJets_));
657  }
StringCutObjectSelector< reco::Candidate > * cutGen_

Member Function Documentation

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

Definition at line 663 of file MCEmbeddingValidationAnalyzer.h.

References DQMStore::book1D(), MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::dqmDirectory_, MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::histogramGenLeptonEta_, MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::histogramGenLeptonPhi_, MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::histogramGenLeptonPt_, MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::histogramNumGenLeptons_, MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::histogramNumRecLeptons_, MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::histogramRecLeptonEta_, MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::histogramRecLeptonPhi_, MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::histogramRecLeptonPt_, MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::histogramRecMinusGenLeptonEta_, MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::histogramRecMinusGenLeptonPhi_, MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::histogramRecMinusGenLeptonPt_, MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::histogramRecMinusGenLeptonPt_div_genLeptonPt_, Pi, and DQMStore::setCurrentFolder().

664  {
665  dqmStore.setCurrentFolder(dqmDirectory_.data());
666  histogramNumGenLeptons_ = dqmStore.book1D("numGenLeptons", "numGenLeptons", 10, -0.5, 9.5);
667  histogramGenLeptonPt_ = dqmStore.book1D("genLeptonPt", "genLeptonPt", 250, 0., 250.);
668  histogramGenLeptonEta_ = dqmStore.book1D("genLeptonEta", "genLeptonEta", 198, -9.9, +9.9);
669  histogramGenLeptonPhi_ = dqmStore.book1D("genLeptonPhi", "genLeptonPhi", 72, -TMath::Pi(), +TMath::Pi());
670  histogramNumRecLeptons_ = dqmStore.book1D("numRecLeptons", "numRecLeptons", 10, -0.5, 9.5);
671  histogramRecLeptonPt_ = dqmStore.book1D("recLeptonPt", "recLeptonPt", 250, 0., 250.);
672  histogramRecLeptonEta_ = dqmStore.book1D("recLeptonEta", "recLeptonEta", 198, -9.9, +9.9);
673  histogramRecLeptonPhi_ = dqmStore.book1D("recLeptonPhi", "recLeptonPhi", 72, -TMath::Pi(), +TMath::Pi());
674  histogramRecMinusGenLeptonPt_ = dqmStore.book1D("recMinusGenLeptonPt", "recMinusGenLeptonPt", 200, -100., +100.);
675  histogramRecMinusGenLeptonPt_div_genLeptonPt_ = dqmStore.book1D("recMinusGenLeptonPt_div_genLeptonPt", "recMinusGenLeptonPt_div_genLeptonPt", 200, 0., 2.);
676  histogramRecMinusGenLeptonEta_ = dqmStore.book1D("recMinusGenLeptonEta", "recMinusGenLeptonEta", 100, -0.5, +0.5);
677  histogramRecMinusGenLeptonPhi_ = dqmStore.book1D("recMinusGenLeptonPhi", "recMinusGenLeptonPhi", 100, -0.5, +0.5);
678  }
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::leptonDistributionT< T >::fillHistograms ( int  numJets,
const edm::Event evt,
double  evtWeight 
)
inline

Definition at line 679 of file MCEmbeddingValidationAnalyzer.h.

References MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::cutGen_, MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::cutRec_, deltaR(), PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::dRmatch_, MonitorElement::Fill(), edm::Event::getByLabel(), MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::histogramGenLeptonEta_, MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::histogramGenLeptonPhi_, MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::histogramGenLeptonPt_, MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::histogramNumGenLeptons_, MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::histogramNumRecLeptons_, MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::histogramRecLeptonEta_, MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::histogramRecLeptonPhi_, MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::histogramRecLeptonPt_, MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::histogramRecMinusGenLeptonEta_, MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::histogramRecMinusGenLeptonPhi_, MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::histogramRecMinusGenLeptonPt_, MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::histogramRecMinusGenLeptonPt_div_genLeptonPt_, MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::maxJets_, MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::minJets_, MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::srcGen_, and MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::srcRec_.

681  {
682  if ( (minJets_ == -1 || numJets >= minJets_) &&
683  (maxJets_ == -1 || numJets <= maxJets_) ) {
685  edm::Handle<CandidateView> genLeptons;
686  evt.getByLabel(srcGen_, genLeptons);
687  histogramNumGenLeptons_->Fill(genLeptons->size(), evtWeight);
688  typedef std::vector<T> recLeptonCollection;
690  evt.getByLabel(srcRec_, recLeptons);
691  histogramNumRecLeptons_->Fill(recLeptons->size(), evtWeight);
692  for ( CandidateView::const_iterator genLepton = genLeptons->begin();
693  genLepton != genLeptons->end(); ++genLepton ) {
694  if ( cutGen_ && !(*cutGen_)(*genLepton) ) continue;
695  for ( typename recLeptonCollection::const_iterator recLepton = recLeptons->begin();
696  recLepton != recLeptons->end(); ++recLepton ) {
697  if ( cutRec_ && !(*cutRec_)(*recLepton) ) continue;
698  double dR = deltaR(genLepton->p4(), recLepton->p4());
699  if ( dR < dRmatch_ ) {
700  histogramGenLeptonPt_->Fill(genLepton->pt(), evtWeight);
701  histogramGenLeptonEta_->Fill(genLepton->eta(), evtWeight);
702  histogramGenLeptonPhi_->Fill(genLepton->phi(), evtWeight);
703  histogramRecLeptonPt_->Fill(recLepton->pt(), evtWeight);
704  histogramRecLeptonEta_->Fill(recLepton->eta(), evtWeight);
705  histogramRecLeptonPhi_->Fill(recLepton->phi(), evtWeight);
706  histogramRecMinusGenLeptonPt_->Fill(recLepton->pt() - genLepton->pt(), evtWeight);
707  if ( genLepton->pt() > 0. ) histogramRecMinusGenLeptonPt_div_genLeptonPt_->Fill((recLepton->pt() - genLepton->pt())/genLepton->pt(), evtWeight);
708  histogramRecMinusGenLeptonEta_->Fill(recLepton->eta() - genLepton->eta(), evtWeight);
709  histogramRecMinusGenLeptonPhi_->Fill(recLepton->phi() - genLepton->phi(), evtWeight);
710  }
711  }
712  }
713  }
714  }
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
void Fill(long long x)
edm::View< reco::Candidate > CandidateView
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
StringCutObjectSelector< reco::Candidate > * cutGen_

Member Data Documentation

template<typename T>
std::string MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::dqmDirectory_
template<typename T>
double MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::dRmatch_
template<typename T>
MonitorElement* MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::histogramGenLeptonEta_
template<typename T>
MonitorElement* MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::histogramGenLeptonPhi_
template<typename T>
MonitorElement* MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::histogramGenLeptonPt_
template<typename T>
MonitorElement* MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::histogramNumGenLeptons_
template<typename T>
MonitorElement* MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::histogramNumRecLeptons_
template<typename T>
MonitorElement* MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::histogramRecLeptonEta_
template<typename T>
MonitorElement* MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::histogramRecLeptonPhi_
template<typename T>
MonitorElement* MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::histogramRecLeptonPt_
template<typename T>
MonitorElement* MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::histogramRecMinusGenLeptonEta_
template<typename T>
MonitorElement* MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::histogramRecMinusGenLeptonPhi_
template<typename T>
MonitorElement* MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::histogramRecMinusGenLeptonPt_
template<typename T>
MonitorElement* MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::histogramRecMinusGenLeptonPt_div_genLeptonPt_
template<typename T>
int MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::maxJets_
template<typename T>
int MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::minJets_