CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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, const std::vector< std::string > &)
 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 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 19 of file HLTMuonMatchAndPlotContainer.cc.

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

20 {
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 
40 }
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:43
std::string const & instance() const
Definition: InputTag.h:44
HLTMuonMatchAndPlotContainer::~HLTMuonMatchAndPlotContainer ( )
inline

Destructor.

Definition at line 53 of file HLTMuonMatchAndPlotContainer.h.

References plotters_.

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

Member Function Documentation

void HLTMuonMatchAndPlotContainer::addPlotter ( const edm::ParameterSet pset,
std::string  path,
const std::vector< std::string > &  labels 
)
void HLTMuonMatchAndPlotContainer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)

Definition at line 84 of file HLTMuonMatchAndPlotContainer.cc.

References allMuons_cfi::allMuons, SiPixelRawToDigiRegional_cfi::beamSpot, end, edm::Event::getByToken(), edm::HandleBase::isValid(), triggerResults, and HLT_25ns14e33_v1_cff::vertices.

Referenced by HLTMuonOfflineAnalyzer::analyze().

86 {
87 
88  // Get objects from the event.
89  Handle<TriggerEvent> triggerSummary;
90  iEvent.getByToken(trigSummaryToken_, triggerSummary);
91 
92  if(!triggerSummary.isValid())
93  {
94  LogError("HLTMuonMatchAndPlot")<<"Missing triggerSummary collection" << endl;
95  return;
96  }
97 
99  iEvent.getByToken(trigResultsToken_, triggerResults);
100 
101  if(!triggerResults.isValid())
102  {
103  LogError("HLTMuonMatchAndPlot")<<"Missing triggerResults collection" << endl;
104  return;
105  }
106 
108  iEvent.getByToken(muonToken_, allMuons);
109 
110  if(!allMuons.isValid())
111  {
112  LogError("HLTMuonMatchAndPlot")<<"Missing muon collection " << endl;
113  return;
114  }
115 
117  iEvent.getByToken(bsToken_, beamSpot);
118 
119  if(!beamSpot.isValid())
120  {
121  LogError("HLTMuonMatchAndPlot")<<"Missing beam spot collection " << endl;
122  return;
123  }
124 
126  iEvent.getByToken(pvToken_, vertices);
127 
128  if(!vertices.isValid())
129  {
130  LogError("HLTMuonMatchAndPlot")<<"Missing vertices collection " << endl;
131  return;
132  }
133 
134 
135  vector<HLTMuonMatchAndPlot>::iterator iter = plotters_.begin();
136  vector<HLTMuonMatchAndPlot>::iterator end = plotters_.end();
137 
138  for (; iter != end; ++iter)
139  {
140  iter->analyze(allMuons, beamSpot, vertices, triggerSummary, triggerResults);
141  }
142 
143 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
edm::EDGetTokenT< trigger::TriggerEvent > trigSummaryToken_
edm::EDGetTokenT< reco::MuonCollection > muonToken_
edm::EDGetTokenT< edm::TriggerResults > trigResultsToken_
edm::EDGetTokenT< reco::VertexCollection > pvToken_
tuple allMuons
Definition: allMuons_cfi.py:3
edm::EDGetTokenT< reco::BeamSpot > bsToken_
#define end
Definition: vmac.h:37
static std::string const triggerResults
Definition: EdmProvDump.cc:40
bool isValid() const
Definition: HandleBase.h:75
std::vector< HLTMuonMatchAndPlot > plotters_
void HLTMuonMatchAndPlotContainer::beginRun ( DQMStore::IBooker iBooker,
const edm::Run iRun,
const edm::EventSetup iSetup 
)

Definition at line 53 of file HLTMuonMatchAndPlotContainer.cc.

References end.

Referenced by HLTMuonOfflineAnalyzer::bookHistograms().

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

Definition at line 69 of file HLTMuonMatchAndPlotContainer.cc.

References end.

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

Member Data Documentation

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

Definition at line 68 of file HLTMuonMatchAndPlotContainer.h.

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

Definition at line 69 of file HLTMuonMatchAndPlotContainer.h.

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

Definition at line 66 of file HLTMuonMatchAndPlotContainer.h.

Referenced by ~HLTMuonMatchAndPlotContainer().

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

Definition at line 70 of file HLTMuonMatchAndPlotContainer.h.

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

Definition at line 73 of file HLTMuonMatchAndPlotContainer.h.

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

Definition at line 72 of file HLTMuonMatchAndPlotContainer.h.