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::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

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
 
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual void dqmBeginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
virtual void dqmEndLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmEndRun (edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &, edm::EventSetup const &) final
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

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::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::ProducerBase
ProducesCollector producesCollector ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

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 ( const edm::ParameterSet iConfig)
explicit

Definition at line 111 of file B2GHadronicHLTValidation.h.

References HLT_2018_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 ( )
override

Definition at line 130 of file B2GHadronicHLTValidation.h.

References DEFINE_FWK_MODULE.

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

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

Definition at line 45 of file B2GHadronicHLTValidation.cc.

References reco::LeafCandidate::eta(), etaJets_, dqm::impl::MonitorElement::Fill(), edm::Event::getByToken(), hDenJetEta, hDenJetPt, hDenTriggerMon, hNumJetEta, hNumJetPt, hNumTriggerMon, htMin_, mps_fire::i, training_settings::idx, isAll_, edm::Ptr< T >::isNonnull(), isSel_, dqmiolumiharvest::j, jet_, singleTopDQM_cfi::jets, minJets_, Skims_PA_cff::name, reco::LeafCandidate::pt(), ptJets0_, ptJets1_, ptJets_, tokJets_, tokTrigger_, L1TEGammaOffline_cfi::triggerNames, edm::TriggerNames::triggerNames(), edm::Event::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 eta() const final
momentum pseudorapidity
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
double pt() const final
transverse momentum
Strings const & triggerNames() const
Definition: TriggerNames.cc:20
void Fill(long long x)
edm::EDGetTokenT< edm::TriggerResults > tokTrigger_
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_
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
Definition: Event.cc:265
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::dqmstoreimpl::DQMStore::IBooker::book1D(), hDenJetEta, hDenJetPt, hDenTriggerMon, hNumJetEta, hNumJetPt, hNumTriggerMon, sDir_, dqm::dqmstoreimpl::DQMStore::IBooker::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 }
void triggerBinLabels(const std::vector< std::string > &labels)
set configurable labels for trigger monitoring histograms
std::vector< std::string > vsPaths_
void B2GHadronicHLTValidation::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 152 of file B2GHadronicHLTValidation.cc.

References edm::ConfigurationDescriptions::addDefault(), and edm::ParameterSetDescription::setUnknown().

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)
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 SummaryClient_cfi::labels, and triggerBinLabels().

Referenced by triggerBinLabels().

61 { return label.substr(label.find(':') + 1); };
char const * label
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, training_settings::idx, monitorPath(), and dqm::impl::MonitorElement::setBinLabel().

Referenced by bookHistograms(), and monitorPath().

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

double B2GHadronicHLTValidation::etaJets_
private

Definition at line 81 of file B2GHadronicHLTValidation.h.

Referenced by analyze().

MonitorElement* B2GHadronicHLTValidation::hDenJetEta
private

Definition at line 71 of file B2GHadronicHLTValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* B2GHadronicHLTValidation::hDenJetPt
private

Definition at line 69 of file B2GHadronicHLTValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* B2GHadronicHLTValidation::hDenTriggerMon
private

Definition at line 73 of file B2GHadronicHLTValidation.h.

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

MonitorElement* B2GHadronicHLTValidation::hNumJetEta
private

Definition at line 70 of file B2GHadronicHLTValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* B2GHadronicHLTValidation::hNumJetPt
private

Definition at line 68 of file B2GHadronicHLTValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* B2GHadronicHLTValidation::hNumTriggerMon
private

Definition at line 72 of file B2GHadronicHLTValidation.h.

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

double B2GHadronicHLTValidation::htMin_
private

Definition at line 83 of file B2GHadronicHLTValidation.h.

Referenced by analyze().

bool B2GHadronicHLTValidation::isAll_ = false
private

Definition at line 89 of file B2GHadronicHLTValidation.h.

Referenced by analyze().

bool B2GHadronicHLTValidation::isSel_ = false
private

Definition at line 90 of file B2GHadronicHLTValidation.h.

Referenced by analyze().

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

Definition at line 75 of file B2GHadronicHLTValidation.h.

Referenced by analyze().

unsigned int B2GHadronicHLTValidation::minJets_
private

Definition at line 82 of file B2GHadronicHLTValidation.h.

Referenced by analyze().

double B2GHadronicHLTValidation::ptJets0_
private

Definition at line 79 of file B2GHadronicHLTValidation.h.

Referenced by analyze().

double B2GHadronicHLTValidation::ptJets1_
private

Definition at line 80 of file B2GHadronicHLTValidation.h.

Referenced by analyze().

double B2GHadronicHLTValidation::ptJets_
private

Definition at line 78 of file B2GHadronicHLTValidation.h.

Referenced by analyze().

std::string B2GHadronicHLTValidation::sDir_
private

Definition at line 67 of file B2GHadronicHLTValidation.h.

Referenced by bookHistograms().

std::string B2GHadronicHLTValidation::sJets_
private

Definition at line 76 of file B2GHadronicHLTValidation.h.

Referenced by B2GHadronicHLTValidation().

std::string B2GHadronicHLTValidation::sTrigger_
private

Definition at line 85 of file B2GHadronicHLTValidation.h.

Referenced by B2GHadronicHLTValidation().

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

Definition at line 77 of file B2GHadronicHLTValidation.h.

Referenced by analyze(), and B2GHadronicHLTValidation().

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

Definition at line 86 of file B2GHadronicHLTValidation.h.

Referenced by analyze(), and B2GHadronicHLTValidation().

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

Definition at line 87 of file B2GHadronicHLTValidation.h.

Referenced by analyze(), and bookHistograms().