CMS 3D CMS Logo

L1TdeCSCTPGShowerClient.cc
Go to the documentation of this file.
2 
9 #include "TRandom.h"
10 using namespace edm;
11 using namespace std;
12 
14  : monitorDir_(ps.getUntrackedParameter<string>("monitorDir")) {}
15 
17 
19  DQMStore::IGetter &igetter,
20  const edm::LuminosityBlock &lumiSeg,
21  const edm::EventSetup &c) {
22  book(ibooker);
23  processHistograms(igetter);
24 }
25 
26 //--------------------------------------------------------
28  book(ibooker);
29  processHistograms(igetter);
30 }
31 
34 
35  lctShowerDataNomSummary_eff_ = iBooker.book2D("lct_cscshower_data_nom_summary_eff",
36  "Efficiency of data LCT Nominal shower being correctly emulated",
37  36,
38  1,
39  37,
40  18,
41  0,
42  18);
43  alctShowerDataNomSummary_eff_ = iBooker.book2D("alct_cscshower_data_nom_summary_eff",
44  "Efficiency of data ALCT Nominal shower being correctly emulated",
45  36,
46  1,
47  37,
48  18,
49  0,
50  18);
51  clctShowerDataNomSummary_eff_ = iBooker.book2D("clct_cscshower_data_nom_summary_eff",
52  "Efficiency of data CLCT Nominal shower being correctly emulated",
53  36,
54  1,
55  37,
56  18,
57  0,
58  18);
59 
60  lctShowerEmulNomSummary_eff_ = iBooker.book2D("lct_cscshower_emul_nom_summary_eff",
61  "Fraction of emulated LCT Nominal shower without matching data LCT",
62  36,
63  1,
64  37,
65  18,
66  0,
67  18);
68  alctShowerEmulNomSummary_eff_ = iBooker.book2D("alct_cscshower_emul_nom_summary_eff",
69  "Fraction of emulated ALCT Nominal shower without matching data ALCT",
70  36,
71  1,
72  37,
73  18,
74  0,
75  18);
76  clctShowerEmulNomSummary_eff_ = iBooker.book2D("clct_cscshower_emul_nom_summary_eff",
77  "Fraction of emulated CLCT Nominal shower without matching data CLCT",
78  36,
79  1,
80  37,
81  18,
82  0,
83  18);
84 
85  lctShowerDataTightSummary_eff_ = iBooker.book2D("lct_cscshower_data_tight_summary_eff",
86  "Efficiency of data LCT Tight shower being correctly emulated",
87  36,
88  1,
89  37,
90  18,
91  0,
92  18);
93  alctShowerDataTightSummary_eff_ = iBooker.book2D("alct_cscshower_data_tight_summary_eff",
94  "Efficiency of data ALCT Tight shower being correctly emulated",
95  36,
96  1,
97  37,
98  18,
99  0,
100  18);
101  clctShowerDataTightSummary_eff_ = iBooker.book2D("clct_cscshower_data_tight_summary_eff",
102  "Efficiency of data CLCT Tight shower being correctly emulated",
103  36,
104  1,
105  37,
106  18,
107  0,
108  18);
109 
110  lctShowerEmulTightSummary_eff_ = iBooker.book2D("lct_cscshower_emul_tight_summary_eff",
111  "Fraction of emulated LCT Tight shower without matching data LCT",
112  36,
113  1,
114  37,
115  18,
116  0,
117  18);
118  alctShowerEmulTightSummary_eff_ = iBooker.book2D("alct_cscshower_emul_tight_summary_eff",
119  "Fraction of emulated ALCT Tight shower without matching data ALCT",
120  36,
121  1,
122  37,
123  18,
124  0,
125  18);
126  clctShowerEmulTightSummary_eff_ = iBooker.book2D("clct_cscshower_emul_tight_summary_eff",
127  "Fraction of emulated CLCT Tight shower without matching data CLCT",
128  36,
129  1,
130  37,
131  18,
132  0,
133  18);
134 
135  // x labels
139 
143 
147 
151 
152  // plotting option
156 
160 
164 
168 
169  // summary plots
170  const std::array<std::string, 9> suffix_label{{"4/2", "4/1", "3/2", "3/1", " 2/2", "2/1", "1/3", "1/2", "1/1"}};
171 
172  // y labels
173  for (int ybin = 1; ybin <= 9; ++ybin) {
174  lctShowerDataNomSummary_eff_->setBinLabel(ybin, "ME-" + suffix_label[ybin - 1], 2);
175  alctShowerDataNomSummary_eff_->setBinLabel(ybin, "ME-" + suffix_label[ybin - 1], 2);
176  clctShowerDataNomSummary_eff_->setBinLabel(ybin, "ME-" + suffix_label[ybin - 1], 2);
177 
178  lctShowerEmulNomSummary_eff_->setBinLabel(ybin, "ME-" + suffix_label[ybin - 1], 2);
179  alctShowerEmulNomSummary_eff_->setBinLabel(ybin, "ME-" + suffix_label[ybin - 1], 2);
180  clctShowerEmulNomSummary_eff_->setBinLabel(ybin, "ME-" + suffix_label[ybin - 1], 2);
181 
182  lctShowerDataNomSummary_eff_->setBinLabel(19 - ybin, "ME+" + suffix_label[ybin - 1], 2);
183  alctShowerDataNomSummary_eff_->setBinLabel(19 - ybin, "ME+" + suffix_label[ybin - 1], 2);
184  clctShowerDataNomSummary_eff_->setBinLabel(19 - ybin, "ME+" + suffix_label[ybin - 1], 2);
185 
186  lctShowerEmulNomSummary_eff_->setBinLabel(19 - ybin, "ME+" + suffix_label[ybin - 1], 2);
187  alctShowerEmulNomSummary_eff_->setBinLabel(19 - ybin, "ME+" + suffix_label[ybin - 1], 2);
188  clctShowerEmulNomSummary_eff_->setBinLabel(19 - ybin, "ME+" + suffix_label[ybin - 1], 2);
189 
190  lctShowerDataTightSummary_eff_->setBinLabel(ybin, "ME-" + suffix_label[ybin - 1], 2);
191  alctShowerDataTightSummary_eff_->setBinLabel(ybin, "ME-" + suffix_label[ybin - 1], 2);
192  clctShowerDataTightSummary_eff_->setBinLabel(ybin, "ME-" + suffix_label[ybin - 1], 2);
193 
194  lctShowerEmulTightSummary_eff_->setBinLabel(ybin, "ME-" + suffix_label[ybin - 1], 2);
195  alctShowerEmulTightSummary_eff_->setBinLabel(ybin, "ME-" + suffix_label[ybin - 1], 2);
196  clctShowerEmulTightSummary_eff_->setBinLabel(ybin, "ME-" + suffix_label[ybin - 1], 2);
197 
198  lctShowerDataTightSummary_eff_->setBinLabel(19 - ybin, "ME+" + suffix_label[ybin - 1], 2);
199  alctShowerDataTightSummary_eff_->setBinLabel(19 - ybin, "ME+" + suffix_label[ybin - 1], 2);
200  clctShowerDataTightSummary_eff_->setBinLabel(19 - ybin, "ME+" + suffix_label[ybin - 1], 2);
201 
202  lctShowerEmulTightSummary_eff_->setBinLabel(19 - ybin, "ME+" + suffix_label[ybin - 1], 2);
203  alctShowerEmulTightSummary_eff_->setBinLabel(19 - ybin, "ME+" + suffix_label[ybin - 1], 2);
204  clctShowerEmulTightSummary_eff_->setBinLabel(19 - ybin, "ME+" + suffix_label[ybin - 1], 2);
205  }
206 }
207 
209  MonitorElement *lctShowerDataNomSummary_denom_ = igetter.get(monitorDir_ + "/lct_cscshower_data_nom_summary_denom");
210  MonitorElement *lctShowerDataNomSummary_num_ = igetter.get(monitorDir_ + "/lct_cscshower_data_nom_summary_num");
211  MonitorElement *alctShowerDataNomSummary_denom_ = igetter.get(monitorDir_ + "/alct_cscshower_data_nom_summary_denom");
212  MonitorElement *alctShowerDataNomSummary_num_ = igetter.get(monitorDir_ + "/alct_cscshower_data_nom_summary_num");
213  MonitorElement *clctShowerDataNomSummary_denom_ = igetter.get(monitorDir_ + "/clct_cscshower_data_nom_summary_denom");
214  MonitorElement *clctShowerDataNomSummary_num_ = igetter.get(monitorDir_ + "/clct_cscshower_data_nom_summary_num");
215 
216  if (lctShowerDataNomSummary_denom_ == nullptr or lctShowerDataNomSummary_num_ == nullptr or
217  alctShowerDataNomSummary_denom_ == nullptr or alctShowerDataNomSummary_num_ == nullptr or
218  clctShowerDataNomSummary_denom_ == nullptr or clctShowerDataNomSummary_num_ == nullptr) {
219  edm::LogWarning("L1TdeCSCTPGShowerClient")
220  << __PRETTY_FUNCTION__ << " could not load the necessary shower data histograms for harvesting";
221  return;
222  }
223 
224  MonitorElement *lctShowerEmulNomSummary_denom_ = igetter.get(monitorDir_ + "/lct_cscshower_emul_nom_summary_denom");
225  MonitorElement *lctShowerEmulNomSummary_num_ = igetter.get(monitorDir_ + "/lct_cscshower_emul_nom_summary_num");
226  MonitorElement *alctShowerEmulNomSummary_denom_ = igetter.get(monitorDir_ + "/alct_cscshower_emul_nom_summary_denom");
227  MonitorElement *alctShowerEmulNomSummary_num_ = igetter.get(monitorDir_ + "/alct_cscshower_emul_nom_summary_num");
228  MonitorElement *clctShowerEmulNomSummary_denom_ = igetter.get(monitorDir_ + "/clct_cscshower_emul_nom_summary_denom");
229  MonitorElement *clctShowerEmulNomSummary_num_ = igetter.get(monitorDir_ + "/clct_cscshower_emul_nom_summary_num");
230 
231  if (lctShowerEmulNomSummary_denom_ == nullptr or lctShowerEmulNomSummary_num_ == nullptr or
232  alctShowerEmulNomSummary_denom_ == nullptr or alctShowerEmulNomSummary_num_ == nullptr or
233  clctShowerEmulNomSummary_denom_ == nullptr or clctShowerEmulNomSummary_num_ == nullptr) {
234  edm::LogWarning("L1TdeCSCTPGShowerClient")
235  << __PRETTY_FUNCTION__ << " could not load the necessary shower emulation histograms for harvesting";
236  return;
237  }
238 
239  MonitorElement *lctShowerDataTightSummary_denom_ =
240  igetter.get(monitorDir_ + "/lct_cscshower_data_tight_summary_denom");
241  MonitorElement *lctShowerDataTightSummary_num_ = igetter.get(monitorDir_ + "/lct_cscshower_data_tight_summary_num");
242  MonitorElement *alctShowerDataTightSummary_denom_ =
243  igetter.get(monitorDir_ + "/alct_cscshower_data_tight_summary_denom");
244  MonitorElement *alctShowerDataTightSummary_num_ = igetter.get(monitorDir_ + "/alct_cscshower_data_tight_summary_num");
245  MonitorElement *clctShowerDataTightSummary_denom_ =
246  igetter.get(monitorDir_ + "/clct_cscshower_data_tight_summary_denom");
247  MonitorElement *clctShowerDataTightSummary_num_ = igetter.get(monitorDir_ + "/clct_cscshower_data_tight_summary_num");
248 
249  if (lctShowerDataTightSummary_denom_ == nullptr or lctShowerDataTightSummary_num_ == nullptr or
250  alctShowerDataTightSummary_denom_ == nullptr or alctShowerDataTightSummary_num_ == nullptr or
251  clctShowerDataTightSummary_denom_ == nullptr or clctShowerDataTightSummary_num_ == nullptr) {
252  edm::LogWarning("L1TdeCSCTPGShowerClient")
253  << __PRETTY_FUNCTION__ << " could not load the necessary shower data (tight) histograms for harvesting";
254  return;
255  }
256 
257  MonitorElement *lctShowerEmulTightSummary_denom_ =
258  igetter.get(monitorDir_ + "/lct_cscshower_emul_tight_summary_denom");
259  MonitorElement *lctShowerEmulTightSummary_num_ = igetter.get(monitorDir_ + "/lct_cscshower_emul_tight_summary_num");
260  MonitorElement *alctShowerEmulTightSummary_denom_ =
261  igetter.get(monitorDir_ + "/alct_cscshower_emul_tight_summary_denom");
262  MonitorElement *alctShowerEmulTightSummary_num_ = igetter.get(monitorDir_ + "/alct_cscshower_emul_tight_summary_num");
263  MonitorElement *clctShowerEmulTightSummary_denom_ =
264  igetter.get(monitorDir_ + "/clct_cscshower_emul_tight_summary_denom");
265  MonitorElement *clctShowerEmulTightSummary_num_ = igetter.get(monitorDir_ + "/clct_cscshower_emul_tight_summary_num");
266 
267  if (lctShowerEmulTightSummary_denom_ == nullptr or lctShowerEmulTightSummary_num_ == nullptr or
268  alctShowerEmulTightSummary_denom_ == nullptr or alctShowerEmulTightSummary_num_ == nullptr or
269  clctShowerEmulTightSummary_denom_ == nullptr or clctShowerEmulTightSummary_num_ == nullptr) {
270  edm::LogWarning("L1TdeCSCTPGShowerClient")
271  << __PRETTY_FUNCTION__ << " could not load the necessary shower emulation (tight) histograms for harvesting";
272  return;
273  }
274 
276  lctShowerDataNomSummary_num_->getTH2F(), lctShowerDataNomSummary_denom_->getTH2F(), 1, 1, "");
278  alctShowerDataNomSummary_num_->getTH2F(), alctShowerDataNomSummary_denom_->getTH2F(), 1, 1, "");
280  clctShowerDataNomSummary_num_->getTH2F(), clctShowerDataNomSummary_denom_->getTH2F(), 1, 1, "");
281 
283  lctShowerEmulNomSummary_num_->getTH2F(), lctShowerEmulNomSummary_denom_->getTH2F(), 1, 1, "");
285  alctShowerEmulNomSummary_num_->getTH2F(), alctShowerEmulNomSummary_denom_->getTH2F(), 1, 1, "");
287  clctShowerEmulNomSummary_num_->getTH2F(), clctShowerEmulNomSummary_denom_->getTH2F(), 1, 1, "");
288 
290  lctShowerDataTightSummary_num_->getTH2F(), lctShowerDataTightSummary_denom_->getTH2F(), 1, 1, "");
292  alctShowerDataTightSummary_num_->getTH2F(), alctShowerDataTightSummary_denom_->getTH2F(), 1, 1, "");
294  clctShowerDataTightSummary_num_->getTH2F(), clctShowerDataTightSummary_denom_->getTH2F(), 1, 1, "");
295 
297  lctShowerEmulTightSummary_num_->getTH2F(), lctShowerEmulTightSummary_denom_->getTH2F(), 1, 1, "");
299  alctShowerEmulTightSummary_num_->getTH2F(), alctShowerEmulTightSummary_denom_->getTH2F(), 1, 1, "");
301  clctShowerEmulTightSummary_num_->getTH2F(), clctShowerEmulTightSummary_denom_->getTH2F(), 1, 1, "");
302 
303  lctShowerDataNomSummary_eff_->getTH2F()->GetZaxis()->SetRangeUser(0.95, 1);
304  alctShowerDataNomSummary_eff_->getTH2F()->GetZaxis()->SetRangeUser(0.95, 1);
305  clctShowerDataNomSummary_eff_->getTH2F()->GetZaxis()->SetRangeUser(0.95, 1);
306 
307  lctShowerDataTightSummary_eff_->getTH2F()->GetZaxis()->SetRangeUser(0.95, 1);
308  alctShowerDataTightSummary_eff_->getTH2F()->GetZaxis()->SetRangeUser(0.95, 1);
309  clctShowerDataTightSummary_eff_->getTH2F()->GetZaxis()->SetRangeUser(0.95, 1);
310 }
MonitorElement * alctShowerEmulTightSummary_eff_
MonitorElement * clctShowerDataTightSummary_eff_
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
virtual void setOption(const char *option)
~L1TdeCSCTPGShowerClient() override
Destructor.
L1TdeCSCTPGShowerClient(const edm::ParameterSet &ps)
Constructor.
MonitorElement * lctShowerEmulNomSummary_eff_
MonitorElement * clctShowerEmulNomSummary_eff_
MonitorElement * clctShowerEmulTightSummary_eff_
virtual TH2F * getTH2F() const
MonitorElement * clctShowerDataNomSummary_eff_
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
MonitorElement * lctShowerDataNomSummary_eff_
MonitorElement * alctShowerDataNomSummary_eff_
MonitorElement * lctShowerEmulTightSummary_eff_
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * alctShowerDataTightSummary_eff_
void book(DQMStore::IBooker &ibooker)
MonitorElement * alctShowerEmulNomSummary_eff_
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:212
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:673
void processHistograms(DQMStore::IGetter &)
MonitorElement * lctShowerDataTightSummary_eff_
HLT enums.
Log< level::Warning, false > LogWarning
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)