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:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Classes

struct  HTME
 
struct  MEHTbinning
 

Public Member Functions

 HTMonitor (const edm::ParameterSet &)
 
 ~HTMonitor () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void beginRun (edm::Run const &, edm::EventSetup const &) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer (void)
 
void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
static void fillHistoLSPSetDescription (edm::ParameterSetDescription &pset)
 
static void fillHistoPSetDescription (edm::ParameterSetDescription &pset)
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr< dqmDetails::NoCacheglobalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr< dqmDetails::NoCacheglobalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

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)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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_
 
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_
 
StringCutObjectSelector< reco::Jet, true > jetSelection_
 
StringCutObjectSelector< reco::Jet, true > jetSelection_HT_
 
edm::EDGetTokenT< reco::JetViewjetToken_
 
MEHTbinning ls_binning_
 
StringCutObjectSelector< reco::MET, true > metSelection_
 
edm::EDGetTokenT< reco::PFMETCollectionmetToken_
 
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::EDGetTokenT< reco::VertexCollectionvtxToken_
 

Static Private Attributes

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

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Detailed Description

Definition at line 50 of file HTMonitor.h.

Constructor & Destructor Documentation

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

Definition at line 11 of file HTMonitor.cc.

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

11  :
12  folderName_ ( iConfig.getParameter<std::string>("FolderName") )
13  , metToken_ ( consumes<reco::PFMETCollection> (iConfig.getParameter<edm::InputTag>("met") ) )
14  , jetToken_ ( mayConsume<reco::JetView> (iConfig.getParameter<edm::InputTag>("jets") ) )
15  , eleToken_ ( mayConsume<reco::GsfElectronCollection>(iConfig.getParameter<edm::InputTag>("electrons") ) )
16  , muoToken_ ( mayConsume<reco::MuonCollection> (iConfig.getParameter<edm::InputTag>("muons") ) )
17  , vtxToken_ ( mayConsume<reco::VertexCollection> (iConfig.getParameter<edm::InputTag>("vertices") ) )
18  , ht_variable_binning_ ( iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("htBinning") )
19  , ht_binning_ ( getHistoPSet (iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet> ("htPSet") ) )
20  , ls_binning_ ( getHistoPSet (iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet> ("lsPSet") ) )
21  , num_genTriggerEventFlag_(new GenericTriggerEventFlag(iConfig.getParameter<edm::ParameterSet>("numGenericTriggerEventPSet"),consumesCollector(), *this))
22  , den_genTriggerEventFlag_(new GenericTriggerEventFlag(iConfig.getParameter<edm::ParameterSet>("denGenericTriggerEventPSet"),consumesCollector(), *this))
23  , metSelection_ ( iConfig.getParameter<std::string>("metSelection") )
24  , jetSelection_ ( iConfig.getParameter<std::string>("jetSelection") )
25  , eleSelection_ ( iConfig.getParameter<std::string>("eleSelection") )
26  , muoSelection_ ( iConfig.getParameter<std::string>("muoSelection") )
27  , jetSelection_HT_ ( iConfig.getParameter<std::string>("jetSelection_HT") )
28  , njets_ ( iConfig.getParameter<unsigned>("njets" ) )
29  , nelectrons_ ( iConfig.getParameter<unsigned>("nelectrons" ) )
30  , nmuons_ ( iConfig.getParameter<unsigned>("nmuons" ) )
31  , dEtaCut_ ( iConfig.getParameter<double>("dEtaCut") )
32 {
33  string quantity = iConfig.getParameter<std::string>("quantity");
34  if(quantity == "HT")
35  {
36  quantity_ = HT;
37  }
38  else if(quantity == "Mjj")
39  {
40  quantity_ = MJJ;
41  }
42  else if(quantity == "softdrop")
43  {
45  }
46  else
47  {
48  throw cms::Exception("quantity not defined") << "the quantity '" << quantity << "' is undefined. Please check your config!" << std::endl;
49  }
50 }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::MuonCollection > muoToken_
Definition: HTMonitor.h:96
edm::EDGetTokenT< reco::JetView > jetToken_
Definition: HTMonitor.h:94
double dEtaCut_
Definition: HTMonitor.h:119
quant quantity_
Definition: HTMonitor.h:91
StringCutObjectSelector< reco::Muon, true > muoSelection_
Definition: HTMonitor.h:114
std::vector< double > ht_variable_binning_
Definition: HTMonitor.h:99
unsigned njets_
Definition: HTMonitor.h:116
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:97
static MEHTbinning getHistoPSet(const edm::ParameterSet &pset)
Definition: HTMonitor.cc:54
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
Definition: HTMonitor.h:109
StringCutObjectSelector< reco::MET, true > metSelection_
Definition: HTMonitor.h:111
Definition: HTMonitor.h:44
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
MEHTbinning ht_binning_
Definition: HTMonitor.h:100
edm::EDGetTokenT< reco::GsfElectronCollection > eleToken_
Definition: HTMonitor.h:95
MEHTbinning ls_binning_
Definition: HTMonitor.h:101
StringCutObjectSelector< reco::Jet, true > jetSelection_HT_
Definition: HTMonitor.h:115
unsigned nelectrons_
Definition: HTMonitor.h:117
StringCutObjectSelector< reco::GsfElectron, true > eleSelection_
Definition: HTMonitor.h:113
StringCutObjectSelector< reco::Jet, true > jetSelection_
Definition: HTMonitor.h:112
std::string folderName_
Definition: HTMonitor.h:89
Definition: HTMonitor.h:44
edm::EDGetTokenT< reco::PFMETCollection > metToken_
Definition: HTMonitor.h:93
unsigned nmuons_
Definition: HTMonitor.h:118
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
Definition: HTMonitor.h:108
HTMonitor::~HTMonitor ( )
overridedefault

Referenced by HTMonitor().

Member Function Documentation

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

Implements edm::stream::EDAnalyzerBase.

Definition at line 176 of file HTMonitor.cc.

References hiPixelPairStep_cff::deltaPhi, deltaphij1j2ME_, deltaphimetj1ME_, den_genTriggerEventFlag_, HTMonitor::HTME::denominator, dEtaCut_, MillePedeFileConverter_cfg::e, electrons_cff::electrons, eleSelection_, eleToken_, reco::tau::disc::Eta(), HcalObjRepresent::Fill(), edm::Event::getByToken(), htVsLS_, edm::EventBase::id(), fwrapper::jets, jetSelection_, jetSelection_HT_, jetToken_, eostools::ls(), edm::EventID::luminosityBlock(), funct::m, metSelection_, metToken_, MJJ, nano_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, badGlobalMuonTaggersAOD_cff::vtx, and vtxToken_.

176  {
177 
178  // Filter out events if Trigger Filtering is requested
179  if (den_genTriggerEventFlag_->on() && ! den_genTriggerEventFlag_->accept( iEvent, iSetup) ) return;
180 
182  iEvent.getByToken( metToken_, metHandle );
183  reco::PFMET pfmet = metHandle->front();
184  if ( ! metSelection_( pfmet ) ) return;
185 
186  edm::Handle<reco::JetView> jetHandle; //add a configurable jet collection & jet pt selection
187  iEvent.getByToken( jetToken_, jetHandle );
188  std::vector<reco::Jet> jets;
189  if ( jetHandle->size() < njets_ ) return;
190  for ( auto const & j : *jetHandle ) {
191  if ( jetSelection_( j ) ) {
192  jets.push_back(j);
193  }
194  }
195 
196  if ( jets.size() < njets_ ) return;
197 
198  float deltaPhi_met_j1 = 10.0;
199  float deltaPhi_j1_j2 = 10.0;
200 
201  if (!jets.empty()) deltaPhi_met_j1 = fabs( deltaPhi( pfmet.phi(), jets[0].phi() ));
202  if (jets.size() >= 2) deltaPhi_j1_j2 = fabs( deltaPhi( jets[0].phi(), jets[1].phi() ));
203 
205  iEvent.getByToken( eleToken_, eleHandle );
206  std::vector<reco::GsfElectron> electrons;
207  if ( eleHandle->size() < nelectrons_ ) return;
208  for ( auto const & e : *eleHandle ) {
209  if ( eleSelection_( e ) ) electrons.push_back(e);
210  }
211  if ( electrons.size() < nelectrons_ ) return;
212 
214  iEvent.getByToken(vtxToken_, vtxHandle);
215 
217  for (auto const & v : *vtxHandle) {
218  bool isFake = v.isFake() ;
219 
220  if (!isFake) {
221  vtx = v;
222  break;
223  }
224  }
225 
227  iEvent.getByToken( muoToken_, muoHandle );
228  if ( muoHandle->size() < nmuons_ ) return;
229  std::vector<reco::Muon> muons;
230  for ( auto const & m : *muoHandle ) {
231  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);
232  }
233  if ( muons.size() < nmuons_ ) return;
234 
235  // fill histograms
236  switch(quantity_)
237  {
238  case HT:
239  {
240  float ht = 0.0;
241  for ( auto const & j : *jetHandle )
242  {
243  if ( jetSelection_HT_(j)) ht += j.pt();
244  }
245 
246  // filling histograms (denominator)
248 
249  deltaphimetj1ME_.denominator -> Fill(deltaPhi_met_j1);
250  deltaphij1j2ME_.denominator -> Fill(deltaPhi_j1_j2);
251 
252  int ls = iEvent.id().luminosityBlock();
253  htVsLS_.denominator -> Fill(ls, ht);
254 
255  // applying selection for numerator
256  if (num_genTriggerEventFlag_->on() && ! num_genTriggerEventFlag_->accept( iEvent, iSetup) ) return;
257 
258  // filling histograms (num_genTriggerEventFlag_)
260 
261  htVsLS_.numerator -> Fill(ls, ht);
262  deltaphimetj1ME_.numerator -> Fill(deltaPhi_met_j1);
263  deltaphij1j2ME_.numerator -> Fill(deltaPhi_j1_j2);
264  break;
265  }
266 
267  case MJJ:
268  {
269  if (jets.size() < 2) return;
270 
271  // deltaEta cut
272  if(fabs(jets[0].p4().Eta() - jets[1].p4().Eta()) >= dEtaCut_) return;
273  float mjj = (jets[0].p4() + jets[1].p4()).M();
274 
276 
277  // applying selection for numerator
278  if (num_genTriggerEventFlag_->on() && ! num_genTriggerEventFlag_->accept( iEvent, iSetup) ) return;
279 
281  break;
282  }
283 
284  case SOFTDROP:
285  {
286  if (jets.size() < 2) return;
287 
288  // deltaEta cut
289  if(fabs(jets[0].p4().Eta() - jets[1].p4().Eta()) >= dEtaCut_) return;
290 
291  float softdrop = jets[0].p4().M();
292 
294 
295  // applying selection for numerator
296  if (num_genTriggerEventFlag_->on() && ! num_genTriggerEventFlag_->accept( iEvent, iSetup) ) return;
297 
298  qME_variableBinning_.numerator -> Fill(softdrop);
299  break;
300  }
301  }
302 }
edm::EDGetTokenT< reco::MuonCollection > muoToken_
Definition: HTMonitor.h:96
edm::EDGetTokenT< reco::JetView > jetToken_
Definition: HTMonitor.h:94
double dEtaCut_
Definition: HTMonitor.h:119
MonitorElement * denominator
Definition: HTMonitor.h:63
quant quantity_
Definition: HTMonitor.h:91
HTME qME_variableBinning_
Definition: HTMonitor.h:103
StringCutObjectSelector< reco::Muon, true > muoSelection_
Definition: HTMonitor.h:114
size_type size() const
unsigned njets_
Definition: HTMonitor.h:116
edm::EDGetTokenT< reco::VertexCollection > vtxToken_
Definition: HTMonitor.h:97
const Point & position() const
position
Definition: Vertex.h:109
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
Definition: HTMonitor.h:109
StringCutObjectSelector< reco::MET, true > metSelection_
Definition: HTMonitor.h:111
Definition: HTMonitor.h:44
int iEvent
Definition: GenABIO.cc:230
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
edm::EDGetTokenT< reco::GsfElectronCollection > eleToken_
Definition: HTMonitor.h:95
def ls(path, rec=False)
Definition: eostools.py:348
StringCutObjectSelector< reco::Jet, true > jetSelection_HT_
Definition: HTMonitor.h:115
unsigned nelectrons_
Definition: HTMonitor.h:117
StringCutObjectSelector< reco::GsfElectron, true > eleSelection_
Definition: HTMonitor.h:113
StringCutObjectSelector< reco::Jet, true > jetSelection_
Definition: HTMonitor.h:112
HTME deltaphimetj1ME_
Definition: HTMonitor.h:105
HTME deltaphij1j2ME_
Definition: HTMonitor.h:106
edm::EDGetTokenT< reco::PFMETCollection > metToken_
Definition: HTMonitor.h:93
Definition: HT.h:21
HTME htVsLS_
Definition: HTMonitor.h:104
double phi() const final
momentum azimuthal angle
unsigned nmuons_
Definition: HTMonitor.h:118
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
Definition: HTMonitor.h:108
void HTMonitor::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 117 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.

120 {
121  std::string histname, histtitle;
122 
123  std::string currentFolder = folderName_ ;
124  ibooker.setCurrentFolder(currentFolder);
125 
126  switch(quantity_)
127  {
128  case HT:
129  {
130  histname = "ht_variable"; histtitle = "HT";
131  bookME(ibooker,qME_variableBinning_,histname,histtitle,ht_variable_binning_);
132  setHTitle(qME_variableBinning_,"HT [GeV]","events / [GeV]");
133 
134  histname = "htVsLS"; histtitle = "HT vs LS";
136  setHTitle(htVsLS_,"LS","HT [GeV]");
137 
138  histname = "deltaphi_metjet1"; histtitle = "DPHI_METJ1";
140  setHTitle(deltaphimetj1ME_,"delta phi (met, j1)","events / 0.1 rad");
141 
142  histname = "deltaphi_jet1jet2"; histtitle = "DPHI_J1J2";
144  setHTitle(deltaphij1j2ME_,"delta phi (j1, j2)","events / 0.1 rad");
145  break;
146  }
147 
148 
149  case MJJ:
150  {
151  histname = "mjj_variable"; histtitle = "Mjj";
152  bookME(ibooker,qME_variableBinning_,histname,histtitle, ht_variable_binning_);
153  setHTitle(qME_variableBinning_,"Mjj [GeV]","events / [GeV]");
154  break;
155  }
156 
157 
158  case SOFTDROP:
159  {
160  histname = "softdrop_variable"; histtitle = "softdropmass";
161  bookME(ibooker,qME_variableBinning_,histname,histtitle, ht_variable_binning_);
162  setHTitle(qME_variableBinning_,"leading jet softdropmass [GeV]","events / [GeV]");
163  break;
164  }
165  }
166 
167  // Initialize the GenericTriggerEventFlag
168  if ( num_genTriggerEventFlag_ && num_genTriggerEventFlag_->on() ) num_genTriggerEventFlag_->initRun( iRun, iSetup );
169  if ( den_genTriggerEventFlag_ && den_genTriggerEventFlag_->on() ) den_genTriggerEventFlag_->initRun( iRun, iSetup );
170 }
quant quantity_
Definition: HTMonitor.h:91
void setHTitle(HTME &me, const std::string &titleX, const std::string &titleY)
Definition: HTMonitor.cc:72
void bookME(DQMStore::IBooker &, HTME &me, const std::string &histname, const std::string &histtitle, int nbins, double xmin, double xmax)
Definition: HTMonitor.cc:81
HTME qME_variableBinning_
Definition: HTMonitor.h:103
std::vector< double > ht_variable_binning_
Definition: HTMonitor.h:99
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
Definition: HTMonitor.h:109
Definition: HTMonitor.h:44
MEHTbinning ht_binning_
Definition: HTMonitor.h:100
MEHTbinning ls_binning_
Definition: HTMonitor.h:101
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
std::string folderName_
Definition: HTMonitor.h:89
HTME deltaphimetj1ME_
Definition: HTMonitor.h:105
HTME deltaphij1j2ME_
Definition: HTMonitor.h:106
Definition: HT.h:21
HTME htVsLS_
Definition: HTMonitor.h:104
static MEHTbinning phi_binning_
Definition: HTMonitor.h:123
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
Definition: HTMonitor.h:108
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 81 of file HTMonitor.cc.

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

Referenced by bookHistograms().

82 {
83  me.numerator = ibooker.book1D(histname+"_numerator", histtitle+" (numerator)", nbins, min, max);
84  me.denominator = ibooker.book1D(histname+"_denominator", histtitle+" (denominator)", nbins, min, max);
85 }
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
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 86 of file HTMonitor.cc.

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

87 {
88  int nbins = binning.size()-1;
89  std::vector<float> fbinning(binning.begin(),binning.end());
90  float* arr = &fbinning[0];
91  me.numerator = ibooker.book1D(histname+"_numerator", histtitle+" (numerator)", nbins, arr);
92  me.denominator = ibooker.book1D(histname+"_denominator", histtitle+" (denominator)", nbins, arr);
93 }
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
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 94 of file HTMonitor.cc.

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

95 {
96  me.numerator = ibooker.bookProfile(histname+"_numerator", histtitle+" (numerator)", nbinsX, xmin, xmax, ymin, ymax);
97  me.denominator = ibooker.bookProfile(histname+"_denominator", histtitle+" (denominator)", nbinsX, xmin, xmax, ymin, ymax);
98 }
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:157
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 99 of file HTMonitor.cc.

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

100 {
101  me.numerator = ibooker.book2D(histname+"_numerator", histtitle+" (numerator)", nbinsX, xmin, xmax, nbinsY, ymin, ymax);
102  me.denominator = ibooker.book2D(histname+"_denominator", histtitle+" (denominator)", nbinsX, xmin, xmax, nbinsY, ymin, ymax);
103 }
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
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 104 of file HTMonitor.cc.

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

105 {
106  int nbinsX = binningX.size()-1;
107  std::vector<float> fbinningX(binningX.begin(),binningX.end());
108  float* arrX = &fbinningX[0];
109  int nbinsY = binningY.size()-1;
110  std::vector<float> fbinningY(binningY.begin(),binningY.end());
111  float* arrY = &fbinningY[0];
112 
113  me.numerator = ibooker.book2D(histname+"_numerator", histtitle+" (numerator)", nbinsX, arrX, nbinsY, arrY);
114  me.denominator = ibooker.book2D(histname+"_denominator", histtitle+" (denominator)", nbinsX, arrX, nbinsY, arrY);
115 }
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
void HTMonitor::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 318 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.

319 {
321  desc.add<std::string> ( "FolderName", "HLT/HT" );
322  desc.add<std::string> ( "quantity", "HT" );
323 
324 
325  desc.add<edm::InputTag>( "met", edm::InputTag("pfMet") );
326  desc.add<edm::InputTag>( "jets", edm::InputTag("ak4PFJetsCHS") );
327  desc.add<edm::InputTag>( "electrons",edm::InputTag("gedGsfElectrons") );
328  desc.add<edm::InputTag>( "muons", edm::InputTag("muons") );
329  desc.add<edm::InputTag>( "vertices",edm::InputTag("offlinePrimaryVertices") );
330  desc.add<std::string>("metSelection", "pt > 0");
331  desc.add<std::string>("jetSelection", "pt > 0");
332  desc.add<std::string>("eleSelection", "pt > 0");
333  desc.add<std::string>("muoSelection", "pt > 0");
334  desc.add<std::string>("jetSelection_HT", "pt > 30 && eta < 2.5");
335  desc.add<unsigned>("njets", 0);
336  desc.add<unsigned>("nelectrons", 0);
337  desc.add<unsigned>("nmuons", 0);
338  desc.add<double>("dEtaCut", 1.3);
339 
340  edm::ParameterSetDescription genericTriggerEventPSet;
341  genericTriggerEventPSet.add<bool>("andOr");
342  genericTriggerEventPSet.add<edm::InputTag>("dcsInputTag", edm::InputTag("scalersRawToDigi") );
343  genericTriggerEventPSet.add<std::vector<int> >("dcsPartitions",{});
344  genericTriggerEventPSet.add<bool>("andOrDcs", false);
345  genericTriggerEventPSet.add<bool>("errorReplyDcs", true);
346  genericTriggerEventPSet.add<std::string>("dbLabel","");
347  genericTriggerEventPSet.add<bool>("andOrHlt", true);
348  genericTriggerEventPSet.add<edm::InputTag>("hltInputTag", edm::InputTag("TriggerResults::HLT") );
349  genericTriggerEventPSet.add<std::vector<std::string> >("hltPaths",{});
350  genericTriggerEventPSet.add<std::string>("hltDBKey","");
351  genericTriggerEventPSet.add<bool>("errorReplyHlt",false);
352  genericTriggerEventPSet.add<unsigned int>("verbosityLevel",1);
353 
354  desc.add<edm::ParameterSetDescription>("numGenericTriggerEventPSet", genericTriggerEventPSet);
355  desc.add<edm::ParameterSetDescription>("denGenericTriggerEventPSet", genericTriggerEventPSet);
356 
359  fillHistoPSetDescription(htPSet);
360  histoPSet.add<edm::ParameterSetDescription>("htPSet", htPSet);
361  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.};
362  histoPSet.add<std::vector<double> >("htBinning", bins);
363 
366  histoPSet.add<edm::ParameterSetDescription>("lsPSet", lsPSet);
367 
368  desc.add<edm::ParameterSetDescription>("histoPSet",histoPSet);
369 
370  descriptions.add("htMonitoring", desc);
371 }
static void fillHistoLSPSetDescription(edm::ParameterSetDescription &pset)
Definition: HTMonitor.cc:311
static void fillHistoPSetDescription(edm::ParameterSetDescription &pset)
Definition: HTMonitor.cc:304
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 311 of file HTMonitor.cc.

References edm::ParameterSetDescription::add().

Referenced by fillDescriptions().

312 {
313  pset.add<unsigned int> ( "nbins", 2500);
314  pset.add<double> ( "xmin", 0.);
315  pset.add<double> ( "xmax", 2500.);
316 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void HTMonitor::fillHistoPSetDescription ( edm::ParameterSetDescription pset)
static

Definition at line 304 of file HTMonitor.cc.

References edm::ParameterSetDescription::add().

Referenced by fillDescriptions().

305 {
306  pset.add<unsigned int> ( "nbins");
307  pset.add<double>( "xmin" );
308  pset.add<double>( "xmax" );
309 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
HTMonitor::MEHTbinning HTMonitor::getHistoLSPSet ( const edm::ParameterSet pset)
staticprivate

Definition at line 63 of file HTMonitor.cc.

References edm::ParameterSet::getParameter().

64 {
66  pset.getParameter<unsigned>("nbins"),
67  0.,
68  double(pset.getParameter<unsigned>("nbins"))
69  };
70 }
T getParameter(std::string const &) const
HTMonitor::MEHTbinning HTMonitor::getHistoPSet ( const edm::ParameterSet pset)
staticprivate

Definition at line 54 of file HTMonitor.cc.

References edm::ParameterSet::getParameter().

55 {
57  pset.getParameter<unsigned>("nbins"),
58  pset.getParameter<double>("xmin"),
59  pset.getParameter<double>("xmax"),
60  };
61 }
T getParameter(std::string const &) const
void HTMonitor::setHTitle ( HTME me,
const std::string &  titleX,
const std::string &  titleY 
)
protected

Definition at line 72 of file HTMonitor.cc.

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

Referenced by bookHistograms().

73 {
74  me.numerator->setAxisTitle(titleX,1);
75  me.numerator->setAxisTitle(titleY,2);
76  me.denominator->setAxisTitle(titleX,1);
77  me.denominator->setAxisTitle(titleY,2);
78 
79 }

Member Data Documentation

HTME HTMonitor::deltaphij1j2ME_
private

Definition at line 106 of file HTMonitor.h.

Referenced by analyze(), and bookHistograms().

HTME HTMonitor::deltaphimetj1ME_
private

Definition at line 105 of file HTMonitor.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 109 of file HTMonitor.h.

Referenced by analyze(), and bookHistograms().

double HTMonitor::dEtaCut_
private

Definition at line 119 of file HTMonitor.h.

Referenced by analyze().

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

Definition at line 113 of file HTMonitor.h.

Referenced by analyze().

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

Definition at line 95 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 100 of file HTMonitor.h.

Referenced by bookHistograms().

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

Definition at line 99 of file HTMonitor.h.

Referenced by bookHistograms().

HTME HTMonitor::htVsLS_
private

Definition at line 104 of file HTMonitor.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 112 of file HTMonitor.h.

Referenced by analyze().

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

Definition at line 115 of file HTMonitor.h.

Referenced by analyze().

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

Definition at line 94 of file HTMonitor.h.

Referenced by analyze().

MEHTbinning HTMonitor::ls_binning_
private

Definition at line 101 of file HTMonitor.h.

Referenced by bookHistograms().

double HTMonitor::MAXedge_PHI = 3.2
staticprivate

Definition at line 121 of file HTMonitor.h.

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

Definition at line 111 of file HTMonitor.h.

Referenced by analyze().

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

Definition at line 93 of file HTMonitor.h.

Referenced by analyze().

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

Definition at line 114 of file HTMonitor.h.

Referenced by analyze().

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

Definition at line 96 of file HTMonitor.h.

Referenced by analyze().

int HTMonitor::Nbin_PHI = 64
staticprivate

Definition at line 122 of file HTMonitor.h.

unsigned HTMonitor::nelectrons_
private

Definition at line 117 of file HTMonitor.h.

Referenced by analyze().

unsigned HTMonitor::njets_
private

Definition at line 116 of file HTMonitor.h.

Referenced by analyze().

unsigned HTMonitor::nmuons_
private

Definition at line 118 of file HTMonitor.h.

Referenced by analyze().

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

Definition at line 108 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 123 of file HTMonitor.h.

Referenced by bookHistograms().

HTME HTMonitor::qME_variableBinning_
private

Definition at line 103 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::EDGetTokenT<reco::VertexCollection> HTMonitor::vtxToken_
private

Definition at line 97 of file HTMonitor.h.

Referenced by analyze().