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 638 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 640 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_.

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

Member Function Documentation

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

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

666  {
667  dqmStore.setCurrentFolder(dqmDirectory_.data());
668  histogramNumGenLeptons_ = dqmStore.book1D("numGenLeptons", "numGenLeptons", 10, -0.5, 9.5);
669  histogramGenLeptonPt_ = dqmStore.book1D("genLeptonPt", "genLeptonPt", 250, 0., 250.);
670  histogramGenLeptonEta_ = dqmStore.book1D("genLeptonEta", "genLeptonEta", 198, -9.9, +9.9);
671  histogramGenLeptonPhi_ = dqmStore.book1D("genLeptonPhi", "genLeptonPhi", 72, -TMath::Pi(), +TMath::Pi());
672  histogramNumRecLeptons_ = dqmStore.book1D("numRecLeptons", "numRecLeptons", 10, -0.5, 9.5);
673  histogramRecLeptonPt_ = dqmStore.book1D("recLeptonPt", "recLeptonPt", 250, 0., 250.);
674  histogramRecLeptonEta_ = dqmStore.book1D("recLeptonEta", "recLeptonEta", 198, -9.9, +9.9);
675  histogramRecLeptonPhi_ = dqmStore.book1D("recLeptonPhi", "recLeptonPhi", 72, -TMath::Pi(), +TMath::Pi());
676  histogramRecMinusGenLeptonPt_ = dqmStore.book1D("recMinusGenLeptonPt", "recMinusGenLeptonPt", 200, -100., +100.);
677  histogramRecMinusGenLeptonPt_div_genLeptonPt_ = dqmStore.book1D("recMinusGenLeptonPt_div_genLeptonPt", "recMinusGenLeptonPt_div_genLeptonPt", 200, 0., 2.);
678  histogramRecMinusGenLeptonEta_ = dqmStore.book1D("recMinusGenLeptonEta", "recMinusGenLeptonEta", 100, -0.5, +0.5);
679  histogramRecMinusGenLeptonPhi_ = dqmStore.book1D("recMinusGenLeptonPhi", "recMinusGenLeptonPhi", 100, -0.5, +0.5);
680  }
const double Pi
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:942
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:655
template<typename T>
void MCEmbeddingValidationAnalyzer::leptonDistributionT< T >::fillHistograms ( int  numJets,
const edm::Event evt,
double  evtWeight 
)
inline

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

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