CMS 3D CMS Logo

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