CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EEClusterTaskExtras.cc
Go to the documentation of this file.
1 /*
2  * \file EEClusterTaskExtras.cc
3  *
4  * \author G. Della Ricca
5  * \author E. Di Marco
6  *
7  */
8 
9 #include <iostream>
10 #include <fstream>
11 #include <vector>
12 #include <math.h>
13 
16 
18 
20 
28 
35 
37 
39 
41 
44 
45 using namespace cms;
46 using namespace edm;
47 using namespace std;
48 using namespace reco;
49 
51 
52  init_ = false;
53 
54  dqmStore_ = Service<DQMStore>().operator->();
55 
56  prefixME_ = ps.getUntrackedParameter<string>("prefixME", "");
57 
58  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
59 
60  mergeRuns_ = ps.getUntrackedParameter<bool>("mergeRuns", false);
61 
62  // parameters...
63  SuperClusterCollection_ = consumes<reco::SuperClusterCollection>(ps.getParameter<edm::InputTag>("SuperClusterCollection"));
64  EcalRecHitCollection_ = consumes<EcalRecHitCollection>(ps.getParameter<edm::InputTag>("EcalRecHitCollection"));
65  l1GTReadoutRecToken_ = consumes<L1GlobalTriggerReadoutRecord>(ps.getParameter<edm::InputTag>("l1GlobalReadoutRecord"));
66  l1GMTReadoutRecToken_ = consumes<L1MuGMTReadoutCollection>(ps.getParameter<edm::InputTag>("l1GlobalMuonReadoutRecord"));
67 
68  // histograms...
69 #ifndef EECLUSTERTASKEXTRAS_DQMOFFLINE
70  meSCSizCrystal_ = 0;
71  meSCSizBC_ = 0;
72 
73  meSCSeedEne_ = 0;
74  meSCEne2_ = 0;
75  meSCEneLow_ = 0;
76  meSCEneHigh_ = 0;
77  meSCEneSingleCrystal_ = 0;
78 
79  for(int i=0;i!=2;++) {
80  meSCSeedMapOccSingleCrystal_[i] = 0;
81  meSCSeedMapOccSC_[i] = 0;
82  meSCSeedMapOccHighEne_[i] = 0;
83  meSCSeedMapTimeSC_[i] = 0;
84  for(int j=0;j!=5;++j) {
85  meSCSeedMapOccTrg_[i][j] = 0;
86  meSCSeedMapOccTrgExcl_[i][j] = 0;
87  }
88  }
89 
90  meSCSeedTime_ = 0;
91  meSCSeedTimeVsAmp_ = 0;
92  meSCSeedTimeEEM_ = 0;
93  meSCSeedTimeEEP_ = 0;
94  for(int i=0;i!=18;++i)
95  meSCSeedTimePerFed_[i] = 0;
96 #endif
97 
98  meSCSizCrystalVsEne_ = 0;
99 
100  for(int i=0;i!=2;++i) {
101  meSCSeedMapOcc_[i] = 0;
102  meSCSeedMapOccHighEneSC_[i] = 0;
103  for(int j=0;j!=5;++j) {
104  meSCSeedMapTimeTrgSC_[i][j] = 0;
105  meSCSeedMapOccTrgSC_[i][j] = 0;
106  meSCSeedMapOccTrgExclSC_[i][j] = 0;
107  }
108  }
109 
110 }
111 
113 
114 }
115 
117 
118  ievt_ = 0;
119 
120  if ( dqmStore_ ) {
121  dqmStore_->setCurrentFolder(prefixME_ + "/EEClusterTaskExtras");
122  dqmStore_->rmdir(prefixME_ + "/EEClusterTaskExtras");
123  }
124 
125 }
126 
128 
129  Numbers::initGeometry(c, false);
130 
131  if ( ! mergeRuns_ ) this->reset();
132 
133 }
134 
136 
137 }
138 
140 #ifndef EECLUSTERTASKEXTRAS_DQMOFFLINE
141  if ( meSCSizCrystal_ ) meSCSizCrystal_->Reset();
142  if ( meSCSizBC_ ) meSCSizBC_->Reset();
143 
144  if ( meSCSeedEne_ ) meSCSeedEne_->Reset();
145  if ( meSCEne2_ ) meSCEne2_->Reset();
146  if ( meSCEneLow_ ) meSCEneLow_->Reset();
147  if ( meSCEneHigh_ ) meSCEneHigh_->Reset();
148  if ( meSCEneSingleCrystal_ ) meSCEneSingleCrystal_->Reset();
149 
150  for(int i=0;i!=2;++i) {
151  if ( meSCSeedMapOccSingleCrystal_[i] ) meSCSeedMapOccSingleCrystal_[i]->Reset();
152  if ( meSCSeedMapOccSC_[i] ) meSCSeedMapOccSC_[i]->Reset();
153  if ( meSCSeedMapOccHighEne_[i] ) meSCSeedMapOccHighEne_[i]->Reset();
154  if ( meSCSeedMapTimeSC_[i] ) meSCSeedMapTimeSC_[i]->Reset();
155  for(int j=0;j!=5;++j) {
156  if ( meSCSeedMapOccTrg_[i][j] ) meSCSeedMapOccTrg_[i][j]->Reset();
157  if ( meSCSeedMapOccTrgExcl_[i][j] ) meSCSeedMapOccTrgExcl_[i][j]->Reset();
158  }
159  }
160 
161  if ( meSCSeedTime_ ) meSCSeedTime_->Reset();
162  if ( meSCSeedTimeVsAmp_ ) meSCSeedTimeVsAmp_->Reset();
163  if ( meSCSeedTimeEEM_ ) meSCSeedTimeEEM_->Reset();
164  if ( meSCSeedTimeEEP_ ) meSCSeedTimeEEP_->Reset();
165 
166  for(int i=0;i!=18;++i)
167  if ( meSCSeedTimePerFed_[i] ) meSCSeedTimePerFed_[i]->Reset();
168 #endif
169 
170  if ( meSCSizCrystalVsEne_ ) meSCSizCrystalVsEne_->Reset();
171 
172  for(int i=0;i!=2;++i) {
173  if ( meSCSeedMapOcc_[i] ) meSCSeedMapOcc_[i]->Reset();
174  if ( meSCSeedMapOccHighEneSC_[i] ) meSCSeedMapOccHighEneSC_[i]->Reset();
175  for(int j=0; j!=5; ++j) {
176  if ( meSCSeedMapOccTrgSC_[i][j] ) meSCSeedMapOccTrgSC_[i][j]->Reset();
177  if ( meSCSeedMapOccTrgExclSC_[i][j] ) meSCSeedMapOccTrgExclSC_[i][j]->Reset();
178  if ( meSCSeedMapTimeTrgSC_[i][j] ) meSCSeedMapTimeTrgSC_[i][j]->Reset();
179  }
180  }
181 
182 }
183 
185 
186  init_ = true;
187 
189 
190  if ( dqmStore_ ) {
191  dqmStore_->setCurrentFolder(prefixME_ + "/EEClusterTaskExtras");
192 
193 #ifndef EECLUSTERTASKEXTRAS_DQMOFFLINE
194  // Cluster hists
195  histo = "EECLTE SC size (crystal)";
196  meSCSizCrystal_ = dqmStore_->book1D(histo,histo,150,0,150);
197  meSCSizCrystal_->setAxisTitle("super cluster size (crystal)", 1);
198 
199  histo = "EECLTE SC size (basic clusters)";
200  meSCSizBC_ = dqmStore_->book1D(histo,histo,20,0,20);
201  meSCSizBC_->setAxisTitle("super cluster size (basic clusters)", 1);
202 
203  histo = "EECLTE SC energy";
204  meSCSeedEne_ = dqmStore_->book1D(histo,histo,200,0,1.8);
205  meSCSeedEne_->setAxisTitle("energy (GeV)", 1);
206 
207  histo = "EECLTE SC + highest neighbor energy";
208  meSCEne2_ = dqmStore_->book1D(histo,histo,200,0,1.8);
209  meSCEne2_->setAxisTitle("+ highest neighbor energy (GeV)", 1);
210 
211  histo = "EECLTE SC energy low scale";
212  meSCEneLow_ = dqmStore_->book1D(histo,histo,200,0,1.8);
213  meSCEneLow_->setAxisTitle("energy (GeV)", 1);
214 
215  histo = "EECLTE SC energy high scale";
216  meSCEneHigh_ = dqmStore_->book1D(histo,histo,200,0,200);
217  meSCEneHigh_->setAxisTitle("energy (GeV)", 1);
218 
219  histo = "EECLTE SC single crystal cluster energy (GeV)";
220  meSCEneSingleCrystal_ = dqmStore_->book1D(histo,histo,200,0,200);
221  meSCEneSingleCrystal_->setAxisTitle("energy (GeV)", 1);
222 
223  histo = "EECLTE SC seed occupancy map super crystal binned EE -";
224  meSCSeedMapOccSC_[0] = dqmStore_->book2D(histo,histo,20,0,100,20,0,100);
225  meSCSeedMapOccSC_[0]->setAxisTitle("jx", 1);
226  meSCSeedMapOccSC_[0]->setAxisTitle("jy", 2);
227 
228  histo = "EECLTE SC seed occupancy map EE - (high energy clusters)";
229  meSCSeedMapOccHighEne_[0] = dqmStore_->book2D(histo,histo,100,0,100,100,0,100);
230  meSCSeedMapOccHighEne_[0]->setAxisTitle("jx", 1);
231  meSCSeedMapOccHighEne_[0]->setAxisTitle("jy", 2);
232 
233  histo = "EECLTE SC single crystal cluster seed occupancy map EE -";
234  meSCSeedMapOccSingleCrystal_[0] = dqmStore_->book2D(histo,histo,100,0,100,100,0,100);
235  meSCSeedMapOccSingleCrystal_[0]->setAxisTitle("jx", 1);
236  meSCSeedMapOccSingleCrystal_[0]->setAxisTitle("jy", 2);
237 
238  histo = "EECLTE SC seed occupancy map EE - (CSC triggered)";
239  meSCSeedMapOccTrg_[0][0] = dqmStore_->book2D(histo,histo,100,0,100,100,0,100);
240  meSCSeedMapOccTrg_[0][0]->setAxisTitle("jx", 1);
241  meSCSeedMapOccTrg_[0][0]->setAxisTitle("jy", 2);
242 
243  histo = "EECLTE SC seed occupancy map EE - (DT triggered)";
244  meSCSeedMapOccTrg_[0][1] = dqmStore_->book2D(histo,histo,100,0,100,100,0,100);
245  meSCSeedMapOccTrg_[0][1]->setAxisTitle("jx", 1);
246  meSCSeedMapOccTrg_[0][1]->setAxisTitle("jy", 2);
247 
248  histo = "EECLTE SC seed occupancy map EE - (ECAL triggered)";
249  meSCSeedMapOccTrg_[0][2] = dqmStore_->book2D(histo,histo,100,0,100,100,0,100);
250  meSCSeedMapOccTrg_[0][2]->setAxisTitle("jx", 1);
251  meSCSeedMapOccTrg_[0][2]->setAxisTitle("jy", 2);
252 
253  histo = "EECLTE SC seed occupancy map EE - (HCAL triggered)";
254  meSCSeedMapOccTrg_[0][3] = dqmStore_->book2D(histo,histo,100,0,100,100,0,100);
255  meSCSeedMapOccTrg_[0][3]->setAxisTitle("jx", 1);
256  meSCSeedMapOccTrg_[0][3]->setAxisTitle("jy", 2);
257 
258  histo = "EECLTE SC seed occupancy map EE - (RPC triggered)";
259  meSCSeedMapOccTrg_[0][4] = dqmStore_->book2D(histo,histo,100,0,100,100,0,100);
260  meSCSeedMapOccTrg_[0][4]->setAxisTitle("jx", 1);
261  meSCSeedMapOccTrg_[0][4]->setAxisTitle("jy", 2);
262 
263  histo = "EECLTE SC seed occupancy map EE - (CSC exclusive triggered)";
264  meSCSeedMapOccTrgExcl_[0][0] = dqmStore_->book2D(histo,histo,100,0,100,100,0,100);
265  meSCSeedMapOccTrgExcl_[0][0]->setAxisTitle("jx", 1);
266  meSCSeedMapOccTrgExcl_[0][0]->setAxisTitle("jy", 2);
267 
268  histo = "EECLTE SC seed occupancy map EE - (DT exclusive triggered)";
269  meSCSeedMapOccTrgExcl_[0][1] = dqmStore_->book2D(histo,histo,100,0,100,100,0,100);
270  meSCSeedMapOccTrgExcl_[0][1]->setAxisTitle("jx", 1);
271  meSCSeedMapOccTrgExcl_[0][1]->setAxisTitle("jy", 2);
272 
273  histo = "EECLTE SC seed occupancy map EE - (ECAL exclusive triggered)";
274  meSCSeedMapOccTrgExcl_[0][2] = dqmStore_->book2D(histo,histo,100,0,100,100,0,100);
275  meSCSeedMapOccTrgExcl_[0][2]->setAxisTitle("jx", 1);
276  meSCSeedMapOccTrgExcl_[0][2]->setAxisTitle("jy", 2);
277 
278  histo = "EECLTE SC seed occupancy map EE - (HCAL exclusive triggered)";
279  meSCSeedMapOccTrgExcl_[0][3] = dqmStore_->book2D(histo,histo,100,0,100,100,0,100);
280  meSCSeedMapOccTrgExcl_[0][3]->setAxisTitle("jx", 1);
281  meSCSeedMapOccTrgExcl_[0][3]->setAxisTitle("jy", 2);
282 
283  histo = "EECLTE SC seed occupancy map EE - (RPC exclusive triggered)";
284  meSCSeedMapOccTrgExcl_[0][4] = dqmStore_->book2D(histo,histo,100,0,100,100,0,100);
285  meSCSeedMapOccTrgExcl_[0][4]->setAxisTitle("jx", 1);
286  meSCSeedMapOccTrgExcl_[0][4]->setAxisTitle("jy", 2);
287 
288  histo = "EECLTE SC seed occupancy map super crystal binned EE +";
289  meSCSeedMapOccSC_[1] = dqmStore_->book2D(histo,histo,20,0,100,20,0,100);
290  meSCSeedMapOccSC_[1]->setAxisTitle("jx", 1);
291  meSCSeedMapOccSC_[1]->setAxisTitle("jy", 2);
292 
293  histo = "EECLTE SC seed occupancy map EE + (high energy clusters)";
294  meSCSeedMapOccHighEne_[1] = dqmStore_->book2D(histo,histo,100,0,100,100,0,100);
295  meSCSeedMapOccHighEne_[1]->setAxisTitle("jx", 1);
296  meSCSeedMapOccHighEne_[1]->setAxisTitle("jy", 2);
297 
298  histo = "EECLTE SC single crystal cluster seed occupancy map EE +";
299  meSCSeedMapOccSingleCrystal_[1] = dqmStore_->book2D(histo,histo,100,0,100,100,0,100);
300  meSCSeedMapOccSingleCrystal_[1]->setAxisTitle("jx", 1);
301  meSCSeedMapOccSingleCrystal_[1]->setAxisTitle("jy", 2);
302 
303  histo = "EECLTE SC seed occupancy map EE + (CSC triggered)";
304  meSCSeedMapOccTrg_[1][0] = dqmStore_->book2D(histo,histo,100,0,100,100,0,100);
305  meSCSeedMapOccTrg_[1][0]->setAxisTitle("jx", 1);
306  meSCSeedMapOccTrg_[1][0]->setAxisTitle("jy", 2);
307 
308  histo = "EECLTE SC seed occupancy map EE + (DT triggered)";
309  meSCSeedMapOccTrg_[1][1] = dqmStore_->book2D(histo,histo,100,0,100,100,0,100);
310  meSCSeedMapOccTrg_[1][1]->setAxisTitle("jx", 1);
311  meSCSeedMapOccTrg_[1][1]->setAxisTitle("jy", 2);
312 
313  histo = "EECLTE SC seed occupancy map EE + (ECAL triggered)";
314  meSCSeedMapOccTrg_[1][2] = dqmStore_->book2D(histo,histo,100,0,100,100,0,100);
315  meSCSeedMapOccTrg_[1][2]->setAxisTitle("jx", 1);
316  meSCSeedMapOccTrg_[1][2]->setAxisTitle("jy", 2);
317 
318  histo = "EECLTE SC seed occupancy map EE + (HCAL triggered)";
319  meSCSeedMapOccTrg_[1][3] = dqmStore_->book2D(histo,histo,100,0,100,100,0,100);
320  meSCSeedMapOccTrg_[1][3]->setAxisTitle("jx", 1);
321  meSCSeedMapOccTrg_[1][3]->setAxisTitle("jy", 2);
322 
323  histo = "EECLTE SC seed occupancy map EE + (RPC triggered)";
324  meSCSeedMapOccTrg_[1][4] = dqmStore_->book2D(histo,histo,100,0,100,100,0,100);
325  meSCSeedMapOccTrg_[1][4]->setAxisTitle("jx", 1);
326  meSCSeedMapOccTrg_[1][4]->setAxisTitle("jy", 2);
327 
328  histo = "EECLTE SC seed occupancy map EE + (CSC exclusive triggered)";
329  meSCSeedMapOccTrgExcl_[1][0] = dqmStore_->book2D(histo,histo,100,0,100,100,0,100);
330  meSCSeedMapOccTrgExcl_[1][0]->setAxisTitle("jx", 1);
331  meSCSeedMapOccTrgExcl_[1][0]->setAxisTitle("jy", 2);
332 
333  histo = "EECLTE SC seed occupancy map EE + (DT exclusive triggered)";
334  meSCSeedMapOccTrgExcl_[1][1] = dqmStore_->book2D(histo,histo,100,0,100,100,0,100);
335  meSCSeedMapOccTrgExcl_[1][1]->setAxisTitle("jx", 1);
336  meSCSeedMapOccTrgExcl_[1][1]->setAxisTitle("jy", 2);
337 
338  histo = "EECLTE SC seed occupancy map EE + (ECAL exclusive triggered)";
339  meSCSeedMapOccTrgExcl_[1][2] = dqmStore_->book2D(histo,histo,100,0,100,100,0,100);
340  meSCSeedMapOccTrgExcl_[1][2]->setAxisTitle("jx", 1);
341  meSCSeedMapOccTrgExcl_[1][2]->setAxisTitle("jy", 2);
342 
343  histo = "EECLTE SC seed occupancy map EE + (HCAL exclusive triggered)";
344  meSCSeedMapOccTrgExcl_[1][3] = dqmStore_->book2D(histo,histo,100,0,100,100,0,100);
345  meSCSeedMapOccTrgExcl_[1][3]->setAxisTitle("jx", 1);
346  meSCSeedMapOccTrgExcl_[1][3]->setAxisTitle("jy", 2);
347 
348  histo = "EECLTE SC seed occupancy map EE + (RPC exclusive triggered)";
349  meSCSeedMapOccTrgExcl_[1][4] = dqmStore_->book2D(histo,histo,100,0,100,100,0,100);
350  meSCSeedMapOccTrgExcl_[1][4]->setAxisTitle("jx", 1);
351  meSCSeedMapOccTrgExcl_[1][4]->setAxisTitle("jy", 2);
352 
353  histo = "EECLTE SC seed crystal timing map EE + super crystal binned";
354  meSCSeedMapTimeSC_[1] = dqmStore_->bookProfile2D(histo,histo,20,0,100,20,0,100,78,0.,10.,"s");
355  meSCSeedMapTimeSC_[1]->setAxisTitle("jx", 1);
356  meSCSeedMapTimeSC_[1]->setAxisTitle("jy", 2);
357 
358  histo = "EECLTE SC seed crystal timing map EE + super crystal binned";
359  meSCSeedMapTimeSC_[1] = dqmStore_->bookProfile2D(histo,histo,20,0,100,20,0,100,78,0.,10.,"s");
360  meSCSeedMapTimeSC_[1]->setAxisTitle("jx", 1);
361  meSCSeedMapTimeSC_[1]->setAxisTitle("jy", 2);
362 
363  histo = "EECLTE SC relative timing";
364  meSCSeedTime_ = dqmStore_->book1D(histo,histo,78,0.,10.);
365  meSCSeedTime_->setAxisTitle("seed crystal timing");
366 
367  histo = "EECLTE SC relative timing vs amplitude";
368  meSCSeedTimeVsAmp_ = dqmStore_->bookProfile(histo, histo, 78, -7, 7, 200, 0, 1.8);
369  meSCSeedTimeVsAmp_->setAxisTitle("seed crystal timing", 1);
370  meSCSeedTimeVsAmp_->setAxisTitle("energy (GeV)", 2);
371 
372  histo = "EECLTE SC relative timing EE -";
373  meSCSeedTimeEEM_ = dqmStore_->book1D(histo,histo,78,0.,10.);
374  meSCSeedTimeEEM_->setAxisTitle("seed crystal timing");
375 
376  histo = "EECLTE SC relative timing EE +";
377  meSCSeedTimeEEP_ = dqmStore_->book1D(histo,histo,78,0.,10.);
378  meSCSeedTimeEEP_->setAxisTitle("seed crystal timing");
379 
380  std::stringstream ss;
381  dqmStore_->setCurrentFolder(prefixME_ + "/EEClusterTaskExtras/EECLTE timing per super module");
382  for(int i=0;i!=18;++i) {
383  ss.str("");
384  if((i+1) <= 9){
385  ss << "EECLTE SC timing EE - " << i+1;
386  histo = ss.str();
387  }
388  else{
389  ss << "EECLTE SC timing EE + " << i+1-9;
390  histo = ss.str();
391  }
392  meSCSeedTimePerFed_[i] = dqmStore_->book1D(histo,histo,78,0.,10.);
393  meSCSeedTimePerFed_[i]->setAxisTitle("seed crystal timing", 1);
394  }
395 
396  dqmStore_->setCurrentFolder(prefixME_ + "/EEClusterTaskExtras");
397 
398 #endif
399 
400  histo = "EECLTE SC size (crystal) vs energy (GeV)";
401  meSCSizCrystalVsEne_ = dqmStore_->bookProfile(histo,histo,200,0.,10.,150,0,150);
402  meSCSizCrystalVsEne_->setAxisTitle("energy (GeV)", 1);
403  meSCSizCrystalVsEne_->setAxisTitle("super cluster size (crystal)", 2);
404 
405  histo = "EECLTE SC seed occupancy map EE -";
406  meSCSeedMapOcc_[0] = dqmStore_->book2D(histo,histo,100,0,100,100,0,100);
407  meSCSeedMapOcc_[0]->setAxisTitle("jx", 1);
408  meSCSeedMapOcc_[0]->setAxisTitle("jy", 2);
409 
410  histo = "EECLTE SC seed occupancy map EE - (high energy clusters) super crystal binned";
411  meSCSeedMapOccHighEneSC_[0] = dqmStore_->book2D(histo,histo,20,0,100,20,0,100);
412  meSCSeedMapOccHighEneSC_[0]->setAxisTitle("jx", 1);
413  meSCSeedMapOccHighEneSC_[0]->setAxisTitle("jy", 2);
414 
415  histo = "EECLTE SC seed occupancy map EE - (CSC triggered) super crystal binned";
416  meSCSeedMapOccTrgSC_[0][0] = dqmStore_->book2D(histo,histo,20,0,100,20,0,100);
417  meSCSeedMapOccTrgSC_[0][0]->setAxisTitle("jx", 1);
418  meSCSeedMapOccTrgSC_[0][0]->setAxisTitle("jy", 2);
419 
420  histo = "EECLTE SC seed occupancy map EE - (DT triggered) super crystal binned";
421  meSCSeedMapOccTrgSC_[0][1] = dqmStore_->book2D(histo,histo,20,0,100,20,0,100);
422  meSCSeedMapOccTrgSC_[0][1]->setAxisTitle("jx", 1);
423  meSCSeedMapOccTrgSC_[0][1]->setAxisTitle("jy", 2);
424 
425  histo = "EECLTE SC seed occupancy map EE - (ECAL triggered) super crystal binned";
426  meSCSeedMapOccTrgSC_[0][2] = dqmStore_->book2D(histo,histo,20,0,100,20,0,100);
427  meSCSeedMapOccTrgSC_[0][2]->setAxisTitle("jx", 1);
428  meSCSeedMapOccTrgSC_[0][2]->setAxisTitle("jy", 2);
429 
430  histo = "EECLTE SC seed occupancy map EE - (HCAL triggered) super crystal binned";
431  meSCSeedMapOccTrgSC_[0][3] = dqmStore_->book2D(histo,histo,20,0,100,20,0,100);
432  meSCSeedMapOccTrgSC_[0][3]->setAxisTitle("jx", 1);
433  meSCSeedMapOccTrgSC_[0][3]->setAxisTitle("jy", 2);
434 
435  histo = "EECLTE SC seed occupancy map EE - (RPC triggered) super crystal binned";
436  meSCSeedMapOccTrgSC_[0][4] = dqmStore_->book2D(histo,histo,20,0,100,20,0,100);
437  meSCSeedMapOccTrgSC_[0][4]->setAxisTitle("jx", 1);
438  meSCSeedMapOccTrgSC_[0][4]->setAxisTitle("jy", 2);
439 
440  histo = "EECLTE SC seed occupancy map EE - (CSC exclusive triggered) super crystal binned";
441  meSCSeedMapOccTrgExclSC_[0][0] = dqmStore_->book2D(histo,histo,20,0,100,20,0,100);
442  meSCSeedMapOccTrgExclSC_[0][0]->setAxisTitle("jx", 1);
443  meSCSeedMapOccTrgExclSC_[0][0]->setAxisTitle("jy", 2);
444 
445  histo = "EECLTE SC seed occupancy map EE - (DT exclusive triggered) super crystal binned";
446  meSCSeedMapOccTrgExclSC_[0][1] = dqmStore_->book2D(histo,histo,20,0,100,20,0,100);
447  meSCSeedMapOccTrgExclSC_[0][1]->setAxisTitle("jx", 1);
448  meSCSeedMapOccTrgExclSC_[0][1]->setAxisTitle("jy", 2);
449 
450  histo = "EECLTE SC seed occupancy map EE - (ECAL exclusive triggered) super crystal binned";
451  meSCSeedMapOccTrgExclSC_[0][2] = dqmStore_->book2D(histo,histo,20,0,100,20,0,100);
452  meSCSeedMapOccTrgExclSC_[0][2]->setAxisTitle("jx", 1);
453  meSCSeedMapOccTrgExclSC_[0][2]->setAxisTitle("jy", 2);
454 
455  histo = "EECLTE SC seed occupancy map EE - (HCAL exclusive triggered) super crystal binned";
456  meSCSeedMapOccTrgExclSC_[0][3] = dqmStore_->book2D(histo,histo,20,0,100,20,0,100);
457  meSCSeedMapOccTrgExclSC_[0][3]->setAxisTitle("jx", 1);
458  meSCSeedMapOccTrgExclSC_[0][3]->setAxisTitle("jy", 2);
459 
460  histo = "EECLTE SC seed occupancy map EE - (RPC exclusive triggered) super crystal binned";
461  meSCSeedMapOccTrgExclSC_[0][4] = dqmStore_->book2D(histo,histo,20,0,100,20,0,100);
462  meSCSeedMapOccTrgExclSC_[0][4]->setAxisTitle("jx", 1);
463  meSCSeedMapOccTrgExclSC_[0][4]->setAxisTitle("jy", 2);
464 
465  histo = "EECLTE SC seed occupancy map EE +";
466  meSCSeedMapOcc_[1] = dqmStore_->book2D(histo,histo,100,0,100,100,0,100);
467  meSCSeedMapOcc_[1]->setAxisTitle("jx", 1);
468  meSCSeedMapOcc_[1]->setAxisTitle("jy", 2);
469 
470  histo = "EECLTE SC seed occupancy map EE + (high energy clusters) super crystal binned";
471  meSCSeedMapOccHighEneSC_[1] = dqmStore_->book2D(histo,histo,20,0,100,20,0,100);
472  meSCSeedMapOccHighEneSC_[1]->setAxisTitle("jx", 1);
473  meSCSeedMapOccHighEneSC_[1]->setAxisTitle("jy", 2);
474 
475  histo = "EECLTE SC seed occupancy map EE + (CSC triggered) super crystal binned";
476  meSCSeedMapOccTrgSC_[1][0] = dqmStore_->book2D(histo,histo,20,0,100,20,0,100);
477  meSCSeedMapOccTrgSC_[1][0]->setAxisTitle("jx", 1);
478  meSCSeedMapOccTrgSC_[1][0]->setAxisTitle("jy", 2);
479 
480  histo = "EECLTE SC seed occupancy map EE + (DT triggered) super crystal binned";
481  meSCSeedMapOccTrgSC_[1][1] = dqmStore_->book2D(histo,histo,20,0,100,20,0,100);
482  meSCSeedMapOccTrgSC_[1][1]->setAxisTitle("jx", 1);
483  meSCSeedMapOccTrgSC_[1][1]->setAxisTitle("jy", 2);
484 
485  histo = "EECLTE SC seed occupancy map EE + (ECAL triggered) super crystal binned";
486  meSCSeedMapOccTrgSC_[1][2] = dqmStore_->book2D(histo,histo,20,0,100,20,0,100);
487  meSCSeedMapOccTrgSC_[1][2]->setAxisTitle("jx", 1);
488  meSCSeedMapOccTrgSC_[1][2]->setAxisTitle("jy", 2);
489 
490  histo = "EECLTE SC seed occupancy map EE + (HCAL triggered) super crystal binned";
491  meSCSeedMapOccTrgSC_[1][3] = dqmStore_->book2D(histo,histo,20,0,100,20,0,100);
492  meSCSeedMapOccTrgSC_[1][3]->setAxisTitle("jx", 1);
493  meSCSeedMapOccTrgSC_[1][3]->setAxisTitle("jy", 2);
494 
495  histo = "EECLTE SC seed occupancy map EE + (RPC triggered) super crystal binned";
496  meSCSeedMapOccTrgSC_[1][4] = dqmStore_->book2D(histo,histo,20,0,100,20,0,100);
497  meSCSeedMapOccTrgSC_[1][4]->setAxisTitle("jx", 1);
498  meSCSeedMapOccTrgSC_[1][4]->setAxisTitle("jy", 2);
499 
500  histo = "EECLTE SC seed occupancy map EE + (CSC exclusive triggered) super crystal binned";
501  meSCSeedMapOccTrgExclSC_[1][0] = dqmStore_->book2D(histo,histo,20,0,100,20,0,100);
502  meSCSeedMapOccTrgExclSC_[1][0]->setAxisTitle("jx", 1);
503  meSCSeedMapOccTrgExclSC_[1][0]->setAxisTitle("jy", 2);
504 
505  histo = "EECLTE SC seed occupancy map EE + (DT exclusive triggered) super crystal binned";
506  meSCSeedMapOccTrgExclSC_[1][1] = dqmStore_->book2D(histo,histo,20,0,100,20,0,100);
507  meSCSeedMapOccTrgExclSC_[1][1]->setAxisTitle("jx", 1);
508  meSCSeedMapOccTrgExclSC_[1][1]->setAxisTitle("jy", 2);
509 
510  histo = "EECLTE SC seed occupancy map EE + (ECAL exclusive triggered) super crystal binned";
511  meSCSeedMapOccTrgExclSC_[1][2] = dqmStore_->book2D(histo,histo,20,0,100,20,0,100);
512  meSCSeedMapOccTrgExclSC_[1][2]->setAxisTitle("jx", 1);
513  meSCSeedMapOccTrgExclSC_[1][2]->setAxisTitle("jy", 2);
514 
515  histo = "EECLTE SC seed occupancy map EE + (HCAL exclusive triggered) super crystal binned";
516  meSCSeedMapOccTrgExclSC_[1][3] = dqmStore_->book2D(histo,histo,20,0,100,20,0,100);
517  meSCSeedMapOccTrgExclSC_[1][3]->setAxisTitle("jx", 1);
518  meSCSeedMapOccTrgExclSC_[1][3]->setAxisTitle("jy", 2);
519 
520  histo = "EECLTE SC seed occupancy map EE + (RPC exclusive triggered) super crystal binned";
521  meSCSeedMapOccTrgExclSC_[1][4] = dqmStore_->book2D(histo,histo,20,0,100,20,0,100);
522  meSCSeedMapOccTrgExclSC_[1][4]->setAxisTitle("jx", 1);
523  meSCSeedMapOccTrgExclSC_[1][4]->setAxisTitle("jy", 2);
524 
525  histo = "EECLTE SC seed crystal timing map EE - (CSC exclusive triggered) super crystal binned";
526  meSCSeedMapTimeTrgSC_[0][0] = dqmStore_->bookProfile2D(histo,histo,20,0,100,20,0,100,78,0.,10.,"s");
527  meSCSeedMapTimeTrgSC_[0][0]->setAxisTitle("jx", 1);
528  meSCSeedMapTimeTrgSC_[0][0]->setAxisTitle("jy", 2);
529 
530  histo = "EECLTE SC seed crystal timing map EE - (DT exclusive triggered) super crystal binned";
531  meSCSeedMapTimeTrgSC_[0][1] = dqmStore_->bookProfile2D(histo,histo,20,0,100,20,0,100,78,0.,10.,"s");
532  meSCSeedMapTimeTrgSC_[0][1]->setAxisTitle("jx", 1);
533  meSCSeedMapTimeTrgSC_[0][1]->setAxisTitle("jy", 2);
534 
535  histo = "EECLTE SC seed crystal timing map EE - (ECAL exclusive triggered) super crystal binned";
536  meSCSeedMapTimeTrgSC_[0][2] = dqmStore_->bookProfile2D(histo,histo,20,0,100,20,0,100,78,0.,10.,"s");
537  meSCSeedMapTimeTrgSC_[0][2]->setAxisTitle("jx", 1);
538  meSCSeedMapTimeTrgSC_[0][2]->setAxisTitle("jy", 2);
539 
540  histo = "EECLTE SC seed crystal timing map EE - (HCAL exclusive triggered) super crystal binned";
541  meSCSeedMapTimeTrgSC_[0][3] = dqmStore_->bookProfile2D(histo,histo,20,0,100,20,0,100,78,0.,10.,"s");
542  meSCSeedMapTimeTrgSC_[0][3]->setAxisTitle("jx", 1);
543  meSCSeedMapTimeTrgSC_[0][3]->setAxisTitle("jy", 2);
544 
545  histo = "EECLTE SC seed crystal timing map EE - (RPC exclusive triggered) super crystal binned";
546  meSCSeedMapTimeTrgSC_[0][4] = dqmStore_->bookProfile2D(histo,histo,20,0,100,20,0,100,78,0.,10.,"s");
547  meSCSeedMapTimeTrgSC_[0][4]->setAxisTitle("jx", 1);
548  meSCSeedMapTimeTrgSC_[0][4]->setAxisTitle("jy", 2);
549 
550  histo = "EECLTE SC seed crystal timing map EE + (CSC exclusive triggered) super crystal binned";
551  meSCSeedMapTimeTrgSC_[1][0] = dqmStore_->bookProfile2D(histo,histo,20,0,100,20,0,100,78,0.,10.,"s");
552  meSCSeedMapTimeTrgSC_[1][0]->setAxisTitle("jx", 1);
553  meSCSeedMapTimeTrgSC_[1][0]->setAxisTitle("jy", 2);
554 
555  histo = "EECLTE SC seed crystal timing map EE + (DT exclusive triggered) super crystal binned";
556  meSCSeedMapTimeTrgSC_[1][1] = dqmStore_->bookProfile2D(histo,histo,20,0,100,20,0,100,78,0.,10.,"s");
557  meSCSeedMapTimeTrgSC_[1][1]->setAxisTitle("jx", 1);
558  meSCSeedMapTimeTrgSC_[1][1]->setAxisTitle("jy", 2);
559 
560  histo = "EECLTE SC seed crystal timing map EE + (ECAL exclusive triggered) super crystal binned";
561  meSCSeedMapTimeTrgSC_[1][2] = dqmStore_->bookProfile2D(histo,histo,20,0,100,20,0,100,78,0.,10.,"s");
562  meSCSeedMapTimeTrgSC_[1][2]->setAxisTitle("jx", 1);
563  meSCSeedMapTimeTrgSC_[1][2]->setAxisTitle("jy", 2);
564 
565  histo = "EECLTE SC seed crystal timing map EE + (HCAL exclusive triggered) super crystal binned";
566  meSCSeedMapTimeTrgSC_[1][3] = dqmStore_->bookProfile2D(histo,histo,20,0,100,20,0,100,78,0.,10.,"s");
567  meSCSeedMapTimeTrgSC_[1][3]->setAxisTitle("jx", 1);
568  meSCSeedMapTimeTrgSC_[1][3]->setAxisTitle("jy", 2);
569 
570  histo = "EECLTE SC seed crystal timing map EE + (RPC exclusive triggered) super crystal binned";
571  meSCSeedMapTimeTrgSC_[1][4] = dqmStore_->bookProfile2D(histo,histo,20,0,100,20,0,100,78,0.,10.,"s");
572  meSCSeedMapTimeTrgSC_[1][4]->setAxisTitle("jx", 1);
573  meSCSeedMapTimeTrgSC_[1][4]->setAxisTitle("jy", 2);
574  }
575 }
576 
578 
579  if ( ! init_ ) return;
580 
581  if ( dqmStore_ ) {
582  dqmStore_->setCurrentFolder(prefixME_ + "/EEClusterTaskExtras");
583 
584 #ifndef EECLUSTERTASKEXTRAS_DQMOFFLINE
585  if ( meSCSizCrystal_ ) dqmStore_->removeElement( meSCSizCrystal_->getName() );
586  meSCSizCrystal_ = 0;
587  if ( meSCSizBC_ ) dqmStore_->removeElement( meSCSizBC_->getName() );
588  meSCSizBC_ = 0;
589 
590  if ( meSCSeedEne_ ) dqmStore_->removeElement( meSCSeedEne_->getName() );
591  meSCSeedEne_ = 0;
592  if ( meSCEne2_ ) dqmStore_->removeElement( meSCEne2_->getName() );
593  meSCEne2_= 0;
594  if ( meSCEneLow_ ) dqmStore_->removeElement( meSCEneLow_->getName() );
595  meSCEneLow_ = 0;
596  if ( meSCEneHigh_ ) dqmStore_->removeElement( meSCEneHigh_->getName() );
597  meSCEneHigh_ = 0;
598  if ( meSCEneSingleCrystal_ ) dqmStore_->removeElement( meSCEneSingleCrystal_->getName() );
599  meSCEneSingleCrystal_ = 0;
600 
601  for(int i=0;i!=2;++i) {
602  if ( meSCSeedMapOccSC_[i] ) dqmStore_->removeElement( meSCSeedMapOccSC_[i]->getName() );
603  meSCSeedMapOccSC_[i] = 0;
604  if ( meSCSeedMapOccHighEne_[i] ) dqmStore_->removeElement( meSCSeedMapOccHighEne_[i]->getName() );
605  meSCSeedMapOccHighEne_[i] = 0;
606  if ( meSCSeedMapOccSingleCrystal_[i] ) dqmStore_->removeElement( meSCSeedMapOccSingleCrystal_[i]->getName() );
607  meSCSeedMapOccSingleCrystal_[i] = 0;
608  if ( meSCSeedMapTimeSC_[i] ) dqmStore_->removeElement( meSCSeedMapTimeSC_[i]->getName() );
609  meSCSeedMapTimeSC_[i] = 0;
610  for(int j=0;j!=5;++j) {
611  if ( meSCSeedMapOccTrg_[i][j] ) dqmStore_->removeElement( meSCSeedMapOccTrg_[i][j]->getName() );
612  meSCSeedMapOccTrg_[i][j] = 0;
613  if ( meSCSeedMapOccTrgExcl_[i][j] ) dqmStore_->removeElement( meSCSeedMapOccTrgExcl_[i][j]->getName() );
614  meSCSeedMapOccTrgExcl_[i][j] = 0;
615  }
616  }
617 
618  dqmStore_->setCurrentFolder(prefixME_ + "/EEClusterTaskExtras/EECLTE timing per super module");
619  for(int i=0; i!=18; ++i) {
620  if( meSCSeedTimePerFed_[i] ) dqmStore_->removeElement( meSCSeedTimePerFed_[i]->getName() );
621  meSCSeedTimePerFed_[i] = 0;
622  }
623  dqmStore_->setCurrentFolder(prefixME_ + "/EEClusterTaskExtras");
624 
625  if ( meSCSeedTime_ ) dqmStore_->removeElement( meSCSeedTime_->getName() );
626  meSCSeedTime_ = 0;
627  if ( meSCSeedTimeVsAmp_ ) dqmStore_->removeElement( meSCSeedTimeVsAmp_->getName() );
628  meSCSeedTimeVsAmp_ = 0;
629  if ( meSCSeedTimeEEM_ ) dqmStore_->removeElement( meSCSeedTimeEEM_->getName() );
630  meSCSeedTimeEEM_ = 0;
631  if ( meSCSeedTimeEEP_ ) dqmStore_->removeElement( meSCSeedTimeEEP_->getName() );
632  meSCSeedTimeEEP_ = 0;
633 
634 #endif
635 
636  if (meSCSizCrystalVsEne_ ) dqmStore_->removeElement(meSCSizCrystalVsEne_->getName() );
637  meSCSizCrystalVsEne_ = 0;
638 
639  for(int i=0;i!=2;++i) {
640  if ( meSCSeedMapOcc_[i] ) dqmStore_->removeElement( meSCSeedMapOcc_[i]->getName() );
641  meSCSeedMapOcc_[i] = 0;
642  if ( meSCSeedMapOccHighEneSC_[i] ) dqmStore_->removeElement( meSCSeedMapOccHighEneSC_[i]->getName() );
643  meSCSeedMapOccHighEneSC_[i] = 0;
644 
645  for(int j=0; j!=5; ++j) {
646  if ( meSCSeedMapOccTrgSC_[i][j] ) dqmStore_->removeElement( meSCSeedMapOccTrgSC_[i][j]->getName() );
647  meSCSeedMapOccTrgSC_[i][j] = 0;
648  if ( meSCSeedMapOccTrgExclSC_[i][j] ) dqmStore_->removeElement( meSCSeedMapOccTrgExclSC_[i][j]->getName() );
649  meSCSeedMapOccTrgExclSC_[i][j] = 0;
650 
651  if ( meSCSeedMapTimeTrgSC_[i][j] ) dqmStore_->removeElement( meSCSeedMapTimeTrgSC_[i][j]->getName() );
652  meSCSeedMapTimeTrgSC_[i][j] = 0;
653  }
654  }
655 
656  }
657 
658  init_ = false;
659 
660 }
661 
663 
664  LogInfo("EEClusterTaskExtras") << "analyzed " << ievt_ << " events";
665 
666  if ( enableCleanup_ ) this->cleanup();
667 
668 }
669 
671 
672  using namespace std;
673 
674  if ( ! init_ ) this->setup();
675 
676  ievt_++;
677 
678  // --- Barrel Super Clusters ---
679 
680  Handle<SuperClusterCollection> pSuperClusters;
681 
682  if ( e.getByToken(SuperClusterCollection_, pSuperClusters) ) {
683 
684  //int nscc = pSuperClusters->size();
685 
686  //TLorentzVector sc1_p(0,0,0,0);
687  //TLorentzVector sc2_p(0,0,0,0);
688 
689  for ( SuperClusterCollection::const_iterator sCluster = pSuperClusters->begin(); sCluster != pSuperClusters->end(); ++sCluster ) {
690 
691  // seed and shapes
693  e.getByToken( EcalRecHitCollection_, pEERecHits );
694  if ( pEERecHits.isValid() ) {
695  const EcalRecHitCollection *eeRecHits = pEERecHits.product();
696 
697  // Find the seed rec hit
698  // <= CMSSW_3_0_X
699  //std::vector<DetId> sIds = sCluster->getHitsByDetId();
700  // >= CMSSW_3_1_X
701  std::vector< std::pair<DetId,float> > sIds = sCluster->hitsAndFractions();
702 
703  EcalRecHitCollection::const_iterator seedItr = eeRecHits->begin();
704  EcalRecHitCollection::const_iterator secondItr = eeRecHits->begin();
705 
706  // <= CMSSW_3_0_X
707  //for(std::vector<DetId>::const_iterator idItr = sIds.begin(); idItr != sIds.end(); ++idItr) {
708  //if(idItr->det() != DetId::Ecal) { continue; }
709  //EcalRecHitCollection::const_iterator hitItr = eeRecHits->find((*idItr));
710  // >= CMSSW_3_1_X
711  for(std::vector< std::pair<DetId,float> >::const_iterator idItr = sIds.begin(); idItr != sIds.end(); ++idItr) {
712  DetId id = idItr->first;
713  if(id.det() != DetId::Ecal) { continue; }
714  EcalRecHitCollection::const_iterator hitItr = eeRecHits->find(id);
715  if(hitItr == eeRecHits->end()) { continue; }
716  if(hitItr->energy() > secondItr->energy()) { secondItr = hitItr; }
717  if(hitItr->energy() > seedItr->energy()) { std::swap(seedItr,secondItr); }
718  }
719 
720  EEDetId seedId = (EEDetId) seedItr->id();
721 
722  // Prepare to fill maps
723  int ism = Numbers::iSM(seedId);
724  int eey = seedId.iy();
725  int eex = seedId.ix();
726  float xeey = eey - 0.5;
727  float xeex = eex - 0.5;
728 
729  int side = (ism >=1 && ism <= 9) ? 0 : 1;
730 
732  c.get<EcalADCToGeVConstantRcd>().get(pAgc);
733 
734  vector<bool> triggers = determineTriggers(e,c);
735 
736 #ifndef EECLUSTERTASKEXTRAS_DQMOFFLINE
737  float eMax, e2nd;
738  eMax = seedItr->energy();
739  e2nd = secondItr->energy();
740  // energy, size
741  if(meSCEneLow_) meSCEneLow_->Fill( sCluster->energy() );
742  if(meSCEneHigh_) meSCEneHigh_->Fill( sCluster->energy() );
743  if(meSCSizBC_) meSCSizBC_->Fill( float(sCluster->clustersSize()) );
744 
745  if(meSCSizCrystal_) meSCSizCrystal_->Fill(sIds.size());
746  if(meSCSeedEne_) meSCSeedEne_->Fill(eMax);
747  if(meSCEne2_) meSCEne2_->Fill(eMax+e2nd);
748  //if(meSCEneVsEMax_) meSCEneVsEMax_->Fill(eMax,sCluster->energy());
749 
750  if(meSCSeedMapOccSC_[side]) meSCSeedMapOccSC_[side]->Fill(xeex, xeey);
751 
752  if(sCluster->energy() > 2) {
753  if(meSCSeedMapOccHighEne_[side]) meSCSeedMapOccHighEne_[side]->Fill(xeex, xeey);
754  if(meSCSeedMapOccHighEneSC_[side]) meSCSeedMapOccHighEneSC_[side]->Fill(xeex, xeey);
755  }
756  if(sIds.size() == 1) {
757  if(meSCEneSingleCrystal_) meSCEneSingleCrystal_->Fill(sCluster->energy());
758  if(meSCSeedMapOccSingleCrystal_[side]) meSCSeedMapOccSingleCrystal_[side]->Fill(xeex, xeey);
759  }
760 
761  if(meSCSeedMapOcc_[side]) meSCSeedMapOcc_[side]->Fill(xeex, xeey);
762 
763  if(pAgc.isValid()) {
764  const EcalADCToGeVConstant* agc = pAgc.product();
765  if(seedItr->energy() / agc->getEBValue() > 12) {
766  if(meSCSeedTime_) meSCSeedTime_->Fill(seedItr->time());
767  if(meSCSeedTimeVsAmp_) meSCSeedTimeVsAmp_->Fill(seedItr->time(),sCluster->energy());
768  if(!side)
769  if(meSCSeedTimeEEM_) meSCSeedTimeEEM_->Fill(seedItr->time());
770  if(side)
771  if(meSCSeedTimeEEP_) meSCSeedTimeEEP_->Fill(seedItr->time());
772  if(meSCSeedTimePerFed_[ism-1]) meSCSeedTimePerFed_[ism-1]->Fill(seedItr->time());
773  if(meSCSeedMapTimeSC_[side]) meSCSeedMapTimeSC_[side]->Fill(xeex,xeey,seedItr->time());
774 
775  }
776  }
777  else {
778  LogWarning("EBClusterTaskExtras") << "EcalADCToGeVConstant not valid";
779  }
780  for(int i=0;i!=5;++i) {
781  if(triggers[i]) {
782  if(meSCSeedMapOccTrg_[side][i]) meSCSeedMapOccTrg_[side][i]->Fill(xeex, xeey);
783  bool isExclusive = true;
784  for(int j=0;j!=5;++j) {
785  if(j != i && triggers[j])
786  isExclusive = false;
787  }
788  if(isExclusive)
789  if(meSCSeedMapOccTrgExcl_[side][i]) meSCSeedMapOccTrgExcl_[side][i]->Fill(xeex, xeey);
790  }
791  }
792 #endif
793 
794  if(meSCSizCrystalVsEne_) meSCSizCrystalVsEne_->Fill(sCluster->energy(),sIds.size());
795 
796  for(int i=0;i!=5;++i) {
797  if(triggers[i]) {
798  if(meSCSeedMapOccTrgSC_[side][i]) meSCSeedMapOccTrgSC_[side][i]->Fill(xeex, xeey);
799 
800  if(pAgc.isValid()) {
801  const EcalADCToGeVConstant* agc = pAgc.product();
802  if(seedItr->energy() / agc->getEBValue() > 12) {
803  if(meSCSeedMapTimeTrgSC_[side][i]) meSCSeedMapTimeTrgSC_[side][i]->Fill(xeex, xeey, seedItr->time());
804  }
805  }
806  else {
807  LogWarning("EBClusterTaskExtras") << "EcalADCToGeVConstant not valid";
808  }
809 
810  bool isExclusive = true;
811  for(int j=0;j!=5;++j) {
812  if(j != i && triggers[j])
813  isExclusive = false;
814  }
815  if(isExclusive)
816  if(meSCSeedMapOccTrgExclSC_[side][i]) meSCSeedMapOccTrgExclSC_[side][i]->Fill(xeex, xeey);
817  }
818  }
819  }
820  else {
821  LogWarning("EEClusterTaskExtras") << pEERecHits << " not available";
822  }
823  }
824 
825  } else {
826 
827  // LogWarning("EEClusterTaskExtras") << "SuperClusterCollection not available";
828 
829  }
830 
831 }
832 
833 std::vector<bool>
835 
836  using namespace edm;
837  std::vector<bool> l1Triggers; //DT,CSC,RPC,HCAL,ECAL
838  //0 , 1 , 2 , 3 , 4
839  for(int i=0;i<5;i++)
840  l1Triggers.push_back(false);
841 
842  // get the GMTReadoutCollection
844  iEvent.getByToken(l1GMTReadoutRecToken_,gmtrc_handle);
845  L1MuGMTReadoutCollection const* gmtrc = gmtrc_handle.product();
846  if (!(gmtrc_handle.isValid()))
847  {
848  LogWarning("EcalCosmicsHists") << "l1MuGMTReadoutCollection" << " not available";
849  return l1Triggers;
850  }
851  // get hold of L1GlobalReadoutRecord
853  iEvent.getByToken(l1GTReadoutRecToken_,L1GTRR);
854 
855  //Ecal
857  eventSetup.get<L1GtTriggerMenuRcd>().get(menuRcd) ;
858  const L1GtTriggerMenu* menu = menuRcd.product();
859  // Get dWord after masking disabled bits
860  const DecisionWord dWord = L1GTRR->decisionWord();
861 
862  bool l1SingleEG2 = menu->gtAlgorithmResult("L1_SingleEG2", dWord);
863  bool l1SingleEG5 = menu->gtAlgorithmResult("L1_SingleEG5", dWord);
864  bool l1SingleEG8 = menu->gtAlgorithmResult("L1_SingleEG8", dWord);
865  bool l1SingleEG10 = menu->gtAlgorithmResult("L1_SingleEG10", dWord);
866  bool l1SingleEG12 = menu->gtAlgorithmResult("L1_SingleEG12", dWord);
867  bool l1SingleEG15 = menu->gtAlgorithmResult("L1_SingleEG15", dWord);
868  bool l1SingleEG20 = menu->gtAlgorithmResult("L1_SingleEG20", dWord);
869  bool l1SingleEG25 = menu->gtAlgorithmResult("L1_SingleEG25", dWord);
870  bool l1DoubleNoIsoEGBTBtight = menu->gtAlgorithmResult("L1_DoubleNoIsoEG_BTB_tight", dWord);
871  bool l1DoubleNoIsoEGBTBloose = menu->gtAlgorithmResult("L1_DoubleNoIsoEG_BTB_loose ", dWord);
872  bool l1DoubleNoIsoEGTopBottom = menu->gtAlgorithmResult("L1_DoubleNoIsoEGTopBottom", dWord);
873  bool l1DoubleNoIsoEGTopBottomCen = menu->gtAlgorithmResult("L1_DoubleNoIsoEGTopBottomCen", dWord);
874  bool l1DoubleNoIsoEGTopBottomCen2 = menu->gtAlgorithmResult("L1_DoubleNoIsoEGTopBottomCen2", dWord);
875  bool l1DoubleNoIsoEGTopBottomCenVert = menu->gtAlgorithmResult("L1_DoubleNoIsoEGTopBottomCenVert", dWord);
876 
877  l1Triggers[ECAL_TRIGGER] = l1SingleEG2 || l1SingleEG5 || l1SingleEG8 || l1SingleEG10 || l1SingleEG12 || l1SingleEG15
878  || l1SingleEG20 || l1SingleEG25 || l1DoubleNoIsoEGBTBtight || l1DoubleNoIsoEGBTBloose
879  || l1DoubleNoIsoEGTopBottom || l1DoubleNoIsoEGTopBottomCen || l1DoubleNoIsoEGTopBottomCen2
880  || l1DoubleNoIsoEGTopBottomCenVert;
881 
882  std::vector<L1MuGMTReadoutRecord> gmt_records = gmtrc->getRecords();
883  std::vector<L1MuGMTReadoutRecord>::const_iterator igmtrr;
884  for(igmtrr=gmt_records.begin(); igmtrr!=gmt_records.end(); igmtrr++) {
885  std::vector<L1MuRegionalCand>::const_iterator iter1;
886  std::vector<L1MuRegionalCand> rmc;
887 
888  //DT triggers
889  int idt = 0;
890  rmc = igmtrr->getDTBXCands();
891  for(iter1=rmc.begin(); iter1!=rmc.end(); iter1++) {
892  if ( !(*iter1).empty() ) {
893  idt++;
894  }
895  }
896  //if(idt>0) std::cout << "Found " << idt << " valid DT candidates in bx wrt. L1A = "
897  // << igmtrr->getBxInEvent() << std::endl;
898  if(igmtrr->getBxInEvent()==0 && idt>0) l1Triggers[DT_TRIGGER] = true;
899 
900  //RPC triggers
901  int irpcb = 0;
902  rmc = igmtrr->getBrlRPCCands();
903  for(iter1=rmc.begin(); iter1!=rmc.end(); iter1++) {
904  if ( !(*iter1).empty() ) {
905  irpcb++;
906  }
907  }
908  //if(irpcb>0) std::cout << "Found " << irpcb << " valid RPC candidates in bx wrt. L1A = "
909  // << igmtrr->getBxInEvent() << std::endl;
910  if(igmtrr->getBxInEvent()==0 && irpcb>0) l1Triggers[RPC_TRIGGER] = true;
911 
912  //CSC Triggers
913  int icsc = 0;
914  rmc = igmtrr->getCSCCands();
915  for(iter1=rmc.begin(); iter1!=rmc.end(); iter1++) {
916  if ( !(*iter1).empty() ) {
917  icsc++;
918  }
919  }
920  //if(icsc>0) std::cout << "Found " << icsc << " valid CSC candidates in bx wrt. L1A = "
921  // << igmtrr->getBxInEvent() << std::endl;
922  if(igmtrr->getBxInEvent()==0 && icsc>0) l1Triggers[CSC_TRIGGER] = true;
923  }
924 
925  L1GlobalTriggerReadoutRecord const* gtrr = L1GTRR.product();
926 
927  for(int ibx=-1; ibx<=1; ibx++) {
928  bool hcal_top = false;
929  bool hcal_bot = false;
930  const L1GtPsbWord psb = gtrr->gtPsbWord(0xbb0d,ibx);
931  std::vector<int> valid_x;
932  if((psb.aData(4)&0x3f) >= 1) {valid_x.push_back( (psb.aData(4)>>10)&0x1f ); }
933  if((psb.bData(4)&0x3f) >= 1) {valid_x.push_back( (psb.bData(4)>>10)&0x1f ); }
934  if((psb.aData(5)&0x3f) >= 1) {valid_x.push_back( (psb.aData(5)>>10)&0x1f ); }
935  if((psb.bData(5)&0x3f) >= 1) {valid_x.push_back( (psb.bData(5)>>10)&0x1f ); }
936  std::vector<int>::const_iterator ix;
937  for(ix=valid_x.begin(); ix!=valid_x.end(); ix++) {
938  //std::cout << "Found HCAL mip with x=" << *ix << " in bx wrt. L1A = " << ibx << std::endl;
939  if(*ix<9) hcal_top=true;
940  if(*ix>8) hcal_bot=true;
941  }
942  if(ibx==0 && hcal_top && hcal_bot) l1Triggers[HCAL_TRIGGER]=true;
943  }
944  return l1Triggers;
945 }
T getParameter(std::string const &) const
const cms_uint16_t bData(int iB) const
get/set B_DATA_CH_IB
Definition: L1GtPsbWord.cc:323
void beginRun(const edm::Run &r, const edm::EventSetup &c)
BeginRun.
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
void endJob(void)
EndJob.
void beginJob(void)
BeginJob.
int ix() const
Definition: EEDetId.h:76
void endRun(const edm::Run &r, const edm::EventSetup &c)
EndRun.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
Some &quot;id&quot; conversions.
void reset(void)
Reset.
std::vector< EcalRecHit >::const_iterator const_iterator
static void cleanup(const Factory::MakerMap::value_type &v)
Definition: Factory.cc:12
int iEvent
Definition: GenABIO.cc:243
const cms_uint16_t aData(int iA) const
get/set A_DATA_CH_IA
Definition: L1GtPsbWord.cc:228
std::vector< bool > DecisionWord
typedefs
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
std::vector< bool > determineTriggers(const edm::Event &, const edm::EventSetup &eventSetup)
int j
Definition: DBlmapReader.cc:9
int iy() const
Definition: EEDetId.h:82
virtual ~EEClusterTaskExtras()
Destructor.
void setup(void)
Setup.
bool isValid() const
Definition: HandleBase.h:76
const_iterator end() const
Definition: DetId.h:18
static void initGeometry(const edm::EventSetup &setup, bool verbose=false)
Definition: Numbers.cc:47
void cleanup(void)
Cleanup.
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.
EEClusterTaskExtras(const edm::ParameterSet &ps)
Constructor.
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
T const * product() const
Definition: Handle.h:81
iterator find(key_type k)
static unsigned iSM(const unsigned ism, const EcalSubdetector subdet)
Definition: Numbers.cc:243
bool isValid() const
Definition: ESHandle.h:37
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
void reset(double vett[256])
Definition: TPedValues.cc:11
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
const_iterator begin() const
Definition: Run.h:41