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.

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 }

References HigPhotonJetHLTOfflineSource_cfi::hltProcessName, HLT_2018_cff::InputTag, HLTMuonOfflineAnalyzer_cfi::inputTags, edm::InputTag::instance(), edm::InputTag::label(), and muonDTDigis_cfi::pset.

◆ ~HLTMuonMatchAndPlotContainer()

HLTMuonMatchAndPlotContainer::~HLTMuonMatchAndPlotContainer ( )
inline

Destructor.

Definition at line 52 of file HLTMuonMatchAndPlotContainer.h.

52 { plotters_.clear(); };

References 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.

45  {
46  plotters_.emplace_back(pset, std::move(path), std::move(label), islastfilter);
47 }

References label, eostools::move(), castor_dqm_sourceclient_file_cfg::path, and muonDTDigis_cfi::pset.

Referenced by HLTMuonOfflineAnalyzer::dqmBeginRun().

◆ analyze()

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

Definition at line 69 of file HLTMuonMatchAndPlotContainer.cc.

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 }

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

Referenced by HLTMuonOfflineAnalyzer::analyze().

◆ beginRun()

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

Definition at line 49 of file HLTMuonMatchAndPlotContainer.cc.

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 }

References end.

Referenced by HLTMuonOfflineAnalyzer::bookHistograms().

◆ 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 }

References end.

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.

pwdgSkimBPark_cfi.beamSpot
beamSpot
Definition: pwdgSkimBPark_cfi.py:5
trigNames
static const char *const trigNames[]
Definition: EcalDumpRaw.cc:57
edm::InputTag::instance
std::string const & instance() const
Definition: InputTag.h:37
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
triggerResults
static const std::string triggerResults
Definition: EdmProvDump.cc:45
HLTMuonOfflineAnalyzer_cfi.triggerSummary
triggerSummary
Definition: HLTMuonOfflineAnalyzer_cfi.py:86
edm::Handle
Definition: AssociativeIterator.h:50
HigPhotonJetHLTOfflineSource_cfi.hltProcessName
hltProcessName
Definition: HigPhotonJetHLTOfflineSource_cfi.py:7
end
#define end
Definition: vmac.h:39
edm::InputTag::label
std::string const & label() const
Definition: InputTag.h:36
reco::MuonCollection
std::vector< Muon > MuonCollection
collection of Muon objects
Definition: MuonFwd.h:9
reco::BeamSpot
Definition: BeamSpot.h:21
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:49
HLTMuonOfflineAnalyzer_cfi.inputTags
inputTags
All input tags are specified in this pset for convenience.
Definition: HLTMuonOfflineAnalyzer_cfi.py:82
HLTMuonMatchAndPlotContainer::trigResultsToken_
edm::EDGetTokenT< edm::TriggerResults > trigResultsToken_
Definition: HLTMuonMatchAndPlotContainer.h:70
HLTMuonMatchAndPlotContainer::muonToken_
edm::EDGetTokenT< reco::MuonCollection > muonToken_
Definition: HLTMuonMatchAndPlotContainer.h:66
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
allMuons_cfi.allMuons
allMuons
Definition: allMuons_cfi.py:3
edm::ParameterSet
Definition: ParameterSet.h:36
edm::LogError
Definition: MessageLogger.h:183
iEvent
int iEvent
Definition: GenABIO.cc:224
trigger::TriggerEvent
The single EDProduct to be saved for each event (AOD case)
Definition: TriggerEvent.h:25
HLTMuonMatchAndPlotContainer::bsToken_
edm::EDGetTokenT< reco::BeamSpot > bsToken_
Definition: HLTMuonMatchAndPlotContainer.h:65
eostools.move
def move(src, dest)
Definition: eostools.py:511
HLTMuonMatchAndPlotContainer::trigSummaryToken_
edm::EDGetTokenT< trigger::TriggerEvent > trigSummaryToken_
Definition: HLTMuonMatchAndPlotContainer.h:69
HLTMuonMatchAndPlotContainer::pvToken_
edm::EDGetTokenT< reco::VertexCollection > pvToken_
Definition: HLTMuonMatchAndPlotContainer.h:67
edm::TriggerNames
Definition: TriggerNames.h:55
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
edm::InputTag
Definition: InputTag.h:15
label
const char * label
Definition: PFTauDecayModeTools.cc:11
edm::TriggerResults
Definition: TriggerResults.h:35
HLTMuonMatchAndPlotContainer::plotters_
std::vector< HLTMuonMatchAndPlot > plotters_
Definition: HLTMuonMatchAndPlotContainer.h:63
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
pwdgSkimBPark_cfi.vertices
vertices
Definition: pwdgSkimBPark_cfi.py:7