CMS 3D CMS Logo

JetMonitor.h
Go to the documentation of this file.
1 #ifndef JETMETMONITOR_H
2 #define JETMETMONITOR_H
3 
4 #include <string>
5 #include <vector>
6 #include <map>
7 
16 
20 
22 
23 //DataFormats
26 
40 
42 
43 
44 
45 //
46 // class declaration
47 //
48 
49 class JetMonitor : public DQMEDAnalyzer
50 {
51 public:
52  struct MEbinning {
53  unsigned int nbins;
54  double xmin;
55  double xmax;
56  };
57 
58  struct JetME {
61  };
62 
63  JetMonitor( const edm::ParameterSet& );
64  ~JetMonitor() override;
65  static void fillDescriptions(edm::ConfigurationDescriptions & descriptions);
68 
69 protected:
70 
71  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
72  void bookME(DQMStore::IBooker &, JetME& me, std::string& histname, std::string& histtitle, unsigned int nbins, double xmin, double xmax);
73  void bookME(DQMStore::IBooker &, JetME& me, std::string& histname, std::string& histtitle, std::vector<double> binningX);
74  void bookME(DQMStore::IBooker &, JetME& me, std::string& histname, std::string& histtitle, int nbinsX, double xmin, double xmax, double ymin, double ymax);
75  void bookME(DQMStore::IBooker &, JetME& me, std::string& histname, std::string& histtitle, int nbinsX, double xmin, double xmax, int nbinsY, double ymin, double ymax);
76  void bookME(DQMStore::IBooker &, JetME& me, std::string& histname, std::string& histtitle, std::vector<double> binningX, std::vector<double> binningY);
77  void setMETitle(JetME& me, const std::string& titleX, const std::string& titleY);
78  void bookME(DQMStore::IBooker &, MonitorElement* me, std::string& histname, std::string& histtitle, int nbins, double xmin, double xmax);
79  void bookME(DQMStore::IBooker &, MonitorElement* me, std::string& histname, std::string& histtitle, int nbinsX, double xmin, double xmax,int nbinsY, double ymin, double ymax );
80 
81  void analyze(edm::Event const& iEvent, edm::EventSetup const& iSetup) override;
82  bool isBarrel(double eta);
83  bool isEndCapP(double eta);
84  bool isEndCapM(double eta);
85  bool isForward(double eta);
86  bool isHEP17(double eta, double phi);
87  bool isHEM17(double eta, double phi);
88  bool isHEP18(double eta, double phi); // -0.87< Phi < -1.22
89  //void FillME(std::vector<MonitorElement*> v_me,std::vector<double>v_pt, std::vector<double> v_phi); //Fill Histograms
90  //void AutoNullPtr(JetME* a_me,const int len_); //Fill Histograms
91  void bookMESub(DQMStore::IBooker &,JetME* a_me,const int len_,const std::string& h_Name ,const std::string& h_Title, const std::string& h_subOptName, std::string h_subOptTitle, bool doPhi = true, bool doEta = true, bool doEtaPhi = true, bool doVsLS = true); //Fill Histograms
92  void FillME(JetME* a_me,double pt_, double phi_, double eta_, int ls_, const std::string& denu, bool doPhi = true, bool doEta = true, bool doEtaPhi = true, bool doVsLS = true); //Fill Histograms
93 
94 private:
97 
100 
106  //edm::InputTag jetSrc_; // test for Jet
108 
109  std::vector<double> jetpT_variable_binning_;
113 
114 
124 
127  // For Ratio plot
130 
131 
132  std::unique_ptr<GenericTriggerEventFlag> num_genTriggerEventFlag_;
133  std::unique_ptr<GenericTriggerEventFlag> den_genTriggerEventFlag_;
134 
135  int nmuons_;
136  double ptcut_;
139 
140  std::vector<double> v_jetpt;
141  std::vector<double> v_jeteta;
142  std::vector<double> v_jetphi;
143 
144  // Define Phi Bin //
145  double Jet_MAX_PHI = 3.2;
146  // unsigned int Jet_N_PHI = 64;
147  unsigned int Jet_N_PHI = 32;
149  Jet_N_PHI, -Jet_MAX_PHI, Jet_MAX_PHI
150  };
151  // Define Eta Bin //
152  double Jet_MAX_ETA = 5;
153  // unsigned int Jet_N_ETA = 50;
154  unsigned int Jet_N_ETA = 20; // (mia) not optimal, we should make use of variable binning which reflects the detector !
156  Jet_N_ETA, -Jet_MAX_ETA, Jet_MAX_ETA
157  };
158 
159  // Define HEP17 for PHI
160  double Jet_MAX_PHI_HEP17 = -0.52;
161  double Jet_MIN_PHI_HEP17 = -0.87;
162  unsigned int N_PHI_HEP17 = 7;
164  N_PHI_HEP17, Jet_MIN_PHI_HEP17, Jet_MAX_PHI_HEP17
165  };
166 
167  // Define HEP18 for PHI
168  double Jet_MAX_PHI_HEP18 = -0.17;
169  double Jet_MIN_PHI_HEP18 = -0.52;
170  unsigned int N_PHI_HEP18 = 7;
172  N_PHI_HEP18, Jet_MIN_PHI_HEP18, Jet_MAX_PHI_HEP18
173  };
174  // Define HEP17 for ETA
175  double Jet_MAX_ETA_HEP17 = 3.0;
176  double Jet_MIN_ETA_HEP17 = 1.3;
177  unsigned int N_ETA_HEP17 = 9;
179  N_ETA_HEP17, Jet_MIN_ETA_HEP17, Jet_MAX_ETA_HEP17
180  };
181 
183  N_ETA_HEP17, -Jet_MAX_ETA_HEP17, -Jet_MIN_ETA_HEP17
184  };
185 
186 };
187 
188 #endif // JETMETMONITOR_H
unsigned int N_PHI_HEP18
Definition: JetMonitor.h:170
JetME jetHEM17_AbsEtaVsPhi_
Definition: JetMonitor.h:126
bool isBarrel(double eta)
Definition: JetMonitor.cc:331
JetME a_ME_HB[7]
Definition: JetMonitor.h:116
bool isHEP17(double eta, double phi)
For Hcal HEP17 Area.
Definition: JetMonitor.cc:357
unsigned int Jet_N_ETA
Definition: JetMonitor.h:154
JetME a_ME_HE_m[7]
Definition: JetMonitor.h:120
JetME jetHEP17_AbsEta_
Definition: JetMonitor.h:128
MEbinning eta_binning_hem17_
Definition: JetMonitor.h:182
JetME a_ME_HEM17[7]
Definition: JetMonitor.h:121
MEbinning phi_binning_hep17_
Definition: JetMonitor.h:163
MEbinning ls_binning_
Definition: JetMonitor.h:112
edm::EDGetTokenT< reco::PFMETCollection > metToken_
Definition: JetMonitor.h:101
JetMonitor(const edm::ParameterSet &)
Definition: JetMonitor.cc:17
static MEbinning getHistoPSet(const edm::ParameterSet &pset)
Definition: JetMonitor.cc:38
JetME jetHEP17_AbsEtaVsPhi_
Definition: JetMonitor.h:125
double Jet_MIN_PHI_HEP17
Definition: JetMonitor.h:161
static void fillHistoLSPSetDescription(edm::ParameterSetDescription &pset)
Definition: JetMonitor.cc:271
std::string folderName_
Definition: JetMonitor.h:98
JetME a_ME_HE_p[7]
Definition: JetMonitor.h:119
edm::EDGetTokenT< reco::GsfElectronCollection > eleToken_
Definition: JetMonitor.h:104
void FillME(JetME *a_me, double pt_, double phi_, double eta_, int ls_, const std::string &denu, bool doPhi=true, bool doEta=true, bool doEtaPhi=true, bool doVsLS=true)
Definition: JetMonitor.cc:387
edm::EDGetTokenT< reco::PFJetCollection > pfjetToken_
Definition: JetMonitor.h:102
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
double Jet_MAX_ETA
Definition: JetMonitor.h:152
void bookME(DQMStore::IBooker &, JetME &me, std::string &histname, std::string &histtitle, unsigned int nbins, double xmin, double xmax)
Definition: JetMonitor.cc:63
JetME a_ME_HEP18[7]
Definition: JetMonitor.h:123
bool isCaloJetTrig
Definition: JetMonitor.h:138
edm::EDGetTokenT< reco::CaloJetCollection > calojetToken_
Definition: JetMonitor.h:103
void bookMESub(DQMStore::IBooker &, JetME *a_me, const int len_, const std::string &h_Name, const std::string &h_Title, const std::string &h_subOptName, std::string h_subOptTitle, bool doPhi=true, bool doEta=true, bool doEtaPhi=true, bool doVsLS=true)
Definition: JetMonitor.cc:419
MEbinning jetpT_binning
Definition: JetMonitor.h:110
double Jet_MAX_PHI
Definition: JetMonitor.h:145
MEbinning eta_binning_hep17_
Definition: JetMonitor.h:178
MEbinning phi_binning_hep18_
Definition: JetMonitor.h:171
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< reco::MuonCollection > muoToken_
Definition: JetMonitor.h:105
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: JetMonitor.cc:278
MEbinning jet_phi_binning_
Definition: JetMonitor.h:148
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
Definition: JetMonitor.h:133
double Jet_MIN_PHI_HEP18
Definition: JetMonitor.h:169
bool isEndCapM(double eta)
Definition: JetMonitor.cc:338
void analyze(edm::Event const &iEvent, edm::EventSetup const &iSetup) override
Definition: JetMonitor.cc:155
std::vector< double > jetpT_variable_binning_
Definition: JetMonitor.h:109
JetME a_ME_HF[7]
Definition: JetMonitor.h:118
JetME a_ME_HEP17[7]
Definition: JetMonitor.h:122
double Jet_MAX_PHI_HEP17
Definition: JetMonitor.h:160
bool isHEM17(double eta, double phi)
For Hcal HEM17 Area.
Definition: JetMonitor.cc:365
MEbinning jetptThr_binning_
Definition: JetMonitor.h:111
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: JetMonitor.cc:99
JetME jetHEM17_AbsEta_
Definition: JetMonitor.h:129
edm::EDGetTokenT< edm::View< reco::Jet > > jetSrc_
Definition: JetMonitor.h:107
double Jet_MAX_PHI_HEP18
Definition: JetMonitor.h:168
double Jet_MIN_ETA_HEP17
Definition: JetMonitor.h:176
JetME a_ME_HE[7]
Definition: JetMonitor.h:117
std::vector< double > v_jetpt
Definition: JetMonitor.h:140
unsigned int N_PHI_HEP17
Definition: JetMonitor.h:162
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
Definition: JetMonitor.h:132
double Jet_MAX_ETA_HEP17
Definition: JetMonitor.h:175
bool isPFJetTrig
Definition: JetMonitor.h:137
unsigned int Jet_N_PHI
Definition: JetMonitor.h:147
JetME a_ME[7]
Definition: JetMonitor.h:115
~JetMonitor() override
static void fillHistoPSetDescription(edm::ParameterSetDescription &pset)
Definition: JetMonitor.cc:264
std::vector< double > v_jeteta
Definition: JetMonitor.h:141
bool isForward(double eta)
For Hcal Forward Plus Area.
Definition: JetMonitor.cc:351
std::vector< double > v_jetphi
Definition: JetMonitor.h:142
unsigned int N_ETA_HEP17
Definition: JetMonitor.h:177
MEbinning jet_eta_binning_
Definition: JetMonitor.h:155
static MEbinning getHistoLSPSet(const edm::ParameterSet &pset)
Definition: JetMonitor.cc:47
void setMETitle(JetME &me, const std::string &titleX, const std::string &titleY)
Definition: JetMonitor.cc:56
Definition: Run.h:45
bool isHEP18(double eta, double phi)
For Hcal HEP18 Area.
Definition: JetMonitor.cc:372
bool isEndCapP(double eta)
For Hcal Endcap Plus Area.
Definition: JetMonitor.cc:344
unsigned int nbins
Definition: JetMonitor.h:53
std::string histoSuffix_
Definition: JetMonitor.h:99
double ptcut_
Definition: JetMonitor.h:136