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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &) override
 
virtual void beginRun (const Run &iRun, const EventSetup &iSetup) override
 
virtual void endJob () override
 
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
 
EDGetTokenT
< GenParticleCollection
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
 
EDGetTokenT< MuonCollectionrecoMuonsTag
 
string triggerPathName
 
string triggerProcessName
 
EDGetTokenT< TriggerResultstriggerResultsTag
 
EDGetTokenT< TriggerEventtriggerSummaryAODTag
 
EDGetTokenT< TriggerEventWithRefstriggerSummaryRAWTag
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- 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::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 103 of file HeavyFlavorValidation.cc.

References genParticlesTag, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), recoMuonsTag, triggerProcessName, triggerResultsTag, triggerSummaryAODTag, and triggerSummaryRAWTag.

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

Definition at line 653 of file HeavyFlavorValidation.cc.

653  {
654 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 280 of file HeavyFlavorValidation.cc.

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

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

Reimplemented from edm::EDAnalyzer.

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

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

Reimplemented from edm::EDAnalyzer.

Definition at line 543 of file HeavyFlavorValidation.cc.

543  {
544 }
int HeavyFlavorValidation::getMotherId ( const Candidate p)
private

Definition at line 546 of file HeavyFlavorValidation.cc.

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

Referenced by analyze().

546  {
547  const Candidate* mother = p->mother();
548  if( mother ){
549  if( mother->pdgId() == p->pdgId() ){
550  return getMotherId(mother);
551  }else{
552  return mother->pdgId();
553  }
554  }else{
555  return 0;
556  }
557 }
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 559 of file HeavyFlavorValidation.cc.

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

Referenced by analyze().

559  {
560  vector<double> dR(from.size());
561  for(size_t i=0; i<from.size(); i++){
562  map[i] = -1;
563  dR[i] = 10.;
564  //find closest
565  for(size_t j=0; j<to.size(); j++){
566  double dRtmp = deltaR<double>(from[i].eta(), from[i].phi(), to[j].eta(), to[j].phi());
567  if( dRtmp < dR[i] ){
568  dR[i] = dRtmp;
569  map[i] = j;
570  }
571  }
572  //fill matching histo
573  if( map[i] != -1 ){
574  me->Fill( to[map[i]].eta()-from[i].eta(), deltaPhi<double>(to[map[i]].phi(), from[i].phi()) );
575  }
576  //apply matching cut
577  if( dR[i] > dRMatchingCut ){
578  map[i] = -1;
579  }
580  //remove duplication
581  if( map[i] != -1 ){
582  for(size_t k=0; k<i; k++){
583  if( map[k] != -1 && map[i] == map[k] ){
584  if( dR[i] < dR[k] ){
585  map[k] = -1;
586  }else{
587  map[i] = -1;
588  }
589  break;
590  }
591  }
592  }
593  }
594 }
int i
Definition: DBlmapReader.cc:9
T eta() const
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 638 of file HeavyFlavorValidation.cc.

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

Referenced by beginRun().

639 {
640 // dqmStore->setCurrentFolder(dqmFolder+"/"+folder);
641  int binsN = bins.size()==3 ? (int)bins[0]+1 : bins.size();
642  Double_t *myBins = new Double_t[ binsN ];
643  for(int i=0; i<binsN; i++){
644  myBins[i] = bins.size()==3 ? bins[1] + i*(bins[2]-bins[1])/bins[0] : bins[i] ;
645  }
646  TH1F *h = new TH1F( name, name, binsN-1, myBins );
647  h->SetXTitle(label);
648  h->SetTitle(title);
649  ME[name] = dqmStore->book1D( name.Data(), h );
650  delete h;
651 }
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:872
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 596 of file HeavyFlavorValidation.cc.

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

Referenced by beginRun().

597 {
598 // dqmStore->setCurrentFolder(dqmFolder+"/"+folder);
599  int ptN = ptBins.size()==3 ? (int)ptBins[0]+1 : ptBins.size();
600  Double_t *pt = new Double_t[ ptN ];
601  for(int i=0; i<ptN; i++){
602  pt[i] = ptBins.size()==3 ? ptBins[1] + i*(ptBins[2]-ptBins[1])/ptBins[0] : ptBins[i] ;
603  }
604  int etaN = etaBins.size()==3 ? (int)etaBins[0]+1 : etaBins.size();
605  Double_t *eta = new Double_t[ etaN ];
606  for(int i=0; i<etaN; i++){
607  eta[i] = etaBins.size()==3 ? etaBins[1] + i*(etaBins[2]-etaBins[1])/etaBins[0] : etaBins[i] ;
608  }
609  TH2F *h = new TH2F( name, name, ptN-1, pt, etaN-1, eta );
610  h->SetXTitle(ptLabel);
611  h->SetYTitle(etaLabel);
612  h->SetTitle(title);
613  ME[name] = dqmStore->book2D( name.Data(), h );
614  delete h;
615 }
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:1000
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 617 of file HeavyFlavorValidation.cc.

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

Referenced by beginRun().

618 {
619 // dqmStore->setCurrentFolder(dqmFolder+"/"+folder);
620  int ptN = ptBins.size()==3 ? (int)ptBins[0]+1 : ptBins.size();
621  Double_t *pt = new Double_t[ ptN ];
622  for(int i=0; i<ptN; i++){
623  pt[i] = ptBins.size()==3 ? ptBins[1] + i*(ptBins[2]-ptBins[1])/ptBins[0] : ptBins[i] ;
624  }
625  int etaN = etaBins.size()==3 ? (int)etaBins[0]+1 : etaBins.size();
626  Double_t *eta = new Double_t[ etaN ];
627  for(int i=0; i<etaN; i++){
628  eta[i] = etaBins.size()==3 ? etaBins[1] + i*(etaBins[2]-etaBins[1])/etaBins[0] : etaBins[i] ;
629  }
630  TProfile2D *h = new TProfile2D( name, name, ptN-1, pt, etaN-1, eta );
631  h->SetXTitle(ptLabel);
632  h->SetYTitle(etaLabel);
633  h->SetTitle(title);
634  ME[name] = dqmStore->bookProfile2D( name.Data(), h );
635  delete h;
636 }
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:1330
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 89 of file HeavyFlavorValidation.cc.

Referenced by beginRun().

vector<double> HeavyFlavorValidation::deltaPhiBins
private

Definition at line 90 of file HeavyFlavorValidation.cc.

Referenced by beginRun().

vector<double> HeavyFlavorValidation::dimuonDRBins
private

Definition at line 96 of file HeavyFlavorValidation.cc.

Referenced by beginRun().

vector<double> HeavyFlavorValidation::dimuonEtaBins
private

Definition at line 95 of file HeavyFlavorValidation.cc.

Referenced by beginRun().

vector<double> HeavyFlavorValidation::dimuonPtBins
private

Definition at line 94 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 97 of file HeavyFlavorValidation.cc.

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

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

Definition at line 99 of file HeavyFlavorValidation.cc.

Referenced by analyze(), and beginRun().

double HeavyFlavorValidation::genGlobDeltaRMatchingCut
private

Definition at line 85 of file HeavyFlavorValidation.cc.

Referenced by analyze().

EDGetTokenT<GenParticleCollection> HeavyFlavorValidation::genParticlesTag
private

Definition at line 82 of file HeavyFlavorValidation.cc.

Referenced by analyze(), and HeavyFlavorValidation().

double HeavyFlavorValidation::globL1DeltaRMatchingCut
private

Definition at line 86 of file HeavyFlavorValidation.cc.

Referenced by analyze().

double HeavyFlavorValidation::globL2DeltaRMatchingCut
private

Definition at line 87 of file HeavyFlavorValidation.cc.

Referenced by analyze().

double HeavyFlavorValidation::globL3DeltaRMatchingCut
private

Definition at line 88 of file HeavyFlavorValidation.cc.

Referenced by analyze().

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

Definition at line 98 of file HeavyFlavorValidation.cc.

vector<int> HeavyFlavorValidation::motherIDs
private

Definition at line 84 of file HeavyFlavorValidation.cc.

Referenced by analyze().

vector<double> HeavyFlavorValidation::muonEtaBins
private

Definition at line 92 of file HeavyFlavorValidation.cc.

Referenced by beginRun().

const double HeavyFlavorValidation::muonMass
private

Definition at line 100 of file HeavyFlavorValidation.cc.

Referenced by analyze().

vector<double> HeavyFlavorValidation::muonPhiBins
private

Definition at line 93 of file HeavyFlavorValidation.cc.

Referenced by beginRun().

vector<double> HeavyFlavorValidation::muonPtBins
private

Definition at line 91 of file HeavyFlavorValidation.cc.

Referenced by beginRun().

EDGetTokenT<MuonCollection> HeavyFlavorValidation::recoMuonsTag
private

Definition at line 81 of file HeavyFlavorValidation.cc.

Referenced by analyze(), and HeavyFlavorValidation().

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(), beginRun(), and HeavyFlavorValidation().

EDGetTokenT<TriggerResults> HeavyFlavorValidation::triggerResultsTag
private

Definition at line 80 of file HeavyFlavorValidation.cc.

Referenced by analyze(), and HeavyFlavorValidation().

EDGetTokenT<TriggerEvent> HeavyFlavorValidation::triggerSummaryAODTag
private

Definition at line 79 of file HeavyFlavorValidation.cc.

Referenced by analyze(), and HeavyFlavorValidation().

EDGetTokenT<TriggerEventWithRefs> HeavyFlavorValidation::triggerSummaryRAWTag
private

Definition at line 78 of file HeavyFlavorValidation.cc.

Referenced by analyze(), and HeavyFlavorValidation().