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: 2009/09/15 16:04:39 $
5  * $Revision: 1.7 $
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 
214  char histo[200];
215 
216  if ( dqmStore_ ) {
217  dqmStore_->setCurrentFolder(prefixME_ + "/EBClusterTaskExtras");
218 
219 #ifndef EBCLUSTERTASKEXTRAS_DQMOFFLINE
220  // Cluster hists
221  sprintf(histo, "EBCLTE SC size (crystal)");
222  meSCSizCrystal_ = dqmStore_->book1D(histo,histo,150,0,150);
223  meSCSizCrystal_->setAxisTitle("super cluster size (crystal)", 1);
224 
225  sprintf(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  sprintf(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  sprintf(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  sprintf(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  sprintf(histo, "EBCLTE SC energy low scale");
243  meSCEneLow_ = dqmStore_->book1D(histo,histo,200,0,1.8);
244  meSCEneLow_->setAxisTitle("energy (GeV)", 1);
245 
246  sprintf(histo, "EBCLTE SC energy high scale");
247  meSCEneHigh_ = dqmStore_->book1D(histo,histo,200,0,200);
248  meSCEneHigh_->setAxisTitle("energy (GeV)", 1);
249 
250  sprintf(histo, "EBCLTE SC single crystal energy (GeV)");
251  meSCEneSingleCrystal_ = dqmStore_->book1D(histo,histo,200,0,200);
252  meSCEneSingleCrystal_->setAxisTitle("energy (GeV)", 1);
253 
254  sprintf(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  sprintf(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  sprintf(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  sprintf(histo, "EBCLTE SC seed crystal timing");
270  meSCSeedTime_ = dqmStore_->book1D(histo,histo,78,0.,10.);
271  meSCSeedTime_->setAxisTitle("seed crystal timing");
272 
273  sprintf(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  sprintf(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  sprintf(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  sprintf(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  sprintf(histo, "EBCLTE SC seed crystal timing EB -");
294  meSCSeedTimeEBM_ = dqmStore_->book1D(histo,histo,78,0.,10.);
295  meSCSeedTimeEBM_->setAxisTitle("seed crystal timing");
296 
297  sprintf(histo, "EBCLTE SC seed crystal timing EB +");
298  meSCSeedTimeEBP_ = dqmStore_->book1D(histo,histo,78,0.,10.);
299  meSCSeedTimeEBP_->setAxisTitle("seed crystal timing");
300 
301  sprintf(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  sprintf(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  sprintf(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  sprintf(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  dqmStore_->setCurrentFolder(prefixME_ + "/EBClusterTaskExtras/EBCLTE seed crystal timing per super module");
318  for(int i=0;i!=36;++i) {
319  if((i+1) <= 18)
320  sprintf(histo, "EBCLTE SC seed crystal timing EB - %i",i+1);
321  else
322  sprintf(histo, "EBCLTE SC seed crystal timing EB + %i",i+1-18);
323  meSCSeedTimePerFed_[i] = dqmStore_->book1D(histo,histo,78,0.,10.);
324  meSCSeedTimePerFed_[i]->setAxisTitle("seed crystal timing", 1);
325  }
326 
327  dqmStore_->setCurrentFolder(prefixME_ + "/EBClusterTaskExtras");
328 
329  sprintf(histo, "EBCLTE SC seed occupancy map (CSC exclusive triggered)");
330  meSCSeedMapOccTrgExcl_[0] = dqmStore_->book2D(histo,histo,360,0,360,170,-85,85);
331  meSCSeedMapOccTrgExcl_[0]->setAxisTitle("jphi", 1);
332  meSCSeedMapOccTrgExcl_[0]->setAxisTitle("jeta", 2);
333 
334  sprintf(histo, "EBCLTE SC seed occupancy map (DT exclusive triggered)");
335  meSCSeedMapOccTrgExcl_[1] = dqmStore_->book2D(histo,histo,360,0,360,170,-85,85);
336  meSCSeedMapOccTrgExcl_[1]->setAxisTitle("jphi", 1);
337  meSCSeedMapOccTrgExcl_[1]->setAxisTitle("jeta", 2);
338 
339  sprintf(histo, "EBCLTE SC seed occupancy map (ECAL exclusive triggered)");
340  meSCSeedMapOccTrgExcl_[2] = dqmStore_->book2D(histo,histo,360,0,360,170,-85,85);
341  meSCSeedMapOccTrgExcl_[2]->setAxisTitle("jphi", 1);
342  meSCSeedMapOccTrgExcl_[2]->setAxisTitle("jeta", 2);
343 
344  sprintf(histo, "EBCLTE SC seed occupancy map (HCAL exclusive triggered)");
345  meSCSeedMapOccTrgExcl_[3] = dqmStore_->book2D(histo,histo,360,0,360,170,-85,85);
346  meSCSeedMapOccTrgExcl_[3]->setAxisTitle("jphi", 1);
347  meSCSeedMapOccTrgExcl_[3]->setAxisTitle("jeta", 2);
348 
349  sprintf(histo, "EBCLTE SC seed occupancy map (RPC exclusive triggered)");
350  meSCSeedMapOccTrgExcl_[4] = dqmStore_->book2D(histo,histo,360,0,360,170,-85,85);
351  meSCSeedMapOccTrgExcl_[4]->setAxisTitle("jphi", 1);
352  meSCSeedMapOccTrgExcl_[4]->setAxisTitle("jeta", 2);
353 
354  sprintf(histo, "EBCLTE SC seed occupancy map (CSC triggered)");
355  meSCSeedMapOccTrg_[0] = dqmStore_->book2D(histo,histo,360,0,360,170,-85,85);
356  meSCSeedMapOccTrg_[0]->setAxisTitle("jphi", 1);
357  meSCSeedMapOccTrg_[0]->setAxisTitle("jeta", 2);
358 
359  sprintf(histo, "EBCLTE SC seed occupancy map (DT triggered)");
360  meSCSeedMapOccTrg_[1] = dqmStore_->book2D(histo,histo,360,0,360,170,-85,85);
361  meSCSeedMapOccTrg_[1]->setAxisTitle("jphi", 1);
362  meSCSeedMapOccTrg_[1]->setAxisTitle("jeta", 2);
363 
364  sprintf(histo, "EBCLTE SC seed occupancy map (ECAL triggered)");
365  meSCSeedMapOccTrg_[2] = dqmStore_->book2D(histo,histo,360,0,360,170,-85,85);
366  meSCSeedMapOccTrg_[2]->setAxisTitle("jphi", 1);
367  meSCSeedMapOccTrg_[2]->setAxisTitle("jeta", 2);
368 
369  sprintf(histo, "EBCLTE SC seed occupancy map (HCAL triggered)");
370  meSCSeedMapOccTrg_[3] = dqmStore_->book2D(histo,histo,360,0,360,170,-85,85);
371  meSCSeedMapOccTrg_[3]->setAxisTitle("jphi", 1);
372  meSCSeedMapOccTrg_[3]->setAxisTitle("jeta", 2);
373 
374  sprintf(histo, "EBCLTE SC seed occupancy map (RPC triggered)");
375  meSCSeedMapOccTrg_[4] = dqmStore_->book2D(histo,histo,360,0,360,170,-85,85);
376  meSCSeedMapOccTrg_[4]->setAxisTitle("jphi", 1);
377  meSCSeedMapOccTrg_[4]->setAxisTitle("jeta", 2);
378 
379  sprintf(histo, "EBCLTE SC seed crystal timing map (CSC triggered) module binned");
380  meSCSeedMapTimeTrgMod_[0] = dqmStore_->bookProfile2D(histo,histo,72,0,360,34,-85,85,78,0.,10.,"s");
381  meSCSeedMapTimeTrgMod_[0]->setAxisTitle("jphi", 1);
382  meSCSeedMapTimeTrgMod_[0]->setAxisTitle("jeta", 2);
383 
384  sprintf(histo, "EBCLTE SC seed crystal timing map (DT triggered) module binned");
385  meSCSeedMapTimeTrgMod_[1] = dqmStore_->bookProfile2D(histo,histo,72,0,360,34,-85,85,78,0.,10.,"s");
386  meSCSeedMapTimeTrgMod_[1]->setAxisTitle("jphi", 1);
387  meSCSeedMapTimeTrgMod_[1]->setAxisTitle("jeta", 2);
388 
389  sprintf(histo, "EBCLTE SC seed crystal timing map (ECAL triggered) module binned");
390  meSCSeedMapTimeTrgMod_[2] = dqmStore_->bookProfile2D(histo,histo,72,0,360,34,-85,85,78,0.,10.,"s");
391  meSCSeedMapTimeTrgMod_[2]->setAxisTitle("jphi", 1);
392  meSCSeedMapTimeTrgMod_[2]->setAxisTitle("jeta", 2);
393 
394  sprintf(histo, "EBCLTE SC seed crystal timing map (HCAL triggered) module binned");
395  meSCSeedMapTimeTrgMod_[3] = dqmStore_->bookProfile2D(histo,histo,72,0,360,34,-85,85,78,0.,10.,"s");
396  meSCSeedMapTimeTrgMod_[3]->setAxisTitle("jphi", 1);
397  meSCSeedMapTimeTrgMod_[3]->setAxisTitle("jeta", 2);
398 
399  sprintf(histo, "EBCLTE SC seed crystal timing map (RPC triggered) module binned");
400  meSCSeedMapTimeTrgMod_[4] = dqmStore_->bookProfile2D(histo,histo,72,0,360,34,-85,85,78,0.,10.,"s");
401  meSCSeedMapTimeTrgMod_[4]->setAxisTitle("jphi", 1);
402  meSCSeedMapTimeTrgMod_[4]->setAxisTitle("jeta", 2);
403 
404 #endif
405 
406  sprintf(histo, "EBCLTE SC size (crystal) vs energy (GeV)");
407  meSCSizCrystalVsEne_ = dqmStore_->bookProfile(histo,histo,200,0.,10.,150,0,150);
408  meSCSizCrystalVsEne_->setAxisTitle("energy (GeV)", 1);
409  meSCSizCrystalVsEne_->setAxisTitle("super cluster size (crystal)", 2);
410 
411  sprintf(histo, "EBCLTE SC seed occupancy map");
412  meSCSeedMapOcc_ = dqmStore_->book2D(histo,histo,360,0,360,170,-85,85);
413  meSCSeedMapOcc_->setAxisTitle("jphi", 1);
414  meSCSeedMapOcc_->setAxisTitle("jeta", 2);
415 
416  sprintf(histo, "EBCLTE SC seed occupancy map (high energy clusters) trigger tower binned");
417  meSCSeedMapOccHighEneTT_ = dqmStore_->book2D(histo,histo,72,0,360,34,-85,85);
418  meSCSeedMapOccHighEneTT_->setAxisTitle("jphi", 1);
419  meSCSeedMapOccHighEneTT_->setAxisTitle("jeta", 2);
420 
421  sprintf(histo, "EBCLTE SC seed occupancy map (CSC triggered) trigger tower binned");
422  meSCSeedMapOccTrgTT_[0] = dqmStore_->book2D(histo,histo,72,0,360,34,-85,85);
423  meSCSeedMapOccTrgTT_[0]->setAxisTitle("jphi", 1);
424  meSCSeedMapOccTrgTT_[0]->setAxisTitle("jeta", 2);
425 
426  sprintf(histo, "EBCLTE SC seed occupancy map (DT triggered) trigger tower binned");
427  meSCSeedMapOccTrgTT_[1] = dqmStore_->book2D(histo,histo,72,0,360,34,-85,85);
428  meSCSeedMapOccTrgTT_[1]->setAxisTitle("jphi", 1);
429  meSCSeedMapOccTrgTT_[1]->setAxisTitle("jeta", 2);
430 
431  sprintf(histo, "EBCLTE SC seed occupancy map (ECAL triggered) trigger tower binned");
432  meSCSeedMapOccTrgTT_[2] = dqmStore_->book2D(histo,histo,72,0,360,34,-85,85);
433  meSCSeedMapOccTrgTT_[2]->setAxisTitle("jphi", 1);
434  meSCSeedMapOccTrgTT_[2]->setAxisTitle("jeta", 2);
435 
436  sprintf(histo, "EBCLTE SC seed occupancy map (HCAL triggered) trigger tower binned");
437  meSCSeedMapOccTrgTT_[3] = dqmStore_->book2D(histo,histo,72,0,360,34,-85,85);
438  meSCSeedMapOccTrgTT_[3]->setAxisTitle("jphi", 1);
439  meSCSeedMapOccTrgTT_[3]->setAxisTitle("jeta", 2);
440 
441  sprintf(histo, "EBCLTE SC seed occupancy map (RPC triggered) trigger tower binned");
442  meSCSeedMapOccTrgTT_[4] = dqmStore_->book2D(histo,histo,72,0,360,34,-85,85);
443  meSCSeedMapOccTrgTT_[4]->setAxisTitle("jphi", 1);
444  meSCSeedMapOccTrgTT_[4]->setAxisTitle("jeta", 2);
445 
446  sprintf(histo, "EBCLTE SC seed occupancy map (CSC exclusive triggered) trigger tower binned");
447  meSCSeedMapOccTrgExclTT_[0] = dqmStore_->book2D(histo,histo,72,0,360,34,-85,85);
448  meSCSeedMapOccTrgExclTT_[0]->setAxisTitle("jphi", 1);
449  meSCSeedMapOccTrgExclTT_[0]->setAxisTitle("jeta", 2);
450 
451  sprintf(histo, "EBCLTE SC seed occupancy map (DT exclusive triggered) trigger tower binned");
452  meSCSeedMapOccTrgExclTT_[1] = dqmStore_->book2D(histo,histo,72,0,360,34,-85,85);
453  meSCSeedMapOccTrgExclTT_[1]->setAxisTitle("jphi", 1);
454  meSCSeedMapOccTrgExclTT_[1]->setAxisTitle("jeta", 2);
455 
456  sprintf(histo, "EBCLTE SC seed occupancy map (ECAL exclusive triggered) trigger tower binned");
457  meSCSeedMapOccTrgExclTT_[2] = dqmStore_->book2D(histo,histo,72,0,360,34,-85,85);
458  meSCSeedMapOccTrgExclTT_[2]->setAxisTitle("jphi", 1);
459  meSCSeedMapOccTrgExclTT_[2]->setAxisTitle("jeta", 2);
460 
461  sprintf(histo, "EBCLTE SC seed occupancy map (HCAL exclusive triggered) trigger tower binned");
462  meSCSeedMapOccTrgExclTT_[3] = dqmStore_->book2D(histo,histo,72,0,360,34,-85,85);
463  meSCSeedMapOccTrgExclTT_[3]->setAxisTitle("jphi", 1);
464  meSCSeedMapOccTrgExclTT_[3]->setAxisTitle("jeta", 2);
465 
466  sprintf(histo, "EBCLTE SC seed occupancy map (RPC exclusive triggered) trigger tower binned");
467  meSCSeedMapOccTrgExclTT_[4] = dqmStore_->book2D(histo,histo,72,0,360,34,-85,85);
468  meSCSeedMapOccTrgExclTT_[4]->setAxisTitle("jphi", 1);
469  meSCSeedMapOccTrgExclTT_[4]->setAxisTitle("jeta", 2);
470 
471  sprintf(histo, "EBCLTE SC seed crystal timing map (CSC exclusive triggered) trigger tower binned");
472  meSCSeedMapTimeTrgTT_[0] = dqmStore_->bookProfile2D(histo,histo,72,0,360,34,-85,85,78,0.,10.,"s");
473  meSCSeedMapTimeTrgTT_[0]->setAxisTitle("jphi", 1);
474  meSCSeedMapTimeTrgTT_[0]->setAxisTitle("jeta", 2);
475 
476  sprintf(histo, "EBCLTE SC seed crystal timing map (DT exclusive triggered) trigger tower binned");
477  meSCSeedMapTimeTrgTT_[1] = dqmStore_->bookProfile2D(histo,histo,72,0,360,34,-85,85,78,0.,10.,"s");
478  meSCSeedMapTimeTrgTT_[1]->setAxisTitle("jphi", 1);
479  meSCSeedMapTimeTrgTT_[1]->setAxisTitle("jeta", 2);
480 
481  sprintf(histo, "EBCLTE SC seed crystal timing map (ECAL exclusive triggered) trigger tower binned");
482  meSCSeedMapTimeTrgTT_[2] = dqmStore_->bookProfile2D(histo,histo,72,0,360,34,-85,85,78,0.,10.,"s");
483  meSCSeedMapTimeTrgTT_[2]->setAxisTitle("jphi", 1);
484  meSCSeedMapTimeTrgTT_[2]->setAxisTitle("jeta", 2);
485 
486  sprintf(histo, "EBCLTE SC seed crystal timing map (HCAL exclusive triggered) trigger tower binned");
487  meSCSeedMapTimeTrgTT_[3] = dqmStore_->bookProfile2D(histo,histo,72,0,360,34,-85,85,78,0.,10.,"s");
488  meSCSeedMapTimeTrgTT_[3]->setAxisTitle("jphi", 1);
489  meSCSeedMapTimeTrgTT_[3]->setAxisTitle("jeta", 2);
490 
491  sprintf(histo, "EBCLTE SC seed crystal timing map (RPC exclusive triggered) trigger tower binned");
492  meSCSeedMapTimeTrgTT_[4] = dqmStore_->bookProfile2D(histo,histo,72,0,360,34,-85,85,78,0.,10.,"s");
493  meSCSeedMapTimeTrgTT_[4]->setAxisTitle("jphi", 1);
494  meSCSeedMapTimeTrgTT_[4]->setAxisTitle("jeta", 2);
495 
496  sprintf(histo, "EBCLTE SC seed crystal timing (CSC triggered)");
497  meSCSeedTimeTrg_[0] = dqmStore_->book1D(histo,histo,78,0.,10.);
498  meSCSeedTimeTrg_[0]->setAxisTitle("seed crystal timing",1);
499 
500  sprintf(histo, "EBCLTE SC seed crystal timing (DT triggered)");
501  meSCSeedTimeTrg_[1] = dqmStore_->book1D(histo,histo,78,0.,10.);
502  meSCSeedTimeTrg_[1]->setAxisTitle("seed crystal timing",1);
503 
504  sprintf(histo, "EBCLTE SC seed crystal timing (ECAL triggered)");
505  meSCSeedTimeTrg_[2] = dqmStore_->book1D(histo,histo,78,0.,10.);
506  meSCSeedTimeTrg_[2]->setAxisTitle("seed crystal timing",1);
507 
508  sprintf(histo, "EBCLTE SC seed crystal timing (HCAL triggered)");
509  meSCSeedTimeTrg_[3] = dqmStore_->book1D(histo,histo,78,0.,10.);
510  meSCSeedTimeTrg_[3]->setAxisTitle("seed crystal timing",1);
511 
512  sprintf(histo, "EBCLTE SC seed crystal timing (RPC triggered)");
513  meSCSeedTimeTrg_[4] = dqmStore_->book1D(histo,histo,78,0.,10.);
514  meSCSeedTimeTrg_[4]->setAxisTitle("seed crystal timing",1);
515 
516  sprintf(histo, "EBCLTE triggers");
517  meTrg_ = dqmStore_->book1D(histo, histo, 5, 0, 5);
518  meTrg_->setAxisTitle("triggers");
519 
520  sprintf(histo, "EBCLTE exclusive triggers");
521  meTrgExcl_ = dqmStore_->book1D(histo, histo, 5, 0, 5);
522  meTrgExcl_->setAxisTitle("triggers");
523 
524  }
525 
526 }
527 
529 
530  if ( ! init_ ) return;
531 
532  if ( dqmStore_ ) {
533  dqmStore_->setCurrentFolder(prefixME_ + "/EBClusterTaskExtras");
534 
535 #ifndef EBCLUSTERTASKEXTRAS_DQMOFFLINE
536  if ( meSCSizCrystal_ ) dqmStore_->removeElement( meSCSizCrystal_->getName() );
537  meSCSizCrystal_ = 0;
538 
539  if ( meSCSizBC_ ) dqmStore_->removeElement( meSCSizBC_->getName() );
540  meSCSizBC_ = 0;
541 
542  if ( meSCSizPhi_ ) dqmStore_->removeElement( meSCSizPhi_->getName() );
543  meSCSizPhi_ = 0;
544 
545  if ( meSCSeedEne_ ) dqmStore_->removeElement( meSCSeedEne_->getName() );
546  meSCSeedEne_ = 0;
547 
548  if ( meSCEne2_ ) dqmStore_->removeElement( meSCEne2_->getName() );
549  meSCEne2_ = 0;
550 
551  if ( meSCEneLow_ ) dqmStore_->removeElement( meSCEneLow_->getName() );
552  meSCEneLow_ = 0;
553 
554  if ( meSCEneHigh_ ) dqmStore_->removeElement( meSCEneHigh_->getName() );
555  meSCEneHigh_ = 0;
556 
557  if ( meSCEneSingleCrystal_ ) dqmStore_->removeElement( meSCEneSingleCrystal_->getName() );
558  meSCEneSingleCrystal_ = 0;
559 
560  if ( meSCSeedMapOccTT_ ) dqmStore_->removeElement( meSCSeedMapOccTT_->getName() );
561  meSCSeedMapOccTT_ = 0;
562 
563  if ( meSCSeedMapOccHighEne_ ) dqmStore_->removeElement( meSCSeedMapOccHighEne_->getName() );
564  meSCSeedMapOccHighEne_ = 0;
565 
566  if ( meSCSeedMapOccSingleCrystal_ ) dqmStore_->removeElement( meSCSeedMapOccSingleCrystal_->getName() );
567  meSCSeedMapOccSingleCrystal_ = 0;
568 
569  dqmStore_->setCurrentFolder(prefixME_ + "/EBClusterTaskExtras/EBCLTE seed crystal timing per super module");
570  for(int i=0; i!=36; ++i) {
571  if( meSCSeedTimePerFed_[i] ) dqmStore_->removeElement( meSCSeedTimePerFed_[i]->getName() );
572  meSCSeedTimePerFed_[i] = 0;
573  }
574  dqmStore_->setCurrentFolder(prefixME_ + "/EBClusterTaskExtras");
575 
576  if ( meSCSeedTime_ ) dqmStore_->removeElement( meSCSeedTime_->getName() );
577  meSCSeedTime_ = 0;
578  if ( meSCSeedMapTimeTT_ ) dqmStore_->removeElement( meSCSeedMapTimeTT_->getName() );
579  meSCSeedMapTimeTT_ = 0;
580  if ( meSCSeedMapTimeMod_ ) dqmStore_->removeElement( meSCSeedMapTimeMod_->getName() );
581  meSCSeedMapTimeMod_ = 0;
582  if ( meSCSeedTimeVsPhi_ ) dqmStore_->removeElement( meSCSeedTimeVsPhi_->getName() );
583  meSCSeedTimeVsPhi_ = 0;
584  if ( meSCSeedTimeVsAmp_ ) dqmStore_->removeElement( meSCSeedTimeVsAmp_->getName() );
585  meSCSeedTimeVsAmp_ = 0;
586  if ( meSCSeedTimeEBM_ ) dqmStore_->removeElement( meSCSeedTimeEBM_->getName() );
587  meSCSeedTimeEBM_ = 0;
588  if ( meSCSeedTimeEBP_ ) dqmStore_->removeElement( meSCSeedTimeEBP_->getName() );
589  meSCSeedTimeEBP_ = 0;
590  if ( meSCSeedTimeEBMTop_ ) dqmStore_->removeElement( meSCSeedTimeEBMTop_->getName() );
591  meSCSeedTimeEBMTop_ = 0;
592  if ( meSCSeedTimeEBPTop_ ) dqmStore_->removeElement( meSCSeedTimeEBPTop_->getName() );
593  meSCSeedTimeEBPTop_ = 0;
594  if ( meSCSeedTimeEBMBot_ ) dqmStore_->removeElement( meSCSeedTimeEBMBot_->getName() );
595  meSCSeedTimeEBMBot_ = 0;
596  if ( meSCSeedTimeEBPBot_ ) dqmStore_->removeElement( meSCSeedTimeEBPBot_->getName() );
597  meSCSeedTimeEBPBot_ = 0;
598 
599  for(int i=0;i!=5+ii) {
600  if ( meSCSeedMapOccTrg_[i] ) dqmStore_->removeElement( meSCSeedMapOccTrg_[i]->getName() );
601  meSCSeedMapOccTrg_[i] = 0;
602  if ( meSCSeedMapOccTrgExcl_[i] ) dqmStore_->removeElement( meSCSeedMapOccTrgExcl_[i]->getName() );
603  meSCSeedMapOccTrgExcl_[i] = 0;
604  if ( meSCSeedMapTimeTrgMod_[i] ) dqmStore_->removeElement( meSCSeedMapTimeTrgMod_[i]->getName() );
605  meSCSeedMapTimeTrgMod_[i] = 0;
606  }
607 #endif
608 
609  if ( meSCSizCrystalVsEne_ ) dqmStore_->removeElement( meSCSizCrystalVsEne_->getName() );
610  meSCSizCrystalVsEne_ = 0;
611 
612 
613  if ( meSCSeedMapOcc_ ) dqmStore_->removeElement( meSCSeedMapOcc_->getName() );
614  meSCSeedMapOcc_ = 0;
615 
616  if ( meSCSeedMapOccHighEneTT_ ) dqmStore_->removeElement( meSCSeedMapOccHighEneTT_->getName() );
617  meSCSeedMapOccHighEneTT_ = 0;
618 
619  for(int i=0; i!=5; ++i) {
620  if ( meSCSeedMapOccTrgTT_[i] ) dqmStore_->removeElement( meSCSeedMapOccTrgTT_[i]->getName() );
621  meSCSeedMapOccTrgTT_[i] = 0;
622  if ( meSCSeedMapOccTrgExclTT_[i] ) dqmStore_->removeElement( meSCSeedMapOccTrgExclTT_[i]->getName() );
623  meSCSeedMapOccTrgExclTT_[i] = 0;
624 
625  if ( meSCSeedMapTimeTrgTT_[i] ) dqmStore_->removeElement( meSCSeedMapTimeTrgTT_[i]->getName() );
626  meSCSeedMapTimeTrgTT_[i] = 0;
627 
628  if ( meSCSeedTimeTrg_[i] ) dqmStore_->removeElement( meSCSeedTimeTrg_[i]->getName() );
629  meSCSeedTimeTrg_[i] = 0;
630  }
631 
632  if ( meTrg_ ) dqmStore_->removeElement( meTrg_->getName() );
633  meTrg_ = 0;
634 
635  if ( meTrgExcl_ ) dqmStore_->removeElement( meTrgExcl_->getName() );
636  meTrgExcl_ = 0;
637 
638 
639  }
640 
641  init_ = false;
642 
643 }
644 
646 
647  LogInfo("EBClusterTaskExtras") << "analyzed " << ievt_ << " events";
648 
649  if ( enableCleanup_ ) this->cleanup();
650 
651 }
652 
654 
655  using namespace std;
656 
657  if ( ! init_ ) this->setup();
658 
659  ievt_++;
660 
661  // --- Barrel Super Clusters ---
662 
663  Handle<SuperClusterCollection> pSuperClusters;
664 
665  if ( e.getByLabel(SuperClusterCollection_, pSuperClusters) ) {
666 
667  //int nscc = pSuperClusters->size();
668 
669  //TLorentzVector sc1_p(0,0,0,0);
670  //TLorentzVector sc2_p(0,0,0,0);
671 
672  for ( SuperClusterCollection::const_iterator sCluster = pSuperClusters->begin(); sCluster != pSuperClusters->end(); ++sCluster ) {
673 
674  // seed and shapes
676  e.getByLabel( EcalRecHitCollection_, pEBRecHits );
677  if ( pEBRecHits.isValid() ) {
678  const EcalRecHitCollection *ebRecHits = pEBRecHits.product();
679 
680  // Find the seed rec hit
681  // <= CMSSW_3_0_X
682  //std::vector<DetId> sIds = sCluster->getHitsByDetId();
683  // >= CMSSW_3_1_X
684  std::vector< std::pair<DetId,float> > sIds = sCluster->hitsAndFractions();
685 
686  float eMax, e2nd;
687  EcalRecHitCollection::const_iterator seedItr = ebRecHits->begin();
688  EcalRecHitCollection::const_iterator secondItr = ebRecHits->begin();
689 
690  // <= CMSSW_3_0_X
691  //for(std::vector<DetId>::const_iterator idItr = sIds.begin(); idItr != sIds.end(); ++idItr) {
692  //if(idItr->det() != DetId::Ecal) { continue; }
693  //EcalRecHitCollection::const_iterator hitItr = ebRecHits->find((*idItr));
694  // <= CMSSW_3_1_X
695  for(std::vector< std::pair<DetId,float> >::const_iterator idItr = sIds.begin(); idItr != sIds.end(); ++idItr) {
696  DetId id = idItr->first;
697  if(id.det() != DetId::Ecal) { continue; }
698  EcalRecHitCollection::const_iterator hitItr = ebRecHits->find(id);
699  if(hitItr == ebRecHits->end()) { continue; }
700  if(hitItr->energy() > secondItr->energy()) { secondItr = hitItr; }
701  if(hitItr->energy() > seedItr->energy()) { std::swap(seedItr,secondItr); }
702  }
703 
704  eMax = seedItr->energy();
705  e2nd = secondItr->energy();
706  EBDetId seedId = (EBDetId) seedItr->id();
707 
708  // Prepare to fill maps
709  int ebeta = seedId.ieta();
710  int ebphi = seedId.iphi();
711  float xebeta = ebeta - 0.5 * seedId.zside();
712  float xebphi = ebphi - 0.5;
713 
714  // get the gain info;
716  c.get<EcalADCToGeVConstantRcd>().get(pAgc);
717 
718  vector<bool> triggers = determineTriggers(e,c);
719 
720 #ifndef EBCLUSTERTASKEXTRAS_DQMOFFLINE
721  int ism = Numbers::iSM(seedId);
722 
723  // energy, size
724  if(meSCEneLow_) meSCEneLow_->Fill( sCluster->energy() );
725  if(meSCEneHigh_) meSCEneHigh_->Fill( sCluster->energy() );
726  if(meSCSizBC_) meSCSizBC_->Fill( float(sCluster->clustersSize()) );
727  if(meSCSizPhi_) meSCSizPhi_->Fill(xebphi,sCluster->clustersSize());
728 
729  if(meSCSizCrystal_) meSCSizCrystal_->Fill(sIds.size());
730  if(meSCSeedEne_) meSCSeedEne_->Fill(eMax);
731  if(meSCEne2_) meSCEne2_->Fill(eMax+e2nd);
732  //if(meSCEneVsEMax_) meSCEneVsEMax_->Fill(eMax,sCluster->energy());
733 
734  if(meSCSeedMapOccTT_) meSCSeedMapOccTT_->Fill(xebphi, xebeta);
735  if(sIds.size() == 1) {
736  if(meSCEneSingleCrystal_) meSCEneSingleCrystal_->Fill(sCluster->energy());
737  if(meSCSeedMapOccSingleCrystal_) meSCSeedMapOccSingleCrystal_->Fill(xebphi, xebeta);
738  }
739 
740  if(sCluster->energy() > 2) if(meSCSeedMapOccHighEne_) meSCSeedMapOccHighEne_->Fill(xebphi, xebeta);
741  if(pAgc.isValid()) {
742  const EcalADCToGeVConstant* agc = pAgc.product();
743  if(seedItr->energy() / agc->getEBValue() > 12) {
744  if(meSCSeedTimeVsAmp_) meSCSeedTimeVsAmp_->Fill(seedItr->time() + 5,sCluster->energy());
745  if(meSCSeedTime_) meSCSeedTime_->Fill(seedItr->time() + 5);
746  if (ism >= 1 && ism <= 18 && meSCSeedTimeEBM_) meSCSeedTimeEBM_->Fill(seedItr->time() + 5);
747  if (ism >= 19 && ism <= 36 && meSCSeedTimeEBP_) meSCSeedTimeEBP_->Fill(seedItr->time() + 5);
748  if (ism >= 4 && ism <= 7 && meSCSeedTimeEBMTop_) meSCSeedTimeEBMTop_->Fill(seedItr->time() + 5);
749  if (ism >= 22 && ism <= 25 && meSCSeedTimeEBPTop_) meSCSeedTimeEBPTop_->Fill(seedItr->time() + 5);
750  if (ism >= 13 && ism <= 16 && meSCSeedTimeEBMBot_) meSCSeedTimeEBMBot_->Fill(seedItr->time() + 5);
751  if (ism >= 31 && ism <= 34 && meSCSeedTimeEBPBot_) meSCSeedTimeEBPBot_->Fill(seedItr->time() + 5);
752  if(meSCSeedTimePerFed_[ism-1]) meSCSeedTimePerFed_[ism-1]->Fill(seedItr->time() + 5);
753  if(meSCSeedMapTimeTT_) meSCSeedMapTimeTT_->Fill(xebphi,xebeta,seedItr->time() + 5);
754  if(meSCSeedMapTimeMod_) meSCSeedMapTimeMod_->Fill(xebphi,xebeta,seedItr->time() + 5);
755  if(meSCSeedTimeVsPhi_) meSCSeedTimeVsPhi_->Fill(xebphi,seedItr->time() + 5);
756  }
757  }
758  else {
759  LogWarning("EBClusterTaskExtras") << "EcalADCToGeVConstant not valid";
760  }
761 
762  for(int i=0;i!=5;++i) {
763  if(triggers[i]) {
764  if(meSCSeedMapOccTrg_[i]) meSCSeedMapOccTrg_[i]->Fill(xebphi, xebeta);
765  bool isExclusive = true;
766  for(int j=0;j!=5;++j) {
767  if(pAgc.isValid())
768  if(meSCSeedMapTimeTrgMod_[i]) meSCSeedMapTimeTrgMod_[i]->Fill(xebphi, xebeta, seedItr->time() + 5);
769  if(j != i && triggers[j])
770  isExclusive = false;
771  }
772  if(isExclusive) if(meSCSeedMapOccTrgExcl_[i]) meSCSeedMapOccTrgExcl_[i]->Fill(xebphi, xebeta);
773  }
774  }
775 #endif
776  if(meSCSizCrystalVsEne_) meSCSizCrystalVsEne_->Fill(sCluster->energy(),sIds.size());
777 
778  if(meSCSeedMapOcc_) meSCSeedMapOcc_->Fill(xebphi, xebeta);
779 
780  if(sCluster->energy() > 2) if(meSCSeedMapOccHighEneTT_) meSCSeedMapOccHighEneTT_->Fill(xebphi, xebeta);
781 
782 
783  for(int i=0;i!=5;++i) {
784  if(triggers[i]) {
785  if(meSCSeedMapOccTrgTT_[i]) meSCSeedMapOccTrgTT_[i]->Fill(xebphi, xebeta);
786  if(meTrg_) meTrg_->Fill(i);
787 
788  if(pAgc.isValid()) {
789  if(meSCSeedMapTimeTrgTT_[i]) meSCSeedMapTimeTrgTT_[i]->Fill(xebphi, xebeta, seedItr->time() + 5);
790  if(meSCSeedTimeTrg_[i]) meSCSeedTimeTrg_[i]->Fill(seedItr->time() + 5);
791  }
792  else {
793  LogWarning("EBClusterTaskExtras") << "EcalADCToGeVConstant not valid";
794  }
795 
796  bool isExclusive = true;
797  for(int j=0;j!=5;++j) {
798  if(j != i && triggers[j])
799  isExclusive = false;
800  }
801 
802  if(isExclusive) if(meTrgExcl_) meTrgExcl_->Fill(i);
803  }
804  }
805  }
806  else {
807  LogWarning("EBClusterTaskExtras") << EcalRecHitCollection_ << " not available";
808  }
809 
810  }
811  } else {
812 
813  LogWarning("EBClusterTaskExtras") << SuperClusterCollection_ << " not available";
814 
815  }
816 
817 }
818 
819 std::vector<bool>
821 
822  using namespace edm;
823  std::vector<bool> l1Triggers; //CSC,DT,HCAL,ECAL,RPC
824  //0 , 1 , 2 , 3 , 4
825  for(int i=0;i<5;i++)
826  l1Triggers.push_back(false);
827 
828  // get the GMTReadoutCollection
830  iEvent.getByLabel(l1GMTReadoutRecTag_,gmtrc_handle);
831  L1MuGMTReadoutCollection const* gmtrc = gmtrc_handle.product();
832  if (!(gmtrc_handle.isValid()))
833  {
834  LogWarning("EcalCosmicsHists") << "l1MuGMTReadoutCollection" << " not available";
835  return l1Triggers;
836  }
837  // get hold of L1GlobalReadoutRecord
839  iEvent.getByLabel(l1GTReadoutRecTag_,L1GTRR);
840 
841  //Ecal
843  eventSetup.get<L1GtTriggerMenuRcd>().get(menuRcd) ;
844  const L1GtTriggerMenu* menu = menuRcd.product();
846  iEvent.getByLabel( edm::InputTag("gtDigis"), gtRecord);
847  // Get dWord after masking disabled bits
848  const DecisionWord dWord = gtRecord->decisionWord();
849 
850  bool l1SingleEG2 = menu->gtAlgorithmResult("L1_SingleEG2", dWord);
851  bool l1SingleEG5 = menu->gtAlgorithmResult("L1_SingleEG5", dWord);
852  bool l1SingleEG8 = menu->gtAlgorithmResult("L1_SingleEG8", dWord);
853  bool l1SingleEG10 = menu->gtAlgorithmResult("L1_SingleEG10", dWord);
854  bool l1SingleEG12 = menu->gtAlgorithmResult("L1_SingleEG12", dWord);
855  bool l1SingleEG15 = menu->gtAlgorithmResult("L1_SingleEG15", dWord);
856  bool l1SingleEG20 = menu->gtAlgorithmResult("L1_SingleEG20", dWord);
857  bool l1SingleEG25 = menu->gtAlgorithmResult("L1_SingleEG25", dWord);
858  bool l1DoubleNoIsoEGBTBtight = menu->gtAlgorithmResult("L1_DoubleNoIsoEG_BTB_tight", dWord);
859  bool l1DoubleNoIsoEGBTBloose = menu->gtAlgorithmResult("L1_DoubleNoIsoEG_BTB_loose ", dWord);
860  bool l1DoubleNoIsoEGTopBottom = menu->gtAlgorithmResult("L1_DoubleNoIsoEGTopBottom", dWord);
861  bool l1DoubleNoIsoEGTopBottomCen = menu->gtAlgorithmResult("L1_DoubleNoIsoEGTopBottomCen", dWord);
862  bool l1DoubleNoIsoEGTopBottomCen2 = menu->gtAlgorithmResult("L1_DoubleNoIsoEGTopBottomCen2", dWord);
863  bool l1DoubleNoIsoEGTopBottomCenVert = menu->gtAlgorithmResult("L1_DoubleNoIsoEGTopBottomCenVert", dWord);
864 
865  l1Triggers[ECAL_TRIGGER] = l1SingleEG2 || l1SingleEG5 || l1SingleEG8 || l1SingleEG10 || l1SingleEG12 || l1SingleEG15
866  || l1SingleEG20 || l1SingleEG25 || l1DoubleNoIsoEGBTBtight || l1DoubleNoIsoEGBTBloose
867  || l1DoubleNoIsoEGTopBottom || l1DoubleNoIsoEGTopBottomCen || l1DoubleNoIsoEGTopBottomCen2
868  || l1DoubleNoIsoEGTopBottomCenVert;
869 
870  std::vector<L1MuGMTReadoutRecord> gmt_records = gmtrc->getRecords();
871  std::vector<L1MuGMTReadoutRecord>::const_iterator igmtrr;
872  for(igmtrr=gmt_records.begin(); igmtrr!=gmt_records.end(); igmtrr++) {
873  std::vector<L1MuRegionalCand>::const_iterator iter1;
874  std::vector<L1MuRegionalCand> rmc;
875 
876  //DT triggers
877  int idt = 0;
878  rmc = igmtrr->getDTBXCands();
879  for(iter1=rmc.begin(); iter1!=rmc.end(); iter1++) {
880  if ( !(*iter1).empty() ) {
881  idt++;
882  }
883  }
884  //if(idt>0) std::cout << "Found " << idt << " valid DT candidates in bx wrt. L1A = "
885  // << igmtrr->getBxInEvent() << std::endl;
886  if(igmtrr->getBxInEvent()==0 && idt>0) l1Triggers[DT_TRIGGER] = true;
887 
888  //RPC triggers
889  int irpcb = 0;
890  rmc = igmtrr->getBrlRPCCands();
891  for(iter1=rmc.begin(); iter1!=rmc.end(); iter1++) {
892  if ( !(*iter1).empty() ) {
893  irpcb++;
894  }
895  }
896  //if(irpcb>0) std::cout << "Found " << irpcb << " valid RPC candidates in bx wrt. L1A = "
897  // << igmtrr->getBxInEvent() << std::endl;
898  if(igmtrr->getBxInEvent()==0 && irpcb>0) l1Triggers[RPC_TRIGGER] = true;
899 
900  //CSC Triggers
901  int icsc = 0;
902  rmc = igmtrr->getCSCCands();
903  for(iter1=rmc.begin(); iter1!=rmc.end(); iter1++) {
904  if ( !(*iter1).empty() ) {
905  icsc++;
906  }
907  }
908  //if(icsc>0) std::cout << "Found " << icsc << " valid CSC candidates in bx wrt. L1A = "
909  // << igmtrr->getBxInEvent() << std::endl;
910  if(igmtrr->getBxInEvent()==0 && icsc>0) l1Triggers[CSC_TRIGGER] = true;
911  }
912 
913  L1GlobalTriggerReadoutRecord const* gtrr = L1GTRR.product();
914 
915  for(int ibx=-1; ibx<=1; ibx++) {
916  bool hcal_top = false;
917  bool hcal_bot = false;
918  const L1GtPsbWord psb = gtrr->gtPsbWord(0xbb0d,ibx);
919  std::vector<int> valid_phi;
920  if((psb.aData(4)&0x3f) >= 1) {valid_phi.push_back( (psb.aData(4)>>10)&0x1f ); }
921  if((psb.bData(4)&0x3f) >= 1) {valid_phi.push_back( (psb.bData(4)>>10)&0x1f ); }
922  if((psb.aData(5)&0x3f) >= 1) {valid_phi.push_back( (psb.aData(5)>>10)&0x1f ); }
923  if((psb.bData(5)&0x3f) >= 1) {valid_phi.push_back( (psb.bData(5)>>10)&0x1f ); }
924  std::vector<int>::const_iterator iphi;
925  for(iphi=valid_phi.begin(); iphi!=valid_phi.end(); iphi++) {
926  //std::cout << "Found HCAL mip with phi=" << *iphi << " in bx wrt. L1A = " << ibx << std::endl;
927  if(*iphi<9) hcal_top=true;
928  if(*iphi>8) hcal_bot=true;
929  }
930  if(ibx==0 && hcal_top && hcal_bot) l1Triggers[HCAL_TRIGGER]=true;
931  }
932  return l1Triggers;
933 }
T getParameter(std::string const &) const
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< T >::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.
tuple histo
Definition: trackerHits.py:12
void setup(void)
Setup.
void reset(void)
Reset.
int iphi() const
get the crystal iphi
Definition: EBDetId.h:46
int iEvent
Definition: GenABIO.cc:243
static int iSM(const int ism, const EcalSubdetector subdet)
Definition: Numbers.cc:222
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:44
std::string getName(Reflex::Type &cc)
Definition: ClassFiller.cc:18
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
const boost::uint16_t aData(int iA) const
get/set A_DATA_CH_IA
Definition: L1GtPsbWord.cc:230
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:45
const T & get() const
Definition: EventSetup.h:55
const boost::uint16_t bData(int iB) const
get/set B_DATA_CH_IB
Definition: L1GtPsbWord.cc:325
T const * product() const
Definition: ESHandle.h:62
T const * product() const
Definition: Handle.h:74
iterator find(key_type k)
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:32
int zside() const
get the z-side of the crystal (1/-1)
Definition: EBDetId.h:40