CMS 3D CMS Logo

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::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 43 of file HLTMuonMatchAndPlotContainer.h.

Member Typedef Documentation

◆ DQMStore

Definition at line 45 of file HLTMuonMatchAndPlotContainer.h.

◆ MonitorElement

Definition at line 46 of file HLTMuonMatchAndPlotContainer.h.

Constructor & Destructor Documentation

◆ HLTMuonMatchAndPlotContainer()

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 HigPhotonJetHLTOfflineSource_cfi::hltProcessName, ProducerED_cfi::InputTag, HLTMuonOfflineAnalyzer_cfi::inputTags, edm::InputTag::instance(), edm::InputTag::label(), and muonDTDigis_cfi::pset.

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
std::string const & instance() const
Definition: InputTag.h:37
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::string const & label() const
Definition: InputTag.h:36
std::vector< Muon > MuonCollection
collection of Muon objects
Definition: MuonFwd.h:9
edm::EDGetTokenT< reco::VertexCollection > pvToken_
edm::EDGetTokenT< reco::BeamSpot > bsToken_
inputTags
All input tags are specified in this pset for convenience.
std::vector< HLTMuonMatchAndPlot > plotters_

◆ ~HLTMuonMatchAndPlotContainer()

HLTMuonMatchAndPlotContainer::~HLTMuonMatchAndPlotContainer ( )
inline

Destructor.

Definition at line 52 of file HLTMuonMatchAndPlotContainer.h.

References plotters_.

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

Member Function Documentation

◆ addPlotter()

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 label, eostools::move(), castor_dqm_sourceclient_file_cfg::path, and muonDTDigis_cfi::pset.

Referenced by HLTMuonOfflineAnalyzer::dqmBeginRun().

45  {
46  plotters_.emplace_back(pset, std::move(path), std::move(label), islastfilter);
47 }
char const * label
std::vector< HLTMuonMatchAndPlot > plotters_
def move(src, dest)
Definition: eostools.py:511

◆ analyze()

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

Definition at line 69 of file HLTMuonMatchAndPlotContainer.cc.

References allMuons_cfi::allMuons, pwdgSkimBPark_cfi::beamSpot, iEvent, triggerResults, HLTMuonOfflineAnalyzer_cfi::triggerSummary, trigNames, and AlignmentTracksFromVertexSelector_cfi::vertices.

Referenced by HLTMuonOfflineAnalyzer::analyze().

69  {
70  // Get objects from the event.
73 
74  if (!triggerSummary.isValid()) {
75  LogError("HLTMuonMatchAndPlot") << "Missing triggerSummary collection" << endl;
76  return;
77  }
78 
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) {
117  }
118 }
edm::EDGetTokenT< trigger::TriggerEvent > trigSummaryToken_
edm::EDGetTokenT< reco::MuonCollection > muonToken_
edm::EDGetTokenT< edm::TriggerResults > trigResultsToken_
Log< level::Error, false > LogError
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< reco::VertexCollection > pvToken_
edm::EDGetTokenT< reco::BeamSpot > bsToken_
static std::string const triggerResults
Definition: EdmProvDump.cc:47
static const char *const trigNames[]
Definition: EcalDumpRaw.cc:57
std::vector< HLTMuonMatchAndPlot > plotters_

◆ beginRun()

void HLTMuonMatchAndPlotContainer::beginRun ( DQMStore::IBooker iBooker,
const edm::Run iRun,
const edm::EventSetup iSetup 
)

Definition at line 49 of file HLTMuonMatchAndPlotContainer.cc.

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_

◆ endRun()

void HLTMuonMatchAndPlotContainer::endRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)

Definition at line 60 of file HLTMuonMatchAndPlotContainer.cc.

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_

Member Data Documentation

◆ bsToken_

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

Definition at line 65 of file HLTMuonMatchAndPlotContainer.h.

◆ muonToken_

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

Definition at line 66 of file HLTMuonMatchAndPlotContainer.h.

◆ plotters_

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

Definition at line 63 of file HLTMuonMatchAndPlotContainer.h.

Referenced by ~HLTMuonMatchAndPlotContainer().

◆ pvToken_

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

Definition at line 67 of file HLTMuonMatchAndPlotContainer.h.

◆ trigResultsToken_

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

Definition at line 70 of file HLTMuonMatchAndPlotContainer.h.

◆ trigSummaryToken_

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

Definition at line 69 of file HLTMuonMatchAndPlotContainer.h.