CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EBClusterTask.cc
Go to the documentation of this file.
1 /*
2  * \file EBClusterTask.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 
30 
32 
34 
36 
37 #include "TLorentzVector.h"
38 
40 
41  init_ = false;
42 
44 
45  prefixME_ = ps.getUntrackedParameter<std::string>("prefixME", "");
46 
47  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
48 
49  mergeRuns_ = ps.getUntrackedParameter<bool>("mergeRuns", false);
50 
51  // parameters...
52  EcalRawDataCollection_ = consumes<EcalRawDataCollection>(ps.getParameter<edm::InputTag>("EcalRawDataCollection"));
53  BasicClusterCollection_ = consumes<edm::View<reco::CaloCluster> >(ps.getParameter<edm::InputTag>("BasicClusterCollection"));
54  SuperClusterCollection_ = consumes<reco::SuperClusterCollection>(ps.getParameter<edm::InputTag>("SuperClusterCollection"));
55  EcalRecHitCollection_ = consumes<EcalRecHitCollection>(ps.getParameter<edm::InputTag>("EcalRecHitCollection"));
56 
57  // histograms...
58  meBCEne_ = 0;
59  meBCNum_ = 0;
60  meBCSiz_ = 0;
61 
62  meBCEneMap_ = 0;
63  meBCNumMap_ = 0;
64  meBCETMap_ = 0;
65  meBCSizMap_ = 0;
66 
71 
76 
77  meSCEne_ = 0;
78  meSCNum_ = 0;
79  meSCSiz_ = 0;
80 
81  meSCCrystalSiz_ = 0;
82  meSCSeedEne_ = 0;
83  meSCEne2_ = 0;
84  meSCEneVsEMax_ = 0;
85  meSCEneLowScale_ = 0;
86  meSCSeedMapOcc_ = 0;
88 
89  mes1s9_ = 0;
90  mes1s9thr_ = 0;
91  mes9s25_ = 0;
92 
93  meInvMassPi0_ = 0;
94  meInvMassJPsi_ = 0;
95  meInvMassZ0_ = 0;
96  meInvMassHigh_ = 0;
97 
98  meInvMassPi0Sel_ = 0;
100  meInvMassZ0Sel_ = 0;
101  meInvMassHighSel_ = 0;
102 
103  thrS4S9_ = 0.85;
104  thrClusEt_ = 0.200;
105  thrCandEt_ = 0.650;
106 
107 }
108 
110 
111 }
112 
114 
115  ievt_ = 0;
116 
117  if ( dqmStore_ ) {
118  dqmStore_->setCurrentFolder(prefixME_ + "/EBClusterTask");
119  dqmStore_->rmdir(prefixME_ + "/EBClusterTask");
120  }
121 
122 }
123 
125 
126  Numbers::initGeometry(c, false);
127 
128  if ( ! mergeRuns_ ) this->reset();
129 
130 }
131 
133 
134 }
135 
137 
138  if ( meBCEne_ ) meBCEne_->Reset();
139 
140  if ( meBCNum_ ) meBCNum_->Reset();
141 
142  if ( meBCSiz_ ) meBCSiz_->Reset();
143 
144  if ( meBCEneMap_ ) meBCEneMap_->Reset();
145 
146  if ( meBCNumMap_ ) meBCNumMap_->Reset();
147 
148  if ( meBCETMap_ ) meBCETMap_->Reset();
149 
150  if ( meBCSizMap_ ) meBCSizMap_->Reset();
151 
153 
155 
157 
159 
161 
163 
165 
167 
168  if ( meSCEne_ ) meSCEne_->Reset();
169 
170  if ( meSCNum_ ) meSCNum_->Reset();
171 
172  if ( meSCSiz_ ) meSCSiz_->Reset();
173 
175 
176  if ( meSCSeedEne_ ) meSCSeedEne_->Reset();
177 
178  if ( meSCEne2_ ) meSCEne2_->Reset();
179 
181 
183 
185 
187 
188  if ( mes1s9_ ) mes1s9_->Reset();
189 
190  if ( mes1s9thr_ ) mes1s9thr_->Reset();
191 
192  if ( mes9s25_ ) mes9s25_->Reset();
193 
195 
197 
198  if ( meInvMassZ0_ ) meInvMassZ0_->Reset();
199 
201 
203 
205 
207 
209 
210 }
211 
213 
214  init_ = true;
215 
217 
218  if ( dqmStore_ ) {
219  dqmStore_->setCurrentFolder(prefixME_ + "/EBClusterTask");
220 
221  name = "EBCLT BC energy";
222  meBCEne_ = dqmStore_->book1D(name, name, 100, 0., 150.);
223  meBCEne_->setAxisTitle("energy (GeV)", 1);
224 
225  name = "EBCLT BC number";
226  meBCNum_ = dqmStore_->book1D(name, name, 100, 0., 100.);
227  meBCNum_->setAxisTitle("number of clusters", 1);
228 
229  name = "EBCLT BC size";
230  meBCSiz_ = dqmStore_->book1D(name, name, 100, 0., 100.);
231  meBCSiz_->setAxisTitle("cluster size", 1);
232 
233  name = "EBCLT BC energy map";
234  meBCEneMap_ = dqmStore_->bookProfile2D(name, name, 72, -M_PI*(9+1.5)/9, M_PI*(9-1.5)/9, 34, -1.479, 1.479, 100, 0., 500., "s");
235  meBCEneMap_->setAxisTitle("phi", 1);
236  meBCEneMap_->setAxisTitle("eta", 2);
237 
238  name = "EBCLT BC number map";
239  meBCNumMap_ = dqmStore_->book2D(name, name, 72, -M_PI*(9+1.5)/9, M_PI*(9-1.5)/9, 34, -1.479, 1.479);
240  meBCNumMap_->setAxisTitle("phi", 1);
241  meBCNumMap_->setAxisTitle("eta", 2);
242 
243  name = "EBCLT BC ET map";
244  meBCETMap_ = dqmStore_->bookProfile2D(name, name, 72, -M_PI*(9+1.5)/9, M_PI*(9-1.5)/9, 34, -1.479, 1.479, 100, 0., 500., "s");
245  meBCETMap_->setAxisTitle("phi", 1);
246  meBCETMap_->setAxisTitle("eta", 2);
247 
248  name = "EBCLT BC size map";
249  meBCSizMap_ = dqmStore_->bookProfile2D(name, name, 72, -M_PI*(9+1.5)/9, M_PI*(9-1.5)/9, 34, -1.479, 1.479, 100, 0., 100., "s");
250  meBCSizMap_->setAxisTitle("phi", 1);
251  meBCSizMap_->setAxisTitle("eta", 2);
252 
253  name = "EBCLT BC energy projection eta";
254  meBCEneMapProjEta_ = dqmStore_->bookProfile(name, name, 34, -1.479, 1.479, 100, 0., 500., "s");
255  meBCEneMapProjEta_->setAxisTitle("eta", 1);
256  meBCEneMapProjEta_->setAxisTitle("energy (GeV)", 2);
257 
258  name = "EBCLT BC energy projection phi";
259  meBCEneMapProjPhi_ = dqmStore_->bookProfile(name, name, 72, -M_PI*(9+1.5)/9, M_PI*(9-1.5)/9, 100, 0., 500., "s");
260  meBCEneMapProjPhi_->setAxisTitle("phi", 1);
261  meBCEneMapProjPhi_->setAxisTitle("energy (GeV)", 2);
262 
263  name = "EBCLT BC number projection eta";
264  meBCNumMapProjEta_ = dqmStore_->book1D(name, name, 34, -1.479, 1.479);
265  meBCNumMapProjEta_->setAxisTitle("eta", 1);
266  meBCNumMapProjEta_->setAxisTitle("number of clusters", 2);
267 
268  name = "EBCLT BC number projection phi";
269  meBCNumMapProjPhi_ = dqmStore_->book1D(name, name, 72, -M_PI*(9+1.5)/9, M_PI*(9-1.5)/9);
270  meBCNumMapProjPhi_->setAxisTitle("phi", 1);
271  meBCNumMapProjPhi_->setAxisTitle("number of clusters", 2);
272 
273  name = "EBCLT BC ET projection eta";
274  meBCETMapProjEta_ = dqmStore_->bookProfile(name, name, 34, -1.479, 1.479, 100, 0., 500., "s");
275  meBCETMapProjEta_->setAxisTitle("eta", 1);
276  meBCETMapProjEta_->setAxisTitle("transverse energy (GeV)", 2);
277 
278  name = "EBCLT BC ET projection phi";
279  meBCETMapProjPhi_ = dqmStore_->bookProfile(name, name, 72, -M_PI*(9+1.5)/9, M_PI*(9-1.5)/9, 100, 0., 500., "s");
280  meBCETMapProjPhi_->setAxisTitle("phi", 1);
281  meBCETMapProjPhi_->setAxisTitle("transverse energy (GeV)", 2);
282 
283  name = "EBCLT BC size projection eta";
284  meBCSizMapProjEta_ = dqmStore_->bookProfile(name, name, 34, -1.479, 1.479, 100, 0., 100., "s");
285  meBCSizMapProjEta_->setAxisTitle("eta", 1);
286  meBCSizMapProjEta_->setAxisTitle("cluster size", 2);
287 
288  name = "EBCLT BC size projection phi";
289  meBCSizMapProjPhi_ = dqmStore_->bookProfile(name, name, 72, -M_PI*(9+1.5)/9, M_PI*(9-1.5)/9, 100, 0., 100., "s");
290  meBCSizMapProjPhi_->setAxisTitle("phi", 1);
291  meBCSizMapProjPhi_->setAxisTitle("cluster size", 2);
292 
293  name = "EBCLT SC energy";
294  meSCEne_ = dqmStore_->book1D(name, name, 100, 0., 150.);
295  meSCEne_->setAxisTitle("energy (GeV)", 1);
296 
297  name = "EBCLT SC number";
298  meSCNum_ = dqmStore_->book1D(name, name, 50, 0., 50.);
299  meSCNum_->setAxisTitle("number of clusters", 1);
300 
301  name = "EBCLT SC size";
302  meSCSiz_ = dqmStore_->book1D(name, name, 50, 0., 50.);
303  meSCSiz_->setAxisTitle("cluster size", 1);
304 
305  name = "EBCLT SC size (crystal)";
306  meSCCrystalSiz_ = dqmStore_->book1D(name, name, 150, 0, 150);
307  meSCCrystalSiz_->setAxisTitle("cluster size in crystals", 1);
308 
309  name = "EBCLT SC seed crystal energy";
310  meSCSeedEne_ = dqmStore_->book1D(name, name, 100, 0., 10.);
311  meSCSeedEne_->setAxisTitle("seed crystal energy (GeV)", 1);
312 
313  name = "EBCLT SC e2";
314  meSCEne2_ = dqmStore_->book1D(name, name, 100, 0., 10.);
315  meSCEne2_->setAxisTitle("seed + highest neighbor crystal energy (GeV)", 1);
316 
317  name = "EBCLT SC energy vs seed crystal energy";
318  meSCEneVsEMax_ = dqmStore_->book2D(name, name, 50, 0., 10., 50, 0., 10.);
319  meSCEneVsEMax_->setAxisTitle("seed crystal energy (GeV)", 1);
320  meSCEneVsEMax_->setAxisTitle("cluster energy (GeV)", 2);
321 
322  name = "EBCLT SC energy (low scale)";
323  meSCEneLowScale_ = dqmStore_->book1D(name, name, 200, 0., 10.);
324  meSCEneLowScale_->setAxisTitle("cluster energy (GeV)", 1);
325 
326  name = "EBCLT SC seed occupancy map";
327  meSCSeedMapOcc_ = dqmStore_->book2D(name, name, 72, 0., 360., 34, -85, 85);
328  meSCSeedMapOcc_->setAxisTitle("jphi", 1);
329  meSCSeedMapOcc_->setAxisTitle("jeta", 2);
330 
331  name = "EBCLT SC single crystal cluster seed occupancy map";
332  meSCMapSingleCrystal_ = dqmStore_->book2D(name, name, 72, 0., 360., 34, -85, 85);
335 
336  name = "EBCLT s1s9";
337  mes1s9_ = dqmStore_->book1D(name, name, 50, 0., 1.5);
338  mes1s9_->setAxisTitle("s1/s9", 1);
339 
340  name = "EBCLT s1s9 thr";
341  mes1s9thr_ = dqmStore_->book1D(name, name, 50, 0., 1.5);
342  mes1s9thr_->setAxisTitle("s1/s9", 1);
343 
344  name = "EBCLT s9s25";
345  mes9s25_ = dqmStore_->book1D(name, name, 75, 0., 1.5);
346  mes9s25_->setAxisTitle("s9/s25", 1);
347 
348  name = "EBCLT dicluster invariant mass Pi0";
349  meInvMassPi0_ = dqmStore_->book1D(name, name, 50, 0.0, 0.500);
350  meInvMassPi0_->setAxisTitle("mass (GeV)", 1);
351 
352  name = "EBCLT dicluster invariant mass JPsi";
353  meInvMassJPsi_ = dqmStore_->book1D(name, name, 50, 2.9, 3.3);
354  meInvMassJPsi_->setAxisTitle("mass (GeV)", 1);
355 
356  name = "EBCLT dicluster invariant mass Z0";
357  meInvMassZ0_ = dqmStore_->book1D(name, name, 50, 40, 110);
358  meInvMassZ0_->setAxisTitle("mass (GeV)", 1);
359 
360  name = "EBCLT dicluster invariant mass high";
361  meInvMassHigh_ = dqmStore_->book1D(name, name, 500, 110, 3000);
362  meInvMassHigh_->setAxisTitle("mass (GeV)", 1);
363 
364  name = "EBCLT dicluster invariant mass Pi0 sel";
365  meInvMassPi0Sel_ = dqmStore_->book1D(name, name, 50, 0.00, 0.500);
366  meInvMassPi0Sel_->setAxisTitle("mass (GeV)", 1);
367 
368  name = "EBCLT dicluster invariant mass JPsi sel";
369  meInvMassJPsiSel_ = dqmStore_->book1D(name, name, 50, 2.9, 3.3);
370  meInvMassJPsiSel_->setAxisTitle("mass (GeV)", 1);
371 
372  name = "EBCLT dicluster invariant mass Z0 sel";
373  meInvMassZ0Sel_ = dqmStore_->book1D(name, name, 50, 40, 110);
374  meInvMassZ0Sel_->setAxisTitle("mass (GeV)", 1);
375 
376  name = "EBCLT dicluster invariant mass high sel";
377  meInvMassHighSel_ = dqmStore_->book1D(name, name, 500, 110, 3000);
378  meInvMassHighSel_->setAxisTitle("mass (GeV)", 1);
379 
380  }
381 
382 }
383 
385 
386  if ( ! init_ ) return;
387 
388  if ( dqmStore_ ) {
389  dqmStore_->setCurrentFolder(prefixME_ + "/EBClusterTask");
390 
392  meBCEne_ = 0;
393 
395  meBCNum_ = 0;
396 
398  meBCSiz_ = 0;
399 
401  meBCEneMap_ = 0;
402 
404  meBCNumMap_ = 0;
405 
407  meBCETMap_ = 0;
408 
410  meBCSizMap_ = 0;
411 
413  meBCEneMapProjEta_ = 0;
414 
416  meBCEneMapProjPhi_ = 0;
417 
419  meBCNumMapProjEta_ = 0;
420 
422  meBCNumMapProjPhi_ = 0;
423 
425  meBCETMapProjEta_ = 0;
426 
428  meBCETMapProjPhi_ = 0;
429 
431  meBCSizMapProjEta_ = 0;
432 
434  meBCSizMapProjPhi_ = 0;
435 
437  meSCEne_ = 0;
438 
440  meSCNum_ = 0;
441 
443  meSCSiz_ = 0;
444 
446  meSCCrystalSiz_ = 0;
447 
449  meSCSeedEne_ = 0;
450 
452  meSCEne2_ = 0;
453 
455  meSCEneVsEMax_ = 0;
456 
458  meSCEneLowScale_ = 0;
459 
461  meSCSeedMapOcc_ = 0;
462 
465 
467  mes1s9_ = 0;
468 
470  mes1s9thr_ = 0;
471 
473  mes9s25_ = 0;
474 
476  meInvMassPi0_ = 0;
477 
479  meInvMassJPsi_ = 0;
480 
482  meInvMassZ0_ = 0;
483 
485  meInvMassHigh_ = 0;
486 
488  meInvMassPi0Sel_ = 0;
489 
491  meInvMassJPsiSel_ = 0;
492 
494  meInvMassZ0Sel_ = 0;
495 
497  meInvMassHighSel_ = 0;
498 
499  }
500 
501  init_ = false;
502 
503 }
504 
506 
507  edm::LogInfo("EBClusterTask") << "analyzed " << ievt_ << " events";
508 
509  if ( enableCleanup_ ) this->cleanup();
510 
511 }
512 
514 
515  bool enable = false;
516 
518 
519  if ( e.getByToken(EcalRawDataCollection_, dcchs) ) {
520 
521  for ( EcalRawDataCollection::const_iterator dcchItr = dcchs->begin(); dcchItr != dcchs->end(); ++dcchItr ) {
522 
523  if ( Numbers::subDet( *dcchItr ) != EcalBarrel ) continue;
524 
525  if ( dcchItr->getRunType() == EcalDCCHeaderBlock::BEAMH4 ||
526  dcchItr->getRunType() == EcalDCCHeaderBlock::BEAMH2 ) enable = true;
527 
528  if ( dcchItr->getRunType() == EcalDCCHeaderBlock::COSMIC ||
529  dcchItr->getRunType() == EcalDCCHeaderBlock::MTCC ||
530  dcchItr->getRunType() == EcalDCCHeaderBlock::COSMICS_GLOBAL ||
531  dcchItr->getRunType() == EcalDCCHeaderBlock::PHYSICS_GLOBAL ||
532  dcchItr->getRunType() == EcalDCCHeaderBlock::COSMICS_LOCAL ||
533  dcchItr->getRunType() == EcalDCCHeaderBlock::PHYSICS_LOCAL ) enable = true;
534 
535  break;
536 
537  }
538 
539  } else {
540 
541  enable = true;
542  edm::LogWarning("EBClusterTask") << "EcalRawDataCollection not available";
543 
544  }
545 
546  if ( ! enable ) return;
547 
548  if ( ! init_ ) this->setup();
549 
550  ievt_++;
551 
552  // ECAL topology
553  edm::ESHandle<CaloTopology> pTopology;
554  c.get<CaloTopologyRecord>().get(pTopology);
555  if ( !pTopology.isValid() ) {
556  edm::LogWarning("EBClusterTask") << "Topology not valid";
557  return;
558  }
559  const CaloTopology* topology = pTopology.product();
560 
561  // recHits
563  e.getByToken( EcalRecHitCollection_, pEBRecHits );
564  if ( !pEBRecHits.isValid() ) {
565  edm::LogWarning("EBClusterTask") << "RecHit collection not available.";
566  return;
567  }
568  const EcalRecHitCollection* ebRecHits = pEBRecHits.product();
569 
570  std::vector<reco::CaloCluster const*> bcSel;
571 
572  // --- Barrel Basic Clusters ---
574  if ( e.getByToken(BasicClusterCollection_, pBasicClusters) ) {
575 
576  int nbcc = pBasicClusters->size();
577  if ( nbcc > 0 ) meBCNum_->Fill(float(nbcc));
578 
579  for ( edm::View<reco::CaloCluster>::const_iterator bCluster = pBasicClusters->begin(); bCluster != pBasicClusters->end(); ++bCluster ) {
580 
581  meBCEne_->Fill(bCluster->energy());
582  meBCSiz_->Fill(float(bCluster->size()));
583 
584  float xphi = bCluster->phi();
585  if ( xphi > M_PI*(9-1.5)/9 ) xphi = xphi - M_PI*2;
586 
587  meBCEneMap_->Fill(xphi, bCluster->eta(), bCluster->energy());
588  meBCEneMapProjEta_->Fill(bCluster->eta(), bCluster->energy());
589  meBCEneMapProjPhi_->Fill(xphi, bCluster->energy());
590 
591  meBCNumMap_->Fill(xphi, bCluster->eta());
592  meBCNumMapProjEta_->Fill(bCluster->eta());
593  meBCNumMapProjPhi_->Fill(xphi);
594 
595  meBCSizMap_->Fill(xphi, bCluster->eta(), float(bCluster->size()));
596  meBCSizMapProjEta_->Fill(bCluster->eta(), float(bCluster->size()));
597  meBCSizMapProjPhi_->Fill(xphi, float(bCluster->size()));
598 
599  meBCETMap_->Fill(xphi, bCluster->eta(), float(bCluster->energy()) * sin(bCluster->position().theta()));
600  meBCETMapProjEta_->Fill(bCluster->eta(), float(bCluster->energy()) * sin(bCluster->position().theta()));
601  meBCETMapProjPhi_->Fill(xphi, float(bCluster->energy()) * sin(bCluster->position().theta()));
602 
603  float e2x2 = EcalClusterTools::e2x2( *bCluster, ebRecHits, topology );
604  float e3x3 = EcalClusterTools::e3x3( *bCluster, ebRecHits, topology );
605 
606  // fill the selected cluster collection
607  float pt = std::abs( bCluster->energy()*sin(bCluster->position().theta()) );
608  if ( pt > thrClusEt_ && e2x2/e3x3 > thrS4S9_ ) bcSel.push_back(&*bCluster);
609  }
610 
611  } else {
612  // edm::LogWarning("EBClusterTask") << "BasicClusterCollection not available";
613  }
614 
615  for ( std::vector<reco::CaloCluster const*>::const_iterator bc1 = bcSel.begin(); bc1 != bcSel.end(); ++bc1 ) {
616  TLorentzVector bc1P;
617  bc1P.SetPtEtaPhiE(std::abs((*bc1)->energy()*sin((*bc1)->position().theta())),
618  (*bc1)->eta(), (*bc1)->phi(), (*bc1)->energy());
619  for ( std::vector<reco::CaloCluster const*>::const_iterator bc2 = bc1+1; bc2 != bcSel.end(); ++bc2 ) {
620  TLorentzVector bc2P;
621  bc2P.SetPtEtaPhiE(std::abs((*bc2)->energy()*sin((*bc2)->position().theta())),
622  (*bc2)->eta(), (*bc2)->phi(), (*bc2)->energy());
623 
624  TLorentzVector candP = bc1P + bc2P;
625 
626  if ( candP.Pt() > thrCandEt_ ) {
627  float mass = candP.M();
628  if ( mass < 0.500 ) {
629  meInvMassPi0Sel_->Fill( mass );
630  } else if ( mass > 2.9 && mass < 3.3 ) {
631  meInvMassJPsiSel_->Fill( mass );
632  } else if ( mass > 40 && mass < 110 ) {
633  meInvMassZ0Sel_->Fill( mass );
634  } else if ( mass > 110 ) {
635  meInvMassHighSel_->Fill( mass );
636  }
637 
638  }
639 
640  }
641  }
642 
643  // --- Barrel Super Clusters ---
645  if ( e.getByToken(SuperClusterCollection_, pSuperClusters) ) {
646 
647  int nscc = pSuperClusters->size();
648  if ( nscc > 0 ) meSCNum_->Fill(float(nscc));
649 
650  TLorentzVector sc1_p(0,0,0,0);
651  TLorentzVector sc2_p(0,0,0,0);
652 
653  for ( reco::SuperClusterCollection::const_iterator sCluster = pSuperClusters->begin(); sCluster != pSuperClusters->end(); ++sCluster ) {
654 
655  // energy, size
656  meSCEne_->Fill( sCluster->energy() );
657  meSCSiz_->Fill( float(sCluster->clustersSize()) );
658 
659  reco::CaloClusterPtr theSeed = sCluster->seed();
660 
661  // Find the seed rec hit
662  std::vector< std::pair<DetId,float> > sIds = sCluster->hitsAndFractions();
663 
664  float eMax, e2nd;
665  EcalRecHitCollection::const_iterator seedItr = ebRecHits->begin();
666  EcalRecHitCollection::const_iterator secondItr = ebRecHits->begin();
667 
668  for(std::vector< std::pair<DetId,float> >::const_iterator idItr = sIds.begin(); idItr != sIds.end(); ++idItr) {
669  DetId id = idItr->first;
670  if(id.det() != DetId::Ecal) { continue; }
671  EcalRecHitCollection::const_iterator hitItr = ebRecHits->find(id);
672  if(hitItr == ebRecHits->end()) { continue; }
673  if(hitItr->energy() > secondItr->energy()) { secondItr = hitItr; }
674  if(hitItr->energy() > seedItr->energy()) { std::swap(seedItr,secondItr); }
675  }
676 
677  eMax = seedItr->energy();
678  e2nd = secondItr->energy();
679  EBDetId seedId = (EBDetId) seedItr->id();
680 
681  float e3x3 = EcalClusterTools::e3x3( *theSeed, ebRecHits, topology );
682  float e5x5 = EcalClusterTools::e5x5( *theSeed, ebRecHits, topology );
683 
684  meSCCrystalSiz_->Fill(sIds.size());
685  meSCSeedEne_->Fill(eMax);
686  meSCEne2_->Fill(eMax+e2nd);
687  meSCEneVsEMax_->Fill(eMax,sCluster->energy());
688  meSCEneLowScale_->Fill(sCluster->energy());
689 
690  // Prepare to fill maps
691  int ebeta = seedId.ieta();
692  int ebphi = seedId.iphi();
693  float xebeta = ebeta - 0.5 * seedId.zside();
694  float xebphi = ebphi - 0.5;
695 
696  meSCSeedMapOcc_->Fill(xebphi,xebeta);
697 
698  if(sIds.size() == 1) meSCMapSingleCrystal_->Fill(xebphi,xebeta);
699 
700  mes1s9_->Fill( eMax/e3x3 );
701  if ( eMax > 3.0 ) mes1s9thr_->Fill( eMax/e3x3 );
702  mes9s25_->Fill( e3x3/e5x5 );
703 
704  if ( nscc >= 2 ) {
705  // look for the two most energetic super clusters
706  if ( sCluster->energy() > sc1_p.Energy() ) {
707  sc2_p=sc1_p;
708  sc1_p.SetPtEtaPhiE(std::abs(sCluster->energy()*sin(sCluster->position().theta())),
709  sCluster->eta(), sCluster->phi(), sCluster->energy());
710  } else if ( sCluster->energy() > sc2_p.Energy() ) {
711  sc2_p.SetPtEtaPhiE(std::abs(sCluster->energy()*sin(sCluster->position().theta())),
712  sCluster->eta(), sCluster->phi(), sCluster->energy());
713  }
714  }
715 
716  }
717  // Get the invariant mass of the two most energetic super clusters
718  if ( nscc >= 2 ) {
719  TLorentzVector sum = sc1_p+sc2_p;
720  float mass = sum.M();
721  if ( mass < 0.500 ) {
722  meInvMassPi0_->Fill( mass );
723  } else if ( mass > 2.9 && mass < 3.3 ) {
724  meInvMassJPsi_->Fill( mass );
725  } else if ( mass > 40 && mass < 110 ) {
726  meInvMassZ0_->Fill( mass );
727  } else if ( mass > 110 ) {
728  meInvMassHigh_->Fill( mass );
729  }
730  }
731 
732  } else {
733 
734  // edm::LogWarning("EBClusterTask") << "SuperClusterCollection not available";
735 
736  }
737 
738 }
T getParameter(std::string const &) const
MonitorElement * meBCSizMap_
Definition: EBClusterTask.h:85
T getUntrackedParameter(std::string const &, T const &) const
const std::string & getName(void) const
get name of ME
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
MonitorElement * meBCEneMapProjPhi_
Definition: EBClusterTask.h:82
MonitorElement * meBCNumMapProjPhi_
Definition: EBClusterTask.h:83
MonitorElement * meSCSiz_
Definition: EBClusterTask.h:89
MonitorElement * meSCSeedEne_
Definition: EBClusterTask.h:92
void setup(void)
Setup.
void beginRun(const edm::Run &r, const edm::EventSetup &c)
BeginRun.
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:873
void rmdir(const std::string &fullpath)
Definition: DQMStore.cc:2731
edm::EDGetTokenT< reco::SuperClusterCollection > SuperClusterCollection_
Definition: EBClusterTask.h:75
MonitorElement * meBCSiz_
Definition: EBClusterTask.h:80
MonitorElement * meBCSizMapProjEta_
Definition: EBClusterTask.h:85
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
MonitorElement * meInvMassPi0Sel_
Some &quot;id&quot; conversions.
MonitorElement * mes9s25_
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
std::vector< EcalDCCHeaderBlock >::const_iterator const_iterator
MonitorElement * mes1s9thr_
MonitorElement * meSCEne_
Definition: EBClusterTask.h:87
MonitorElement * meBCEneMap_
Definition: EBClusterTask.h:82
MonitorElement * meSCCrystalSiz_
Definition: EBClusterTask.h:91
MonitorElement * meBCEneMapProjEta_
Definition: EBClusterTask.h:82
edm::EDGetTokenT< EcalRawDataCollection > EcalRawDataCollection_
Definition: EBClusterTask.h:73
MonitorElement * meInvMassJPsiSel_
void Fill(long long x)
MonitorElement * meInvMassZ0_
int iphi() const
get the crystal iphi
Definition: EBDetId.h:53
MonitorElement * meSCNum_
Definition: EBClusterTask.h:88
MonitorElement * meInvMassPi0_
MonitorElement * meBCSizMapProjPhi_
Definition: EBClusterTask.h:85
EBClusterTask(const edm::ParameterSet &ps)
Constructor.
MonitorElement * meBCEne_
Definition: EBClusterTask.h:78
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
MonitorElement * meSCSeedMapOcc_
Definition: EBClusterTask.h:96
void removeElement(const std::string &name)
Definition: DQMStore.cc:2773
static float e3x3(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
MonitorElement * meBCETMap_
Definition: EBClusterTask.h:84
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
Definition: DQMStore.cc:1187
DQMStore * dqmStore_
Definition: EBClusterTask.h:65
int ieta() const
get the crystal ieta
Definition: EBDetId.h:51
bool isValid() const
Definition: HandleBase.h:76
MonitorElement * meSCEneVsEMax_
Definition: EBClusterTask.h:94
void reset(void)
Reset.
edm::EDGetTokenT< edm::View< reco::CaloCluster > > BasicClusterCollection_
Definition: EBClusterTask.h:74
MonitorElement * meSCEneLowScale_
Definition: EBClusterTask.h:95
MonitorElement * meSCMapSingleCrystal_
Definition: EBClusterTask.h:97
MonitorElement * mes1s9_
Definition: EBClusterTask.h:99
const_iterator end() const
MonitorElement * meInvMassHigh_
Definition: DetId.h:18
MonitorElement * meInvMassHighSel_
MonitorElement * meBCNumMap_
Definition: EBClusterTask.h:83
void endRun(const edm::Run &r, const edm::EventSetup &c)
EndRun.
#define M_PI
Definition: BFit3D.cc:3
static void initGeometry(const edm::EventSetup &setup, bool verbose=false)
Definition: Numbers.cc:47
void beginJob(void)
BeginJob.
MonitorElement * meBCNumMapProjEta_
Definition: EBClusterTask.h:83
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
edm::EDGetTokenT< EcalRecHitCollection > EcalRecHitCollection_
Definition: EBClusterTask.h:76
T const * product() const
Definition: Handle.h:81
MonitorElement * meSCEne2_
Definition: EBClusterTask.h:93
MonitorElement * meBCNum_
Definition: EBClusterTask.h:79
iterator find(key_type k)
static float e5x5(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
MonitorElement * meBCETMapProjEta_
Definition: EBClusterTask.h:84
std::string prefixME_
Definition: EBClusterTask.h:67
static EcalSubdetector subDet(const EBDetId &id)
Definition: Numbers.cc:142
void endJob(void)
EndJob.
MonitorElement * meInvMassJPsi_
bool isValid() const
Definition: ESHandle.h:37
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1001
void cleanup(void)
Cleanup.
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void Reset(void)
reset ME (ie. contents, errors, etc)
MonitorElement * meInvMassZ0Sel_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:585
const_iterator begin() const
Definition: Run.h:41
MonitorElement * meBCETMapProjPhi_
Definition: EBClusterTask.h:84
int zside() const
get the z-side of the crystal (1/-1)
Definition: EBDetId.h:47
virtual ~EBClusterTask()
Destructor.
MonitorElement * bookProfile2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, const char *option="s")
Definition: DQMStore.cc:1331
static float e2x2(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)