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 }
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
edm::Run
Definition: Run.h:45
edm
HLT enums.
Definition: AlignableModifier.h:19
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89285
triggerResults
static const std::string triggerResults
Definition: EdmProvDump.cc:45
HLTMuonMatchAndPlotContainer::endRun
void endRun(const edm::Run &, const edm::EventSetup &)
Definition: HLTMuonMatchAndPlotContainer.cc:60
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
HLTMuonOfflineAnalyzer_cfi.triggerSummary
triggerSummary
Definition: HLTMuonOfflineAnalyzer_cfi.py:86
edm::Handle
Definition: AssociativeIterator.h:50
HLTMuonMatchAndPlotContainer::addPlotter
void addPlotter(const edm::ParameterSet &, std::string, std::string, bool)
Add a HLTMuonMatchAndPlot for a given path.
Definition: HLTMuonMatchAndPlotContainer.cc:42
HigPhotonJetHLTOfflineSource_cfi.hltProcessName
hltProcessName
Definition: HigPhotonJetHLTOfflineSource_cfi.py:7
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
mps_fire.end
end
Definition: mps_fire.py:242
reco::BeamSpot
Definition: BeamSpot.h:21
HLTMuonOfflineAnalyzer_cfi.inputTags
inputTags
All input tags are specified in this pset for convenience.
Definition: HLTMuonOfflineAnalyzer_cfi.py:82
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HLTMuonMatchAndPlotContainer::HLTMuonMatchAndPlotContainer
HLTMuonMatchAndPlotContainer(edm::ConsumesCollector &&, const edm::ParameterSet &)
Constructor.
Definition: HLTMuonMatchAndPlotContainer.cc:21
allMuons_cfi.allMuons
allMuons
Definition: allMuons_cfi.py:3
edm::ParameterSet
Definition: ParameterSet.h:47
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup
Definition: EventSetup.h:58
trigger::TriggerEvent
The single EDProduct to be saved for each event (AOD case)
Definition: TriggerEvent.h:25
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
edm::TriggerNames
Definition: TriggerNames.h:55
dqm::implementation::IBooker
Definition: DQMStore.h:43
trigger
Definition: HLTPrescaleTableCond.h:8
HLTMuonMatchAndPlotContainer::analyze
void analyze(const edm::Event &, const edm::EventSetup &)
Definition: HLTMuonMatchAndPlotContainer.cc:69
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
edm::Event
Definition: Event.h:73
HLTMuonMatchAndPlotContainer::beginRun
void beginRun(DQMStore::IBooker &, const edm::Run &, const edm::EventSetup &)
Definition: HLTMuonMatchAndPlotContainer.cc:49
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
label
const char * label
Definition: PFTauDecayModeTools.cc:11
edm::TriggerResults
Definition: TriggerResults.h:35
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
HLTMuonMatchAndPlotContainer.h
pwdgSkimBPark_cfi.vertices
vertices
Definition: pwdgSkimBPark_cfi.py:7