CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
B2GHadronicHLTValidation Class Reference

#include <B2GHadronicHLTValidation.h>

Inheritance diagram for B2GHadronicHLTValidation:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Member Functions

 B2GHadronicHLTValidation (const edm::ParameterSet &)
 
 ~B2GHadronicHLTValidation () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
std::string monitorPath (const std::string &label) const
 
void triggerBinLabels (const std::vector< std::string > &labels)
 set configurable labels for trigger monitoring histograms More...
 

Private Attributes

double etaJets_
 
MonitorElementhDenJetEta
 
MonitorElementhDenJetPt
 
MonitorElementhDenTriggerMon
 
MonitorElementhNumJetEta
 
MonitorElementhNumJetPt
 
MonitorElementhNumTriggerMon
 
double htMin_
 
bool isAll_ = false
 
bool isSel_ = false
 
edm::Ptr< reco::Jetjet_
 
unsigned int minJets_
 
double ptJets0_
 
double ptJets1_
 
double ptJets_
 
std::string sDir_
 
std::string sJets_
 
std::string sTrigger_
 
edm::EDGetTokenT< edm::View< reco::Jet > > tokJets_
 
edm::EDGetTokenT< edm::TriggerResultstokTrigger_
 
std::vector< std::string > vsPaths_
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

HLTriggerOffline/B2G/interface/B2GHadronicHLTValidation.h

Description: compute efficiencies of trigger paths on offline reco selection with respect to pt and eta

Implementation: harvesting

HLTriggerOffline/B2G/src/B2GHadronicHLTValidation.cc

Description:

Description: compute efficiencies of trigger paths on offline reco selection with respect to pt and eta

Implementation: harvesting

Definition at line 49 of file B2GHadronicHLTValidation.h.

Constructor & Destructor Documentation

◆ B2GHadronicHLTValidation()

B2GHadronicHLTValidation::B2GHadronicHLTValidation ( const edm::ParameterSet iConfig)
inlineexplicit

Definition at line 111 of file B2GHadronicHLTValidation.h.

References HLT_2022v12_cff::InputTag, sJets_, sTrigger_, tokJets_, and tokTrigger_.

112  : sDir_(iConfig.getUntrackedParameter<std::string>("sDir", "HLTValidation/B2G/Efficiencies/")),
113  sJets_(iConfig.getUntrackedParameter<std::string>("sJets", "ak5PFJets")),
114  ptJets_(iConfig.getUntrackedParameter<double>("ptJets", 0.)),
115  ptJets0_(iConfig.getUntrackedParameter<double>("ptJets0", 0.)),
116  ptJets1_(iConfig.getUntrackedParameter<double>("ptJets1", 0.)),
117  etaJets_(iConfig.getUntrackedParameter<double>("etaJets", 0.)),
118  minJets_(iConfig.getUntrackedParameter<unsigned int>("minJets", 0)),
119  htMin_(iConfig.getUntrackedParameter<double>("htMin", 0.0)),
120  sTrigger_(iConfig.getUntrackedParameter<std::string>("sTrigger", "TriggerResults")),
121  vsPaths_(iConfig.getUntrackedParameter<std::vector<std::string>>("vsPaths"))
122 
123 {
124  // Jets
125  tokJets_ = consumes<edm::View<reco::Jet>>(edm::InputTag(sJets_));
126  // Trigger
127  tokTrigger_ = consumes<edm::TriggerResults>(edm::InputTag(sTrigger_, "", "HLT"));
128 }
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< edm::TriggerResults > tokTrigger_
edm::EDGetTokenT< edm::View< reco::Jet > > tokJets_
std::vector< std::string > vsPaths_

◆ ~B2GHadronicHLTValidation()

B2GHadronicHLTValidation::~B2GHadronicHLTValidation ( )
inlineoverride

Definition at line 130 of file B2GHadronicHLTValidation.h.

130  {
131  // do anything here that needs to be done at desctruction time
132  // (e.g. close files, deallocate resources etc.)
133 }

Member Function Documentation

◆ analyze()

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

Reimplemented from DQMEDAnalyzer.

Definition at line 45 of file B2GHadronicHLTValidation.cc.

References reco::LeafCandidate::eta(), etaJets_, dqm::impl::MonitorElement::Fill(), hDenJetEta, hDenJetPt, hDenTriggerMon, hNumJetEta, hNumJetPt, hNumTriggerMon, htMin_, mps_fire::i, heavyIonCSV_trainingSettings::idx, iEvent, isAll_, edm::Ptr< T >::isNonnull(), isSel_, dqmiolumiharvest::j, jet_, PDWG_EXODelayedJetMET_cff::jets, minJets_, Skims_PA_cff::name, reco::LeafCandidate::pt(), ptJets0_, ptJets1_, ptJets_, tokJets_, tokTrigger_, L1TEGammaOffline_cfi::triggerNames, and vsPaths_.

45  {
46  using namespace edm;
47 
48  isAll_ = false;
49  isSel_ = false;
50 
51  // Jets
53  if (!iEvent.getByToken(tokJets_, jets))
54  edm::LogWarning("B2GHadronicHLTValidation") << "Jets collection not found \n";
55  unsigned int nGoodJ = 0;
56  double ht = 0.0;
57  // Check to see if we want asymmetric jet pt cuts
58  if (ptJets0_ > 0.0 || ptJets1_ > 0.0) {
59  if (ptJets0_ > 0.0) {
60  if (!jets->empty() && jets->at(0).pt() > ptJets0_) {
61  nGoodJ++;
62  jet_ = jets->ptrAt(0);
63  }
64  }
65  if (ptJets1_ > 0.0) {
66  if (jets->size() > 1 && jets->at(1).pt() > ptJets1_) {
67  nGoodJ++;
68  jet_ = jets->ptrAt(1);
69  }
70  }
71  } else if (minJets_ > 0 || htMin_ > 0) {
72  for (edm::View<reco::Jet>::const_iterator j = jets->begin(); j != jets->end(); ++j) {
73  if (j->pt() < ptJets_)
74  continue;
75  if (fabs(j->eta()) > etaJets_)
76  continue;
77  nGoodJ++;
78  ht += j->pt();
79  if (nGoodJ == minJets_)
80  jet_ = jets->ptrAt(j - jets->begin());
81  }
82  }
83 
84  if (nGoodJ >= minJets_ || ht > htMin_)
85  isAll_ = true;
86 
87  // Trigger
88  Handle<edm::TriggerResults> triggerTable;
89  if (!iEvent.getByToken(tokTrigger_, triggerTable))
90  edm::LogWarning("B2GHadronicHLTValidation") << "Trigger collection not found \n";
91  const edm::TriggerNames &triggerNames = iEvent.triggerNames(*triggerTable);
92  bool isInteresting = false;
93  for (unsigned int i = 0; i < triggerNames.triggerNames().size(); ++i) {
94  TString name = triggerNames.triggerNames()[i].c_str();
95  for (unsigned int j = 0; j < vsPaths_.size(); j++) {
96  if (name.Contains(TString(vsPaths_[j]), TString::kIgnoreCase)) {
97  isInteresting = true;
98  break;
99  }
100  }
101  if (isInteresting)
102  break;
103  }
104 
105  if (isAll_ && isInteresting)
106  isSel_ = true;
107  else
108  isSel_ = false;
109 
110  // Histos
111  if (isAll_) {
112  if (jet_.isNonnull()) {
113  hDenJetPt->Fill(jet_->pt());
114  hDenJetEta->Fill(jet_->eta());
115  }
116  for (unsigned int idx = 0; idx < vsPaths_.size(); ++idx) {
117  hDenTriggerMon->Fill(idx + 0.5);
118  }
119  }
120  if (isSel_) {
121  hNumJetPt->Fill(jet_->pt());
122  hNumJetEta->Fill(jet_->eta());
123  for (unsigned int i = 0; i < triggerNames.triggerNames().size(); ++i) {
124  TString name = triggerNames.triggerNames()[i].c_str();
125  for (unsigned int j = 0; j < vsPaths_.size(); j++) {
126  if (name.Contains(TString(vsPaths_[j]), TString::kIgnoreCase)) {
127  hNumTriggerMon->Fill(j + 0.5);
128  }
129  }
130  }
131  }
132 }
double pt() const final
transverse momentum
void Fill(long long x)
edm::EDGetTokenT< edm::TriggerResults > tokTrigger_
int iEvent
Definition: GenABIO.cc:224
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:146
HLT enums.
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
edm::EDGetTokenT< edm::View< reco::Jet > > tokJets_
std::vector< std::string > vsPaths_
double eta() const final
momentum pseudorapidity

◆ bookHistograms()

void B2GHadronicHLTValidation::bookHistograms ( DQMStore::IBooker dbe,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprivatevirtual

Implements DQMEDAnalyzer.

Definition at line 135 of file B2GHadronicHLTValidation.cc.

References dqm::implementation::IBooker::book1D(), hDenJetEta, hDenJetPt, hDenTriggerMon, hNumJetEta, hNumJetPt, hNumTriggerMon, sDir_, dqm::implementation::NavigatorBase::setCurrentFolder(), triggerBinLabels(), and vsPaths_.

135  {
136  dbe.setCurrentFolder(sDir_);
137  hDenJetPt = dbe.book1D("PtLastJetAll", "PtLastJetAll", 60, 0., 3000.);
138  hDenJetEta = dbe.book1D("EtaLastJetAll", "EtaLastJetAll", 30, -3., 3.);
139  hNumJetPt = dbe.book1D("PtLastJetSel", "PtLastJetSel", 60, 0., 3000.);
140  hNumJetEta = dbe.book1D("EtaLastJetSel", "EtaLastJetSel", 30, -3., 3.);
141  // determine number of bins for trigger monitoring
142  unsigned int nPaths = vsPaths_.size();
143  // monitored trigger occupancy for single lepton triggers
144  hNumTriggerMon = dbe.book1D("TriggerMonSel", "TriggerMonSel", nPaths, 0., nPaths);
145  hDenTriggerMon = dbe.book1D("TriggerMonAll", "TriggerMonAll", nPaths, 0., nPaths);
146  // set bin labels for trigger monitoring
148 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
void triggerBinLabels(const std::vector< std::string > &labels)
set configurable labels for trigger monitoring histograms
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
std::vector< std::string > vsPaths_

◆ fillDescriptions()

void B2GHadronicHLTValidation::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 152 of file B2GHadronicHLTValidation.cc.

References edm::ConfigurationDescriptions::addDefault(), and submitPVResolutionJobs::desc.

152  {
153  // The following says we do not know what parameters are allowed so do no
154  // validation
155  // Please change this to state exactly what you do use, even if it is no
156  // parameters
158  desc.setUnknown();
159  descriptions.addDefault(desc);
160 }
void addDefault(ParameterSetDescription const &psetDescription)

◆ monitorPath()

std::string B2GHadronicHLTValidation::monitorPath ( const std::string &  label) const
inlineprivate

deduce monitorPath from label, the label is expected to be of type 'selectionPath:monitorPath'

Definition at line 61 of file B2GHadronicHLTValidation.h.

References label.

Referenced by triggerBinLabels().

61 { return label.substr(label.find(':') + 1); };
char const * label

◆ triggerBinLabels()

void B2GHadronicHLTValidation::triggerBinLabels ( const std::vector< std::string > &  labels)
inlineprivate

set configurable labels for trigger monitoring histograms

Definition at line 93 of file B2GHadronicHLTValidation.h.

References hDenTriggerMon, hNumTriggerMon, heavyIonCSV_trainingSettings::idx, SummaryClient_cfi::labels, monitorPath(), and dqm::impl::MonitorElement::setBinLabel().

Referenced by bookHistograms().

93  {
94  for (unsigned int idx = 0; idx < labels.size(); ++idx) {
95  hNumTriggerMon->setBinLabel(idx + 1, "[" + monitorPath(labels[idx]) + "]", 1);
96  hDenTriggerMon->setBinLabel(idx + 1, "[" + monitorPath(labels[idx]) + "]", 1);
97  }
98 }
std::string monitorPath(const std::string &label) const
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)

Member Data Documentation

◆ etaJets_

double B2GHadronicHLTValidation::etaJets_
private

Definition at line 81 of file B2GHadronicHLTValidation.h.

Referenced by analyze().

◆ hDenJetEta

MonitorElement* B2GHadronicHLTValidation::hDenJetEta
private

Definition at line 71 of file B2GHadronicHLTValidation.h.

Referenced by analyze(), and bookHistograms().

◆ hDenJetPt

MonitorElement* B2GHadronicHLTValidation::hDenJetPt
private

Definition at line 69 of file B2GHadronicHLTValidation.h.

Referenced by analyze(), and bookHistograms().

◆ hDenTriggerMon

MonitorElement* B2GHadronicHLTValidation::hDenTriggerMon
private

Definition at line 73 of file B2GHadronicHLTValidation.h.

Referenced by analyze(), bookHistograms(), and triggerBinLabels().

◆ hNumJetEta

MonitorElement* B2GHadronicHLTValidation::hNumJetEta
private

Definition at line 70 of file B2GHadronicHLTValidation.h.

Referenced by analyze(), and bookHistograms().

◆ hNumJetPt

MonitorElement* B2GHadronicHLTValidation::hNumJetPt
private

Definition at line 68 of file B2GHadronicHLTValidation.h.

Referenced by analyze(), and bookHistograms().

◆ hNumTriggerMon

MonitorElement* B2GHadronicHLTValidation::hNumTriggerMon
private

Definition at line 72 of file B2GHadronicHLTValidation.h.

Referenced by analyze(), bookHistograms(), and triggerBinLabels().

◆ htMin_

double B2GHadronicHLTValidation::htMin_
private

Definition at line 83 of file B2GHadronicHLTValidation.h.

Referenced by analyze().

◆ isAll_

bool B2GHadronicHLTValidation::isAll_ = false
private

Definition at line 89 of file B2GHadronicHLTValidation.h.

Referenced by analyze().

◆ isSel_

bool B2GHadronicHLTValidation::isSel_ = false
private

Definition at line 90 of file B2GHadronicHLTValidation.h.

Referenced by analyze().

◆ jet_

edm::Ptr<reco::Jet> B2GHadronicHLTValidation::jet_
private

Definition at line 75 of file B2GHadronicHLTValidation.h.

Referenced by analyze().

◆ minJets_

unsigned int B2GHadronicHLTValidation::minJets_
private

Definition at line 82 of file B2GHadronicHLTValidation.h.

Referenced by analyze().

◆ ptJets0_

double B2GHadronicHLTValidation::ptJets0_
private

Definition at line 79 of file B2GHadronicHLTValidation.h.

Referenced by analyze().

◆ ptJets1_

double B2GHadronicHLTValidation::ptJets1_
private

Definition at line 80 of file B2GHadronicHLTValidation.h.

Referenced by analyze().

◆ ptJets_

double B2GHadronicHLTValidation::ptJets_
private

Definition at line 78 of file B2GHadronicHLTValidation.h.

Referenced by analyze().

◆ sDir_

std::string B2GHadronicHLTValidation::sDir_
private

Definition at line 67 of file B2GHadronicHLTValidation.h.

Referenced by bookHistograms().

◆ sJets_

std::string B2GHadronicHLTValidation::sJets_
private

Definition at line 76 of file B2GHadronicHLTValidation.h.

Referenced by B2GHadronicHLTValidation().

◆ sTrigger_

std::string B2GHadronicHLTValidation::sTrigger_
private

Definition at line 85 of file B2GHadronicHLTValidation.h.

Referenced by B2GHadronicHLTValidation().

◆ tokJets_

edm::EDGetTokenT<edm::View<reco::Jet> > B2GHadronicHLTValidation::tokJets_
private

Definition at line 77 of file B2GHadronicHLTValidation.h.

Referenced by analyze(), and B2GHadronicHLTValidation().

◆ tokTrigger_

edm::EDGetTokenT<edm::TriggerResults> B2GHadronicHLTValidation::tokTrigger_
private

Definition at line 86 of file B2GHadronicHLTValidation.h.

Referenced by analyze(), and B2GHadronicHLTValidation().

◆ vsPaths_

std::vector<std::string> B2GHadronicHLTValidation::vsPaths_
private

Definition at line 87 of file B2GHadronicHLTValidation.h.

Referenced by analyze(), and bookHistograms().