CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SingleTopTChannelLeptonDQM.h
Go to the documentation of this file.
1 #ifndef SINGLETOPTCHANNELLEPTONDQM
2 #define SINGLETOPTCHANNELLEPTONDQM
3 
4 #include <string>
5 #include <vector>
6 
10 
23 
52 namespace SingleTopTChannelLepton {
53 
55  public:
57  enum Level {
61  };
62 
63  public:
65  MonitorEnsemble(const char* label, const edm::ParameterSet& cfg,
66  const edm::VParameterSet& vcfg, edm::ConsumesCollector&& iC);
69 
71  void book(DQMStore::IBooker & ibooker);
73  void fill(const edm::Event& event, const edm::EventSetup& setup);
74 
75  private:
79  return label.substr(label.find(':') + 1);
80  };
84  return label.substr(0, label.find(':'));
85  };
86 
88  void triggerBinLabels(std::string channel,
89  const std::vector<std::string> labels);
91  void fill(const edm::Event& event, const edm::TriggerResults& triggerTable,
92  std::string channel, const std::vector<std::string> labels) const;
93 
95  bool booked(const std::string histName) const {
96  return hists_.find(histName.c_str()) != hists_.end();
97  };
99  void fill(const std::string histName, double value) const {
100  if (booked(histName.c_str()))
101  hists_.find(histName.c_str())->second->Fill(value);
102  };
104  void fill(const std::string histName, double xValue, double yValue) const {
105  if (booked(histName.c_str()))
106  hists_.find(histName.c_str())->second->Fill(xValue, yValue);
107  };
109  void fill(const std::string histName, double xValue, double yValue,
110  double zValue) const {
111  if (booked(histName.c_str()))
112  hists_.find(histName.c_str())->second->Fill(xValue, yValue, zValue);
113  };
114 
115  private:
121  std::vector<edm::EDGetTokenT<edm::View<reco::MET> > > mets_;
122  // std::vector<edm::InputTag> mets_;
129 
130  // edm::InputTag elecs_, elecs_gsf_, muons_, muons_reco_, jets_, pvs_;
131 
133  // edm::InputTag triggerTable_;
135 
138  std::vector<std::string> triggerPaths_;
139 
141  // edm::InputTag electronId_;
143 
155  // int eidPattern_;
156  // the cut for the MVA Id
157  double eidCutValue_;
162 
165  std::unique_ptr<StringCutObjectSelector<reco::Vertex> > pvSelect_;
166 
171 
176 
178  std::unique_ptr<StringCutObjectSelector<reco::JetID> > jetIDSelect_;
179 
187  // edm::InputTag btagEff_, btagPur_, btagVtx_, btagCombVtx_;
189  btagCombVtx_;
190 
195 
197  int logged_;
200  std::map<std::string, MonitorElement*> hists_;
202 
204 };
205 
207  std::string channel, const std::vector<std::string> labels) {
208  for (unsigned int idx = 0; idx < labels.size(); ++idx) {
209  hists_[(channel + "Mon_").c_str()]
210  ->setBinLabel(idx + 1, "[" + monitorPath(labels[idx]) + "]", 1);
211  hists_[(channel + "Eff_").c_str()]
212  ->setBinLabel(idx + 1, "[" + selectionPath(labels[idx]) + "]|[" +
213  monitorPath(labels[idx]) + "]",
214  1);
215  }
216 }
217 
219  const edm::TriggerResults& triggerTable,
220  std::string channel,
221  const std::vector<std::string> labels) const {
222  for (unsigned int idx = 0; idx < labels.size(); ++idx) {
223  if (accept(event, triggerTable, monitorPath(labels[idx]))) {
224  fill((channel + "Mon_").c_str(), idx + 0.5);
225  // take care to fill triggerMon_ before evts is being called
226  int evts = hists_.find((channel + "Mon_").c_str())
227  ->second->getBinContent(idx + 1);
228  double value = hists_.find((channel + "Eff_").c_str())
229  ->second->getBinContent(idx + 1);
230  fill(
231  (channel + "Eff_").c_str(), idx + 0.5,
232  1. / evts * (accept(event, triggerTable, selectionPath(labels[idx])) -
233  value));
234  }
235  }
236 }
237 }
238 
239 #include <utility>
240 
245 
251 
283 // using SingleTopTChannelLepton::MonitorEnsemble;
285 
287  public:
292 
294  virtual void analyze(const edm::Event& event, const edm::EventSetup& setup);
295 
296  protected:
297  //Book histograms
299  edm::Run const &, edm::EventSetup const &) override;
300 
301  private:
305  return label.substr(0, label.find(':'));
306  };
310  return label.substr(label.find(':') + 1);
311  };
312 
313  private:
316 
318  std::vector<std::string> triggerPaths_;
323  std::unique_ptr<StringCutObjectSelector<reco::Vertex> > vertexSelect_;
324 
329  std::unique_ptr<StringCutObjectSelector<reco::BeamSpot> > beamspotSelect_;
330 
333  std::vector<std::string> selectionOrder_;
339  std::map<
340  std::string,
341  std::pair<edm::ParameterSet,
342  std::unique_ptr<SingleTopTChannelLepton::MonitorEnsemble> > >
344 
345  std::unique_ptr<SelectionStep<reco::Muon> > MuonStep;
346  std::unique_ptr<SelectionStep<reco::PFCandidate> > PFMuonStep;
347  std::unique_ptr<SelectionStep<reco::GsfElectron> > ElectronStep;
348  std::unique_ptr<SelectionStep<reco::PFCandidate> > PFElectronStep;
349  std::unique_ptr<SelectionStep<reco::Vertex> > PvStep;
350 
351  std::vector<std::unique_ptr<SelectionStep<reco::Jet> > > JetSteps;
352  std::vector<std::unique_ptr<SelectionStep<reco::CaloJet> > > CaloJetSteps;
353  std::vector<std::unique_ptr<SelectionStep<reco::PFJet> > > PFJetSteps;
354 
355  std::unique_ptr<SelectionStep<reco::MET> > METStep;
356  std::vector<edm::ParameterSet> sel;
357 };
358 
359 #endif
std::vector< std::string > selectionOrder_
std::map< std::string, MonitorElement * > hists_
std::string objectType(const std::string &label)
~SingleTopTChannelLeptonDQM()
default destructor
edm::EDGetTokenT< reco::JetIDValueMap > jetIDLabel_
jetID as an extra selection type
tuple cfg
Definition: looper.py:237
std::vector< std::string > triggerPaths_
trigger paths
Level verbosity_
verbosity level for booking
std::unique_ptr< SelectionStep< reco::Vertex > > PvStep
std::vector< ParameterSet > VParameterSet
Definition: ParameterSet.h:33
int logged_
number of logged interesting events
std::vector< std::unique_ptr< SelectionStep< reco::CaloJet > > > CaloJetSteps
std::vector< std::unique_ptr< SelectionStep< reco::Jet > > > JetSteps
define MonitorEnsembple to be used
bool booked(const std::string histName) const
check if histogram was booked
edm::EDGetTokenT< reco::JetTagCollection > btagCombVtx_
edm::EDGetTokenT< edm::TriggerResults > triggerTable__
trigger table
std::string muonIso_
extra isolation criterion on muon
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:25
std::string muonSelect_
extra selection on muons
edm::EDGetTokenT< edm::View< reco::PFCandidate > > muons_
SingleTopTChannelLeptonDQM(const edm::ParameterSet &cfg)
default constructor
U second(std::pair< T, U > const &p)
edm::InputTag vertex_
primary vertex
std::string elecSelect_
extra selection on electrons
double lowerEdge_
mass window upper and lower edge
void triggerBinLabels(std::string channel, const std::vector< std::string > labels)
set configurable labels for trigger monitoring histograms
std::vector< edm::ParameterSet > sel
std::string monitorPath(const std::string &label) const
edm::EDGetTokenT< edm::View< reco::GsfElectron > > elecs_gsf_
std::unique_ptr< StringCutObjectSelector< reco::Vertex > > pvSelect_
void fill(const std::string histName, double xValue, double yValue, double zValue) const
fill histogram if it had been booked before (2-dim version)
edm::EDGetTokenT< reco::JetTagCollection > btagPur_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
edm::EDGetTokenT< reco::JetTagCollection > btagEff_
btag discriminator labels
std::unique_ptr< StringCutObjectSelector< reco::JetID > > jetIDSelect_
extra jetID selection on calo jets
std::unique_ptr< SelectionStep< reco::PFCandidate > > PFElectronStep
std::string selectionPath(const std::string &label) const
edm::EDGetTokenT< edm::TriggerResults > triggerTable_
trigger table
edm::EDGetTokenT< edm::ValueMap< float > > electronId_
electronId label
std::string selectionStep(const std::string &label)
std::unique_ptr< SelectionStep< reco::GsfElectron > > ElectronStep
edm::EDGetTokenT< reco::JetTagCollection > btagVtx_
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
edm::EDGetTokenT< edm::View< reco::Vertex > > pvs_
edm::EDGetTokenT< edm::View< reco::PFCandidate > > elecs_
std::unique_ptr< SelectionStep< reco::MET > > METStep
std::vector< edm::EDGetTokenT< edm::View< reco::MET > > > mets_
considers a vector of METs
void fill(const edm::Event &event, const edm::EventSetup &setup)
fill monitor histograms with electronId and jetCorrections
edm::EDGetTokenT< edm::View< reco::Jet > > jets_
input sources for monitoring
virtual void analyze(const edm::Event &event, const edm::EventSetup &setup)
do this during the event loop
std::unique_ptr< StringCutObjectSelector< reco::Vertex > > vertexSelect_
string cut selector
edm::EDGetTokenT< reco::Vertex > vertex__
MonitorEnsemble(const char *label, const edm::ParameterSet &cfg, const edm::VParameterSet &vcfg, edm::ConsumesCollector &&iC)
default contructor
void book(DQMStore::IBooker &ibooker)
book histograms in subdirectory directory
edm::EDGetTokenT< reco::BeamSpot > beamspot__
std::unique_ptr< StringCutObjectSelector< reco::BeamSpot > > beamspotSelect_
string cut selector
std::map< std::string, std::pair< edm::ParameterSet, std::unique_ptr< SingleTopTChannelLepton::MonitorEnsemble > > > selection_
void fill(const std::string histName, double value) const
fill histogram if it had been booked before
std::vector< std::unique_ptr< SelectionStep< reco::PFJet > > > PFJetSteps
void fill(const std::string histName, double xValue, double yValue) const
fill histogram if it had been booked before (2-dim version)
std::unique_ptr< SelectionStep< reco::Muon > > MuonStep
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
Definition: Run.h:41
std::unique_ptr< SelectionStep< reco::PFCandidate > > PFMuonStep
std::string elecIso_
extra isolation criterion on electron