CMS 3D CMS Logo

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

Container Class Definition (this is what is used by the DQM module) ///////. More...

#include <HLTMuonMatchAndPlotContainer.h>

Public Types

typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 

Public Member Functions

void addPlotter (const edm::ParameterSet &, std::string, std::string, bool)
 Add a HLTMuonMatchAndPlot for a given path. More...
 
void analyze (const edm::Event &, const edm::EventSetup &)
 
void beginRun (DQMStore::IBooker &, const edm::Run &, const edm::EventSetup &)
 
void endRun (const edm::Run &, const edm::EventSetup &)
 
 HLTMuonMatchAndPlotContainer (edm::ConsumesCollector &&, const edm::ParameterSet &)
 Constructor. More...
 
 ~HLTMuonMatchAndPlotContainer ()
 Destructor. More...
 

Private Attributes

edm::EDGetTokenT< reco::BeamSpotbsToken_
 
edm::EDGetTokenT
< reco::MuonCollection
muonToken_
 
std::vector< HLTMuonMatchAndPlotplotters_
 
edm::EDGetTokenT
< reco::VertexCollection
pvToken_
 
edm::EDGetTokenT
< edm::TriggerResults
trigResultsToken_
 
edm::EDGetTokenT
< trigger::TriggerEvent
trigSummaryToken_
 

Detailed Description

Container Class Definition (this is what is used by the DQM module) ///////.

Definition at line 43 of file HLTMuonMatchAndPlotContainer.h.

Member Typedef Documentation

Definition at line 45 of file HLTMuonMatchAndPlotContainer.h.

Definition at line 46 of file HLTMuonMatchAndPlotContainer.h.

Constructor & Destructor Documentation

HLTMuonMatchAndPlotContainer::HLTMuonMatchAndPlotContainer ( edm::ConsumesCollector &&  iC,
const edm::ParameterSet pset 
)

Constructor.

Container Class Members (this is what is used by the DQM module) //////////.

Constructor

Definition at line 21 of file HLTMuonMatchAndPlotContainer.cc.

References edm::ParameterSet::getParameter(), HLT_FULL_cff::InputTag, edm::InputTag::instance(), and edm::InputTag::label().

21  {
22  plotters_.clear();
23 
24  string hltProcessName = pset.getParameter<string>("hltProcessName");
25 
26  ParameterSet inputTags = pset.getParameter<ParameterSet>("inputTags");
27 
28  InputTag resTag = inputTags.getParameter<InputTag>("triggerResults");
29  InputTag sumTag = inputTags.getParameter<InputTag>("triggerSummary");
30  resTag = InputTag(resTag.label(), resTag.instance(), hltProcessName);
31  sumTag = InputTag(sumTag.label(), sumTag.instance(), hltProcessName);
32 
35 
36  bsToken_ = iC.consumes<BeamSpot>(inputTags.getParameter<InputTag>("beamSpot"));
37  muonToken_ = iC.consumes<MuonCollection>(inputTags.getParameter<InputTag>("recoMuon"));
38  pvToken_ = iC.consumes<VertexCollection>(inputTags.getParameter<InputTag>("offlinePVs"));
39 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
The single EDProduct to be saved for each event (AOD case)
Definition: TriggerEvent.h:25
edm::EDGetTokenT< trigger::TriggerEvent > trigSummaryToken_
edm::EDGetTokenT< reco::MuonCollection > muonToken_
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
edm::EDGetTokenT< edm::TriggerResults > trigResultsToken_
std::vector< Muon > MuonCollection
collection of Muon objects
Definition: MuonFwd.h:9
edm::EDGetTokenT< reco::VertexCollection > pvToken_
edm::EDGetTokenT< reco::BeamSpot > bsToken_
std::vector< HLTMuonMatchAndPlot > plotters_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::string const & label() const
Definition: InputTag.h:36
std::string const & instance() const
Definition: InputTag.h:37
HLTMuonMatchAndPlotContainer::~HLTMuonMatchAndPlotContainer ( )
inline

Destructor.

Definition at line 52 of file HLTMuonMatchAndPlotContainer.h.

References plotters_.

52 { plotters_.clear(); };
std::vector< HLTMuonMatchAndPlot > plotters_

Member Function Documentation

void HLTMuonMatchAndPlotContainer::addPlotter ( const edm::ParameterSet pset,
std::string  path,
std::string  label,
bool  islastfilter 
)

Add a HLTMuonMatchAndPlot for a given path.

Definition at line 42 of file HLTMuonMatchAndPlotContainer.cc.

References eostools::move().

Referenced by HLTMuonOfflineAnalyzer::dqmBeginRun().

45  {
46  plotters_.emplace_back(pset, std::move(path), std::move(label), islastfilter);
47 }
char const * label
def move
Definition: eostools.py:511
std::vector< HLTMuonMatchAndPlot > plotters_
void HLTMuonMatchAndPlotContainer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)

Definition at line 69 of file HLTMuonMatchAndPlotContainer.cc.

References allMuons_cfi::allMuons, beam_dqm_sourceclient-live_cfg::beamSpot, dataset::end, edm::Event::getByToken(), edm::HandleBase::isValid(), edm::Event::triggerNames(), triggerResults, trigNames, and beam_dqm_sourceclient-live_cfg::vertices.

Referenced by HLTMuonOfflineAnalyzer::analyze().

69  {
70  // Get objects from the event.
71  Handle<TriggerEvent> triggerSummary;
72  iEvent.getByToken(trigSummaryToken_, triggerSummary);
73 
74  if (!triggerSummary.isValid()) {
75  LogError("HLTMuonMatchAndPlot") << "Missing triggerSummary collection" << endl;
76  return;
77  }
78 
80  iEvent.getByToken(trigResultsToken_, triggerResults);
81  const edm::TriggerNames& trigNames = iEvent.triggerNames(*triggerResults);
82 
83  if (!triggerResults.isValid()) {
84  LogError("HLTMuonMatchAndPlot") << "Missing triggerResults collection" << endl;
85  return;
86  }
87 
89  iEvent.getByToken(muonToken_, allMuons);
90 
91  if (!allMuons.isValid()) {
92  LogError("HLTMuonMatchAndPlot") << "Missing muon collection " << endl;
93  return;
94  }
95 
97  iEvent.getByToken(bsToken_, beamSpot);
98 
99  if (!beamSpot.isValid()) {
100  LogError("HLTMuonMatchAndPlot") << "Missing beam spot collection " << endl;
101  return;
102  }
103 
105  iEvent.getByToken(pvToken_, vertices);
106 
107  if (!vertices.isValid()) {
108  LogError("HLTMuonMatchAndPlot") << "Missing vertices collection " << endl;
109  return;
110  }
111 
112  auto iter = plotters_.begin();
113  auto end = plotters_.end();
114 
115  for (; iter != end; ++iter) {
116  iter->analyze(allMuons, beamSpot, vertices, triggerSummary, triggerResults, trigNames);
117  }
118 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
edm::EDGetTokenT< trigger::TriggerEvent > trigSummaryToken_
edm::EDGetTokenT< reco::MuonCollection > muonToken_
edm::EDGetTokenT< edm::TriggerResults > trigResultsToken_
Log< level::Error, false > LogError
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
Definition: Event.cc:275
edm::EDGetTokenT< reco::VertexCollection > pvToken_
tuple allMuons
Definition: allMuons_cfi.py:3
edm::EDGetTokenT< reco::BeamSpot > bsToken_
static std::string const triggerResults
Definition: EdmProvDump.cc:44
bool isValid() const
Definition: HandleBase.h:70
static const char *const trigNames[]
Definition: EcalDumpRaw.cc:57
std::vector< HLTMuonMatchAndPlot > plotters_
string end
Definition: dataset.py:937
void HLTMuonMatchAndPlotContainer::beginRun ( DQMStore::IBooker iBooker,
const edm::Run iRun,
const edm::EventSetup iSetup 
)

Definition at line 49 of file HLTMuonMatchAndPlotContainer.cc.

References dataset::end.

Referenced by HLTMuonOfflineAnalyzer::bookHistograms().

51  {
52  auto iter = plotters_.begin();
53  auto end = plotters_.end();
54 
55  for (; iter != end; ++iter) {
56  iter->beginRun(iBooker, iRun, iSetup);
57  }
58 }
std::vector< HLTMuonMatchAndPlot > plotters_
string end
Definition: dataset.py:937
void HLTMuonMatchAndPlotContainer::endRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)

Definition at line 60 of file HLTMuonMatchAndPlotContainer.cc.

References dataset::end.

60  {
61  auto iter = plotters_.begin();
62  auto end = plotters_.end();
63 
64  for (; iter != end; ++iter) {
65  iter->endRun(iRun, iSetup);
66  }
67 }
std::vector< HLTMuonMatchAndPlot > plotters_
string end
Definition: dataset.py:937

Member Data Documentation

edm::EDGetTokenT<reco::BeamSpot> HLTMuonMatchAndPlotContainer::bsToken_
private

Definition at line 65 of file HLTMuonMatchAndPlotContainer.h.

edm::EDGetTokenT<reco::MuonCollection> HLTMuonMatchAndPlotContainer::muonToken_
private

Definition at line 66 of file HLTMuonMatchAndPlotContainer.h.

std::vector<HLTMuonMatchAndPlot> HLTMuonMatchAndPlotContainer::plotters_
private

Definition at line 63 of file HLTMuonMatchAndPlotContainer.h.

Referenced by ~HLTMuonMatchAndPlotContainer().

edm::EDGetTokenT<reco::VertexCollection> HLTMuonMatchAndPlotContainer::pvToken_
private

Definition at line 67 of file HLTMuonMatchAndPlotContainer.h.

edm::EDGetTokenT<edm::TriggerResults> HLTMuonMatchAndPlotContainer::trigResultsToken_
private

Definition at line 70 of file HLTMuonMatchAndPlotContainer.h.

edm::EDGetTokenT<trigger::TriggerEvent> HLTMuonMatchAndPlotContainer::trigSummaryToken_
private

Definition at line 69 of file HLTMuonMatchAndPlotContainer.h.