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
METMonitor Class Reference

#include <METMonitor.h>

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

Classes

struct  MEbinning
 
struct  METME
 

Public Member Functions

 METMonitor (const edm::ParameterSet &)
 
 ~METMonitor () 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 &, METME &me, const std::string &histname, const std::string &histtitle, int nbins, double xmin, double xmax)
 
void bookME (DQMStore::IBooker &, METME &me, const std::string &histname, const std::string &histtitle, const std::vector< double > &binningX)
 
void bookME (DQMStore::IBooker &, METME &me, const std::string &histname, const std::string &histtitle, int nbinsX, double xmin, double xmax, double ymin, double ymax)
 
void bookME (DQMStore::IBooker &, METME &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 &, METME &me, const std::string &histname, const std::string &histtitle, const std::vector< double > &binningX, const std::vector< double > &binningY)
 
void setMETitle (METME &me, const std::string &titleX, const std::string &titleY)
 

Static Private Member Functions

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

Private Attributes

METME deltaphij1j2ME_
 
METME deltaphimetj1ME_
 
std::unique_ptr< GenericTriggerEventFlagden_genTriggerEventFlag_
 
edm::InputTag eleInputTag_
 
StringCutObjectSelector< reco::GsfElectron, true > eleSelection_
 
edm::EDGetTokenT< reco::GsfElectronCollectioneleToken_
 
std::string folderName_
 
std::string histoSuffix_
 
edm::InputTag jetInputTag_
 
StringCutObjectSelector< reco::PFJet, true > jetSelection_
 
edm::EDGetTokenT< reco::PFJetCollectionjetToken_
 
MEbinning ls_binning_
 
MEbinning met_binning_
 
std::vector< double > met_variable_binning_
 
edm::InputTag metInputTag_
 
METME metME_
 
METME metME_variableBinning_
 
METME metPhiME_
 
StringCutObjectSelector< reco::MET, true > metSelection_
 
edm::EDGetTokenT< reco::PFMETCollectionmetToken_
 
METME metVsLS_
 
edm::InputTag muoInputTag_
 
StringCutObjectSelector< reco::Muon, true > muoSelection_
 
edm::EDGetTokenT< reco::MuonCollectionmuoToken_
 
unsigned nelectrons_
 
unsigned njets_
 
unsigned nmuons_
 
std::unique_ptr< GenericTriggerEventFlagnum_genTriggerEventFlag_
 
edm::InputTag vtxInputTag_
 
edm::EDGetTokenT< reco::VertexCollectionvtxToken_
 
std::vector< bool > warningPrinted4token_
 

Static Private Attributes

static double MAX_PHI = 3.2
 
static int N_PHI = 64
 
static MEbinning phi_binning_
 

Detailed Description

Definition at line 49 of file METMonitor.h.

Constructor & Destructor Documentation

METMonitor::METMonitor ( const edm::ParameterSet iConfig)

Definition at line 15 of file METMonitor.cc.

References warningPrinted4token_, and ~METMonitor().

15  :
16  folderName_ ( iConfig.getParameter<std::string>("FolderName") )
17  , metInputTag_ ( iConfig.getParameter<edm::InputTag> ("met") )
18  , jetInputTag_ ( iConfig.getParameter<edm::InputTag> ("jets") )
19  , eleInputTag_ ( iConfig.getParameter<edm::InputTag> ("electrons") )
20  , muoInputTag_ ( iConfig.getParameter<edm::InputTag> ("muons") )
21  , vtxInputTag_ ( iConfig.getParameter<edm::InputTag> ("vertices") )
22  , metToken_ ( consumes<reco::PFMETCollection> ( metInputTag_ ) )
23  , jetToken_ ( mayConsume<reco::PFJetCollection> ( jetInputTag_ ) )
24  , eleToken_ ( mayConsume<reco::GsfElectronCollection>( eleInputTag_ ) )
25  , muoToken_ ( mayConsume<reco::MuonCollection> ( muoInputTag_ ) )
26  , vtxToken_ ( mayConsume<reco::VertexCollection> ( vtxInputTag_ ) )
27  , met_variable_binning_ ( iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("metBinning") )
28  , met_binning_ ( getHistoPSet (iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet> ("metPSet") ) )
29  , ls_binning_ ( getHistoPSet (iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet> ("lsPSet") ) )
30  , num_genTriggerEventFlag_(new GenericTriggerEventFlag(iConfig.getParameter<edm::ParameterSet>("numGenericTriggerEventPSet"),consumesCollector(), *this))
31  , den_genTriggerEventFlag_(new GenericTriggerEventFlag(iConfig.getParameter<edm::ParameterSet>("denGenericTriggerEventPSet"),consumesCollector(), *this))
32  , metSelection_ ( iConfig.getParameter<std::string>("metSelection") )
33  , jetSelection_ ( iConfig.getParameter<std::string>("jetSelection") )
34  , eleSelection_ ( iConfig.getParameter<std::string>("eleSelection") )
35  , muoSelection_ ( iConfig.getParameter<std::string>("muoSelection") )
36  , njets_ ( iConfig.getParameter<unsigned>("njets" ) )
37  , nelectrons_ ( iConfig.getParameter<unsigned>("nelectrons" ) )
38  , nmuons_ ( iConfig.getParameter<unsigned>("nmuons" ) )
39 {
40  // this vector has to be alligned to the the number of Tokens accessed by this module
41  warningPrinted4token_.push_back(false); // PFMETCollection
42  warningPrinted4token_.push_back(false); // JetCollection
43  warningPrinted4token_.push_back(false); // GsfElectronCollection
44  warningPrinted4token_.push_back(false); // MuonCollection
45  warningPrinted4token_.push_back(false); // VertexCollection
46 }
T getParameter(std::string const &) const
unsigned nmuons_
Definition: METMonitor.h:124
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
Definition: METMonitor.h:115
edm::InputTag vtxInputTag_
Definition: METMonitor.h:95
static MEbinning getHistoPSet(const edm::ParameterSet &pset)
Definition: METMonitor.cc:50
edm::InputTag muoInputTag_
Definition: METMonitor.h:94
edm::EDGetTokenT< reco::VertexCollection > vtxToken_
Definition: METMonitor.h:101
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
StringCutObjectSelector< reco::Muon, true > muoSelection_
Definition: METMonitor.h:120
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
Definition: METMonitor.h:114
edm::InputTag eleInputTag_
Definition: METMonitor.h:93
StringCutObjectSelector< reco::GsfElectron, true > eleSelection_
Definition: METMonitor.h:119
std::string folderName_
Definition: METMonitor.h:88
unsigned njets_
Definition: METMonitor.h:122
StringCutObjectSelector< reco::PFJet, true > jetSelection_
Definition: METMonitor.h:118
edm::EDGetTokenT< reco::GsfElectronCollection > eleToken_
Definition: METMonitor.h:99
MEbinning met_binning_
Definition: METMonitor.h:104
edm::EDGetTokenT< reco::PFJetCollection > jetToken_
Definition: METMonitor.h:98
edm::EDGetTokenT< reco::PFMETCollection > metToken_
Definition: METMonitor.h:97
edm::EDGetTokenT< reco::MuonCollection > muoToken_
Definition: METMonitor.h:100
unsigned nelectrons_
Definition: METMonitor.h:123
std::vector< double > met_variable_binning_
Definition: METMonitor.h:103
edm::InputTag metInputTag_
Definition: METMonitor.h:91
MEbinning ls_binning_
Definition: METMonitor.h:105
StringCutObjectSelector< reco::MET, true > metSelection_
Definition: METMonitor.h:117
edm::InputTag jetInputTag_
Definition: METMonitor.h:92
std::vector< bool > warningPrinted4token_
Definition: METMonitor.h:132
METMonitor::~METMonitor ( )
overridedefault

Referenced by METMonitor().

Member Function Documentation

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

Definition at line 157 of file METMonitor.cc.

References hiPixelPairStep_cff::deltaPhi, deltaphij1j2ME_, deltaphimetj1ME_, den_genTriggerEventFlag_, METMonitor::METME::denominator, MillePedeFileConverter_cfg::e, nano_cff::electrons, eleInputTag_, eleSelection_, eleToken_, HcalObjRepresent::Fill(), edm::Event::getByToken(), edm::EventBase::id(), edm::HandleBase::isValid(), jetInputTag_, fwrapper::jets, jetSelection_, jetToken_, edm::InputTag::label(), eostools::ls(), edm::EventID::luminosityBlock(), funct::m, RazorAnalyzer::met, metInputTag_, metME_, metME_variableBinning_, metPhiME_, metSelection_, metToken_, metVsLS_, muoInputTag_, extraflags_cff::muons, muoSelection_, muoToken_, nelectrons_, njets_, nmuons_, num_genTriggerEventFlag_, METMonitor::METME::numerator, phi, reco::LeafCandidate::phi(), reco::Vertex::position(), reco::LeafCandidate::pt(), findQualityFiles::v, extraflags_cff::vtx, vtxInputTag_, vtxToken_, and warningPrinted4token_.

157  {
158  // Filter out events if Trigger Filtering is requested
159  if (den_genTriggerEventFlag_->on() && ! den_genTriggerEventFlag_->accept( iEvent, iSetup) ) return;
161  iEvent.getByToken( metToken_, metHandle );
162  if ( !metHandle.isValid() ) {
163  if (!warningPrinted4token_[0]) {
164  edm::LogWarning("METMonitor") << "skipping events because the collection " << metInputTag_.label().c_str() << " is not available";
165  warningPrinted4token_[0] = true;
166  }
167  return;
168  }
169  reco::PFMET pfmet = metHandle->front();
170  if ( ! metSelection_( pfmet ) ) return;
171 
172  float met = pfmet.pt();
173  float phi = pfmet.phi();
174 
175  std::vector<reco::PFJet> jets;
177  iEvent.getByToken( jetToken_, jetHandle );
178  if ( jetHandle.isValid() ) {
179  if ( jetHandle->size() < njets_ ) return;
180  for ( auto const & j : *jetHandle ) {
181  if ( jetSelection_(j) ) {
182  jets.push_back(j);
183  }
184  }
185  } else {
186  if (!warningPrinted4token_[1]) {
187  if ( jetInputTag_.label().empty() )
188  edm::LogWarning("METMonitor") << "JetCollection not set";
189  else
190  edm::LogWarning("METMonitor") << "skipping events because the collection " << jetInputTag_.label().c_str() << " is not available";
191  warningPrinted4token_[1] = true;
192  }
193  // if Handle is not valid, because the InputTag has been mis-configured, then skip the event
194  if ( !jetInputTag_.label().empty() ) return;
195  }
196  float deltaPhi_met_j1= 10.0;
197  float deltaPhi_j1_j2 = 10.0;
198 
199  if (!jets.empty() ) deltaPhi_met_j1 = fabs( deltaPhi( pfmet.phi(), jets[0].phi() ));
200  if (jets.size() >= 2) deltaPhi_j1_j2 = fabs( deltaPhi( jets[0].phi(), jets[1].phi() ));
201 
202  std::vector<reco::GsfElectron> electrons;
204  iEvent.getByToken( eleToken_, eleHandle );
205  if ( eleHandle.isValid() ) {
206  if ( eleHandle->size() < nelectrons_ ) return;
207  for ( auto const & e : *eleHandle ) {
208  if ( eleSelection_( e ) ) electrons.push_back(e);
209  }
210  if (electrons.size() < nelectrons_ ) return;
211  } else {
212  if (!warningPrinted4token_[2]) {
213  warningPrinted4token_[2] = true;
214  if ( eleInputTag_.label().empty() )
215  edm::LogWarning("METMonitor") << "GsfElectronCollection not set";
216  else
217  edm::LogWarning("METMonitor") << "skipping events because the collection " << eleInputTag_.label().c_str() << " is not available";
218  }
219  if ( !eleInputTag_.label().empty() ) return;
220  }
221 
224  iEvent.getByToken(vtxToken_, vtxHandle);
225  if ( vtxHandle.isValid() ) {
226  for (auto const & v : *vtxHandle) {
227  bool isFake = v.isFake() ;
228 
229  if (!isFake) {
230  vtx = v;
231  break;
232  }
233  }
234  } else {
235  if (!warningPrinted4token_[3]) {
236  warningPrinted4token_[3] = true;
237  if ( vtxInputTag_.label().empty() )
238  edm::LogWarning("METMonitor") << "VertexCollection is not set";
239  else
240  edm::LogWarning("METMonitor") << "skipping events because the collection " << vtxInputTag_.label().c_str() << " is not available";
241  }
242  if ( !vtxInputTag_.label().empty() ) return;
243  }
244 
245 
246  std::vector<reco::Muon> muons;
248  iEvent.getByToken( muoToken_, muoHandle );
249  if ( muoHandle.isValid() ) {
250  if ( muoHandle->size() < nmuons_ ) return;
251  for ( auto const & m : *muoHandle ) {
252  bool pass = 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;
253  if ( muoSelection_( m ) && pass ) muons.push_back(m);
254  }
255  if ( muons.size() < nmuons_ ) return;
256  } else {
257  if (!warningPrinted4token_[4]) {
258  warningPrinted4token_[4] = true;
259  if ( muoInputTag_.label().empty() )
260  edm::LogWarning("METMonitor") << "MuonCollection not set";
261  else
262  edm::LogWarning("METMonitor") << "skipping events because the collection " << muoInputTag_.label().c_str() << " is not available";
263  }
264  if ( !muoInputTag_.label().empty() ) return;
265  }
266 
267  // filling histograms (denominator)
268  metME_.denominator -> Fill(met);
270  metPhiME_.denominator -> Fill(phi);
271  deltaphimetj1ME_.denominator -> Fill(deltaPhi_met_j1);
272  deltaphij1j2ME_.denominator -> Fill(deltaPhi_j1_j2);
273 
274  int ls = iEvent.id().luminosityBlock();
275  metVsLS_.denominator -> Fill(ls, met);
276  // applying selection for numerator
277  if (num_genTriggerEventFlag_->on() && ! num_genTriggerEventFlag_->accept( iEvent, iSetup) ) return;
278 
279  // filling histograms (num_genTriggerEventFlag_)
280  metME_.numerator -> Fill(met);
282  metPhiME_.numerator -> Fill(phi);
283  metVsLS_.numerator -> Fill(ls, met);
284  deltaphimetj1ME_.numerator -> Fill(deltaPhi_met_j1);
285  deltaphij1j2ME_.numerator -> Fill(deltaPhi_j1_j2);
286 }
unsigned nmuons_
Definition: METMonitor.h:124
edm::InputTag vtxInputTag_
Definition: METMonitor.h:95
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
Definition: METMonitor.h:115
MonitorElement * numerator
Definition: METMonitor.h:60
edm::InputTag muoInputTag_
Definition: METMonitor.h:94
edm::EDGetTokenT< reco::VertexCollection > vtxToken_
Definition: METMonitor.h:101
double pt() const final
transverse momentum
StringCutObjectSelector< reco::Muon, true > muoSelection_
Definition: METMonitor.h:120
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
Definition: METMonitor.h:114
edm::InputTag eleInputTag_
Definition: METMonitor.h:93
StringCutObjectSelector< reco::GsfElectron, true > eleSelection_
Definition: METMonitor.h:119
METME metME_variableBinning_
Definition: METMonitor.h:108
const Point & position() const
position
Definition: Vertex.h:109
unsigned njets_
Definition: METMonitor.h:122
StringCutObjectSelector< reco::PFJet, true > jetSelection_
Definition: METMonitor.h:118
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< reco::GsfElectronCollection > eleToken_
Definition: METMonitor.h:99
MonitorElement * denominator
Definition: METMonitor.h:61
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
edm::EDGetTokenT< reco::PFJetCollection > jetToken_
Definition: METMonitor.h:98
vector< PseudoJet > jets
edm::EDGetTokenT< reco::PFMETCollection > metToken_
Definition: METMonitor.h:97
edm::EDGetTokenT< reco::MuonCollection > muoToken_
Definition: METMonitor.h:100
METME deltaphij1j2ME_
Definition: METMonitor.h:112
bool isValid() const
Definition: HandleBase.h:74
def ls(path, rec=False)
Definition: eostools.py:349
unsigned nelectrons_
Definition: METMonitor.h:123
met
===> hadronic RAZOR
METME metPhiME_
Definition: METMonitor.h:110
METME metVsLS_
Definition: METMonitor.h:109
std::string const & label() const
Definition: InputTag.h:36
edm::InputTag metInputTag_
Definition: METMonitor.h:91
StringCutObjectSelector< reco::MET, true > metSelection_
Definition: METMonitor.h:117
edm::InputTag jetInputTag_
Definition: METMonitor.h:92
METME deltaphimetj1ME_
Definition: METMonitor.h:111
std::vector< bool > warningPrinted4token_
Definition: METMonitor.h:132
METME metME_
Definition: METMonitor.h:107
double phi() const final
momentum azimuthal angle
void METMonitor::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprotected

Definition at line 113 of file METMonitor.cc.

References bookME(), deltaphij1j2ME_, deltaphimetj1ME_, den_genTriggerEventFlag_, folderName_, ls_binning_, met_binning_, met_variable_binning_, metME_, metME_variableBinning_, metPhiME_, metVsLS_, METMonitor::MEbinning::nbins, num_genTriggerEventFlag_, phi_binning_, DQMStore::IBooker::setCurrentFolder(), setMETitle(), AlCaHLTBitMon_QueryRunRegistry::string, METMonitor::MEbinning::xmax, and METMonitor::MEbinning::xmin.

116 {
117 
118  std::string histname, histtitle;
119 
120  std::string currentFolder = folderName_ ;
121  ibooker.setCurrentFolder(currentFolder);
122 
123  histname = "deltaphi_metjet1"; histtitle = "DPHI_METJ1";
125  setMETitle(deltaphimetj1ME_,"delta phi (met, j1)","events / 0.1 rad");
126 
127  histname = "deltaphi_jet1jet2"; histtitle = "DPHI_J1J2";
129  setMETitle(deltaphij1j2ME_,"delta phi (j1, j2)","events / 0.1 rad");
130 
131  histname = "met"; histtitle = "PFMET";
132  bookME(ibooker,metME_,histname,histtitle,met_binning_.nbins,met_binning_.xmin, met_binning_.xmax);
133  setMETitle(metME_,"PF MET [GeV]","events / [GeV]");
134 
135  histname = "met_variable"; histtitle = "PFMET";
136  bookME(ibooker,metME_variableBinning_,histname,histtitle,met_variable_binning_);
137  setMETitle(metME_variableBinning_,"PF MET [GeV]","events / [GeV]");
138 
139  histname = "metVsLS"; histtitle = "PFMET vs LS";
141  setMETitle(metVsLS_,"LS","PF MET [GeV]");
142 
143  histname = "metPhi"; histtitle = "PFMET phi";
144  bookME(ibooker,metPhiME_,histname,histtitle, phi_binning_.nbins, phi_binning_.xmin, phi_binning_.xmax);
145  setMETitle(metPhiME_,"PF MET #phi","events / 0.1 rad");
146 
147  // Initialize the GenericTriggerEventFlag
148  if ( num_genTriggerEventFlag_ && num_genTriggerEventFlag_->on() ) num_genTriggerEventFlag_->initRun( iRun, iSetup );
149  if ( den_genTriggerEventFlag_ && den_genTriggerEventFlag_->on() ) den_genTriggerEventFlag_->initRun( iRun, iSetup );
150 
151 }
void setMETitle(METME &me, const std::string &titleX, const std::string &titleY)
Definition: METMonitor.cc:68
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
Definition: METMonitor.h:115
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
Definition: METMonitor.h:114
METME metME_variableBinning_
Definition: METMonitor.h:108
std::string folderName_
Definition: METMonitor.h:88
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
MEbinning met_binning_
Definition: METMonitor.h:104
METME deltaphij1j2ME_
Definition: METMonitor.h:112
void bookME(DQMStore::IBooker &, METME &me, const std::string &histname, const std::string &histtitle, int nbins, double xmin, double xmax)
Definition: METMonitor.cc:77
static MEbinning phi_binning_
Definition: METMonitor.h:128
std::vector< double > met_variable_binning_
Definition: METMonitor.h:103
METME metPhiME_
Definition: METMonitor.h:110
METME metVsLS_
Definition: METMonitor.h:109
MEbinning ls_binning_
Definition: METMonitor.h:105
METME deltaphimetj1ME_
Definition: METMonitor.h:111
METME metME_
Definition: METMonitor.h:107
void METMonitor::bookME ( DQMStore::IBooker ibooker,
METME me,
const std::string &  histname,
const std::string &  histtitle,
int  nbins,
double  xmin,
double  xmax 
)
protected

Definition at line 77 of file METMonitor.cc.

References DQMStore::IBooker::book1D(), METMonitor::METME::denominator, and METMonitor::METME::numerator.

Referenced by bookHistograms().

78 {
79  me.numerator = ibooker.book1D(histname+"_numerator", histtitle+" (numerator)", nbins, min, max);
80  me.denominator = ibooker.book1D(histname+"_denominator", histtitle+" (denominator)", nbins, min, max);
81 }
MonitorElement * numerator
Definition: BPHMonitor.h:68
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
MonitorElement * denominator
Definition: BPHMonitor.h:69
T min(T a, T b)
Definition: MathUtil.h:58
void METMonitor::bookME ( DQMStore::IBooker ibooker,
METME me,
const std::string &  histname,
const std::string &  histtitle,
const std::vector< double > &  binningX 
)
protected

Definition at line 82 of file METMonitor.cc.

References DQMStore::IBooker::book1D(), METMonitor::METME::denominator, pileupCalc::nbins, and METMonitor::METME::numerator.

83 {
84  int nbins = binning.size()-1;
85  std::vector<float> fbinning(binning.begin(),binning.end());
86  float* arr = &fbinning[0];
87  me.numerator = ibooker.book1D(histname+"_numerator", histtitle+" (numerator)", nbins, arr);
88  me.denominator = ibooker.book1D(histname+"_denominator", histtitle+" (denominator)", nbins, arr);
89 }
MonitorElement * numerator
Definition: BPHMonitor.h:68
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
MonitorElement * denominator
Definition: BPHMonitor.h:69
void METMonitor::bookME ( DQMStore::IBooker ibooker,
METME me,
const std::string &  histname,
const std::string &  histtitle,
int  nbinsX,
double  xmin,
double  xmax,
double  ymin,
double  ymax 
)
protected

Definition at line 90 of file METMonitor.cc.

References DQMStore::IBooker::bookProfile(), METMonitor::METME::denominator, and METMonitor::METME::numerator.

91 {
92  me.numerator = ibooker.bookProfile(histname+"_numerator", histtitle+" (numerator)", nbinsX, xmin, xmax, ymin, ymax);
93  me.denominator = ibooker.bookProfile(histname+"_denominator", histtitle+" (denominator)", nbinsX, xmin, xmax, ymin, ymax);
94 }
MonitorElement * numerator
Definition: BPHMonitor.h:68
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:113
MonitorElement * denominator
Definition: BPHMonitor.h:69
void METMonitor::bookME ( DQMStore::IBooker ibooker,
METME 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 95 of file METMonitor.cc.

References DQMStore::IBooker::book2D(), METMonitor::METME::denominator, and METMonitor::METME::numerator.

96 {
97  me.numerator = ibooker.book2D(histname+"_numerator", histtitle+" (numerator)", nbinsX, xmin, xmax, nbinsY, ymin, ymax);
98  me.denominator = ibooker.book2D(histname+"_denominator", histtitle+" (denominator)", nbinsX, xmin, xmax, nbinsY, ymin, ymax);
99 }
MonitorElement * numerator
Definition: BPHMonitor.h:68
MonitorElement * denominator
Definition: BPHMonitor.h:69
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
void METMonitor::bookME ( DQMStore::IBooker ibooker,
METME me,
const std::string &  histname,
const std::string &  histtitle,
const std::vector< double > &  binningX,
const std::vector< double > &  binningY 
)
protected

Definition at line 100 of file METMonitor.cc.

References DQMStore::IBooker::book2D(), METMonitor::METME::denominator, and METMonitor::METME::numerator.

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

Definition at line 302 of file METMonitor.cc.

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

303 {
305  desc.add<std::string> ( "FolderName", "HLT/MET" );
306 
307  desc.add<edm::InputTag>( "met", edm::InputTag("pfMet") );
308  desc.add<edm::InputTag>( "jets", edm::InputTag("ak4PFJetsCHS") );
309  desc.add<edm::InputTag>( "electrons",edm::InputTag("gedGsfElectrons") );
310  desc.add<edm::InputTag>( "muons", edm::InputTag("muons") );
311  desc.add<edm::InputTag>( "vertices",edm::InputTag("offlinePrimaryVertices") );
312  desc.add<std::string>("metSelection", "pt > 0");
313  desc.add<std::string>("jetSelection", "pt > 0");
314  desc.add<std::string>("eleSelection", "pt > 0");
315  desc.add<std::string>("muoSelection", "pt > 0");
316  desc.add<unsigned>("njets", 0);
317  desc.add<unsigned>("nelectrons", 0);
318  desc.add<unsigned>("nmuons", 0);
319 
320  edm::ParameterSetDescription genericTriggerEventPSet;
321  genericTriggerEventPSet.add<bool>("andOr");
322  genericTriggerEventPSet.add<edm::InputTag>("dcsInputTag", edm::InputTag("scalersRawToDigi") );
323  genericTriggerEventPSet.add<std::vector<int> >("dcsPartitions",{});
324  genericTriggerEventPSet.add<bool>("andOrDcs", false);
325  genericTriggerEventPSet.add<bool>("errorReplyDcs", true);
326  genericTriggerEventPSet.add<std::string>("dbLabel","");
327  genericTriggerEventPSet.add<bool>("andOrHlt", true);
328  genericTriggerEventPSet.add<edm::InputTag>("hltInputTag", edm::InputTag("TriggerResults::HLT") );
329  genericTriggerEventPSet.add<std::vector<std::string> >("hltPaths",{});
330  genericTriggerEventPSet.add<std::string>("hltDBKey","");
331  genericTriggerEventPSet.add<bool>("errorReplyHlt",false);
332  genericTriggerEventPSet.add<unsigned int>("verbosityLevel",1);
333 
334  desc.add<edm::ParameterSetDescription>("numGenericTriggerEventPSet", genericTriggerEventPSet);
335  desc.add<edm::ParameterSetDescription>("denGenericTriggerEventPSet", genericTriggerEventPSet);
336 
339  fillHistoPSetDescription(metPSet);
340  histoPSet.add<edm::ParameterSetDescription>("metPSet", metPSet);
341  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.,1000.};
342  histoPSet.add<std::vector<double> >("metBinning", bins);
343 
346  histoPSet.add<edm::ParameterSetDescription>("lsPSet", lsPSet);
347 
348  desc.add<edm::ParameterSetDescription>("histoPSet",histoPSet);
349 
350  descriptions.add("metMonitoring", desc);
351 }
static void fillHistoPSetDescription(edm::ParameterSetDescription &pset)
Definition: METMonitor.cc:288
static void fillHistoLSPSetDescription(edm::ParameterSetDescription &pset)
Definition: METMonitor.cc:295
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void METMonitor::fillHistoLSPSetDescription ( edm::ParameterSetDescription pset)
static

Definition at line 295 of file METMonitor.cc.

References edm::ParameterSetDescription::add().

Referenced by fillDescriptions().

296 {
297  pset.add<unsigned int> ( "nbins", 2500 );
298  pset.add<double> ( "xmin", 0.);
299  pset.add<double> ( "xmax", 2500.);
300 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void METMonitor::fillHistoPSetDescription ( edm::ParameterSetDescription pset)
static

Definition at line 288 of file METMonitor.cc.

References edm::ParameterSetDescription::add().

Referenced by fillDescriptions().

289 {
290  pset.add<unsigned> ( "nbins");
291  pset.add<double>( "xmin" );
292  pset.add<double>( "xmax" );
293 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
METMonitor::MEbinning METMonitor::getHistoLSPSet ( const edm::ParameterSet pset)
staticprivate

Definition at line 59 of file METMonitor.cc.

References edm::ParameterSet::getParameter().

60 {
61  return METMonitor::MEbinning{
62  pset.getParameter<unsigned>("nbins"),
63  0.,
64  double(pset.getParameter<unsigned>("nbins"))
65  };
66 }
T getParameter(std::string const &) const
METMonitor::MEbinning METMonitor::getHistoPSet ( const edm::ParameterSet pset)
staticprivate

Definition at line 50 of file METMonitor.cc.

References edm::ParameterSet::getParameter().

51 {
52  return METMonitor::MEbinning{
53  pset.getParameter<unsigned>("nbins"),
54  pset.getParameter<double>("xmin"),
55  pset.getParameter<double>("xmax"),
56  };
57 }
T getParameter(std::string const &) const
void METMonitor::setMETitle ( METME me,
const std::string &  titleX,
const std::string &  titleY 
)
protected

Definition at line 68 of file METMonitor.cc.

References METMonitor::METME::denominator, METMonitor::METME::numerator, and MonitorElement::setAxisTitle().

Referenced by bookHistograms().

69 {
70  me.numerator->setAxisTitle(titleX,1);
71  me.numerator->setAxisTitle(titleY,2);
72  me.denominator->setAxisTitle(titleX,1);
73  me.denominator->setAxisTitle(titleY,2);
74 
75 }
MonitorElement * numerator
Definition: BPHMonitor.h:68
MonitorElement * denominator
Definition: BPHMonitor.h:69
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)

Member Data Documentation

METME METMonitor::deltaphij1j2ME_
private

Definition at line 112 of file METMonitor.h.

Referenced by analyze(), and bookHistograms().

METME METMonitor::deltaphimetj1ME_
private

Definition at line 111 of file METMonitor.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 115 of file METMonitor.h.

Referenced by analyze(), and bookHistograms().

edm::InputTag METMonitor::eleInputTag_
private

Definition at line 93 of file METMonitor.h.

Referenced by analyze().

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

Definition at line 119 of file METMonitor.h.

Referenced by analyze().

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

Definition at line 99 of file METMonitor.h.

Referenced by analyze().

std::string METMonitor::folderName_
private

Definition at line 88 of file METMonitor.h.

Referenced by bookHistograms().

std::string METMonitor::histoSuffix_
private

Definition at line 89 of file METMonitor.h.

edm::InputTag METMonitor::jetInputTag_
private

Definition at line 92 of file METMonitor.h.

Referenced by analyze().

StringCutObjectSelector<reco::PFJet,true > METMonitor::jetSelection_
private

Definition at line 118 of file METMonitor.h.

Referenced by analyze().

edm::EDGetTokenT<reco::PFJetCollection> METMonitor::jetToken_
private

Definition at line 98 of file METMonitor.h.

Referenced by analyze().

MEbinning METMonitor::ls_binning_
private

Definition at line 105 of file METMonitor.h.

Referenced by bookHistograms().

double METMonitor::MAX_PHI = 3.2
staticprivate

Definition at line 126 of file METMonitor.h.

MEbinning METMonitor::met_binning_
private

Definition at line 104 of file METMonitor.h.

Referenced by bookHistograms().

std::vector<double> METMonitor::met_variable_binning_
private

Definition at line 103 of file METMonitor.h.

Referenced by bookHistograms().

edm::InputTag METMonitor::metInputTag_
private

Definition at line 91 of file METMonitor.h.

Referenced by analyze().

METME METMonitor::metME_
private

Definition at line 107 of file METMonitor.h.

Referenced by analyze(), and bookHistograms().

METME METMonitor::metME_variableBinning_
private

Definition at line 108 of file METMonitor.h.

Referenced by analyze(), and bookHistograms().

METME METMonitor::metPhiME_
private

Definition at line 110 of file METMonitor.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 117 of file METMonitor.h.

Referenced by analyze().

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

Definition at line 97 of file METMonitor.h.

Referenced by analyze().

METME METMonitor::metVsLS_
private

Definition at line 109 of file METMonitor.h.

Referenced by analyze(), and bookHistograms().

edm::InputTag METMonitor::muoInputTag_
private

Definition at line 94 of file METMonitor.h.

Referenced by analyze().

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

Definition at line 120 of file METMonitor.h.

Referenced by analyze().

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

Definition at line 100 of file METMonitor.h.

Referenced by analyze().

int METMonitor::N_PHI = 64
staticprivate

Definition at line 127 of file METMonitor.h.

unsigned METMonitor::nelectrons_
private

Definition at line 123 of file METMonitor.h.

Referenced by analyze().

unsigned METMonitor::njets_
private

Definition at line 122 of file METMonitor.h.

Referenced by analyze().

unsigned METMonitor::nmuons_
private

Definition at line 124 of file METMonitor.h.

Referenced by analyze().

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

Definition at line 114 of file METMonitor.h.

Referenced by analyze(), and bookHistograms().

MEbinning METMonitor::phi_binning_
staticprivate
Initial value:
{
N_PHI, -MAX_PHI, MAX_PHI
}

Definition at line 128 of file METMonitor.h.

Referenced by bookHistograms().

edm::InputTag METMonitor::vtxInputTag_
private

Definition at line 95 of file METMonitor.h.

Referenced by analyze().

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

Definition at line 101 of file METMonitor.h.

Referenced by analyze().

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

Definition at line 132 of file METMonitor.h.

Referenced by analyze(), and METMonitor().