CMS 3D CMS Logo

HLTMuonMatchAndPlotContainer.cc
Go to the documentation of this file.
1 
5 #include <utility>
6 
8 
11 
12 using namespace std;
13 using namespace edm;
14 using namespace reco;
15 using namespace trigger;
16 
19 
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 
33  trigSummaryToken_ = iC.consumes<TriggerEvent>(sumTag);
34  trigResultsToken_ = iC.consumes<TriggerResults>(resTag);
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 
45  bool islastfilter) {
46  plotters_.emplace_back(pset, std::move(path), std::move(label), islastfilter);
47 }
48 
50  const edm::Run& iRun,
51  const edm::EventSetup& iSetup) {
52  auto iter = plotters_.begin();
53  auto end = plotters_.end();
54 
55  for (; iter != end; ++iter) {
56  iter->beginRun(iBooker, iRun, iSetup);
57  }
58 }
59 
61  auto iter = plotters_.begin();
62  auto end = plotters_.end();
63 
64  for (; iter != end; ++iter) {
65  iter->endRun(iRun, iSetup);
66  }
67 }
68 
70  // Get objects from the event.
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) {
117  }
118 }
void endRun(const edm::Run &, const edm::EventSetup &)
HLTMuonMatchAndPlotContainer(edm::ConsumesCollector &&, const edm::ParameterSet &)
Constructor.
The single EDProduct to be saved for each event (AOD case)
Definition: TriggerEvent.h:25
std::string const & instance() const
Definition: InputTag.h:37
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
std::string const & label() const
Definition: InputTag.h:36
Log< level::Error, false > LogError
std::vector< Muon > MuonCollection
collection of Muon objects
Definition: MuonFwd.h:9
char const * label
int iEvent
Definition: GenABIO.cc:224
static std::string const triggerResults
Definition: EdmProvDump.cc:44
void analyze(const edm::Event &, const edm::EventSetup &)
static const char *const trigNames[]
Definition: EcalDumpRaw.cc:57
inputTags
All input tags are specified in this pset for convenience.
void beginRun(DQMStore::IBooker &, const edm::Run &, const edm::EventSetup &)
fixed size matrix
HLT enums.
void addPlotter(const edm::ParameterSet &, std::string, std::string, bool)
Add a HLTMuonMatchAndPlot for a given path.
def move(src, dest)
Definition: eostools.py:511
Definition: Run.h:45