CMS 3D CMS Logo

TrigObjTnPSource.cc
Go to the documentation of this file.
1 
11 
12 #include "TrigObjTnPHistColl.h"
13 
14 class TrigObjTnPSource : public DQMGlobalEDAnalyzer<std::vector<TrigObjTnPHistColl>> {
15 public:
16  explicit TrigObjTnPSource(const edm::ParameterSet&);
17  ~TrigObjTnPSource() override = default;
18  TrigObjTnPSource(const TrigObjTnPSource&) = delete;
20 
21  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
22 
23  void dqmAnalyze(const edm::Event&, const edm::EventSetup&, const std::vector<TrigObjTnPHistColl>&) const override;
25  const edm::Run&,
26  const edm::EventSetup&,
27  std::vector<TrigObjTnPHistColl>&) const override;
28  void dqmBeginRun(const edm::Run&, const edm::EventSetup&, std::vector<TrigObjTnPHistColl>&) const override;
29 
30 private:
34  //it would be more memory efficient to save this as a vector of TrigTnPHistColls and then use this to instance
35  //the TrigTnPHistColls for each run, something to do for the future
36  std::vector<edm::ParameterSet> histCollConfigs_;
37 };
38 
40  : trigEvtToken_(consumes<trigger::TriggerEvent>(config.getParameter<edm::InputTag>("triggerEvent"))),
41  trigResultsToken_(consumes<edm::TriggerResults>(config.getParameter<edm::InputTag>("triggerResults"))),
42  hltProcess_(config.getParameter<edm::InputTag>("triggerResults").process()),
43  histCollConfigs_(config.getParameter<std::vector<edm::ParameterSet>>("histColls")) {}
44 
47  desc.add<edm::InputTag>("triggerEvent", edm::InputTag("hltTriggerSummaryAOD::HLT"));
48  desc.add<edm::InputTag>("triggerResults", edm::InputTag("TriggerResults::HLT"));
49  desc.addVPSet("histColls", TrigObjTnPHistColl::makePSetDescription(), std::vector<edm::ParameterSet>());
50  descriptions.add("trigObjTnPSource", desc);
51 }
52 
54  const edm::Run& run,
55  const edm::EventSetup& setup,
56  std::vector<TrigObjTnPHistColl>& tnpHistColls) const {
57  tnpHistColls.clear();
59  bool hltChanged = false;
60  hltConfig.init(run, setup, hltProcess_, hltChanged);
61  for (auto& histCollConfig : histCollConfigs_)
62  tnpHistColls.emplace_back(TrigObjTnPHistColl(histCollConfig));
63  for (auto& histColl : tnpHistColls) {
64  histColl.init(hltConfig);
65  histColl.bookHists(iBooker);
66  }
67 }
68 
70  const edm::EventSetup& setup,
71  std::vector<TrigObjTnPHistColl>& tnpHistColls) const {}
72 
74  const edm::EventSetup& setup,
75  const std::vector<TrigObjTnPHistColl>& tnpHistColls) const {
77  event.getByToken(trigEvtToken_, trigEvtHandle);
78  edm::Handle<edm::TriggerResults> trigResultsHandle;
79  event.getByToken(trigResultsToken_, trigResultsHandle);
80  //DQM should never crash the HLT under any circumstances (except at configure)
81  if (trigEvtHandle.isValid() && trigResultsHandle.isValid()) {
82  for (auto& histColl : tnpHistColls) {
83  histColl.fill(*trigEvtHandle, *trigResultsHandle, event.triggerNames(*trigResultsHandle));
84  }
85  }
86 }
87 
MessageLogger.h
TriggerResults.h
TrigObjTnPSource::~TrigObjTnPSource
~TrigObjTnPSource() override=default
edm::Run
Definition: Run.h:45
TriggerEvent.h
edm::EDGetTokenT< trigger::TriggerEvent >
edm
HLT enums.
Definition: AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89287
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
TrigObjTnPSource::hltProcess_
std::string hltProcess_
Definition: TrigObjTnPSource.cc:33
TrigObjTnPHistColl
Definition: TrigObjTnPHistColl.h:86
TrigObjTnPSource::dqmBeginRun
void dqmBeginRun(const edm::Run &, const edm::EventSetup &, std::vector< TrigObjTnPHistColl > &) const override
Definition: TrigObjTnPSource.cc:69
edm::Handle< trigger::TriggerEvent >
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
config
Definition: config.py:1
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
Service.h
TrigObjTnPSource::trigEvtToken_
edm::EDGetTokenT< trigger::TriggerEvent > trigEvtToken_
Definition: TrigObjTnPSource.cc:31
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TrigObjTnPHistColl::makePSetDescription
static edm::ParameterSetDescription makePSetDescription()
Definition: TrigObjTnPHistColl.cc:27
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
ParameterSet
Definition: Functions.h:16
LaserDQM_cfg.process
process
Definition: LaserDQM_cfg.py:3
TrigObjTnPSource::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: TrigObjTnPSource.cc:45
TriggerNames.h
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
TrigObjTnPSource
Definition: TrigObjTnPSource.cc:14
edm::EventSetup
Definition: EventSetup.h:57
TrigObjTnPSource::TrigObjTnPSource
TrigObjTnPSource(const edm::ParameterSet &)
Definition: TrigObjTnPSource.cc:39
TrigObjTnPSource::dqmAnalyze
void dqmAnalyze(const edm::Event &, const edm::EventSetup &, const std::vector< TrigObjTnPHistColl > &) const override
Definition: TrigObjTnPSource.cc:73
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
HLTConfigProvider
Definition: HLTConfigProvider.h:29
TrigObjTnPSource::histCollConfigs_
std::vector< edm::ParameterSet > histCollConfigs_
Definition: TrigObjTnPSource.cc:36
std
Definition: JetResolutionObject.h:76
writedatasetfile.run
run
Definition: writedatasetfile.py:27
HltComparatorCreateWorkflow.hltConfig
hltConfig
Definition: HltComparatorCreateWorkflow.py:161
dqm::implementation::IBooker
Definition: DQMStore.h:43
trigger
Definition: HLTPrescaleTableCond.h:8
TrigObjTnPSource::operator=
TrigObjTnPSource & operator=(const TrigObjTnPSource &)=delete
DQMGlobalEDAnalyzer
Definition: DQMGlobalEDAnalyzer.h:76
ParameterSet.h
TrigObjTnPHistColl.h
TrigObjTnPSource::trigResultsToken_
edm::EDGetTokenT< edm::TriggerResults > trigResultsToken_
Definition: TrigObjTnPSource.cc:32
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
event
Definition: event.py:1
HLTObjectsMonitor_cfi.TriggerResults
TriggerResults
Definition: HLTObjectsMonitor_cfi.py:9
edm::Event
Definition: Event.h:73
TrigObjTnPSource::bookHistograms
void bookHistograms(DQMStore::IBooker &, const edm::Run &, const edm::EventSetup &, std::vector< TrigObjTnPHistColl > &) const override
Definition: TrigObjTnPSource.cc:53
edm::InputTag
Definition: InputTag.h:15
ZCounting_cff.TriggerEvent
TriggerEvent
Definition: ZCounting_cff.py:5
DQMGlobalEDAnalyzer.h