CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TopSingleLeptonDQM.h
Go to the documentation of this file.
1 #ifndef TOPSINGLELEPTONDQM
2 #define TOPSINGLELEPTONDQM
3 
4 #include <string>
5 #include <vector>
6 
10 
18 
19 
37 namespace TopSingleLepton {
38 
40  public:
43 
44  public:
46  MonitorEnsemble(const char* label, const edm::ParameterSet& cfg);
49 
51  void book(std::string directory);
53  void fill(const edm::Event& event, const edm::EventSetup& setup);
54 
55  private:
58  std::string monitorPath(const std::string& label) const { return label.substr(label.find(':')+1); };
61  std::string selectionPath(const std::string& label) const { return label.substr(0, label.find(':')); };
62 
64  void triggerBinLabels(std::string channel, const std::vector<std::string> labels);
66  void fill(const edm::Event& event, const edm::TriggerResults& triggerTable, std::string channel, const std::vector<std::string> labels) const;
67 
69  bool booked(const std::string histName) const { return hists_.find(histName.c_str())!=hists_.end(); };
71  void fill(const std::string histName, double value) const { if(booked(histName.c_str())) hists_.find(histName.c_str())->second->Fill(value); };
73  void fill(const std::string histName, double xValue, double yValue) const { if(booked(histName.c_str())) hists_.find(histName.c_str())->second->Fill(xValue, yValue); };
75  void fill(const std::string histName, double xValue, double yValue, double zValue) const { if(booked(histName.c_str())) hists_.find(histName.c_str())->second->Fill(xValue, yValue, zValue); };
76 
77  private:
81  std::string label_;
83  std::vector<edm::InputTag> mets_;
86 
91  std::vector<std::string> triggerPaths_;
92 
99 
104 
106  std::string jetCorrector_;
113  std::string jetSelect_;
123 
125  int logged_;
129  std::map<std::string,MonitorElement*> hists_;
130  };
131 
132  inline void
133  MonitorEnsemble::triggerBinLabels(std::string channel, const std::vector<std::string> labels)
134  {
135  for(unsigned int idx=0; idx<labels.size(); ++idx){
136  hists_[(channel+"Mon_").c_str()]->setBinLabel( idx+1, "["+monitorPath(labels[idx])+"]", 1);
137  hists_[(channel+"Eff_").c_str()]->setBinLabel( idx+1, "["+selectionPath(labels[idx])+"]|["+monitorPath(labels[idx])+"]", 1);
138  }
139  }
140 
141  inline void
142  MonitorEnsemble::fill(const edm::Event& event, const edm::TriggerResults& triggerTable, std::string channel, const std::vector<std::string> labels) const
143  {
144  for(unsigned int idx=0; idx<labels.size(); ++idx){
145  if( accept(event, triggerTable, monitorPath(labels[idx])) ){
146  fill((channel+"Mon_").c_str(), idx+0.5 );
147  // take care to fill triggerMon_ before evts is being called
148  int evts = hists_.find((channel+"Mon_").c_str())->second->getBinContent(idx+1);
149  double value = hists_.find((channel+"Eff_").c_str())->second->getBinContent(idx+1);
150  fill((channel+"Eff_").c_str(), idx+0.5, 1./evts*(accept(event, triggerTable, selectionPath(labels[idx]))-value));
151  }
152  }
153  }
154 
155 }
156 
157 #include <utility>
158 
164 
169 
195 //using TopSingleLepton::MonitorEnsemble;
197 
199  public:
204 
206  virtual void analyze(const edm::Event& event, const edm::EventSetup& setup);
207 
208  private:
211  std::string objectType(const std::string& label) { return label.substr(0, label.find(':')); };
214  std::string selectionStep(const std::string& label) { return label.substr(label.find(':')+1); };
215 
216  private:
220  std::vector<std::string> triggerPaths_;
229 
232  std::vector<std::string> selectionOrder_;
238  std::map<std::string, std::pair<edm::ParameterSet, TopSingleLepton::MonitorEnsemble*> > selection_;
239 };
240 
241 #endif
std::map< std::string, MonitorElement * > hists_
histogram container
std::string selectionPath(const std::string &label) const
int logged_
number of logged interesting events
double btagEffWP_
btag working points
void fill(const std::string histName, double xValue, double yValue) const
fill histogram if it had been booked before (2-dim version)
const std::string & label
Definition: MVAComputer.cc:186
edm::InputTag elecs_
input sources for monitoring
edm::InputTag triggerTable_
trigger table
std::vector< edm::InputTag > mets_
considers a vector of METs
std::vector< std::string > triggerPaths_
define MonitorEnsembple to be used
StringCutObjectSelector< reco::BeamSpot > * beamspotSelect_
string cut selector
TopSingleLeptonDQM(const edm::ParameterSet &cfg)
default constructor
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:21
std::vector< std::string > triggerPaths_
trigger paths
std::vector< std::string > selectionOrder_
std::string selectionStep(const std::string &label)
Level verbosity_
verbosity level for booking
edm::InputTag vertex_
primary vertex
double lowerEdge_
mass window upper and lower edge
U second(std::pair< T, U > const &p)
edm::InputTag btagEff_
btag discriminator labels
std::map< std::string, std::pair< edm::ParameterSet, TopSingleLepton::MonitorEnsemble * > > selection_
edm::InputTag beamspot_
beamspot
StringCutObjectSelector< reco::Muon > * muonSelect_
extra selection on muons
void fill(const std::string histName, double value) const
fill histogram if it had been booked before
void book(std::string directory)
book histograms in subdirectory directory
~MonitorEnsemble()
default destructor
edm::InputTag triggerTable_
trigger table
StringCutObjectSelector< reco::GsfElectron > * elecIso_
extra isolation criterion on electron
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
tuple labels
Definition: L1TDQM_cfg.py:62
edm::InputTag jetIDLabel_
jetID as an extra selection type
std::string label_
instance label
StringCutObjectSelector< reco::GsfElectron > * elecSelect_
extra selection on electrons
Level
different verbosity levels
std::string objectType(const std::string &label)
StringCutObjectSelector< reco::Muon > * muonIso_
extra isolation criterion on muon
void fill(const edm::Event &event, const edm::EventSetup &setup)
fill monitor histograms with electronId and jetCorrections
edm::InputTag electronId_
electronId
void triggerBinLabels(std::string channel, const std::vector< std::string > labels)
set configurable labels for trigger monitoring histograms
std::string jetCorrector_
jetCorrector
~TopSingleLeptonDQM()
default destructor
MonitorEnsemble(const char *label, const edm::ParameterSet &cfg)
default contructor
std::string monitorPath(const std::string &label) const
StringCutObjectSelector< reco::JetID > * jetIDSelect_
extra jetID selection on calo jets
virtual void analyze(const edm::Event &event, const edm::EventSetup &setup)
do this during the event loop
StringCutObjectSelector< reco::Vertex > * vertexSelect_
string cut selector
bool booked(const std::string histName) const
check if histogram was booked
DQMStore * store_
storage manager