CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TopSingleLeptonHLTOfflineDQM.h
Go to the documentation of this file.
1 #ifndef TOPSINGLELEPTONHLTOFFLINEDQM
2 #define TOPSINGLELEPTONHLTOFFLINEDQM
3 
4 #include <string>
5 #include <vector>
6 
10 
19 
22 
24 
25 /*Originally from DQM/Physics by R. Wolf and J. Andrea*/
26 
44 namespace HLTOfflineDQMTopSingleLepton {
45 
47  public:
48 
49  public:
54 
56  void book(DQMStore::IBooker& store_);
58  void fill(const edm::Event& event, const edm::EventSetup& setup, const HLTConfigProvider& hltConfig, const std::vector<std::string> triggerPaths);
59 
60  private:
63  std::string monitorPath(const std::string& label) const { return label.substr(label.find(':')+1); };
66  std::string selectionPath(const std::string& label) const { return label.substr(0, label.find(':')); };
67 
69  void triggerBinLabels(std::string channel, const std::vector<std::string>& labels);
71  void fill(const edm::Event& event, const edm::TriggerResults& triggerTable, std::string channel, const std::vector<std::string>& labels) const;
72 
74  bool booked(const std::string histName) const { return hists_.find(histName.c_str())!=hists_.end(); };
76  void fill(const std::string histName, double value) const { if(booked(histName.c_str())) hists_.find(histName.c_str())->second->Fill(value); };
78  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); };
80  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); };
81 
82  private:
87  std::vector< edm::EDGetTokenT< edm::View<reco::MET> > > mets_;
93 
96 // edm::EDGetTokenT< trigger::TriggerEventWithRefs > triggerEventWithRefsTag_;
100 
101 
104  std::vector<std::string> triggerPaths_;
105 
123 
126 
131 
152 
154  int logged_;
156  std::map<std::string,MonitorElement*> hists_;
157 
166  };
167 
168  inline void
169  MonitorSingleLepton::triggerBinLabels(std::string channel, const std::vector<std::string>& labels)
170  {
171  for(unsigned int idx=0; idx<labels.size(); ++idx){
172  hists_[(channel+"Mon_").c_str()]->setBinLabel( idx+1, "["+monitorPath(labels[idx])+"]", 1);
173  }
174  }
175 
176  inline void
177  MonitorSingleLepton::fill(const edm::Event& event, const edm::TriggerResults& triggerTable, std::string channel, const std::vector<std::string>& labels) const
178  {
179  for(unsigned int idx=0; idx<labels.size(); ++idx){
180  if( acceptHLT(event, triggerTable, monitorPath(labels[idx])) ){
181  fill((channel+"Mon_").c_str(), idx+0.5 );
182  }
183  }
184  }
185 
186 }
187 
188 #include <utility>
189 
195 
201 
227 //using HLTOfflineDQMTopSingleLepton::MonitorSingleLepton;
229 
231  public:
236  if( vertexSelect_ ) delete vertexSelect_;
237  if( beamspotSelect_ ) delete beamspotSelect_;
238  };
239 
241  virtual void dqmBeginRun(const edm::Run& r, const edm::EventSetup& c) override;
242  virtual void analyze(const edm::Event& event, const edm::EventSetup& setup) override;
243  void bookHistograms(DQMStore::IBooker &i, edm::Run const&, edm::EventSetup const&) override;
244 
245  private:
248  std::string objectType(const std::string& label) { return label.substr(0, label.find(':')); };
251  std::string selectionStep(const std::string& label) { return label.substr(label.find(':')+1); };
252 
253  private:
257  std::vector<std::string> triggerPaths_;
262 
267 
269 
270 
271 
274  std::vector<std::string> selectionOrder_;
280  std::map<std::string, std::pair<edm::ParameterSet, HLTOfflineDQMTopSingleLepton::MonitorSingleLepton*> > selection_;
281 
282  std::map<std::string, SelectionStepHLTBase*> selectmap_;
283 };
284 
285 #endif
edm::EDGetTokenT< trigger::TriggerEventWithRefs > triggerSummaryTokenAOD
int i
Definition: DBlmapReader.cc:9
define MonitorSingleLepton to be used
virtual void analyze(const edm::Event &event, const edm::EventSetup &setup) override
tuple cfg
Definition: looper.py:293
StringCutObjectSelector< reco::JetID > * jetIDSelect_
extra jetID selection on calo jets
std::map< std::string, SelectionStepHLTBase * > selectmap_
StringCutObjectSelector< reco::GsfElectron > * elecSelect_
extra selection on electrons
std::string monitorPath(const std::string &label) const
void fill(const std::string histName, double xValue, double yValue) const
fill histogram if it had been booked before (2-dim version)
void bookHistograms(DQMStore::IBooker &i, edm::Run const &, edm::EventSetup const &) override
StringCutObjectSelector< reco::Vertex > * pvSelect_
extra selection on primary vertices; meant to investigate the pile-up effect
std::map< std::string, MonitorElement * > hists_
histogram container
edm::EDGetTokenT< reco::JetTagCollection > btagPur_
edm::EDGetTokenT< edm::View< reco::GsfElectron > > elecs_
input sources for monitoring
~TopSingleLeptonHLTOfflineDQM()
default destructor
std::string selectionStep(const std::string &label)
edm::EDGetTokenT< reco::JetIDValueMap > jetIDLabel_
jetID as an extra selection type
std::vector< edm::EDGetTokenT< edm::View< reco::MET > > > mets_
considers a vector of METs
void book(DQMStore::IBooker &store_)
book histograms in subdirectory directory
std::vector< std::string > selectionOrder_
MonitorSingleLepton(const char *label, const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
default contructor
U second(std::pair< T, U > const &p)
edm::EDGetTokenT< edm::TriggerResults > triggerTable_
trigger table
edm::EDGetTokenT< std::vector< reco::Vertex > > vertex_
primary vertex
void fill(const edm::Event &event, const edm::EventSetup &setup, const HLTConfigProvider &hltConfig, const std::vector< std::string > triggerPaths)
fill monitor histograms with electronId and jetCorrections
virtual void dqmBeginRun(const edm::Run &r, const edm::EventSetup &c) override
do this during the event loop
StringCutObjectSelector< reco::BeamSpot > * beamspotSelect_
string cut selector
edm::EDGetTokenT< edm::View< reco::Muon > > muons_
std::map< std::string, std::pair< edm::ParameterSet, HLTOfflineDQMTopSingleLepton::MonitorSingleLepton * > > selection_
edm::EDGetTokenT< reco::JetTagCollection > btagEff_
btag discriminator labels
bool booked(const std::string histName) const
check if histogram was booked
void triggerBinLabels(std::string channel, const std::vector< std::string > &labels)
set configurable labels for trigger monitoring histograms
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< trigger::TriggerEventWithRefs > triggerSummaryTokenRAW
edm::EDGetTokenT< edm::View< reco::Vertex > > pvs_
std::vector< std::string > triggerPaths_
trigger paths
StringCutObjectSelector< reco::Muon > * muonIso_
extra isolation criterion on muon
StringCutObjectSelector< reco::Vertex > * vertexSelect_
string cut selector
StringCutObjectSelector< reco::GsfElectron > * elecIso_
extra isolation criterion on electron
edm::EDGetTokenT< reco::BeamSpot > beamspot_
beamspot
bool acceptHLT(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
std::vector< reco::PFJetRef > VRpfjet
edm::EDGetTokenT< edm::View< reco::Jet > > jets_
std::string selectionPath(const std::string &label) const
void fill(const std::string histName, double value) const
fill histogram if it had been booked before
std::vector< reco::RecoChargedCandidateRef > VRmuon
std::string objectType(const std::string &label)
TopSingleLeptonHLTOfflineDQM(const edm::ParameterSet &cfg)
default constructor
edm::EDGetTokenT< edm::TriggerResults > triggerTable_
trigger table
std::vector< reco::ElectronRef > VRelectron
edm::EDGetTokenT< reco::JetTagCollection > btagVtx_
edm::EDGetTokenT< edm::ValueMap< float > > electronId_
electronId label
StringCutObjectSelector< reco::Muon > * muonSelect_
extra selection on muons
static std::string const triggerPaths
Definition: EdmProvDump.cc:42
std::vector< int > Vids
Definition: Run.h:42