CMS 3D CMS Logo

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