CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes
HTMonitor Class Reference

#include <HTMonitor.h>

Inheritance diagram for HTMonitor:
one::DQMEDAnalyzer< T > one::dqmimplementation::DQMBaseClass< T... >

Classes

struct  HTME
 
struct  MEHTbinning
 

Public Member Functions

 HTMonitor (const edm::ParameterSet &)
 
 ~HTMonitor () override
 
- Public Member Functions inherited from one::DQMEDAnalyzer< T >
 DQMEDAnalyzer ()=default
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > &&)=delete
 
 ~DQMEDAnalyzer () override=default
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
static void fillHistoLSPSetDescription (edm::ParameterSetDescription &pset)
 
static void fillHistoPSetDescription (edm::ParameterSetDescription &pset)
 

Protected Member Functions

void analyze (edm::Event const &iEvent, edm::EventSetup const &iSetup) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void bookME (DQMStore::IBooker &, HTME &me, const std::string &histname, const std::string &histtitle, int nbins, double xmin, double xmax)
 
void bookME (DQMStore::IBooker &, HTME &me, const std::string &histname, const std::string &histtitle, const std::vector< double > &binningX)
 
void bookME (DQMStore::IBooker &, HTME &me, const std::string &histname, const std::string &histtitle, int nbinsX, double xmin, double xmax, double ymin, double ymax)
 
void bookME (DQMStore::IBooker &, HTME &me, const std::string &histname, const std::string &histtitle, int nbinsX, double xmin, double xmax, int nbinsY, double ymin, double ymax)
 
void bookME (DQMStore::IBooker &, HTME &me, const std::string &histname, const std::string &histtitle, const std::vector< double > &binningX, const std::vector< double > &binningY)
 
void setHTitle (HTME &me, const std::string &titleX, const std::string &titleY)
 

Static Private Member Functions

static MEHTbinning getHistoLSPSet (const edm::ParameterSet &pset)
 
static MEHTbinning getHistoPSet (const edm::ParameterSet &pset)
 

Private Attributes

HTME deltaphij1j2ME_
 
HTME deltaphimetj1ME_
 
std::unique_ptr< GenericTriggerEventFlagden_genTriggerEventFlag_
 
double dEtaCut_
 
edm::InputTag eleInputTag_
 
StringCutObjectSelector< reco::GsfElectron, true > eleSelection_
 
edm::EDGetTokenT< reco::GsfElectronCollectioneleToken_
 
std::string folderName_
 
std::string histoSuffix_
 
MEHTbinning ht_binning_
 
std::vector< double > ht_variable_binning_
 
HTME htVsLS_
 
edm::InputTag jetInputTag_
 
StringCutObjectSelector< reco::Jet, true > jetSelection_
 
StringCutObjectSelector< reco::Jet, true > jetSelection_HT_
 
edm::EDGetTokenT< reco::JetViewjetToken_
 
MEHTbinning ls_binning_
 
edm::InputTag metInputTag_
 
StringCutObjectSelector< reco::MET, true > metSelection_
 
edm::EDGetTokenT< reco::PFMETCollectionmetToken_
 
edm::InputTag muoInputTag_
 
StringCutObjectSelector< reco::Muon, true > muoSelection_
 
edm::EDGetTokenT< reco::MuonCollectionmuoToken_
 
unsigned nelectrons_
 
unsigned njets_
 
unsigned nmuons_
 
std::unique_ptr< GenericTriggerEventFlagnum_genTriggerEventFlag_
 
HTME qME_variableBinning_
 
quant quantity_
 
edm::InputTag vtxInputTag_
 
edm::EDGetTokenT< reco::VertexCollectionvtxToken_
 
std::vector< bool > warningPrinted4token_
 

Static Private Attributes

static double MAXedge_PHI = 3.2
 
static int Nbin_PHI = 64
 
static MEHTbinning phi_binning_
 

Detailed Description

Definition at line 50 of file HTMonitor.h.

Constructor & Destructor Documentation

HTMonitor::HTMonitor ( const edm::ParameterSet iConfig)

Definition at line 12 of file HTMonitor.cc.

References Exception, edm::ParameterSet::getParameter(), HT, MJJ, tauVariables_cff::quantity, quantity_, SOFTDROP, AlCaHLTBitMon_QueryRunRegistry::string, warningPrinted4token_, and ~HTMonitor().

12  :
13  folderName_ ( iConfig.getParameter<std::string>("FolderName") )
14  , metInputTag_ ( iConfig.getParameter<edm::InputTag> ("met") )
15  , jetInputTag_ ( iConfig.getParameter<edm::InputTag> ("jets") )
16  , eleInputTag_ ( iConfig.getParameter<edm::InputTag> ("electrons") )
17  , muoInputTag_ ( iConfig.getParameter<edm::InputTag> ("muons") )
18  , vtxInputTag_ ( iConfig.getParameter<edm::InputTag> ("vertices") )
19  , metToken_ ( consumes<reco::PFMETCollection> ( metInputTag_ ) )
20  , jetToken_ ( mayConsume<reco::JetView> ( jetInputTag_ ) )
21  , eleToken_ ( mayConsume<reco::GsfElectronCollection>( eleInputTag_ ) )
22  , muoToken_ ( mayConsume<reco::MuonCollection> ( muoInputTag_ ) )
23  , vtxToken_ ( mayConsume<reco::VertexCollection> ( vtxInputTag_ ) )
24  , ht_variable_binning_ ( iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("htBinning") )
25  , ht_binning_ ( getHistoPSet (iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet> ("htPSet") ) )
26  , ls_binning_ ( getHistoPSet (iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet> ("lsPSet") ) )
27  , num_genTriggerEventFlag_(new GenericTriggerEventFlag(iConfig.getParameter<edm::ParameterSet>("numGenericTriggerEventPSet"),consumesCollector(), *this))
28  , den_genTriggerEventFlag_(new GenericTriggerEventFlag(iConfig.getParameter<edm::ParameterSet>("denGenericTriggerEventPSet"),consumesCollector(), *this))
29  , metSelection_ ( iConfig.getParameter<std::string>("metSelection") )
30  , jetSelection_ ( iConfig.getParameter<std::string>("jetSelection") )
31  , eleSelection_ ( iConfig.getParameter<std::string>("eleSelection") )
32  , muoSelection_ ( iConfig.getParameter<std::string>("muoSelection") )
33  , jetSelection_HT_ ( iConfig.getParameter<std::string>("jetSelection_HT") )
34  , njets_ ( iConfig.getParameter<unsigned>("njets" ) )
35  , nelectrons_ ( iConfig.getParameter<unsigned>("nelectrons" ) )
36  , nmuons_ ( iConfig.getParameter<unsigned>("nmuons" ) )
37  , dEtaCut_ ( iConfig.getParameter<double>("dEtaCut") )
38 {
39  /* mia: THIS CODE SHOULD BE DELETED !!!! */
40  string quantity = iConfig.getParameter<std::string>("quantity");
41  if(quantity == "HT")
42  {
43  quantity_ = HT;
44  }
45  else if(quantity == "Mjj")
46  {
47  quantity_ = MJJ;
48  }
49  else if(quantity == "softdrop")
50  {
52  }
53  else
54  {
55  throw cms::Exception("quantity not defined") << "the quantity '" << quantity << "' is undefined. Please check your config!" << std::endl;
56  }
57 
58  // this vector has to be alligned to the the number of Tokens accessed by this module
59  warningPrinted4token_.push_back(false); // PFMETCollection
60  warningPrinted4token_.push_back(false); // JetCollection
61  warningPrinted4token_.push_back(false); // GsfElectronCollection
62  warningPrinted4token_.push_back(false); // MuonCollection
63  warningPrinted4token_.push_back(false); // VertexCollection
64 }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::MuonCollection > muoToken_
Definition: HTMonitor.h:102
edm::EDGetTokenT< reco::JetView > jetToken_
Definition: HTMonitor.h:100
double dEtaCut_
Definition: HTMonitor.h:125
quant quantity_
Definition: HTMonitor.h:91
edm::InputTag muoInputTag_
Definition: HTMonitor.h:96
StringCutObjectSelector< reco::Muon, true > muoSelection_
Definition: HTMonitor.h:120
std::vector< double > ht_variable_binning_
Definition: HTMonitor.h:105
unsigned njets_
Definition: HTMonitor.h:122
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
edm::EDGetTokenT< reco::VertexCollection > vtxToken_
Definition: HTMonitor.h:103
static MEHTbinning getHistoPSet(const edm::ParameterSet &pset)
Definition: HTMonitor.cc:68
edm::InputTag jetInputTag_
Definition: HTMonitor.h:94
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
Definition: HTMonitor.h:115
StringCutObjectSelector< reco::MET, true > metSelection_
Definition: HTMonitor.h:117
std::vector< bool > warningPrinted4token_
Definition: HTMonitor.h:133
Definition: HTMonitor.h:44
edm::InputTag eleInputTag_
Definition: HTMonitor.h:95
MEHTbinning ht_binning_
Definition: HTMonitor.h:106
edm::EDGetTokenT< reco::GsfElectronCollection > eleToken_
Definition: HTMonitor.h:101
MEHTbinning ls_binning_
Definition: HTMonitor.h:107
edm::InputTag vtxInputTag_
Definition: HTMonitor.h:97
edm::InputTag metInputTag_
Definition: HTMonitor.h:93
StringCutObjectSelector< reco::Jet, true > jetSelection_HT_
Definition: HTMonitor.h:121
unsigned nelectrons_
Definition: HTMonitor.h:123
StringCutObjectSelector< reco::GsfElectron, true > eleSelection_
Definition: HTMonitor.h:119
StringCutObjectSelector< reco::Jet, true > jetSelection_
Definition: HTMonitor.h:118
std::string folderName_
Definition: HTMonitor.h:89
Definition: HTMonitor.h:44
edm::EDGetTokenT< reco::PFMETCollection > metToken_
Definition: HTMonitor.h:99
unsigned nmuons_
Definition: HTMonitor.h:124
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
Definition: HTMonitor.h:114
HTMonitor::~HTMonitor ( )
overridedefault

Referenced by HTMonitor().

Member Function Documentation

void HTMonitor::analyze ( edm::Event const &  iEvent,
edm::EventSetup const &  iSetup 
)
overrideprotected

Definition at line 190 of file HTMonitor.cc.

References hiPixelPairStep_cff::deltaPhi, deltaphij1j2ME_, deltaphimetj1ME_, den_genTriggerEventFlag_, HTMonitor::HTME::denominator, dEtaCut_, MillePedeFileConverter_cfg::e, nano_cff::electrons, eleInputTag_, eleSelection_, eleToken_, reco::tau::disc::Eta(), HcalObjRepresent::Fill(), edm::Event::getByToken(), htVsLS_, edm::EventBase::id(), edm::HandleBase::isValid(), jetInputTag_, fwrapper::jets, jetSelection_, jetSelection_HT_, jetToken_, edm::InputTag::label(), eostools::ls(), edm::EventID::luminosityBlock(), funct::m, metInputTag_, metSelection_, metToken_, MJJ, muoInputTag_, extraflags_cff::muons, muoSelection_, muoToken_, nelectrons_, njets_, nmuons_, num_genTriggerEventFlag_, HTMonitor::HTME::numerator, p4, phi, reco::LeafCandidate::phi(), reco::Vertex::position(), qME_variableBinning_, quantity_, edm::View< T >::size(), SOFTDROP, findQualityFiles::v, extraflags_cff::vtx, vtxInputTag_, vtxToken_, and warningPrinted4token_.

190  {
191 
192  // Filter out events if Trigger Filtering is requested
193  if (den_genTriggerEventFlag_->on() && ! den_genTriggerEventFlag_->accept( iEvent, iSetup) ) return;
194 
196  iEvent.getByToken( metToken_, metHandle );
197  if ( !metHandle.isValid() ) {
198  if (!warningPrinted4token_[0]) {
199  edm::LogWarning("HTMonitor") << "skipping events because the collection " << metInputTag_.label().c_str() << " is not available";
200  warningPrinted4token_[0] = true;
201  }
202  return;
203  }
204  reco::PFMET pfmet = metHandle->front();
205  if ( ! metSelection_( pfmet ) ) return;
206 
207  edm::Handle<reco::JetView> jetHandle; //add a configurable jet collection & jet pt selection
208  iEvent.getByToken( jetToken_, jetHandle );
209  if ( !jetHandle.isValid() ) {
210  if (!warningPrinted4token_[1]) {
211  edm::LogWarning("HTMonitor") << "skipping events because the collection " << jetInputTag_.label().c_str() << " is not available";
212  warningPrinted4token_[1] = true;
213  }
214  return;
215  }
216  std::vector<reco::Jet> jets;
217  if ( jetHandle->size() < njets_ ) return;
218  for ( auto const & j : *jetHandle ) {
219  if ( jetSelection_( j ) ) {
220  jets.push_back(j);
221  }
222  }
223 
224  if ( jets.size() < njets_ ) return;
225 
226  float deltaPhi_met_j1 = 10.0;
227  float deltaPhi_j1_j2 = 10.0;
228 
229  if (!jets.empty()) deltaPhi_met_j1 = fabs( deltaPhi( pfmet.phi(), jets[0].phi() ));
230  if (jets.size() >= 2) deltaPhi_j1_j2 = fabs( deltaPhi( jets[0].phi(), jets[1].phi() ));
231 
232  std::vector<reco::GsfElectron> electrons;
234  iEvent.getByToken( eleToken_, eleHandle );
235  if ( eleHandle.isValid() ) {
236  if ( eleHandle->size() < nelectrons_ ) return;
237  for ( auto const & e : *eleHandle ) {
238  if ( eleSelection_( e ) ) electrons.push_back(e);
239  }
240  if ( electrons.size() < nelectrons_ ) return;
241  } else {
242  if (!warningPrinted4token_[2]) {
243  warningPrinted4token_[2] = true;
244  if ( eleInputTag_.label().empty() )
245  edm::LogWarning("HTMonitor") << "GsfElectronCollection not set";
246  else
247  edm::LogWarning("HTMonitor") << "skipping events because the collection " << eleInputTag_.label().c_str() << " is not available";
248  }
249  if ( !eleInputTag_.label().empty() ) return;
250  }
251 
252 
255  iEvent.getByToken(vtxToken_, vtxHandle);
256  if ( vtxHandle.isValid() ) {
257  for (auto const & v : *vtxHandle) {
258  bool isFake = v.isFake() ;
259 
260  if (!isFake) {
261  vtx = v;
262  break;
263  }
264  }
265  } else {
266  if (!warningPrinted4token_[3]) {
267  warningPrinted4token_[3] = true;
268  if ( vtxInputTag_.label().empty() )
269  edm::LogWarning("HTMonitor") << "VertexCollection not set";
270  else
271  edm::LogWarning("HTMonitor") << "skipping events because the collection " << vtxInputTag_.label().c_str() << " is not available";
272  }
273  if ( !vtxInputTag_.label().empty() ) return;
274  }
275 
276  std::vector<reco::Muon> muons;
278  iEvent.getByToken( muoToken_, muoHandle );
279  if ( muoHandle.isValid() ) {
280  if ( muoHandle->size() < nmuons_ ) return;
281  for ( auto const & m : *muoHandle ) {
282  if ( muoSelection_( m ) && m.isGlobalMuon() && m.isPFMuon() && m.globalTrack()->normalizedChi2() < 10. && m.globalTrack()->hitPattern().numberOfValidMuonHits() > 0 && m.numberOfMatchedStations() > 1 && fabs(m.muonBestTrack()->dxy(vtx.position())) < 0.2 && fabs(m.muonBestTrack()->dz(vtx.position())) < 0.5 && m.innerTrack()->hitPattern().numberOfValidPixelHits() > 0 && m.innerTrack()->hitPattern().trackerLayersWithMeasurement() > 5 ) muons.push_back(m);
283  }
284  if ( muons.size() < nmuons_ ) return;
285  } else {
286  if (!warningPrinted4token_[4]) {
287  warningPrinted4token_[4] = true;
288  if ( muoInputTag_.label().empty() )
289  edm::LogWarning("HTMonitor") << "MuonCollection not set";
290  else
291  edm::LogWarning("HTMonitor") << "skipping events because the collection " << muoInputTag_.label().c_str() << " is not available";
292  }
293  if ( !muoInputTag_.label().empty() ) return;
294  }
295 
296  // fill histograms
297  switch(quantity_)
298  {
299  case HT:
300  {
301  float ht = 0.0;
302  for ( auto const & j : *jetHandle )
303  {
304  if ( jetSelection_HT_(j)) ht += j.pt();
305  }
306 
307  // filling histograms (denominator)
309 
310  deltaphimetj1ME_.denominator -> Fill(deltaPhi_met_j1);
311  deltaphij1j2ME_.denominator -> Fill(deltaPhi_j1_j2);
312 
313  int ls = iEvent.id().luminosityBlock();
314  htVsLS_.denominator -> Fill(ls, ht);
315 
316  // applying selection for numerator
317  if (num_genTriggerEventFlag_->on() && ! num_genTriggerEventFlag_->accept( iEvent, iSetup) ) return;
318 
319  // filling histograms (num_genTriggerEventFlag_)
321 
322  htVsLS_.numerator -> Fill(ls, ht);
323  deltaphimetj1ME_.numerator -> Fill(deltaPhi_met_j1);
324  deltaphij1j2ME_.numerator -> Fill(deltaPhi_j1_j2);
325  break;
326  }
327 
328  case MJJ:
329  {
330  if (jets.size() < 2) return;
331 
332  // deltaEta cut
333  if(fabs(jets[0].p4().Eta() - jets[1].p4().Eta()) >= dEtaCut_) return;
334  float mjj = (jets[0].p4() + jets[1].p4()).M();
335 
337 
338  // applying selection for numerator
339  if (num_genTriggerEventFlag_->on() && ! num_genTriggerEventFlag_->accept( iEvent, iSetup) ) return;
340 
342  break;
343  }
344 
345  case SOFTDROP:
346  {
347  if (jets.size() < 2) return;
348 
349  // deltaEta cut
350  if(fabs(jets[0].p4().Eta() - jets[1].p4().Eta()) >= dEtaCut_) return;
351 
352  float softdrop = jets[0].p4().M();
353 
355 
356  // applying selection for numerator
357  if (num_genTriggerEventFlag_->on() && ! num_genTriggerEventFlag_->accept( iEvent, iSetup) ) return;
358 
359  qME_variableBinning_.numerator -> Fill(softdrop);
360  break;
361  }
362  }
363 }
edm::EDGetTokenT< reco::MuonCollection > muoToken_
Definition: HTMonitor.h:102
edm::EDGetTokenT< reco::JetView > jetToken_
Definition: HTMonitor.h:100
double dEtaCut_
Definition: HTMonitor.h:125
MonitorElement * denominator
Definition: HTMonitor.h:63
quant quantity_
Definition: HTMonitor.h:91
HTME qME_variableBinning_
Definition: HTMonitor.h:109
edm::InputTag muoInputTag_
Definition: HTMonitor.h:96
StringCutObjectSelector< reco::Muon, true > muoSelection_
Definition: HTMonitor.h:120
size_type size() const
unsigned njets_
Definition: HTMonitor.h:122
edm::EDGetTokenT< reco::VertexCollection > vtxToken_
Definition: HTMonitor.h:103
edm::InputTag jetInputTag_
Definition: HTMonitor.h:94
const Point & position() const
position
Definition: Vertex.h:109
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
Definition: HTMonitor.h:115
StringCutObjectSelector< reco::MET, true > metSelection_
Definition: HTMonitor.h:117
std::vector< bool > warningPrinted4token_
Definition: HTMonitor.h:133
Definition: HTMonitor.h:44
int iEvent
Definition: GenABIO.cc:224
edm::InputTag eleInputTag_
Definition: HTMonitor.h:95
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
double p4[4]
Definition: TauolaWrapper.h:92
vector< PseudoJet > jets
MonitorElement * numerator
Definition: HTMonitor.h:62
bool isValid() const
Definition: HandleBase.h:74
edm::EDGetTokenT< reco::GsfElectronCollection > eleToken_
Definition: HTMonitor.h:101
def ls(path, rec=False)
Definition: eostools.py:349
edm::InputTag vtxInputTag_
Definition: HTMonitor.h:97
edm::InputTag metInputTag_
Definition: HTMonitor.h:93
StringCutObjectSelector< reco::Jet, true > jetSelection_HT_
Definition: HTMonitor.h:121
unsigned nelectrons_
Definition: HTMonitor.h:123
StringCutObjectSelector< reco::GsfElectron, true > eleSelection_
Definition: HTMonitor.h:119
StringCutObjectSelector< reco::Jet, true > jetSelection_
Definition: HTMonitor.h:118
std::string const & label() const
Definition: InputTag.h:36
HTME deltaphimetj1ME_
Definition: HTMonitor.h:111
HTME deltaphij1j2ME_
Definition: HTMonitor.h:112
edm::EDGetTokenT< reco::PFMETCollection > metToken_
Definition: HTMonitor.h:99
Definition: HT.h:21
HTME htVsLS_
Definition: HTMonitor.h:110
double phi() const final
momentum azimuthal angle
unsigned nmuons_
Definition: HTMonitor.h:124
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
Definition: HTMonitor.h:114
void HTMonitor::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprotected

Definition at line 131 of file HTMonitor.cc.

References bookME(), deltaphij1j2ME_, deltaphimetj1ME_, den_genTriggerEventFlag_, folderName_, ht_binning_, ht_variable_binning_, htVsLS_, ls_binning_, MJJ, HTMonitor::MEHTbinning::nbins, num_genTriggerEventFlag_, phi_binning_, qME_variableBinning_, quantity_, DQMStore::IBooker::setCurrentFolder(), setHTitle(), SOFTDROP, AlCaHLTBitMon_QueryRunRegistry::string, HTMonitor::MEHTbinning::xmax, and HTMonitor::MEHTbinning::xmin.

134 {
135  std::string histname, histtitle;
136 
137  std::string currentFolder = folderName_ ;
138  ibooker.setCurrentFolder(currentFolder);
139 
140  switch(quantity_)
141  {
142  case HT:
143  {
144  histname = "ht_variable"; histtitle = "HT";
145  bookME(ibooker,qME_variableBinning_,histname,histtitle,ht_variable_binning_);
146  setHTitle(qME_variableBinning_,"HT [GeV]","events / [GeV]");
147 
148  histname = "htVsLS"; histtitle = "HT vs LS";
150  setHTitle(htVsLS_,"LS","HT [GeV]");
151 
152  histname = "deltaphi_metjet1"; histtitle = "DPHI_METJ1";
154  setHTitle(deltaphimetj1ME_,"delta phi (met, j1)","events / 0.1 rad");
155 
156  histname = "deltaphi_jet1jet2"; histtitle = "DPHI_J1J2";
158  setHTitle(deltaphij1j2ME_,"delta phi (j1, j2)","events / 0.1 rad");
159  break;
160  }
161 
162 
163  case MJJ:
164  {
165  histname = "mjj_variable"; histtitle = "Mjj";
166  bookME(ibooker,qME_variableBinning_,histname,histtitle, ht_variable_binning_);
167  setHTitle(qME_variableBinning_,"Mjj [GeV]","events / [GeV]");
168  break;
169  }
170 
171 
172  case SOFTDROP:
173  {
174  histname = "softdrop_variable"; histtitle = "softdropmass";
175  bookME(ibooker,qME_variableBinning_,histname,histtitle, ht_variable_binning_);
176  setHTitle(qME_variableBinning_,"leading jet softdropmass [GeV]","events / [GeV]");
177  break;
178  }
179  }
180 
181  // Initialize the GenericTriggerEventFlag
182  if ( num_genTriggerEventFlag_ && num_genTriggerEventFlag_->on() ) num_genTriggerEventFlag_->initRun( iRun, iSetup );
183  if ( den_genTriggerEventFlag_ && den_genTriggerEventFlag_->on() ) den_genTriggerEventFlag_->initRun( iRun, iSetup );
184 }
quant quantity_
Definition: HTMonitor.h:91
void setHTitle(HTME &me, const std::string &titleX, const std::string &titleY)
Definition: HTMonitor.cc:86
void bookME(DQMStore::IBooker &, HTME &me, const std::string &histname, const std::string &histtitle, int nbins, double xmin, double xmax)
Definition: HTMonitor.cc:95
HTME qME_variableBinning_
Definition: HTMonitor.h:109
std::vector< double > ht_variable_binning_
Definition: HTMonitor.h:105
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
Definition: HTMonitor.h:115
Definition: HTMonitor.h:44
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
MEHTbinning ht_binning_
Definition: HTMonitor.h:106
MEHTbinning ls_binning_
Definition: HTMonitor.h:107
std::string folderName_
Definition: HTMonitor.h:89
HTME deltaphimetj1ME_
Definition: HTMonitor.h:111
HTME deltaphij1j2ME_
Definition: HTMonitor.h:112
Definition: HT.h:21
HTME htVsLS_
Definition: HTMonitor.h:110
static MEHTbinning phi_binning_
Definition: HTMonitor.h:129
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
Definition: HTMonitor.h:114
void HTMonitor::bookME ( DQMStore::IBooker ibooker,
HTME me,
const std::string &  histname,
const std::string &  histtitle,
int  nbins,
double  xmin,
double  xmax 
)
protected

Definition at line 95 of file HTMonitor.cc.

References DQMStore::IBooker::book1D(), HTMonitor::HTME::denominator, and HTMonitor::HTME::numerator.

Referenced by bookHistograms().

96 {
97  me.numerator = ibooker.book1D(histname+"_numerator", histtitle+" (numerator)", nbins, min, max);
98  me.denominator = ibooker.book1D(histname+"_denominator", histtitle+" (denominator)", nbins, min, max);
99 }
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
T min(T a, T b)
Definition: MathUtil.h:58
void HTMonitor::bookME ( DQMStore::IBooker ibooker,
HTME me,
const std::string &  histname,
const std::string &  histtitle,
const std::vector< double > &  binningX 
)
protected

Definition at line 100 of file HTMonitor.cc.

References DQMStore::IBooker::book1D(), HTMonitor::HTME::denominator, pileupCalc::nbins, and HTMonitor::HTME::numerator.

101 {
102  int nbins = binning.size()-1;
103  std::vector<float> fbinning(binning.begin(),binning.end());
104  float* arr = &fbinning[0];
105  me.numerator = ibooker.book1D(histname+"_numerator", histtitle+" (numerator)", nbins, arr);
106  me.denominator = ibooker.book1D(histname+"_denominator", histtitle+" (denominator)", nbins, arr);
107 }
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
void HTMonitor::bookME ( DQMStore::IBooker ibooker,
HTME me,
const std::string &  histname,
const std::string &  histtitle,
int  nbinsX,
double  xmin,
double  xmax,
double  ymin,
double  ymax 
)
protected

Definition at line 108 of file HTMonitor.cc.

References DQMStore::IBooker::bookProfile(), HTMonitor::HTME::denominator, and HTMonitor::HTME::numerator.

109 {
110  me.numerator = ibooker.bookProfile(histname+"_numerator", histtitle+" (numerator)", nbinsX, xmin, xmax, ymin, ymax);
111  me.denominator = ibooker.bookProfile(histname+"_denominator", histtitle+" (denominator)", nbinsX, xmin, xmax, ymin, ymax);
112 }
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:113
void HTMonitor::bookME ( DQMStore::IBooker ibooker,
HTME me,
const std::string &  histname,
const std::string &  histtitle,
int  nbinsX,
double  xmin,
double  xmax,
int  nbinsY,
double  ymin,
double  ymax 
)
protected

Definition at line 113 of file HTMonitor.cc.

References DQMStore::IBooker::book2D(), HTMonitor::HTME::denominator, and HTMonitor::HTME::numerator.

114 {
115  me.numerator = ibooker.book2D(histname+"_numerator", histtitle+" (numerator)", nbinsX, xmin, xmax, nbinsY, ymin, ymax);
116  me.denominator = ibooker.book2D(histname+"_denominator", histtitle+" (denominator)", nbinsX, xmin, xmax, nbinsY, ymin, ymax);
117 }
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
void HTMonitor::bookME ( DQMStore::IBooker ibooker,
HTME me,
const std::string &  histname,
const std::string &  histtitle,
const std::vector< double > &  binningX,
const std::vector< double > &  binningY 
)
protected

Definition at line 118 of file HTMonitor.cc.

References DQMStore::IBooker::book2D(), HTMonitor::HTME::denominator, and HTMonitor::HTME::numerator.

119 {
120  int nbinsX = binningX.size()-1;
121  std::vector<float> fbinningX(binningX.begin(),binningX.end());
122  float* arrX = &fbinningX[0];
123  int nbinsY = binningY.size()-1;
124  std::vector<float> fbinningY(binningY.begin(),binningY.end());
125  float* arrY = &fbinningY[0];
126 
127  me.numerator = ibooker.book2D(histname+"_numerator", histtitle+" (numerator)", nbinsX, arrX, nbinsY, arrY);
128  me.denominator = ibooker.book2D(histname+"_denominator", histtitle+" (denominator)", nbinsX, arrX, nbinsY, arrY);
129 }
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
void HTMonitor::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 379 of file HTMonitor.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), create_public_pileup_plots::bins, DEFINE_FWK_MODULE, fillHistoLSPSetDescription(), fillHistoPSetDescription(), and AlCaHLTBitMon_QueryRunRegistry::string.

380 {
382  desc.add<std::string> ( "FolderName", "HLT/HT" );
383  desc.add<std::string> ( "quantity", "HT" );
384 
385 
386  desc.add<edm::InputTag>( "met", edm::InputTag("pfMet") );
387  desc.add<edm::InputTag>( "jets", edm::InputTag("ak4PFJetsCHS") );
388  desc.add<edm::InputTag>( "electrons",edm::InputTag("gedGsfElectrons") );
389  desc.add<edm::InputTag>( "muons", edm::InputTag("muons") );
390  desc.add<edm::InputTag>( "vertices",edm::InputTag("offlinePrimaryVertices") );
391  desc.add<std::string>("metSelection", "pt > 0");
392  desc.add<std::string>("jetSelection", "pt > 0");
393  desc.add<std::string>("eleSelection", "pt > 0");
394  desc.add<std::string>("muoSelection", "pt > 0");
395  desc.add<std::string>("jetSelection_HT", "pt > 30 && eta < 2.5");
396  desc.add<unsigned>("njets", 0);
397  desc.add<unsigned>("nelectrons", 0);
398  desc.add<unsigned>("nmuons", 0);
399  desc.add<double>("dEtaCut", 1.3);
400 
401  edm::ParameterSetDescription genericTriggerEventPSet;
402  genericTriggerEventPSet.add<bool>("andOr");
403  genericTriggerEventPSet.add<edm::InputTag>("dcsInputTag", edm::InputTag("scalersRawToDigi") );
404  genericTriggerEventPSet.add<std::vector<int> >("dcsPartitions",{});
405  genericTriggerEventPSet.add<bool>("andOrDcs", false);
406  genericTriggerEventPSet.add<bool>("errorReplyDcs", true);
407  genericTriggerEventPSet.add<std::string>("dbLabel","");
408  genericTriggerEventPSet.add<bool>("andOrHlt", true);
409  genericTriggerEventPSet.add<edm::InputTag>("hltInputTag", edm::InputTag("TriggerResults::HLT") );
410  genericTriggerEventPSet.add<std::vector<std::string> >("hltPaths",{});
411  genericTriggerEventPSet.add<std::string>("hltDBKey","");
412  genericTriggerEventPSet.add<bool>("errorReplyHlt",false);
413  genericTriggerEventPSet.add<unsigned int>("verbosityLevel",1);
414 
415  desc.add<edm::ParameterSetDescription>("numGenericTriggerEventPSet", genericTriggerEventPSet);
416  desc.add<edm::ParameterSetDescription>("denGenericTriggerEventPSet", genericTriggerEventPSet);
417 
420  fillHistoPSetDescription(htPSet);
421  histoPSet.add<edm::ParameterSetDescription>("htPSet", htPSet);
422  std::vector<double> bins = {0.,20.,40.,60.,80.,90.,100.,110.,120.,130.,140.,150.,160.,170.,180.,190.,200.,220.,240.,260.,280.,300.,350.,400.,450.,500.,550.,600.,650.,700.,750.,800.,850.,900.,950.,1000.,1050.,1100.,1200.,1300.,1400.,1500.,2000.,2500.};
423  histoPSet.add<std::vector<double> >("htBinning", bins);
424 
427  histoPSet.add<edm::ParameterSetDescription>("lsPSet", lsPSet);
428 
429  desc.add<edm::ParameterSetDescription>("histoPSet",histoPSet);
430 
431  descriptions.add("htMonitoring", desc);
432 }
static void fillHistoLSPSetDescription(edm::ParameterSetDescription &pset)
Definition: HTMonitor.cc:372
static void fillHistoPSetDescription(edm::ParameterSetDescription &pset)
Definition: HTMonitor.cc:365
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void HTMonitor::fillHistoLSPSetDescription ( edm::ParameterSetDescription pset)
static

Definition at line 372 of file HTMonitor.cc.

References edm::ParameterSetDescription::add().

Referenced by fillDescriptions().

373 {
374  pset.add<unsigned int> ( "nbins", 2500);
375  pset.add<double> ( "xmin", 0.);
376  pset.add<double> ( "xmax", 2500.);
377 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void HTMonitor::fillHistoPSetDescription ( edm::ParameterSetDescription pset)
static

Definition at line 365 of file HTMonitor.cc.

References edm::ParameterSetDescription::add().

Referenced by fillDescriptions().

366 {
367  pset.add<unsigned int> ( "nbins");
368  pset.add<double>( "xmin" );
369  pset.add<double>( "xmax" );
370 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
HTMonitor::MEHTbinning HTMonitor::getHistoLSPSet ( const edm::ParameterSet pset)
staticprivate

Definition at line 77 of file HTMonitor.cc.

References edm::ParameterSet::getParameter().

78 {
80  pset.getParameter<unsigned>("nbins"),
81  0.,
82  double(pset.getParameter<unsigned>("nbins"))
83  };
84 }
T getParameter(std::string const &) const
HTMonitor::MEHTbinning HTMonitor::getHistoPSet ( const edm::ParameterSet pset)
staticprivate

Definition at line 68 of file HTMonitor.cc.

References edm::ParameterSet::getParameter().

69 {
71  pset.getParameter<unsigned>("nbins"),
72  pset.getParameter<double>("xmin"),
73  pset.getParameter<double>("xmax"),
74  };
75 }
T getParameter(std::string const &) const
void HTMonitor::setHTitle ( HTME me,
const std::string &  titleX,
const std::string &  titleY 
)
protected

Definition at line 86 of file HTMonitor.cc.

References HTMonitor::HTME::denominator, HTMonitor::HTME::numerator, and MonitorElement::setAxisTitle().

Referenced by bookHistograms().

87 {
88  me.numerator->setAxisTitle(titleX,1);
89  me.numerator->setAxisTitle(titleY,2);
90  me.denominator->setAxisTitle(titleX,1);
91  me.denominator->setAxisTitle(titleY,2);
92 
93 }

Member Data Documentation

HTME HTMonitor::deltaphij1j2ME_
private

Definition at line 112 of file HTMonitor.h.

Referenced by analyze(), and bookHistograms().

HTME HTMonitor::deltaphimetj1ME_
private

Definition at line 111 of file HTMonitor.h.

Referenced by analyze(), and bookHistograms().

std::unique_ptr<GenericTriggerEventFlag> HTMonitor::den_genTriggerEventFlag_
private

Definition at line 115 of file HTMonitor.h.

Referenced by analyze(), and bookHistograms().

double HTMonitor::dEtaCut_
private

Definition at line 125 of file HTMonitor.h.

Referenced by analyze().

edm::InputTag HTMonitor::eleInputTag_
private

Definition at line 95 of file HTMonitor.h.

Referenced by analyze().

StringCutObjectSelector<reco::GsfElectron,true> HTMonitor::eleSelection_
private

Definition at line 119 of file HTMonitor.h.

Referenced by analyze().

edm::EDGetTokenT<reco::GsfElectronCollection> HTMonitor::eleToken_
private

Definition at line 101 of file HTMonitor.h.

Referenced by analyze().

std::string HTMonitor::folderName_
private

Definition at line 89 of file HTMonitor.h.

Referenced by bookHistograms().

std::string HTMonitor::histoSuffix_
private

Definition at line 90 of file HTMonitor.h.

MEHTbinning HTMonitor::ht_binning_
private

Definition at line 106 of file HTMonitor.h.

Referenced by bookHistograms().

std::vector<double> HTMonitor::ht_variable_binning_
private

Definition at line 105 of file HTMonitor.h.

Referenced by bookHistograms().

HTME HTMonitor::htVsLS_
private

Definition at line 110 of file HTMonitor.h.

Referenced by analyze(), and bookHistograms().

edm::InputTag HTMonitor::jetInputTag_
private

Definition at line 94 of file HTMonitor.h.

Referenced by analyze().

StringCutObjectSelector<reco::Jet,true > HTMonitor::jetSelection_
private

Definition at line 118 of file HTMonitor.h.

Referenced by analyze().

StringCutObjectSelector<reco::Jet,true > HTMonitor::jetSelection_HT_
private

Definition at line 121 of file HTMonitor.h.

Referenced by analyze().

edm::EDGetTokenT< reco::JetView > HTMonitor::jetToken_
private

Definition at line 100 of file HTMonitor.h.

Referenced by analyze().

MEHTbinning HTMonitor::ls_binning_
private

Definition at line 107 of file HTMonitor.h.

Referenced by bookHistograms().

double HTMonitor::MAXedge_PHI = 3.2
staticprivate

Definition at line 127 of file HTMonitor.h.

edm::InputTag HTMonitor::metInputTag_
private

Definition at line 93 of file HTMonitor.h.

Referenced by analyze().

StringCutObjectSelector<reco::MET,true> HTMonitor::metSelection_
private

Definition at line 117 of file HTMonitor.h.

Referenced by analyze().

edm::EDGetTokenT<reco::PFMETCollection> HTMonitor::metToken_
private

Definition at line 99 of file HTMonitor.h.

Referenced by analyze().

edm::InputTag HTMonitor::muoInputTag_
private

Definition at line 96 of file HTMonitor.h.

Referenced by analyze().

StringCutObjectSelector<reco::Muon,true> HTMonitor::muoSelection_
private

Definition at line 120 of file HTMonitor.h.

Referenced by analyze().

edm::EDGetTokenT<reco::MuonCollection> HTMonitor::muoToken_
private

Definition at line 102 of file HTMonitor.h.

Referenced by analyze().

int HTMonitor::Nbin_PHI = 64
staticprivate

Definition at line 128 of file HTMonitor.h.

unsigned HTMonitor::nelectrons_
private

Definition at line 123 of file HTMonitor.h.

Referenced by analyze().

unsigned HTMonitor::njets_
private

Definition at line 122 of file HTMonitor.h.

Referenced by analyze().

unsigned HTMonitor::nmuons_
private

Definition at line 124 of file HTMonitor.h.

Referenced by analyze().

std::unique_ptr<GenericTriggerEventFlag> HTMonitor::num_genTriggerEventFlag_
private

Definition at line 114 of file HTMonitor.h.

Referenced by analyze(), and bookHistograms().

MEHTbinning HTMonitor::phi_binning_
staticprivate
Initial value:
{
Nbin_PHI, -MAXedge_PHI, MAXedge_PHI
}

Definition at line 129 of file HTMonitor.h.

Referenced by bookHistograms().

HTME HTMonitor::qME_variableBinning_
private

Definition at line 109 of file HTMonitor.h.

Referenced by analyze(), and bookHistograms().

quant HTMonitor::quantity_
private

Definition at line 91 of file HTMonitor.h.

Referenced by analyze(), bookHistograms(), and HTMonitor().

edm::InputTag HTMonitor::vtxInputTag_
private

Definition at line 97 of file HTMonitor.h.

Referenced by analyze().

edm::EDGetTokenT<reco::VertexCollection> HTMonitor::vtxToken_
private

Definition at line 103 of file HTMonitor.h.

Referenced by analyze().

std::vector<bool> HTMonitor::warningPrinted4token_
private

Definition at line 133 of file HTMonitor.h.

Referenced by analyze(), and HTMonitor().