CMS 3D CMS Logo

SingleTopTChannelLeptonDQM_miniAOD.h
Go to the documentation of this file.
1 #ifndef SINGLETOPTCHANNELLEPTONDQM_MINIAOD
2 #define SINGLETOPTCHANNELLEPTONDQM_MINIAOD
3 
5 #include <string>
6 #include <vector>
8 
20 
25 
29 
31  public:
34 
35  public:
40 
42  void book(DQMStore::IBooker& ibooker);
44  void fill(const edm::Event& event, const edm::EventSetup& setup);
45 
46  private:
49  std::string monitorPath(const std::string& label) const { return label.substr(label.find(':') + 1); };
52  std::string selectionPath(const std::string& label) const { return label.substr(0, label.find(':')); };
53 
55  void triggerBinLabels(std::string channel, const std::vector<std::string> labels);
57  void fill(const edm::Event& event,
58  const edm::TriggerResults& triggerTable,
59  std::string channel,
60  const std::vector<std::string> labels) const;
61 
63  bool booked(const std::string histName) const { return hists_.find(histName) != hists_.end(); };
65  void fill(const std::string histName, double value) const {
66  if (booked(histName))
67  hists_.find(histName)->second->Fill(value);
68  };
70  void fill(const std::string histName, double xValue, double yValue) const {
71  if (booked(histName))
72  hists_.find(histName)->second->Fill(xValue, yValue);
73  };
75  void fill(const std::string histName, double xValue, double yValue, double zValue) const {
76  if (booked(histName))
77  hists_.find(histName)->second->Fill(xValue, yValue, zValue);
78  };
79 
80  private:
86  std::vector<edm::EDGetTokenT<edm::View<pat::MET> > > mets_;
96  std::vector<std::string> triggerPaths_;
97 
99 
102 
103  double eidCutValue_;
105  std::unique_ptr<StringCutObjectSelector<pat::Electron> > elecIso_;
107  std::unique_ptr<StringCutObjectSelector<pat::Electron> > elecSelect_;
108 
111  std::unique_ptr<StringCutObjectSelector<reco::Vertex> > pvSelect_;
112 
114  std::unique_ptr<StringCutObjectSelector<pat::Muon> > muonIso_;
115 
117  std::unique_ptr<StringCutObjectSelector<pat::Muon> > muonSelect_;
118 
124  std::unique_ptr<StringCutObjectSelector<reco::JetID> > jetIDSelect_;
128  std::unique_ptr<StringCutObjectSelector<pat::Jet> > jetSelect;
138 
140  int logged_;
141 
143  std::map<std::string, MonitorElement*> hists_;
146  };
147 
148  inline void MonitorEnsemble::triggerBinLabels(std::string channel, const std::vector<std::string> labels) {
149  for (unsigned int idx = 0; idx < labels.size(); ++idx) {
150  hists_[channel + "Mon_"]->setBinLabel(idx + 1, "[" + monitorPath(labels[idx]) + "]", 1);
151  hists_[channel + "Eff_"]->setBinLabel(
152  idx + 1, "[" + selectionPath(labels[idx]) + "]|[" + monitorPath(labels[idx]) + "]", 1);
153  }
154  }
155 
157  const edm::TriggerResults& triggerTable,
158  std::string channel,
159  const std::vector<std::string> labels) const {
160  for (unsigned int idx = 0; idx < labels.size(); ++idx) {
161  if (accept(event, triggerTable, monitorPath(labels[idx]))) {
162  fill(channel + "Mon_", idx + 0.5);
163  // take care to fill triggerMon_ before evts is being called
164  int evts = hists_.find(channel + "Mon_")->second->getBinContent(idx + 1);
165  double value = hists_.find(channel + "Eff_")->second->getBinContent(idx + 1);
166  fill(
167  channel + "Eff_", idx + 0.5, 1. / evts * (accept(event, triggerTable, selectionPath(labels[idx])) - value));
168  }
169  }
170  }
171 } // namespace SingleTopTChannelLepton_miniAOD
172 
173 #include <utility>
174 
179 
184 
186 public:
191 
193  void analyze(const edm::Event& event, const edm::EventSetup& setup) override;
194 
195 protected:
196  //Book histograms
197  void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
198 
199 private:
202  std::string objectType(const std::string& label) { return label.substr(0, label.find(':')); };
205  std::string selectionStep(const std::string& label) { return label.substr(label.find(':') + 1); };
206 
207 private:
211  std::vector<std::string> triggerPaths_;
213  std::unique_ptr<StringCutObjectSelector<reco::Vertex> > vertexSelect_;
214 
219  std::unique_ptr<StringCutObjectSelector<reco::BeamSpot> > beamspotSelect_;
220 
223  std::vector<std::string> selectionOrder_;
229  std::map<std::string, std::pair<edm::ParameterSet, std::unique_ptr<SingleTopTChannelLepton_miniAOD::MonitorEnsemble> > >
231  std::unique_ptr<SelectionStep<pat::Muon> > MuonStep;
232  std::unique_ptr<SelectionStep<pat::Electron> > ElectronStep;
233  std::unique_ptr<SelectionStep<reco::Vertex> > PvStep;
234  std::unique_ptr<SelectionStep<pat::MET> > METStep;
235  std::vector<std::unique_ptr<SelectionStep<pat::Jet> > > JetSteps;
236 
237  std::vector<edm::ParameterSet> sel_;
239 };
240 
241 #endif
242 
243 /* Local Variables: */
244 /* show-trailing-whitespace: t */
245 /* truncate-lines: t */
246 /* End: */
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::jetSelect
std::unique_ptr< StringCutObjectSelector< pat::Jet > > jetSelect
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:128
SummaryClient_cfi.labels
labels
Definition: SummaryClient_cfi.py:61
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::elecSelect_
std::unique_ptr< StringCutObjectSelector< pat::Electron > > elecSelect_
extra selection on electrons
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:107
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::pvs_
edm::EDGetTokenT< edm::View< reco::Vertex > > pvs_
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:91
SingleTopTChannelLeptonDQM_miniAOD::PvStep
std::unique_ptr< SelectionStep< reco::Vertex > > PvStep
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:233
TriggerResults.h
PFCandidate.h
edm::Run
Definition: Run.h:45
edm::EDGetTokenT
Definition: EDGetToken.h:33
JetCorrector.h
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::triggerBinLabels
void triggerBinLabels(std::string channel, const std::vector< std::string > labels)
set configurable labels for trigger monitoring histograms
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:148
Muon.h
SingleTopTChannelLeptonDQM_miniAOD::ElectronStep
std::unique_ptr< SelectionStep< pat::Electron > > ElectronStep
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:232
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::btagPurWP_
double btagPurWP_
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:135
SingleTopTChannelLeptonDQM_miniAOD::JetSteps
std::vector< std::unique_ptr< SelectionStep< pat::Jet > > > JetSteps
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:235
SingleTopTChannelLeptonDQM_miniAOD::selectionOrder_
std::vector< std::string > selectionOrder_
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:223
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::eidCutValue_
double eidCutValue_
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:103
DQMOneEDAnalyzer
Definition: DQMOneEDAnalyzer.h:20
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::btagVtxWP_
double btagVtxWP_
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:135
Jet.h
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::electronId_
edm::EDGetTokenT< edm::ValueMap< float > > electronId_
electronId label
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:101
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::triggerTable_
edm::EDGetTokenT< edm::TriggerResults > triggerTable_
trigger table
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:93
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::hists_
std::map< std::string, MonitorElement * > hists_
histogram container
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:143
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
DQMOneEDAnalyzer.h
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::jets_
edm::EDGetTokenT< edm::View< pat::Jet > > jets_
input sources for monitoring
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:88
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::book
void book(DQMStore::IBooker &ibooker)
book histograms in subdirectory directory
Definition: SingleTopTChannelLeptonDQM_miniAOD.cc:171
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::includeBTag_
bool includeBTag_
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:131
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::booked
bool booked(const std::string histName) const
check if histogram was booked
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:63
accept
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:31
edm::EDConsumerBase
Definition: EDConsumerBase.h:71
SingleTopTChannelLeptonDQM_miniAOD::selection_
std::map< std::string, std::pair< edm::ParameterSet, std::unique_ptr< SingleTopTChannelLepton_miniAOD::MonitorEnsemble > > > selection_
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:230
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::VERBOSE
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:33
SingleTopTChannelLeptonDQM_miniAOD::sel_
std::vector< edm::ParameterSet > sel_
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:237
BeamSpot.h
CaloMET.h
Service.h
SingleTopTChannelLeptonDQM_miniAOD::beamspot__
edm::EDGetTokenT< reco::BeamSpot > beamspot__
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:217
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::muonSelect_
std::unique_ptr< StringCutObjectSelector< pat::Muon > > muonSelect_
extra selection on muons
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:117
SingleTopTChannelLepton_miniAOD
Definition: SingleTopTChannelLeptonDQM_miniAOD.cc:22
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::jetSelect_
std::string jetSelect_
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:127
SingleTopTChannelLeptonDQM_miniAOD::MuonStep
std::unique_ptr< SelectionStep< pat::Muon > > MuonStep
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:231
SingleTopTChannelLeptonDQM_miniAOD::objectType
std::string objectType(const std::string &label)
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:202
GsfElectron.h
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::selectionPath
std::string selectionPath(const std::string &label) const
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:52
EDGetToken.h
SingleTopTChannelLeptonDQM_miniAOD::analyze
void analyze(const edm::Event &event, const edm::EventSetup &setup) override
do this during the event loop
Definition: SingleTopTChannelLeptonDQM_miniAOD.cc:815
SingleTopTChannelLeptonDQM_miniAOD::triggerPaths_
std::vector< std::string > triggerPaths_
trigger paths
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:211
SingleTopTChannelLeptonDQM_miniAOD::selectionStep
std::string selectionStep(const std::string &label)
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:205
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Vertex.h
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::STANDARD
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:33
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::fill
void fill(const std::string histName, double value) const
fill histogram if it had been booked before
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:65
edm::ParameterSet
Definition: ParameterSet.h:47
EDConsumerBase.h
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::lowerEdge_
double lowerEdge_
mass window upper and lower edge
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:137
SingleTopTChannelLeptonDQM_miniAOD::beamspot_
edm::InputTag beamspot_
beamspot
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:216
SingleTopTChannelLeptonDQM_miniAOD::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: SingleTopTChannelLeptonDQM_miniAOD.cc:808
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::directory_
std::string directory_
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:145
TriggerNames.h
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::jetCorrector_
std::string jetCorrector_
jetCorrector
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:120
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::fill
void fill(const std::string histName, double xValue, double yValue, double zValue) const
fill histogram if it had been booked before (2-dim version)
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:75
value
Definition: value.py:1
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::label_
std::string label_
instance label
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:84
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::Level
Level
different verbosity levels
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:33
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::btagCSV_
edm::EDGetTokenT< reco::JetTagCollection > btagCSV_
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:133
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::elecIso_
std::unique_ptr< StringCutObjectSelector< pat::Electron > > elecIso_
extra isolation criterion on electron
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:105
edm::EventSetup
Definition: EventSetup.h:58
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::jetIDLabel_
edm::EDGetTokenT< reco::JetIDValueMap > jetIDLabel_
jetID as an extra selection type
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:122
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::btagPur_
edm::EDGetTokenT< reco::JetTagCollection > btagPur_
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:133
MET.h
SingleTopTChannelLeptonDQM_miniAOD::setup_
edm::ParameterSet setup_
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:238
Jet.h
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::logged_
int logged_
number of logged interesting events
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:140
SingleTopTChannelLeptonDQM_miniAOD::beamspotSelect_
std::unique_ptr< StringCutObjectSelector< reco::BeamSpot > > beamspotSelect_
string cut selector
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:219
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::tmpConsumerBase
edm::EDConsumerBase tmpConsumerBase
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:144
looper.cfg
cfg
Definition: looper.py:297
ValueMap.h
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::DEBUG
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:33
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::muonIso_
std::unique_ptr< StringCutObjectSelector< pat::Muon > > muonIso_
extra isolation criterion on muon
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:114
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::rhoTag
edm::InputTag rhoTag
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:98
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::btagVtx_
edm::EDGetTokenT< reco::JetTagCollection > btagVtx_
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:133
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::fill
void fill(const std::string histName, double xValue, double yValue) const
fill histogram if it had been booked before (2-dim version)
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:70
Frameworkfwd.h
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::monitorPath
std::string monitorPath(const std::string &label) const
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:49
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::verbosity_
Level verbosity_
verbosity level for booking
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:78
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::muons_
edm::EDGetTokenT< edm::View< pat::Muon > > muons_
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:89
phase2tkutil::DQMStore
dqm::reco::DQMStore DQMStore
Definition: TrackerPhase2DQMUtil.h:16
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::upperEdge_
double upperEdge_
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:137
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::jetIDSelect_
std::unique_ptr< StringCutObjectSelector< reco::JetID > > jetIDSelect_
extra jetID selection on calo jets
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:124
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::elecs_
edm::EDGetTokenT< edm::View< pat::Electron > > elecs_
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:90
SingleTopTChannelLeptonDQM_miniAOD::METStep
std::unique_ptr< SelectionStep< pat::MET > > METStep
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:234
MonitorElement
dqm::legacy::MonitorElement MonitorElement
Definition: SiPixelSCurveCalibrationAnalysis.h:55
dqm::implementation::IBooker
Definition: DQMStore.h:43
Electron.h
SingleTopTChannelLeptonDQM_miniAOD::~SingleTopTChannelLeptonDQM_miniAOD
~SingleTopTChannelLeptonDQM_miniAOD() override
default destructor
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:190
SingleTopTChannelLeptonDQM_miniAOD::vertexSelect_
std::unique_ptr< StringCutObjectSelector< reco::Vertex > > vertexSelect_
string cut selector
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:213
SingleTopTChannelLeptonDQM_miniAOD
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:185
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::mets_
std::vector< edm::EDGetTokenT< edm::View< pat::MET > > > mets_
considers a vector of METs
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:86
ConsumesCollector.h
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::MonitorEnsemble
MonitorEnsemble(const char *label, const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
default contructor
Definition: SingleTopTChannelLeptonDQM_miniAOD.cc:31
ParameterSet.h
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::triggerPaths_
std::vector< std::string > triggerPaths_
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:96
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::btagEffWP_
double btagEffWP_
btag working points
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:135
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::~MonitorEnsemble
~MonitorEnsemble()
default destructor
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:39
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::pvSelect_
std::unique_ptr< StringCutObjectSelector< reco::Vertex > > pvSelect_
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:111
event
Definition: event.py:1
edm::Event
Definition: Event.h:73
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::btagCSVWP_
double btagCSVWP_
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:135
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::btagEff_
edm::EDGetTokenT< reco::JetTagCollection > btagEff_
btag discriminator labels
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:133
edm::InputTag
Definition: InputTag.h:15
SingleTopTChannelLeptonDQM_miniAOD::triggerTable__
edm::EDGetTokenT< edm::TriggerResults > triggerTable__
trigger table
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:205
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
label
const char * label
Definition: PFTauDecayModeTools.cc:11
SingleTopTChannelLeptonDQM_miniAOD::SingleTopTChannelLeptonDQM_miniAOD
SingleTopTChannelLeptonDQM_miniAOD(const edm::ParameterSet &cfg)
default constructor
Definition: SingleTopTChannelLeptonDQM_miniAOD.cc:749
edm::TriggerResults
Definition: TriggerResults.h:35
TopDQMHelpers.h
SingleTopTChannelLepton_miniAOD::MonitorEnsemble
Definition: SingleTopTChannelLeptonDQM_miniAOD.h:30
SingleTopTChannelLepton_miniAOD::MonitorEnsemble::fill
void fill(const edm::Event &event, const edm::EventSetup &setup)
fill monitor histograms with electronId and jetCorrections
Definition: SingleTopTChannelLeptonDQM_miniAOD.cc:355