CMS 3D CMS Logo

List of all members | 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 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::MuonCollectionmuonToken_
 
std::vector< HLTMuonMatchAndPlotplotters_
 
edm::EDGetTokenT< reco::VertexCollectionpvToken_
 
edm::EDGetTokenT< edm::TriggerResultstrigResultsToken_
 
edm::EDGetTokenT< trigger::TriggerEventtrigSummaryToken_
 

Detailed Description

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

Definition at line 44 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(), HiRecoMuon_cff::inputTags, edm::InputTag::instance(), and edm::InputTag::label().

22 {
23 
24  plotters_.clear();
25 
26  string hltProcessName = pset.getParameter<string>("hltProcessName");
27 
28  ParameterSet inputTags = pset.getParameter<ParameterSet>("inputTags");
29 
30  InputTag resTag = inputTags.getParameter<InputTag>("triggerResults");
31  InputTag sumTag = inputTags.getParameter<InputTag>("triggerSummary");
32  resTag = InputTag(resTag.label(), resTag.instance(), hltProcessName);
33  sumTag = InputTag(sumTag.label(), sumTag.instance(), hltProcessName);
34 
37 
38  bsToken_ = iC.consumes<BeamSpot>(inputTags.getParameter<InputTag>("beamSpot"));
39  muonToken_ = iC.consumes<MuonCollection>(inputTags.getParameter<InputTag>("recoMuon"));
40  pvToken_ = iC.consumes<VertexCollection>(inputTags.getParameter<InputTag>("offlinePVs"));
41 
42 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
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_
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 53 of file HLTMuonMatchAndPlotContainer.h.

References addPlotter(), analyze(), beginRun(), endRun(), plotters_, and AlCaHLTBitMon_QueryRunRegistry::string.

53 { 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 46 of file HLTMuonMatchAndPlotContainer.cc.

References eostools::move().

Referenced by HLTMuonOfflineAnalyzer::dqmBeginRun(), and ~HLTMuonMatchAndPlotContainer().

48 {
49 
50  plotters_.emplace_back(pset,std::move(path),std::move(label),islastfilter);
51 
52 }
char const * label
std::vector< HLTMuonMatchAndPlot > plotters_
def move(src, dest)
Definition: eostools.py:511
void HLTMuonMatchAndPlotContainer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)

Definition at line 86 of file HLTMuonMatchAndPlotContainer.cc.

References allMuons_cfi::allMuons, ecalDrivenElectronSeedsParameters_cff::beamSpot, end, edm::Event::getByToken(), edm::HandleBase::isValid(), edm::Event::triggerNames(), triggerResults, trigNames, and electrons_cff::vertices.

Referenced by HLTMuonOfflineAnalyzer::analyze(), and ~HLTMuonMatchAndPlotContainer().

88 {
89 
90  // Get objects from the event.
91  Handle<TriggerEvent> triggerSummary;
92  iEvent.getByToken(trigSummaryToken_, triggerSummary);
93 
94  if(!triggerSummary.isValid())
95  {
96  LogError("HLTMuonMatchAndPlot")<<"Missing triggerSummary collection" << endl;
97  return;
98  }
99 
101  iEvent.getByToken(trigResultsToken_, triggerResults);
102  const edm::TriggerNames& trigNames = iEvent.triggerNames(*triggerResults);
103 
104  if(!triggerResults.isValid())
105  {
106  LogError("HLTMuonMatchAndPlot")<<"Missing triggerResults collection" << endl;
107  return;
108  }
109 
111  iEvent.getByToken(muonToken_, allMuons);
112 
113  if(!allMuons.isValid())
114  {
115  LogError("HLTMuonMatchAndPlot")<<"Missing muon collection " << endl;
116  return;
117  }
118 
120  iEvent.getByToken(bsToken_, beamSpot);
121 
122  if(!beamSpot.isValid())
123  {
124  LogError("HLTMuonMatchAndPlot")<<"Missing beam spot collection " << endl;
125  return;
126  }
127 
129  iEvent.getByToken(pvToken_, vertices);
130 
131  if(!vertices.isValid())
132  {
133  LogError("HLTMuonMatchAndPlot")<<"Missing vertices collection " << endl;
134  return;
135  }
136 
137 
138  auto iter = plotters_.begin();
139  auto end = plotters_.end();
140 
141  for (; iter != end; ++iter)
142  {
143  iter->analyze(allMuons, beamSpot, vertices, triggerSummary, triggerResults, trigNames);
144  }
145 
146 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
edm::EDGetTokenT< trigger::TriggerEvent > trigSummaryToken_
edm::EDGetTokenT< reco::MuonCollection > muonToken_
edm::EDGetTokenT< edm::TriggerResults > trigResultsToken_
edm::EDGetTokenT< reco::VertexCollection > pvToken_
edm::EDGetTokenT< reco::BeamSpot > bsToken_
#define end
Definition: vmac.h:39
static std::string const triggerResults
Definition: EdmProvDump.cc:45
bool isValid() const
Definition: HandleBase.h:74
static const char *const trigNames[]
Definition: EcalDumpRaw.cc:74
std::vector< HLTMuonMatchAndPlot > plotters_
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
Definition: Event.cc:256
void HLTMuonMatchAndPlotContainer::beginRun ( DQMStore::IBooker iBooker,
const edm::Run iRun,
const edm::EventSetup iSetup 
)

Definition at line 55 of file HLTMuonMatchAndPlotContainer.cc.

References end.

Referenced by HLTMuonOfflineAnalyzer::bookHistograms(), and ~HLTMuonMatchAndPlotContainer().

58 {
59 
60  auto iter = plotters_.begin();
61  auto end = plotters_.end();
62 
63  for (; iter != end; ++iter)
64  {
65  iter->beginRun(iBooker, iRun, iSetup);
66  }
67 
68 }
#define end
Definition: vmac.h:39
std::vector< HLTMuonMatchAndPlot > plotters_
void HLTMuonMatchAndPlotContainer::endRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)

Definition at line 71 of file HLTMuonMatchAndPlotContainer.cc.

References end.

Referenced by ~HLTMuonMatchAndPlotContainer().

73 {
74 
75  auto iter = plotters_.begin();
76  auto end = plotters_.end();
77 
78  for (; iter != end; ++iter)
79  {
80  iter->endRun(iRun, iSetup);
81  }
82 
83 }
#define end
Definition: vmac.h:39
std::vector< HLTMuonMatchAndPlot > plotters_

Member Data Documentation

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

Definition at line 67 of file HLTMuonMatchAndPlotContainer.h.

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

Definition at line 68 of file HLTMuonMatchAndPlotContainer.h.

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

Definition at line 65 of file HLTMuonMatchAndPlotContainer.h.

Referenced by ~HLTMuonMatchAndPlotContainer().

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

Definition at line 69 of file HLTMuonMatchAndPlotContainer.h.

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

Definition at line 72 of file HLTMuonMatchAndPlotContainer.h.

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

Definition at line 71 of file HLTMuonMatchAndPlotContainer.h.