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