CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
HeavyFlavorValidation Class Reference

#include <HLTriggerOfflineHeavyFlavor/src/HeavyFlavorValidation.cc>

Inheritance diagram for HeavyFlavorValidation:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 HeavyFlavorValidation (const edm::ParameterSet &)
 
 ~HeavyFlavorValidation ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginRun (const Run &iRun, const EventSetup &iSetup)
 
virtual void endJob ()
 
int getMotherId (const Candidate *p)
 
void match (MonitorElement *me, vector< LeafCandidate > &from, vector< LeafCandidate > &to, double deltaRMatchingCut, vector< int > &map)
 
void myBook1D (TString name, vector< double > &xBins, TString label, TString title)
 
void myBook1D (TString name, vector< double > &xBins, TString label)
 
void myBook2D (TString name, vector< double > &xBins, TString xLabel, vector< double > &yBins, TString yLabel, TString title)
 
void myBook2D (TString name, vector< double > &xBins, TString xLabel, vector< double > &yBins, TString yLabel)
 
void myBookProfile2D (TString name, vector< double > &xBins, TString xLabel, vector< double > &yBins, TString yLabel, TString title)
 
void myBookProfile2D (TString name, vector< double > &xBins, TString xLabel, vector< double > &yBins, TString yLabel)
 

Private Attributes

vector< double > deltaEtaBins
 
vector< double > deltaPhiBins
 
vector< double > dimuonDRBins
 
vector< double > dimuonEtaBins
 
vector< double > dimuonPtBins
 
string dqmFolder
 
DQMStoredqmStore
 
vector< pair< string, int > > filterNamesLevels
 
double genGlobDeltaRMatchingCut
 
InputTag genParticlesTag
 
double globL1DeltaRMatchingCut
 
double globL2DeltaRMatchingCut
 
double globL3DeltaRMatchingCut
 
map< TString, MonitorElement * > ME
 
vector< int > motherIDs
 
vector< double > muonEtaBins
 
const double muonMass
 
vector< double > muonPhiBins
 
vector< double > muonPtBins
 
InputTag recoMuonsTag
 
string triggerPathName
 
string triggerProcessName
 
InputTag triggerResultsTag
 
InputTag triggerSummaryAODTag
 
InputTag triggerSummaryRAWTag
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Description: Analyzer to fill Monitoring Elements for muon, dimuon and trigger path efficiency studies (HLT/RECO, RECO/GEN)

Implementation: matching is based on closest in delta R, no duplicates allowed. Generated to Global based on momentum at IP; L1, L2, L2v to Global based on position in muon system, L3 to Global based on momentum at IP.

Definition at line 52 of file HeavyFlavorValidation.cc.

Constructor & Destructor Documentation

HeavyFlavorValidation::HeavyFlavorValidation ( const edm::ParameterSet pset)
explicit

Definition at line 101 of file HeavyFlavorValidation.cc.

101  :
102 //get parameters
103  dqmFolder(pset.getUntrackedParameter<string>("DQMFolder")),
104  triggerProcessName(pset.getUntrackedParameter<string>("TriggerProcessName")),
105  triggerPathName(pset.getUntrackedParameter<string>("TriggerPathName")),
106  triggerSummaryRAWTag(InputTag( pset.getUntrackedParameter<string>("TriggerSummaryRAW"), "", triggerProcessName)),
107  triggerSummaryAODTag(InputTag( pset.getUntrackedParameter<string>("TriggerSummaryAOD"), "", triggerProcessName)),
108  triggerResultsTag(InputTag( pset.getUntrackedParameter<string>("TriggerResults"), "", triggerProcessName)),
109  recoMuonsTag(pset.getParameter<InputTag>("RecoMuons")),
110  genParticlesTag(pset.getParameter<InputTag>("GenParticles")),
111  motherIDs(pset.getUntrackedParameter<vector<int> >("MotherIDs")),
112  genGlobDeltaRMatchingCut(pset.getUntrackedParameter<double>("GenGlobDeltaRMatchingCut")),
113  globL1DeltaRMatchingCut(pset.getUntrackedParameter<double>("GlobL1DeltaRMatchingCut")),
114  globL2DeltaRMatchingCut(pset.getUntrackedParameter<double>("GlobL2DeltaRMatchingCut")),
115  globL3DeltaRMatchingCut(pset.getUntrackedParameter<double>("GlobL3DeltaRMatchingCut")),
116  deltaEtaBins(pset.getUntrackedParameter<vector<double> >("DeltaEtaBins")),
117  deltaPhiBins(pset.getUntrackedParameter<vector<double> >("DeltaPhiBins")),
118  muonPtBins(pset.getUntrackedParameter<vector<double> >("MuonPtBins")),
119  muonEtaBins(pset.getUntrackedParameter<vector<double> >("MuonEtaBins")),
120  muonPhiBins(pset.getUntrackedParameter<vector<double> >("MuonPhiBins")),
121  dimuonPtBins(pset.getUntrackedParameter<vector<double> >("DimuonPtBins")),
122  dimuonEtaBins(pset.getUntrackedParameter<vector<double> >("DimuonEtaBins")),
123  dimuonDRBins(pset.getUntrackedParameter<vector<double> >("DimuonDRBins")),
124  muonMass(0.106)
125 {}
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
vector< double > dimuonEtaBins
HeavyFlavorValidation::~HeavyFlavorValidation ( )

Definition at line 650 of file HeavyFlavorValidation.cc.

650  {
651 }

Member Function Documentation

void HeavyFlavorValidation::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 277 of file HeavyFlavorValidation.cc.

References abs, DeDxDiscriminatorTools::charge(), dqmStore, eta(), f, filterNamesLevels, spr::find(), first, genGlobDeltaRMatchingCut, genParticleCandidates2GenParticles_cfi::genParticles, genParticlesTag, edm::Event::getByLabel(), getMotherId(), globL1DeltaRMatchingCut, globL2DeltaRMatchingCut, globL3DeltaRMatchingCut, i, getHLTprescales::index, edm::HandleBase::isValid(), j, relativeConstraints::keys, LogDebug, match(), motherIDs, muonMass, AlCaHLTBitMon_ParallelJobs::p, phi, recoMuonsTag, edm::second(), edm::TriggerNames::size(), findQualityFiles::size, python.multivaluedict::sort(), trigger::TriggerL1Mu, trigger::TriggerMuon, edm::TriggerNames::triggerName(), edm::Event::triggerNames(), triggerPathName, triggerProcessName, patRefSel_triggerSelection_cff::triggerResults, triggerResultsTag, triggerSummaryAODTag, triggerSummaryRAWTag, x, detailsBasic3DVector::y, and detailsBasic3DVector::z.

277  {
278  if( !dqmStore ){
279  LogDebug("HLTriggerOfflineHeavyFlavor")<<"Could not access DQM Store service"<<endl;
280  return;
281  }
282  if(filterNamesLevels.size()==0){
283  return;
284  }
285 //access the containers and create LeafCandidate copies
286  vector<LeafCandidate> genMuons;
288  iEvent.getByLabel(genParticlesTag, genParticles);
289  if(genParticles.isValid()){
290  for(GenParticleCollection::const_iterator p=genParticles->begin(); p!= genParticles->end(); ++p){
291  if( p->status() == 1 && std::abs(p->pdgId())==13 &&
292  ( find( motherIDs.begin(), motherIDs.end(), -1 )!=motherIDs.end() || find( motherIDs.begin(), motherIDs.end(), getMotherId(&(*p)) )!=motherIDs.end() ) ){
293  genMuons.push_back( *p );
294  }
295  }
296  }else{
297  LogDebug("HLTriggerOfflineHeavyFlavor")<<"Could not access GenParticleCollection"<<endl;
298  }
299  sort(genMuons.begin(), genMuons.end(), GreaterByPt<LeafCandidate>());
300  ME["genMuon_size"]->Fill(genMuons.size());
301  LogDebug("HLTriggerOfflineHeavyFlavor")<<"GenParticleCollection from "<<genParticlesTag<<" has size: "<<genMuons.size()<<endl;
302 
303  vector<LeafCandidate> globMuons;
304  vector<LeafCandidate> globMuons_position;
305  Handle<MuonCollection> recoMuonsHandle;
306  iEvent.getByLabel(recoMuonsTag, recoMuonsHandle);
307  if(recoMuonsHandle.isValid()){
308  for(MuonCollection::const_iterator p=recoMuonsHandle->begin(); p!= recoMuonsHandle->end(); ++p){
309  if(p->isGlobalMuon()){
310  globMuons.push_back(*p);
311  globMuons_position.push_back( LeafCandidate( p->charge(), math::XYZTLorentzVector(p->outerTrack()->innerPosition().x(), p->outerTrack()->innerPosition().y(), p->outerTrack()->innerPosition().z(), 0.) ) );
312  }
313  }
314  }else{
315  LogDebug("HLTriggerOfflineHeavyFlavor")<<"Could not access reco Muons"<<endl;
316  }
317  ME["globMuon_size"]->Fill(globMuons.size());
318  LogDebug("HLTriggerOfflineHeavyFlavor")<<"Global Muons from "<<recoMuonsTag<<" has size: "<<globMuons.size()<<endl;
319 
320 // access RAW trigger event
321  vector<vector<LeafCandidate> > muonsAtFilter;
322  vector<vector<LeafCandidate> > muonPositionsAtFilter;
323  for(size_t i=0; i<filterNamesLevels.size(); i++){
324  muonsAtFilter.push_back(vector<LeafCandidate>());
325  muonPositionsAtFilter.push_back(vector<LeafCandidate>());
326  }
327  Handle<TriggerEventWithRefs> rawTriggerEvent;
328  iEvent.getByLabel( triggerSummaryRAWTag, rawTriggerEvent );
329  if( rawTriggerEvent.isValid() ){
330  for(size_t i=0; i<filterNamesLevels.size(); i++){
331  size_t index = rawTriggerEvent->filterIndex(InputTag( filterNamesLevels[i].first, "", triggerProcessName ));
332  if ( index < rawTriggerEvent->size() ){
333  if( filterNamesLevels[i].second==1 ){
334  vector<L1MuonParticleRef> l1Cands;
335  rawTriggerEvent->getObjects( index, TriggerL1Mu, l1Cands );
336  for(size_t j=0; j<l1Cands.size(); j++){
337  muonsAtFilter[i].push_back(*l1Cands[j]);
338  }
339  }else{
340  vector<RecoChargedCandidateRef> hltCands;
341  rawTriggerEvent->getObjects( index, TriggerMuon, hltCands );
342  for(size_t j=0; j<hltCands.size(); j++){
343  muonsAtFilter[i].push_back(*hltCands[j]);
344  if( filterNamesLevels[i].second==2 ){
345  muonPositionsAtFilter[i].push_back( LeafCandidate( hltCands[j]->charge(), math::XYZTLorentzVector(hltCands[j]->track()->innerPosition().x(), hltCands[j]->track()->innerPosition().y(), hltCands[j]->track()->innerPosition().z(), 0.) ) );
346  }
347  }
348  }
349  }
350  ME[TString::Format("filt%dMuon_size",int(i+1))]->Fill(muonsAtFilter[i].size());
351  LogDebug("HLTriggerOfflineHeavyFlavor")<<"Filter \""<<filterNamesLevels[i].first<<"\" has "<<muonsAtFilter[i].size()<<" muons"<<endl;
352  }
353  }else{
354  LogDebug("HLTriggerOfflineHeavyFlavor")<<"Could not access RAWTriggerEvent"<<endl;
355  }
356 
357 // access AOD trigger event
358  vector<LeafCandidate> pathMuons;
359  Handle<TriggerEvent> aodTriggerEvent;
360  iEvent.getByLabel(triggerSummaryAODTag,aodTriggerEvent);
361  if(aodTriggerEvent.isValid()){
362  TriggerObjectCollection allObjects = aodTriggerEvent->getObjects();
363  for(int i=0; i<aodTriggerEvent->sizeFilters(); i++){
364  if(aodTriggerEvent->filterTag(i)==InputTag((filterNamesLevels.end()-1)->first,"",triggerProcessName)){
365  Keys keys = aodTriggerEvent->filterKeys(i);
366  for(size_t j=0; j<keys.size(); j++){
367  pathMuons.push_back( LeafCandidate( allObjects[keys[j]].id()>0 ? 1 : -1, math::PtEtaPhiMLorentzVector( allObjects[keys[j]].pt(), allObjects[keys[j]].eta(), allObjects[keys[j]].phi(), muonMass ) ) );
368  }
369  }
370  }
371  ME["pathMuon_size"]->Fill(pathMuons.size());
372  LogDebug("HLTriggerOfflineHeavyFlavor")<<"Path \""<<triggerPathName<<"\" has "<<pathMuons.size()<<" muons at last filter \""<<(filterNamesLevels.end()-1)->first<<"\""<<endl;
373  }else{
374  LogDebug("HLTriggerOfflineHeavyFlavor")<<"Could not access AODTriggerEvent"<<endl;
375  }
376 
377 // access Trigger Results
378  bool triggerFired = false;
380  iEvent.getByLabel(triggerResultsTag,triggerResults);
381  if(triggerResults.isValid()){
382  LogDebug("HLTriggerOfflineHeavyFlavor")<<"Successfully initialized "<<triggerResultsTag<<endl;
383  const edm::TriggerNames & triggerNames = iEvent.triggerNames(*triggerResults);
384  bool hlt_exists = false;
385  for ( unsigned int i=0; i!=triggerNames.size(); i++) {
386  TString hlt_name = triggerNames.triggerName(i);
387  if (hlt_name.Contains(triggerPathName)) {
388  triggerFired = triggerResults->accept( i );
389  hlt_exists = true;
390  break;
391  }
392  }
393  if (!hlt_exists) {
394  LogDebug("HLTriggerOfflineHeavyFlavor")<<triggerResultsTag<<" has no trigger: "<<triggerPathName<<endl;
395  }
396  }else{
397  LogDebug("HLTriggerOfflineHeavyFlavor")<<"Could not initialize "<<triggerResultsTag<<endl;
398  }
399 
400 //create matching maps
401  vector<int> glob_gen(genMuons.size(),-1);
402  match( ME["globGen_deltaEtaDeltaPhi"], genMuons, globMuons, genGlobDeltaRMatchingCut, glob_gen );
403  vector<vector<int> > filt_glob;
404  for(size_t i=0; i<filterNamesLevels.size(); i++){
405  filt_glob.push_back( vector<int>(globMuons.size(),-1) );
406  if( filterNamesLevels[i].second == 1 ){
407  match( ME[TString::Format("filt%dGlob_deltaEtaDeltaPhi",int(i+1))], globMuons_position, muonsAtFilter[i] ,globL1DeltaRMatchingCut, filt_glob[i] );
408  }else if( filterNamesLevels[i].second == 2 ){
409  match( ME[TString::Format("filt%dGlob_deltaEtaDeltaPhi",int(i+1))], globMuons_position, muonPositionsAtFilter[i] ,globL2DeltaRMatchingCut, filt_glob[i] );
410  }else if( filterNamesLevels[i].second == 3 || filterNamesLevels[i].second == 4){
411  match( ME[TString::Format("filt%dGlob_deltaEtaDeltaPhi",int(i+1))], globMuons, muonsAtFilter[i] ,globL3DeltaRMatchingCut, filt_glob[i] );
412  }
413  }
414  vector<int> path_glob(globMuons.size(),-1);
415  if( (filterNamesLevels.end()-1)->second == 1 ){
416  match( ME["pathGlob_deltaEtaDeltaPhi"], globMuons_position, pathMuons ,globL1DeltaRMatchingCut, path_glob );
417  }else if( (filterNamesLevels.end()-1)->second == 2 ){
418  match( ME["pathGlob_deltaEtaDeltaPhi"], globMuons, pathMuons ,globL2DeltaRMatchingCut, path_glob );
419  }else if( (filterNamesLevels.end()-1)->second == 3 || (filterNamesLevels.end()-1)->second == 4){
420  match( ME["pathGlob_deltaEtaDeltaPhi"], globMuons, pathMuons ,globL3DeltaRMatchingCut, path_glob );
421  }
422 
423 //fill histos
424  bool first = true;
425  for(size_t i=0; i<genMuons.size(); i++){
426  ME["genMuon_genEtaPt"]->Fill(genMuons[i].eta(), genMuons[i].pt());
427  ME["genMuon_genEtaPhi"]->Fill(genMuons[i].eta(), genMuons[i].phi());
428  if(glob_gen[i] != -1){
429  ME["resGlobGen_genEtaPt"]->Fill(genMuons[i].eta(), genMuons[i].pt(), (globMuons[glob_gen[i]].pt()-genMuons[i].pt())/genMuons[i].pt() );
430  ME["globMuon_genEtaPt"]->Fill(genMuons[i].eta(), genMuons[i].pt());
431  ME["globMuon_genEtaPhi"]->Fill(genMuons[i].eta(), genMuons[i].phi());
432  ME["globMuon_recoEtaPt"]->Fill(globMuons[glob_gen[i]].eta(), globMuons[glob_gen[i]].pt());
433  ME["globMuon_recoEtaPhi"]->Fill(globMuons[glob_gen[i]].eta(), globMuons[glob_gen[i]].phi());
434  for(size_t f=0; f<filterNamesLevels.size(); f++){
435  if(filt_glob[f][glob_gen[i]] != -1){
436  ME[TString::Format("resFilt%dGlob_recoEtaPt",int(f+1))]->Fill(globMuons[glob_gen[i]].eta(), globMuons[glob_gen[i]].pt(), (muonsAtFilter[f][filt_glob[f][glob_gen[i]]].pt()-globMuons[glob_gen[i]].pt())/globMuons[glob_gen[i]].pt() );
437  ME[TString::Format("filt%dMuon_recoEtaPt",int(f+1))]->Fill(globMuons[glob_gen[i]].eta(), globMuons[glob_gen[i]].pt());
438  ME[TString::Format("filt%dMuon_recoEtaPhi",int(f+1))]->Fill(globMuons[glob_gen[i]].eta(), globMuons[glob_gen[i]].phi());
439  }else{
440  break;
441  }
442  }
443  if(path_glob[glob_gen[i]] != -1){
444  ME["resPathGlob_recoEtaPt"]->Fill(globMuons[glob_gen[i]].eta(), globMuons[glob_gen[i]].pt(), (pathMuons[path_glob[glob_gen[i]]].pt()-globMuons[glob_gen[i]].pt())/globMuons[glob_gen[i]].pt() );
445  ME["pathMuon_recoEtaPt"]->Fill(globMuons[glob_gen[i]].eta(), globMuons[glob_gen[i]].pt());
446  ME["pathMuon_recoEtaPhi"]->Fill(globMuons[glob_gen[i]].eta(), globMuons[glob_gen[i]].phi());
447  }
448 //highest pt muon
449  if( first ){
450  first = false;
451  if( triggerFired ){
452  ME["resultMuon_recoEtaPt"]->Fill(globMuons[glob_gen[i]].eta(), globMuons[glob_gen[i]].pt());
453  ME["resultMuon_recoEtaPhi"]->Fill(globMuons[glob_gen[i]].eta(), globMuons[glob_gen[i]].phi());
454  }
455  }
456  }
457  }
458 
459 //fill dimuon histograms (highest pT, opposite charge)
460  int secondMuon = 0;
461  for(size_t j=1; j<genMuons.size(); j++){
462  if(genMuons[0].charge()*genMuons[j].charge()==-1){
463  secondMuon = j;
464  break;
465  }
466  }
467  if(secondMuon > 0){
468 // int pos = genMuons[0].charge()>0 ? 0 : secondMuon ;
469 // int neg = genMuons[0].charge()<0 ? 0 : secondMuon ;
470 //two generated
471  double genDimuonPt = (genMuons[0].p4()+genMuons[secondMuon].p4()).pt();
472  double genDimuonEta = (genMuons[0].p4()+genMuons[secondMuon].p4()).eta();
473  double genDimuonRap = (genMuons[0].p4()+genMuons[secondMuon].p4()).Rapidity();
474  double genDimuonDR = deltaR<LeafCandidate,LeafCandidate>( genMuons[0], genMuons[secondMuon] );
475  bool highPt = genMuons[0].pt()>7. && genMuons[secondMuon].pt()>7;
476  ME["genDimuon_genEtaPt"]->Fill( genDimuonEta, genDimuonPt );
477  ME["genDimuon_genRapPt"]->Fill( genDimuonRap, genDimuonPt );
478  if(highPt) ME["genDimuon_genPtDR"]->Fill( genDimuonPt, genDimuonDR );
479 //two global
480  if(glob_gen[0]!=-1 && glob_gen[secondMuon]!=-1){
481  ME["globDimuon_genEtaPt"]->Fill( genDimuonEta, genDimuonPt );
482  ME["globDimuon_genRapPt"]->Fill( genDimuonRap, genDimuonPt );
483  if(highPt) ME["globDimuon_genPtDR"]->Fill( genDimuonPt, genDimuonDR );
484  double globDimuonPt = (globMuons[glob_gen[0]].p4()+globMuons[glob_gen[secondMuon]].p4()).pt();
485  double globDimuonEta = (globMuons[glob_gen[0]].p4()+globMuons[glob_gen[secondMuon]].p4()).eta();
486  double globDimuonRap = (globMuons[glob_gen[0]].p4()+globMuons[glob_gen[secondMuon]].p4()).Rapidity();
487  double globDimuonDR = deltaR<LeafCandidate,LeafCandidate>( globMuons[glob_gen[0]], globMuons[glob_gen[secondMuon]] );
488  double globDimuonDRpos = deltaR<LeafCandidate,LeafCandidate>( globMuons_position[glob_gen[0]], globMuons_position[glob_gen[secondMuon]] );
489  ME["globDimuon_recoEtaPt"]->Fill( globDimuonEta, globDimuonPt );
490  ME["globDimuon_recoRapPt"]->Fill( globDimuonRap, globDimuonPt );
491  if(highPt) ME["globDimuon_recoPtDR"]->Fill( globDimuonPt, globDimuonDR );
492  if(highPt) ME["globDimuon_recoPtDRpos"]->Fill( globDimuonPt, globDimuonDRpos );
493 //two filter objects
494  for(size_t f=0; f<filterNamesLevels.size(); f++){
495  if(filt_glob[f][glob_gen[0]] != -1 && filt_glob[f][glob_gen[secondMuon]] != -1){
496  ME[TString::Format("diFilt%dDimuon_recoEtaPt",int(f+1))]->Fill( globDimuonEta, globDimuonPt );
497  ME[TString::Format("diFilt%dDimuon_recoRapPt",int(f+1))]->Fill( globDimuonRap, globDimuonPt );
498  if(highPt) ME[TString::Format("diFilt%dDimuon_recoPtDR",int(f+1))]->Fill( globDimuonPt, globDimuonDR );
499  if(highPt) ME[TString::Format("diFilt%dDimuon_recoPtDRpos",int(f+1))]->Fill( globDimuonPt, globDimuonDRpos );
500  }else{
501  break;
502  }
503  }
504 //one filter object
505  for(size_t f=0; f<filterNamesLevels.size(); f++){
506  if(filt_glob[f][glob_gen[0]] != -1 || filt_glob[f][glob_gen[secondMuon]] != -1){
507  ME[TString::Format("filt%dDimuon_recoEtaPt",int(f+1))]->Fill( globDimuonEta, globDimuonPt );
508  ME[TString::Format("filt%dDimuon_recoRapPt",int(f+1))]->Fill( globDimuonRap, globDimuonPt );
509  if(highPt) ME[TString::Format("filt%dDimuon_recoPtDR",int(f+1))]->Fill( globDimuonPt, globDimuonDR );
510  if(highPt) ME[TString::Format("filt%dDimuon_recoPtDRpos",int(f+1))]->Fill( globDimuonPt, globDimuonDRpos );
511  }else{
512  break;
513  }
514  }
515 //two path objects
516  if(path_glob[glob_gen[0]] != -1 && path_glob[glob_gen[secondMuon]] != -1){
517  ME["diPathDimuon_recoEtaPt"]->Fill( globDimuonEta, globDimuonPt );
518  ME["diPathDimuon_recoRapPt"]->Fill( globDimuonRap, globDimuonPt );
519  if(highPt) ME["diPathDimuon_recoPtDR"]->Fill( globDimuonPt, globDimuonDR );
520  if(highPt) ME["diPathDimuon_recoPtDRpos"]->Fill( globDimuonPt, globDimuonDRpos );
521  }
522 //one path object
523  if(path_glob[glob_gen[0]] != -1 || path_glob[glob_gen[secondMuon]] != -1){
524  ME["pathDimuon_recoEtaPt"]->Fill( globDimuonEta, globDimuonPt );
525  ME["pathDimuon_recoRapPt"]->Fill( globDimuonRap, globDimuonPt );
526  if(highPt) ME["pathDimuon_recoPtDR"]->Fill( globDimuonPt, globDimuonDR );
527  if(highPt) ME["pathDimuon_recoPtDRpos"]->Fill( globDimuonPt, globDimuonDRpos );
528  }
529 //trigger result
530  if( triggerFired ){
531  ME["resultDimuon_recoEtaPt"]->Fill( globDimuonEta, globDimuonPt );
532  ME["resultDimuon_recoRapPt"]->Fill( globDimuonRap, globDimuonPt );
533  if(highPt) ME["resultDimuon_recoPtDR"]->Fill( globDimuonPt, globDimuonDR );
534  if(highPt) ME["resultDimuon_recoPtDRpos"]->Fill( globDimuonPt, globDimuonDRpos );
535  }
536  }
537  }
538 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
Definition: Event.cc:207
enum start value shifted to 81 so as to avoid clashes with PDG codes
vector< pair< string, int > > filterNamesLevels
#define abs(x)
Definition: mlp_lapack.h:159
Strings::size_type size() const
Definition: TriggerNames.cc:39
T eta() const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
double charge(const std::vector< uint8_t > &Ampls)
float float float z
U second(std::pair< T, U > const &p)
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:26
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:30
Definition: ME.h:11
int getMotherId(const Candidate *p)
void match(MonitorElement *me, vector< LeafCandidate > &from, vector< LeafCandidate > &to, double deltaRMatchingCut, vector< int > &map)
int j
Definition: DBlmapReader.cc:9
double f[11][100]
bool first
Definition: L1TdeRCT.cc:94
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:83
std::string const & triggerName(unsigned int index) const
Definition: TriggerNames.cc:27
std::vector< size_type > Keys
Definition: DDAxes.h:10
tuple size
Write out results.
Definition: DDAxes.h:10
void HeavyFlavorValidation::beginRun ( const Run iRun,
const EventSetup iSetup 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 127 of file HeavyFlavorValidation.cc.

References deltaEtaBins, deltaPhiBins, dimuonDRBins, dimuonEtaBins, dimuonPtBins, dqmFolder, dqmStore, filterNamesLevels, first, HltComparatorCreateWorkflow::hltConfig, i, HLTConfigProvider::init(), j, testEve_cfg::level, LogDebug, HLTConfigProvider::moduleLabels(), muonEtaBins, muonPhiBins, muonPtBins, myBook1D(), myBook2D(), myBookProfile2D(), mergeVDriftHistosByStation::name, cppFunctionSkipper::operator, DQMStore::setCurrentFolder(), DQMStore::setVerbose(), HLTConfigProvider::triggerNames(), triggerPathName, and triggerProcessName.

127  {
128 //discover HLT configuration
130  bool isChanged;
131  if(hltConfig.init(iRun, iSetup, triggerProcessName, isChanged)){
132  LogDebug("HLTriggerOfflineHeavyFlavor") << "Successfully initialized HLTConfigProvider with process name: "<<triggerProcessName<<endl;
133  }else{
134  LogWarning("HLTriggerOfflineHeavyFlavor") << "Could not initialize HLTConfigProvider with process name: "<<triggerProcessName<<endl;
135  return;
136  }
137  stringstream os;
138  vector<string> triggerNames = hltConfig.triggerNames();
139  for( size_t i = 0; i < triggerNames.size(); i++) {
140  TString triggerName = triggerNames[i];
141  if (triggerName.Contains(triggerPathName)){
142  vector<string> moduleNames = hltConfig.moduleLabels( triggerNames[i] );
143  for( size_t j = 0; j < moduleNames.size(); j++) {
144  TString name = moduleNames[j];
145  if(name.Contains("Filter")){
146  int level = 0;
147  if(name.Contains("L1"))
148  level = 1;
149  else if(name.Contains("L2"))
150  level = 2;
151  else if(name.Contains("L3"))
152  level = 3;
153  else if(name.Contains("mumuFilter") || name.Contains("JpsiTrackMass"))
154  level = 4;
155  filterNamesLevels.push_back( pair<string,int>(moduleNames[j],level) );
156  os<<" "<<moduleNames[j];
157  }
158  }
159  break;
160  }
161  }
162  if(filterNamesLevels.size()==0){
163  LogDebug("HLTriggerOfflineHeavyFlavor")<<"Bad Trigger Path: "<<triggerPathName<<endl;
164  return;
165  }else{
166  LogDebug("HLTriggerOfflineHeavyFlavor")<<"Trigger Path: "<<triggerPathName<<" has filters:"<<os.str();
167  }
168 
169 //create Monitor Elements
171  if( !dqmStore ){
172  LogError("HLTriggerOfflineHeavyFlavor") << "Could not find DQMStore service\n";
173  return;
174  }
175  dqmStore->setVerbose(0);
177 // Eta Pt Single
178  myBook2D( "genMuon_genEtaPt", muonEtaBins, "#mu eta", muonPtBins, " #mu pT (GeV)");
179  myBook2D( "globMuon_genEtaPt", muonEtaBins, "#mu eta", muonPtBins, " #mu pT (GeV)");
180  myBook2D( "globMuon_recoEtaPt", muonEtaBins, "#mu eta", muonPtBins, " #mu pT (GeV)");
181  for(size_t i=0; i<filterNamesLevels.size(); i++){
182  myBook2D( TString::Format("filt%dMuon_recoEtaPt",int(i+1)), muonEtaBins, "#mu eta", muonPtBins, " #mu pT (GeV)", filterNamesLevels[i].first);
183  }
184  myBook2D( "pathMuon_recoEtaPt", muonEtaBins, "#mu eta", muonPtBins, " #mu pT (GeV)", triggerPathName);
185  myBook2D( "resultMuon_recoEtaPt", muonEtaBins, "#mu eta", muonPtBins, " #mu pT (GeV)");
186 // Eta Pt Single Resolution
187  myBookProfile2D( "resGlobGen_genEtaPt", muonEtaBins, "#mu eta", muonPtBins, " #mu pT (GeV)");
188  for(size_t i=0; i<filterNamesLevels.size(); i++){
189  myBookProfile2D( TString::Format("resFilt%dGlob_recoEtaPt",int(i+1)), muonEtaBins, "#mu eta", muonPtBins, " #mu pT (GeV)", filterNamesLevels[i].first);
190  }
191  myBookProfile2D( "resPathGlob_recoEtaPt", muonEtaBins, "#mu eta", muonPtBins, " #mu pT (GeV)", triggerPathName);
192 // Eta Pt Double
193  myBook2D( "genDimuon_genEtaPt", dimuonEtaBins, "#mu#mu eta", dimuonPtBins, " #mu#mu pT (GeV)");
194  myBook2D( "globDimuon_genEtaPt", dimuonEtaBins, "#mu#mu eta", dimuonPtBins, " #mu#mu pT (GeV)");
195  myBook2D( "globDimuon_recoEtaPt", dimuonEtaBins, "#mu#mu eta", dimuonPtBins, " #mu#mu pT (GeV)");
196  for(size_t i=0; i<filterNamesLevels.size(); i++){
197  myBook2D( TString::Format("filt%dDimuon_recoEtaPt",int(i+1)), dimuonEtaBins, "#mu#mu eta", dimuonPtBins, " #mu#mu pT (GeV)", filterNamesLevels[i].first);
198  }
199  myBook2D( "pathDimuon_recoEtaPt", dimuonEtaBins, "#mu#mu eta", dimuonPtBins, " #mu#mu pT (GeV)", triggerPathName);
200  myBook2D( "resultDimuon_recoEtaPt", dimuonEtaBins, "#mu#mu eta", dimuonPtBins, " #mu#mu pT (GeV)");
201  for(size_t i=0; i<filterNamesLevels.size(); i++){
202  myBook2D( TString::Format("diFilt%dDimuon_recoEtaPt",int(i+1)), dimuonEtaBins, "#mu#mu eta", dimuonPtBins, " #mu#mu pT (GeV)", filterNamesLevels[i].first);
203  }
204  myBook2D( "diPathDimuon_recoEtaPt", dimuonEtaBins, "#mu#mu eta", dimuonPtBins, " #mu#mu pT (GeV)", triggerPathName);
205 // Eta Phi Single
206  myBook2D( "genMuon_genEtaPhi", muonEtaBins, "#mu eta", muonPhiBins, "#mu phi");
207  myBook2D( "globMuon_genEtaPhi", muonEtaBins, "#mu eta", muonPhiBins, "#mu phi");
208  myBook2D( "globMuon_recoEtaPhi", muonEtaBins, "#mu eta", muonPhiBins, "#mu phi");
209  for(size_t i=0; i<filterNamesLevels.size(); i++){
210  myBook2D( TString::Format("filt%dMuon_recoEtaPhi",int(i+1)), muonEtaBins, "#mu eta", muonPhiBins, "#mu phi", filterNamesLevels[i].first);
211  }
212  myBook2D( "pathMuon_recoEtaPhi", muonEtaBins, "#mu eta", muonPhiBins, "#mu phi", triggerPathName);
213  myBook2D( "resultMuon_recoEtaPhi", muonEtaBins, "#mu eta", muonPhiBins, "#mu phi");
214 // Rap Pt Double
215  myBook2D( "genDimuon_genRapPt", dimuonEtaBins, "#mu#mu rapidity", dimuonPtBins, " #mu#mu pT (GeV)");
216  myBook2D( "globDimuon_genRapPt", dimuonEtaBins, "#mu#mu rapidity", dimuonPtBins, " #mu#mu pT (GeV)");
217  myBook2D( "globDimuon_recoRapPt", dimuonEtaBins, "#mu#mu rapidity", dimuonPtBins, " #mu#mu pT (GeV)");
218  for(size_t i=0; i<filterNamesLevels.size(); i++){
219  myBook2D( TString::Format("filt%dDimuon_recoRapPt",int(i+1)), dimuonEtaBins, "#mu#mu rapidity", dimuonPtBins, " #mu#mu pT (GeV)", filterNamesLevels[i].first);
220  }
221  myBook2D( "pathDimuon_recoRapPt", dimuonEtaBins, "#mu#mu rapidity", dimuonPtBins, " #mu#mu pT (GeV)", triggerPathName);
222  myBook2D( "resultDimuon_recoRapPt", dimuonEtaBins, "#mu#mu rapidity", dimuonPtBins, " #mu#mu pT (GeV)");
223  for(size_t i=0; i<filterNamesLevels.size(); i++){
224  myBook2D( TString::Format("diFilt%dDimuon_recoRapPt",int(i+1)), dimuonEtaBins, "#mu#mu rapidity", dimuonPtBins, " #mu#mu pT (GeV)", filterNamesLevels[i].first);
225  }
226  myBook2D( "diPathDimuon_recoRapPt", dimuonEtaBins, "#mu#mu rapidity", dimuonPtBins, " #mu#mu pT (GeV)", triggerPathName);
227 // Pt DR Double
228  myBook2D( "genDimuon_genPtDR", dimuonPtBins, " #mu#mu pT (GeV)", dimuonDRBins, "#mu#mu #Delta R at IP");
229  myBook2D( "globDimuon_genPtDR", dimuonPtBins, " #mu#mu pT (GeV)", dimuonDRBins, "#mu#mu #Delta R at IP");
230  myBook2D( "globDimuon_recoPtDR", dimuonPtBins, " #mu#mu pT (GeV)", dimuonDRBins, "#mu#mu #Delta R at IP");
231  for(size_t i=0; i<filterNamesLevels.size(); i++){
232  myBook2D( TString::Format("filt%dDimuon_recoPtDR",int(i+1)), dimuonPtBins, " #mu#mu pT (GeV)", dimuonDRBins, "#mu#mu #Delta R at IP", filterNamesLevels[i].first);
233  }
234  myBook2D( "pathDimuon_recoPtDR", dimuonPtBins, " #mu#mu pT (GeV)", dimuonDRBins, "#mu#mu #Delta R at IP", triggerPathName);
235  for(size_t i=0; i<filterNamesLevels.size(); i++){
236  myBook2D( TString::Format("diFilt%dDimuon_recoPtDR",int(i+1)), dimuonPtBins, " #mu#mu pT (GeV)", dimuonDRBins, "#mu#mu #Delta R at IP", filterNamesLevels[i].first);
237  }
238  myBook2D( "diPathDimuon_recoPtDR", dimuonPtBins, " #mu#mu pT (GeV)", dimuonDRBins, "#mu#mu #Delta R at IP", triggerPathName);
239  myBook2D( "resultDimuon_recoPtDR", dimuonPtBins, " #mu#mu pT (GeV)", dimuonDRBins, "#mu#mu #Delta R at IP");
240 // Pt DRpos Double
241 // myBook2D( "genDimuon_genPtDRpos", dimuonPtBins, " #mu#mu pT (GeV)", dimuonDRBins, "#mu#mu #Delta R in MS");
242 // myBook2D( "globDimuon_genPtDRpos", dimuonPtBins, " #mu#mu pT (GeV)", dimuonDRBins, "#mu#mu #Delta R in MS");
243  myBook2D( "globDimuon_recoPtDRpos", dimuonPtBins, " #mu#mu pT (GeV)", dimuonDRBins, "#mu#mu #Delta R in MS");
244  for(size_t i=0; i<filterNamesLevels.size(); i++){
245  myBook2D( TString::Format("filt%dDimuon_recoPtDRpos",int(i+1)), dimuonPtBins, " #mu#mu pT (GeV)", dimuonDRBins, "#mu#mu #Delta R in MS", filterNamesLevels[i].first);
246  }
247  myBook2D( "pathDimuon_recoPtDRpos", dimuonPtBins, " #mu#mu pT (GeV)", dimuonDRBins, "#mu#mu #Delta R in MS", triggerPathName);
248  for(size_t i=0; i<filterNamesLevels.size(); i++){
249  myBook2D( TString::Format("diFilt%dDimuon_recoPtDRpos",int(i+1)), dimuonPtBins, " #mu#mu pT (GeV)", dimuonDRBins, "#mu#mu #Delta R in MS", filterNamesLevels[i].first);
250  }
251  myBook2D( "diPathDimuon_recoPtDRpos", dimuonPtBins, " #mu#mu pT (GeV)", dimuonDRBins, "#mu#mu #Delta R in MS", triggerPathName);
252  myBook2D( "resultDimuon_recoPtDRpos", dimuonPtBins, " #mu#mu pT (GeV)", dimuonDRBins, "#mu#mu #Delta R in MS");
253 
254 /* ME["genDimuon_genPt+Pt-"] = myBook2D( "genDimuon_genPt+Pt-", muonPtBins, "#mu+ pt (GeV)", muonPtBins, "#mu- pT (GeV)");
255  ME["genGlobDimuon_genPt+Pt-"] = myBook2D( "genGlobDimuon_genPt+Pt-", muonPtBins, "#mu+ pt (GeV)", muonPtBins, "#mu- pT (GeV)");
256  ME["genGlobDimuon_recoPt+Pt-"] = myBook2D( "genGlobDimuon_recoPt+Pt-", muonPtBins, "#mu+ pt (GeV)", muonPtBins, "#mu- pT (GeV)");
257  ME["genGlobL1Dimuon_recoPt+Pt-"] = myBook2D( "genGlobL1Dimuon_recoPt+Pt-", muonPtBins, "#mu+ pt (GeV)", muonPtBins, "#mu- pT (GeV)");
258  ME["genGlobL1L2Dimuon_recoPt+Pt-"] = myBook2D( "genGlobL1L2Dimuon_recoPt+Pt-", muonPtBins, "#mu+ pt (GeV)", muonPtBins, "#mu- pT (GeV)");
259  ME["genGlobL1L2L3Dimuon_recoPt+Pt-"] = myBook2D( "genGlobL1L2L3Dimuon_recoPt+Pt-", muonPtBins, "#mu+ pt (GeV)", muonPtBins, "#mu- pT (GeV)");*/
260 
261 // Matching
262  myBook2D( "globGen_deltaEtaDeltaPhi", deltaEtaBins, "#Delta eta", deltaPhiBins, "#Delta phi");
263  for(size_t i=0; i<filterNamesLevels.size(); i++){
264  myBook2D( TString::Format("filt%dGlob_deltaEtaDeltaPhi",int(i+1)), deltaEtaBins, "#Delta eta", deltaPhiBins, "#Delta phi", filterNamesLevels[i].first);
265  }
266  myBook2D( "pathGlob_deltaEtaDeltaPhi", deltaEtaBins, "#Delta eta", deltaPhiBins, "#Delta phi", triggerPathName);
267 // Size of containers
268  vector<double> sizeBins; sizeBins.push_back(10); sizeBins.push_back(0); sizeBins.push_back(10);
269  myBook1D( "genMuon_size", sizeBins, "container size" );
270  myBook1D( "globMuon_size", sizeBins, "container size" );
271  for(size_t i=0; i<filterNamesLevels.size(); i++){
272  myBook1D( TString::Format("filt%dMuon_size",int(i+1)), sizeBins, "container size", filterNamesLevels[i].first);
273  }
274  myBook1D( "pathMuon_size", sizeBins, "container size", triggerPathName );
275 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
const std::vector< std::string > & triggerNames() const
names of trigger paths
vector< pair< string, int > > filterNamesLevels
void myBook1D(TString name, vector< double > &xBins, TString label, TString title)
vector< double > dimuonEtaBins
int j
Definition: DBlmapReader.cc:9
void setVerbose(unsigned level)
Definition: DQMStore.cc:398
bool first
Definition: L1TdeRCT.cc:94
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
void myBookProfile2D(TString name, vector< double > &xBins, TString xLabel, vector< double > &yBins, TString yLabel, TString title)
void myBook2D(TString name, vector< double > &xBins, TString xLabel, vector< double > &yBins, TString yLabel, TString title)
tuple level
Definition: testEve_cfg.py:34
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:434
void HeavyFlavorValidation::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 540 of file HeavyFlavorValidation.cc.

540  {
541 }
int HeavyFlavorValidation::getMotherId ( const Candidate p)
private

Definition at line 543 of file HeavyFlavorValidation.cc.

References reco::Candidate::mother(), and reco::Candidate::pdgId().

Referenced by analyze().

543  {
544  const Candidate* mother = p->mother();
545  if( mother ){
546  if( mother->pdgId() == p->pdgId() ){
547  return getMotherId(mother);
548  }else{
549  return mother->pdgId();
550  }
551  }else{
552  return 0;
553  }
554 }
virtual const Candidate * mother(size_type i=0) const =0
return pointer to mother
int getMotherId(const Candidate *p)
virtual int pdgId() const =0
PDG identifier.
void HeavyFlavorValidation::match ( MonitorElement me,
vector< LeafCandidate > &  from,
vector< LeafCandidate > &  to,
double  deltaRMatchingCut,
vector< int > &  map 
)
private

Definition at line 556 of file HeavyFlavorValidation.cc.

References PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, eta(), MonitorElement::Fill(), i, j, gen::k, and phi.

Referenced by analyze().

556  {
557  vector<double> dR(from.size());
558  for(size_t i=0; i<from.size(); i++){
559  map[i] = -1;
560  dR[i] = 10.;
561  //find closest
562  for(size_t j=0; j<to.size(); j++){
563  double dRtmp = deltaR<double>(from[i].eta(), from[i].phi(), to[j].eta(), to[j].phi());
564  if( dRtmp < dR[i] ){
565  dR[i] = dRtmp;
566  map[i] = j;
567  }
568  }
569  //fill matching histo
570  if( map[i] != -1 ){
571  me->Fill( to[map[i]].eta()-from[i].eta(), deltaPhi<double>(to[map[i]].phi(), from[i].phi()) );
572  }
573  //apply matching cut
574  if( dR[i] > dRMatchingCut ){
575  map[i] = -1;
576  }
577  //remove duplication
578  if( map[i] != -1 ){
579  for(size_t k=0; k<i; k++){
580  if( map[k] != -1 && map[i] == map[k] ){
581  if( dR[i] < dR[k] ){
582  map[k] = -1;
583  }else{
584  map[i] = -1;
585  }
586  break;
587  }
588  }
589  }
590  }
591 }
int i
Definition: DBlmapReader.cc:9
T eta() const
dictionary map
Definition: Association.py:205
void Fill(long long x)
int j
Definition: DBlmapReader.cc:9
int k[5][pyjets_maxn]
Definition: DDAxes.h:10
void HeavyFlavorValidation::myBook1D ( TString  name,
vector< double > &  xBins,
TString  label,
TString  title 
)
private

Definition at line 635 of file HeavyFlavorValidation.cc.

References DQMStore::book1D(), dqmStore, h, i, and mergeVDriftHistosByStation::name.

Referenced by beginRun().

636 {
637 // dqmStore->setCurrentFolder(dqmFolder+"/"+folder);
638  int binsN = bins.size()==3 ? (int)bins[0]+1 : bins.size();
639  Double_t *myBins = new Double_t[ binsN ];
640  for(int i=0; i<binsN; i++){
641  myBins[i] = bins.size()==3 ? bins[1] + i*(bins[2]-bins[1])/bins[0] : bins[i] ;
642  }
643  TH1F *h = new TH1F( name, name, binsN-1, myBins );
644  h->SetXTitle(label);
645  h->SetTitle(title);
646  ME[name] = dqmStore->book1D( name.Data(), h );
647  delete h;
648 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:722
Definition: ME.h:11
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
void HeavyFlavorValidation::myBook1D ( TString  name,
vector< double > &  xBins,
TString  label 
)
inlineprivate

Definition at line 71 of file HeavyFlavorValidation.cc.

71  {
72  myBook1D( name, xBins, label, name );
73  }
void myBook1D(TString name, vector< double > &xBins, TString label, TString title)
void HeavyFlavorValidation::myBook2D ( TString  name,
vector< double > &  xBins,
TString  xLabel,
vector< double > &  yBins,
TString  yLabel,
TString  title 
)
private

Definition at line 593 of file HeavyFlavorValidation.cc.

References DQMStore::book2D(), dqmStore, eta(), h, i, and mergeVDriftHistosByStation::name.

Referenced by beginRun().

594 {
595 // dqmStore->setCurrentFolder(dqmFolder+"/"+folder);
596  int ptN = ptBins.size()==3 ? (int)ptBins[0]+1 : ptBins.size();
597  Double_t *pt = new Double_t[ ptN ];
598  for(int i=0; i<ptN; i++){
599  pt[i] = ptBins.size()==3 ? ptBins[1] + i*(ptBins[2]-ptBins[1])/ptBins[0] : ptBins[i] ;
600  }
601  int etaN = etaBins.size()==3 ? (int)etaBins[0]+1 : etaBins.size();
602  Double_t *eta = new Double_t[ etaN ];
603  for(int i=0; i<etaN; i++){
604  eta[i] = etaBins.size()==3 ? etaBins[1] + i*(etaBins[2]-etaBins[1])/etaBins[0] : etaBins[i] ;
605  }
606  TH2F *h = new TH2F( name, name, ptN-1, pt, etaN-1, eta );
607  h->SetXTitle(ptLabel);
608  h->SetYTitle(etaLabel);
609  h->SetTitle(title);
610  ME[name] = dqmStore->book2D( name.Data(), h );
611  delete h;
612 }
int i
Definition: DBlmapReader.cc:9
T eta() const
Definition: ME.h:11
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:850
void HeavyFlavorValidation::myBook2D ( TString  name,
vector< double > &  xBins,
TString  xLabel,
vector< double > &  yBins,
TString  yLabel 
)
inlineprivate

Definition at line 63 of file HeavyFlavorValidation.cc.

63  {
64  myBook2D( name, xBins, xLabel, yBins, yLabel, name);
65  }
void myBook2D(TString name, vector< double > &xBins, TString xLabel, vector< double > &yBins, TString yLabel, TString title)
void HeavyFlavorValidation::myBookProfile2D ( TString  name,
vector< double > &  xBins,
TString  xLabel,
vector< double > &  yBins,
TString  yLabel,
TString  title 
)
private

Definition at line 614 of file HeavyFlavorValidation.cc.

References DQMStore::bookProfile2D(), dqmStore, eta(), h, i, and mergeVDriftHistosByStation::name.

Referenced by beginRun().

615 {
616 // dqmStore->setCurrentFolder(dqmFolder+"/"+folder);
617  int ptN = ptBins.size()==3 ? (int)ptBins[0]+1 : ptBins.size();
618  Double_t *pt = new Double_t[ ptN ];
619  for(int i=0; i<ptN; i++){
620  pt[i] = ptBins.size()==3 ? ptBins[1] + i*(ptBins[2]-ptBins[1])/ptBins[0] : ptBins[i] ;
621  }
622  int etaN = etaBins.size()==3 ? (int)etaBins[0]+1 : etaBins.size();
623  Double_t *eta = new Double_t[ etaN ];
624  for(int i=0; i<etaN; i++){
625  eta[i] = etaBins.size()==3 ? etaBins[1] + i*(etaBins[2]-etaBins[1])/etaBins[0] : etaBins[i] ;
626  }
627  TProfile2D *h = new TProfile2D( name, name, ptN-1, pt, etaN-1, eta );
628  h->SetXTitle(ptLabel);
629  h->SetYTitle(etaLabel);
630  h->SetTitle(title);
631  ME[name] = dqmStore->bookProfile2D( name.Data(), h );
632  delete h;
633 }
int i
Definition: DBlmapReader.cc:9
T eta() const
Definition: ME.h:11
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
MonitorElement * bookProfile2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, const char *option="s")
Definition: DQMStore.cc:1180
void HeavyFlavorValidation::myBookProfile2D ( TString  name,
vector< double > &  xBins,
TString  xLabel,
vector< double > &  yBins,
TString  yLabel 
)
inlineprivate

Definition at line 67 of file HeavyFlavorValidation.cc.

67  {
68  myBookProfile2D( name, xBins, xLabel, yBins, yLabel, name);
69  }
void myBookProfile2D(TString name, vector< double > &xBins, TString xLabel, vector< double > &yBins, TString yLabel, TString title)

Member Data Documentation

vector<double> HeavyFlavorValidation::deltaEtaBins
private

Definition at line 87 of file HeavyFlavorValidation.cc.

Referenced by beginRun().

vector<double> HeavyFlavorValidation::deltaPhiBins
private

Definition at line 88 of file HeavyFlavorValidation.cc.

Referenced by beginRun().

vector<double> HeavyFlavorValidation::dimuonDRBins
private

Definition at line 94 of file HeavyFlavorValidation.cc.

Referenced by beginRun().

vector<double> HeavyFlavorValidation::dimuonEtaBins
private

Definition at line 93 of file HeavyFlavorValidation.cc.

Referenced by beginRun().

vector<double> HeavyFlavorValidation::dimuonPtBins
private

Definition at line 92 of file HeavyFlavorValidation.cc.

Referenced by beginRun().

string HeavyFlavorValidation::dqmFolder
private

Definition at line 74 of file HeavyFlavorValidation.cc.

Referenced by beginRun().

DQMStore* HeavyFlavorValidation::dqmStore
private

Definition at line 95 of file HeavyFlavorValidation.cc.

Referenced by analyze(), beginRun(), myBook1D(), myBook2D(), and myBookProfile2D().

vector<pair<string,int> > HeavyFlavorValidation::filterNamesLevels
private

Definition at line 97 of file HeavyFlavorValidation.cc.

Referenced by analyze(), and beginRun().

double HeavyFlavorValidation::genGlobDeltaRMatchingCut
private

Definition at line 83 of file HeavyFlavorValidation.cc.

Referenced by analyze().

InputTag HeavyFlavorValidation::genParticlesTag
private

Definition at line 81 of file HeavyFlavorValidation.cc.

Referenced by analyze().

double HeavyFlavorValidation::globL1DeltaRMatchingCut
private

Definition at line 84 of file HeavyFlavorValidation.cc.

Referenced by analyze().

double HeavyFlavorValidation::globL2DeltaRMatchingCut
private

Definition at line 85 of file HeavyFlavorValidation.cc.

Referenced by analyze().

double HeavyFlavorValidation::globL3DeltaRMatchingCut
private

Definition at line 86 of file HeavyFlavorValidation.cc.

Referenced by analyze().

map<TString, MonitorElement *> HeavyFlavorValidation::ME
private

Definition at line 96 of file HeavyFlavorValidation.cc.

vector<int> HeavyFlavorValidation::motherIDs
private

Definition at line 82 of file HeavyFlavorValidation.cc.

Referenced by analyze().

vector<double> HeavyFlavorValidation::muonEtaBins
private

Definition at line 90 of file HeavyFlavorValidation.cc.

Referenced by beginRun().

const double HeavyFlavorValidation::muonMass
private

Definition at line 98 of file HeavyFlavorValidation.cc.

Referenced by analyze().

vector<double> HeavyFlavorValidation::muonPhiBins
private

Definition at line 91 of file HeavyFlavorValidation.cc.

Referenced by beginRun().

vector<double> HeavyFlavorValidation::muonPtBins
private

Definition at line 89 of file HeavyFlavorValidation.cc.

Referenced by beginRun().

InputTag HeavyFlavorValidation::recoMuonsTag
private

Definition at line 80 of file HeavyFlavorValidation.cc.

Referenced by analyze().

string HeavyFlavorValidation::triggerPathName
private

Definition at line 76 of file HeavyFlavorValidation.cc.

Referenced by analyze(), and beginRun().

string HeavyFlavorValidation::triggerProcessName
private

Definition at line 75 of file HeavyFlavorValidation.cc.

Referenced by analyze(), and beginRun().

InputTag HeavyFlavorValidation::triggerResultsTag
private

Definition at line 79 of file HeavyFlavorValidation.cc.

Referenced by analyze().

InputTag HeavyFlavorValidation::triggerSummaryAODTag
private

Definition at line 78 of file HeavyFlavorValidation.cc.

Referenced by analyze().

InputTag HeavyFlavorValidation::triggerSummaryRAWTag
private

Definition at line 77 of file HeavyFlavorValidation.cc.

Referenced by analyze().