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  * $Date: 2012/04/27 13:46:01 $
5  * $Revision: 1.95 $
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 
35 
37 
39 
41 
42 #include "TLorentzVector.h"
43 
45 
46  init_ = false;
47 
49 
50  prefixME_ = ps.getUntrackedParameter<std::string>("prefixME", "");
51 
52  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
53 
54  mergeRuns_ = ps.getUntrackedParameter<bool>("mergeRuns", false);
55 
56  // parameters...
57  EcalRawDataCollection_ = ps.getParameter<edm::InputTag>("EcalRawDataCollection");
58  BasicClusterCollection_ = ps.getParameter<edm::InputTag>("BasicClusterCollection");
59  SuperClusterCollection_ = ps.getParameter<edm::InputTag>("SuperClusterCollection");
60  EcalRecHitCollection_ = ps.getParameter<edm::InputTag>("EcalRecHitCollection");
61 
62  // histograms...
63  meBCEne_ = 0;
64  meBCNum_ = 0;
65  meBCSiz_ = 0;
66 
67  meBCEneMap_ = 0;
68  meBCNumMap_ = 0;
69  meBCETMap_ = 0;
70  meBCSizMap_ = 0;
71 
76 
81 
82  meSCEne_ = 0;
83  meSCNum_ = 0;
84  meSCSiz_ = 0;
85 
86  meSCCrystalSiz_ = 0;
87  meSCSeedEne_ = 0;
88  meSCEne2_ = 0;
89  meSCEneVsEMax_ = 0;
90  meSCEneLowScale_ = 0;
91  meSCSeedMapOcc_ = 0;
93 
94  mes1s9_ = 0;
95  mes1s9thr_ = 0;
96  mes9s25_ = 0;
97 
98  meInvMassPi0_ = 0;
99  meInvMassJPsi_ = 0;
100  meInvMassZ0_ = 0;
101  meInvMassHigh_ = 0;
102 
103  meInvMassPi0Sel_ = 0;
104  meInvMassJPsiSel_ = 0;
105  meInvMassZ0Sel_ = 0;
106  meInvMassHighSel_ = 0;
107 
108  thrS4S9_ = 0.85;
109  thrClusEt_ = 0.200;
110  thrCandEt_ = 0.650;
111 
112 }
113 
115 
116 }
117 
119 
120  ievt_ = 0;
121 
122  if ( dqmStore_ ) {
123  dqmStore_->setCurrentFolder(prefixME_ + "/EBClusterTask");
124  dqmStore_->rmdir(prefixME_ + "/EBClusterTask");
125  }
126 
127 }
128 
130 
131  Numbers::initGeometry(c, false);
132 
133  if ( ! mergeRuns_ ) this->reset();
134 
135 }
136 
138 
139 }
140 
142 
143  if ( meBCEne_ ) meBCEne_->Reset();
144 
145  if ( meBCNum_ ) meBCNum_->Reset();
146 
147  if ( meBCSiz_ ) meBCSiz_->Reset();
148 
149  if ( meBCEneMap_ ) meBCEneMap_->Reset();
150 
151  if ( meBCNumMap_ ) meBCNumMap_->Reset();
152 
153  if ( meBCETMap_ ) meBCETMap_->Reset();
154 
155  if ( meBCSizMap_ ) meBCSizMap_->Reset();
156 
158 
160 
162 
164 
166 
168 
170 
172 
173  if ( meSCEne_ ) meSCEne_->Reset();
174 
175  if ( meSCNum_ ) meSCNum_->Reset();
176 
177  if ( meSCSiz_ ) meSCSiz_->Reset();
178 
180 
181  if ( meSCSeedEne_ ) meSCSeedEne_->Reset();
182 
183  if ( meSCEne2_ ) meSCEne2_->Reset();
184 
186 
188 
190 
192 
193  if ( mes1s9_ ) mes1s9_->Reset();
194 
195  if ( mes1s9thr_ ) mes1s9thr_->Reset();
196 
197  if ( mes9s25_ ) mes9s25_->Reset();
198 
200 
202 
203  if ( meInvMassZ0_ ) meInvMassZ0_->Reset();
204 
206 
208 
210 
212 
214 
215 }
216 
218 
219  init_ = true;
220 
221  std::string name;
222 
223  if ( dqmStore_ ) {
224  dqmStore_->setCurrentFolder(prefixME_ + "/EBClusterTask");
225 
226  name = "EBCLT BC energy";
227  meBCEne_ = dqmStore_->book1D(name, name, 100, 0., 150.);
228  meBCEne_->setAxisTitle("energy (GeV)", 1);
229 
230  name = "EBCLT BC number";
231  meBCNum_ = dqmStore_->book1D(name, name, 100, 0., 100.);
232  meBCNum_->setAxisTitle("number of clusters", 1);
233 
234  name = "EBCLT BC size";
235  meBCSiz_ = dqmStore_->book1D(name, name, 100, 0., 100.);
236  meBCSiz_->setAxisTitle("cluster size", 1);
237 
238  name = "EBCLT BC energy map";
239  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");
240  meBCEneMap_->setAxisTitle("phi", 1);
241  meBCEneMap_->setAxisTitle("eta", 2);
242 
243  name = "EBCLT BC number map";
244  meBCNumMap_ = dqmStore_->book2D(name, name, 72, -M_PI*(9+1.5)/9, M_PI*(9-1.5)/9, 34, -1.479, 1.479);
245  meBCNumMap_->setAxisTitle("phi", 1);
246  meBCNumMap_->setAxisTitle("eta", 2);
247 
248  name = "EBCLT BC ET map";
249  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");
250  meBCETMap_->setAxisTitle("phi", 1);
251  meBCETMap_->setAxisTitle("eta", 2);
252 
253  name = "EBCLT BC size map";
254  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");
255  meBCSizMap_->setAxisTitle("phi", 1);
256  meBCSizMap_->setAxisTitle("eta", 2);
257 
258  name = "EBCLT BC energy projection eta";
259  meBCEneMapProjEta_ = dqmStore_->bookProfile(name, name, 34, -1.479, 1.479, 100, 0., 500., "s");
260  meBCEneMapProjEta_->setAxisTitle("eta", 1);
261  meBCEneMapProjEta_->setAxisTitle("energy (GeV)", 2);
262 
263  name = "EBCLT BC energy projection phi";
264  meBCEneMapProjPhi_ = dqmStore_->bookProfile(name, name, 72, -M_PI*(9+1.5)/9, M_PI*(9-1.5)/9, 100, 0., 500., "s");
265  meBCEneMapProjPhi_->setAxisTitle("phi", 1);
266  meBCEneMapProjPhi_->setAxisTitle("energy (GeV)", 2);
267 
268  name = "EBCLT BC number projection eta";
269  meBCNumMapProjEta_ = dqmStore_->book1D(name, name, 34, -1.479, 1.479);
270  meBCNumMapProjEta_->setAxisTitle("eta", 1);
271  meBCNumMapProjEta_->setAxisTitle("number of clusters", 2);
272 
273  name = "EBCLT BC number projection phi";
274  meBCNumMapProjPhi_ = dqmStore_->book1D(name, name, 72, -M_PI*(9+1.5)/9, M_PI*(9-1.5)/9);
275  meBCNumMapProjPhi_->setAxisTitle("phi", 1);
276  meBCNumMapProjPhi_->setAxisTitle("number of clusters", 2);
277 
278  name = "EBCLT BC ET projection eta";
279  meBCETMapProjEta_ = dqmStore_->bookProfile(name, name, 34, -1.479, 1.479, 100, 0., 500., "s");
280  meBCETMapProjEta_->setAxisTitle("eta", 1);
281  meBCETMapProjEta_->setAxisTitle("transverse energy (GeV)", 2);
282 
283  name = "EBCLT BC ET projection phi";
284  meBCETMapProjPhi_ = dqmStore_->bookProfile(name, name, 72, -M_PI*(9+1.5)/9, M_PI*(9-1.5)/9, 100, 0., 500., "s");
285  meBCETMapProjPhi_->setAxisTitle("phi", 1);
286  meBCETMapProjPhi_->setAxisTitle("transverse energy (GeV)", 2);
287 
288  name = "EBCLT BC size projection eta";
289  meBCSizMapProjEta_ = dqmStore_->bookProfile(name, name, 34, -1.479, 1.479, 100, 0., 100., "s");
290  meBCSizMapProjEta_->setAxisTitle("eta", 1);
291  meBCSizMapProjEta_->setAxisTitle("cluster size", 2);
292 
293  name = "EBCLT BC size projection phi";
294  meBCSizMapProjPhi_ = dqmStore_->bookProfile(name, name, 72, -M_PI*(9+1.5)/9, M_PI*(9-1.5)/9, 100, 0., 100., "s");
295  meBCSizMapProjPhi_->setAxisTitle("phi", 1);
296  meBCSizMapProjPhi_->setAxisTitle("cluster size", 2);
297 
298  name = "EBCLT SC energy";
299  meSCEne_ = dqmStore_->book1D(name, name, 100, 0., 150.);
300  meSCEne_->setAxisTitle("energy (GeV)", 1);
301 
302  name = "EBCLT SC number";
303  meSCNum_ = dqmStore_->book1D(name, name, 50, 0., 50.);
304  meSCNum_->setAxisTitle("number of clusters", 1);
305 
306  name = "EBCLT SC size";
307  meSCSiz_ = dqmStore_->book1D(name, name, 50, 0., 50.);
308  meSCSiz_->setAxisTitle("cluster size", 1);
309 
310  name = "EBCLT SC size (crystal)";
311  meSCCrystalSiz_ = dqmStore_->book1D(name, name, 150, 0, 150);
312  meSCCrystalSiz_->setAxisTitle("cluster size in crystals", 1);
313 
314  name = "EBCLT SC seed crystal energy";
315  meSCSeedEne_ = dqmStore_->book1D(name, name, 100, 0., 10.);
316  meSCSeedEne_->setAxisTitle("seed crystal energy (GeV)", 1);
317 
318  name = "EBCLT SC e2";
319  meSCEne2_ = dqmStore_->book1D(name, name, 100, 0., 10.);
320  meSCEne2_->setAxisTitle("seed + highest neighbor crystal energy (GeV)", 1);
321 
322  name = "EBCLT SC energy vs seed crystal energy";
323  meSCEneVsEMax_ = dqmStore_->book2D(name, name, 50, 0., 10., 50, 0., 10.);
324  meSCEneVsEMax_->setAxisTitle("seed crystal energy (GeV)", 1);
325  meSCEneVsEMax_->setAxisTitle("cluster energy (GeV)", 2);
326 
327  name = "EBCLT SC energy (low scale)";
328  meSCEneLowScale_ = dqmStore_->book1D(name, name, 200, 0., 10.);
329  meSCEneLowScale_->setAxisTitle("cluster energy (GeV)", 1);
330 
331  name = "EBCLT SC seed occupancy map";
332  meSCSeedMapOcc_ = dqmStore_->book2D(name, name, 72, 0., 360., 34, -85, 85);
333  meSCSeedMapOcc_->setAxisTitle("jphi", 1);
334  meSCSeedMapOcc_->setAxisTitle("jeta", 2);
335 
336  name = "EBCLT SC single crystal cluster seed occupancy map";
337  meSCMapSingleCrystal_ = dqmStore_->book2D(name, name, 72, 0., 360., 34, -85, 85);
340 
341  name = "EBCLT s1s9";
342  mes1s9_ = dqmStore_->book1D(name, name, 50, 0., 1.5);
343  mes1s9_->setAxisTitle("s1/s9", 1);
344 
345  name = "EBCLT s1s9 thr";
346  mes1s9thr_ = dqmStore_->book1D(name, name, 50, 0., 1.5);
347  mes1s9thr_->setAxisTitle("s1/s9", 1);
348 
349  name = "EBCLT s9s25";
350  mes9s25_ = dqmStore_->book1D(name, name, 75, 0., 1.5);
351  mes9s25_->setAxisTitle("s9/s25", 1);
352 
353  name = "EBCLT dicluster invariant mass Pi0";
354  meInvMassPi0_ = dqmStore_->book1D(name, name, 50, 0.0, 0.500);
355  meInvMassPi0_->setAxisTitle("mass (GeV)", 1);
356 
357  name = "EBCLT dicluster invariant mass JPsi";
358  meInvMassJPsi_ = dqmStore_->book1D(name, name, 50, 2.9, 3.3);
359  meInvMassJPsi_->setAxisTitle("mass (GeV)", 1);
360 
361  name = "EBCLT dicluster invariant mass Z0";
362  meInvMassZ0_ = dqmStore_->book1D(name, name, 50, 40, 110);
363  meInvMassZ0_->setAxisTitle("mass (GeV)", 1);
364 
365  name = "EBCLT dicluster invariant mass high";
366  meInvMassHigh_ = dqmStore_->book1D(name, name, 500, 110, 3000);
367  meInvMassHigh_->setAxisTitle("mass (GeV)", 1);
368 
369  name = "EBCLT dicluster invariant mass Pi0 sel";
370  meInvMassPi0Sel_ = dqmStore_->book1D(name, name, 50, 0.00, 0.500);
371  meInvMassPi0Sel_->setAxisTitle("mass (GeV)", 1);
372 
373  name = "EBCLT dicluster invariant mass JPsi sel";
374  meInvMassJPsiSel_ = dqmStore_->book1D(name, name, 50, 2.9, 3.3);
375  meInvMassJPsiSel_->setAxisTitle("mass (GeV)", 1);
376 
377  name = "EBCLT dicluster invariant mass Z0 sel";
378  meInvMassZ0Sel_ = dqmStore_->book1D(name, name, 50, 40, 110);
379  meInvMassZ0Sel_->setAxisTitle("mass (GeV)", 1);
380 
381  name = "EBCLT dicluster invariant mass high sel";
382  meInvMassHighSel_ = dqmStore_->book1D(name, name, 500, 110, 3000);
383  meInvMassHighSel_->setAxisTitle("mass (GeV)", 1);
384 
385  }
386 
387 }
388 
390 
391  if ( ! init_ ) return;
392 
393  if ( dqmStore_ ) {
394  dqmStore_->setCurrentFolder(prefixME_ + "/EBClusterTask");
395 
397  meBCEne_ = 0;
398 
400  meBCNum_ = 0;
401 
403  meBCSiz_ = 0;
404 
406  meBCEneMap_ = 0;
407 
409  meBCNumMap_ = 0;
410 
412  meBCETMap_ = 0;
413 
415  meBCSizMap_ = 0;
416 
418  meBCEneMapProjEta_ = 0;
419 
421  meBCEneMapProjPhi_ = 0;
422 
424  meBCNumMapProjEta_ = 0;
425 
427  meBCNumMapProjPhi_ = 0;
428 
430  meBCETMapProjEta_ = 0;
431 
433  meBCETMapProjPhi_ = 0;
434 
436  meBCSizMapProjEta_ = 0;
437 
439  meBCSizMapProjPhi_ = 0;
440 
442  meSCEne_ = 0;
443 
445  meSCNum_ = 0;
446 
448  meSCSiz_ = 0;
449 
451  meSCCrystalSiz_ = 0;
452 
454  meSCSeedEne_ = 0;
455 
457  meSCEne2_ = 0;
458 
460  meSCEneVsEMax_ = 0;
461 
463  meSCEneLowScale_ = 0;
464 
466  meSCSeedMapOcc_ = 0;
467 
470 
472  mes1s9_ = 0;
473 
475  mes1s9thr_ = 0;
476 
478  mes9s25_ = 0;
479 
481  meInvMassPi0_ = 0;
482 
484  meInvMassJPsi_ = 0;
485 
487  meInvMassZ0_ = 0;
488 
490  meInvMassHigh_ = 0;
491 
493  meInvMassPi0Sel_ = 0;
494 
496  meInvMassJPsiSel_ = 0;
497 
499  meInvMassZ0Sel_ = 0;
500 
502  meInvMassHighSel_ = 0;
503 
504  }
505 
506  init_ = false;
507 
508 }
509 
511 
512  edm::LogInfo("EBClusterTask") << "analyzed " << ievt_ << " events";
513 
514  if ( enableCleanup_ ) this->cleanup();
515 
516 }
517 
519 
520  bool enable = false;
521 
523 
524  if ( e.getByLabel(EcalRawDataCollection_, dcchs) ) {
525 
526  for ( EcalRawDataCollection::const_iterator dcchItr = dcchs->begin(); dcchItr != dcchs->end(); ++dcchItr ) {
527 
528  if ( Numbers::subDet( *dcchItr ) != EcalBarrel ) continue;
529 
530  if ( dcchItr->getRunType() == EcalDCCHeaderBlock::BEAMH4 ||
531  dcchItr->getRunType() == EcalDCCHeaderBlock::BEAMH2 ) enable = true;
532 
533  if ( dcchItr->getRunType() == EcalDCCHeaderBlock::COSMIC ||
534  dcchItr->getRunType() == EcalDCCHeaderBlock::MTCC ||
535  dcchItr->getRunType() == EcalDCCHeaderBlock::COSMICS_GLOBAL ||
536  dcchItr->getRunType() == EcalDCCHeaderBlock::PHYSICS_GLOBAL ||
537  dcchItr->getRunType() == EcalDCCHeaderBlock::COSMICS_LOCAL ||
538  dcchItr->getRunType() == EcalDCCHeaderBlock::PHYSICS_LOCAL ) enable = true;
539 
540  break;
541 
542  }
543 
544  } else {
545 
546  enable = true;
547  edm::LogWarning("EBClusterTask") << EcalRawDataCollection_ << " not available";
548 
549  }
550 
551  if ( ! enable ) return;
552 
553  if ( ! init_ ) this->setup();
554 
555  ievt_++;
556 
557  // ECAL topology
558  edm::ESHandle<CaloTopology> pTopology;
559  c.get<CaloTopologyRecord>().get(pTopology);
560  if ( !pTopology.isValid() ) {
561  edm::LogWarning("EBClusterTask") << "Topology not valid";
562  return;
563  }
564  const CaloTopology* topology = pTopology.product();
565 
566  // recHits
568  e.getByLabel( EcalRecHitCollection_, pEBRecHits );
569  if ( !pEBRecHits.isValid() ) {
570  edm::LogWarning("EBClusterTask") << "RecHit collection " << EcalRecHitCollection_ << " not available.";
571  return;
572  }
573  const EcalRecHitCollection* ebRecHits = pEBRecHits.product();
574 
576 
577  // --- Barrel Basic Clusters ---
579  if ( e.getByLabel(BasicClusterCollection_, pBasicClusters) ) {
580 
581  int nbcc = pBasicClusters->size();
582  if ( nbcc > 0 ) meBCNum_->Fill(float(nbcc));
583 
584  for ( reco::BasicClusterCollection::const_iterator bCluster = pBasicClusters->begin(); bCluster != pBasicClusters->end(); ++bCluster ) {
585 
586  meBCEne_->Fill(bCluster->energy());
587  meBCSiz_->Fill(float(bCluster->size()));
588 
589  float xphi = bCluster->phi();
590  if ( xphi > M_PI*(9-1.5)/9 ) xphi = xphi - M_PI*2;
591 
592  meBCEneMap_->Fill(xphi, bCluster->eta(), bCluster->energy());
593  meBCEneMapProjEta_->Fill(bCluster->eta(), bCluster->energy());
594  meBCEneMapProjPhi_->Fill(xphi, bCluster->energy());
595 
596  meBCNumMap_->Fill(xphi, bCluster->eta());
597  meBCNumMapProjEta_->Fill(bCluster->eta());
598  meBCNumMapProjPhi_->Fill(xphi);
599 
600  meBCSizMap_->Fill(xphi, bCluster->eta(), float(bCluster->size()));
601  meBCSizMapProjEta_->Fill(bCluster->eta(), float(bCluster->size()));
602  meBCSizMapProjPhi_->Fill(xphi, float(bCluster->size()));
603 
604  meBCETMap_->Fill(xphi, bCluster->eta(), float(bCluster->energy()) * sin(bCluster->position().theta()));
605  meBCETMapProjEta_->Fill(bCluster->eta(), float(bCluster->energy()) * sin(bCluster->position().theta()));
606  meBCETMapProjPhi_->Fill(xphi, float(bCluster->energy()) * sin(bCluster->position().theta()));
607 
608  float e2x2 = EcalClusterTools::e2x2( *bCluster, ebRecHits, topology );
609  float e3x3 = EcalClusterTools::e3x3( *bCluster, ebRecHits, topology );
610 
611  // fill the selected cluster collection
612  float pt = std::abs( bCluster->energy()*sin(bCluster->position().theta()) );
613  if ( pt > thrClusEt_ && e2x2/e3x3 > thrS4S9_ ) bcSel.push_back(*bCluster);
614  }
615 
616  } else {
617  edm::LogWarning("EBClusterTask") << BasicClusterCollection_ << " not available";
618  }
619 
620  for ( reco::BasicClusterCollection::const_iterator bc1 = bcSel.begin(); bc1 != bcSel.end(); ++bc1 ) {
621  TLorentzVector bc1P;
622  bc1P.SetPtEtaPhiE(std::abs(bc1->energy()*sin(bc1->position().theta())),
623  bc1->eta(), bc1->phi(), bc1->energy());
624  for ( reco::BasicClusterCollection::const_iterator bc2 = bc1+1; bc2 != bcSel.end(); ++bc2 ) {
625  TLorentzVector bc2P;
626  bc2P.SetPtEtaPhiE(std::abs(bc2->energy()*sin(bc2->position().theta())),
627  bc2->eta(), bc2->phi(), bc2->energy());
628 
629  TLorentzVector candP = bc1P + bc2P;
630 
631  if ( candP.Pt() > thrCandEt_ ) {
632  float mass = candP.M();
633  if ( mass < 0.500 ) {
634  meInvMassPi0Sel_->Fill( mass );
635  } else if ( mass > 2.9 && mass < 3.3 ) {
636  meInvMassJPsiSel_->Fill( mass );
637  } else if ( mass > 40 && mass < 110 ) {
638  meInvMassZ0Sel_->Fill( mass );
639  } else if ( mass > 110 ) {
640  meInvMassHighSel_->Fill( mass );
641  }
642 
643  }
644 
645  }
646  }
647 
648  // --- Barrel Super Clusters ---
650  if ( e.getByLabel(SuperClusterCollection_, pSuperClusters) ) {
651 
652  int nscc = pSuperClusters->size();
653  if ( nscc > 0 ) meSCNum_->Fill(float(nscc));
654 
655  TLorentzVector sc1_p(0,0,0,0);
656  TLorentzVector sc2_p(0,0,0,0);
657 
658  for ( reco::SuperClusterCollection::const_iterator sCluster = pSuperClusters->begin(); sCluster != pSuperClusters->end(); ++sCluster ) {
659 
660  // energy, size
661  meSCEne_->Fill( sCluster->energy() );
662  meSCSiz_->Fill( float(sCluster->clustersSize()) );
663 
664  reco::CaloClusterPtr theSeed = sCluster->seed();
665 
666  // Find the seed rec hit
667  std::vector< std::pair<DetId,float> > sIds = sCluster->hitsAndFractions();
668 
669  float eMax, e2nd;
670  EcalRecHitCollection::const_iterator seedItr = ebRecHits->begin();
671  EcalRecHitCollection::const_iterator secondItr = ebRecHits->begin();
672 
673  for(std::vector< std::pair<DetId,float> >::const_iterator idItr = sIds.begin(); idItr != sIds.end(); ++idItr) {
674  DetId id = idItr->first;
675  if(id.det() != DetId::Ecal) { continue; }
676  EcalRecHitCollection::const_iterator hitItr = ebRecHits->find(id);
677  if(hitItr == ebRecHits->end()) { continue; }
678  if(hitItr->energy() > secondItr->energy()) { secondItr = hitItr; }
679  if(hitItr->energy() > seedItr->energy()) { std::swap(seedItr,secondItr); }
680  }
681 
682  eMax = seedItr->energy();
683  e2nd = secondItr->energy();
684  EBDetId seedId = (EBDetId) seedItr->id();
685 
686  float e3x3 = EcalClusterTools::e3x3( *theSeed, ebRecHits, topology );
687  float e5x5 = EcalClusterTools::e5x5( *theSeed, ebRecHits, topology );
688 
689  meSCCrystalSiz_->Fill(sIds.size());
690  meSCSeedEne_->Fill(eMax);
691  meSCEne2_->Fill(eMax+e2nd);
692  meSCEneVsEMax_->Fill(eMax,sCluster->energy());
693  meSCEneLowScale_->Fill(sCluster->energy());
694 
695  // Prepare to fill maps
696  int ebeta = seedId.ieta();
697  int ebphi = seedId.iphi();
698  float xebeta = ebeta - 0.5 * seedId.zside();
699  float xebphi = ebphi - 0.5;
700 
701  meSCSeedMapOcc_->Fill(xebphi,xebeta);
702 
703  if(sIds.size() == 1) meSCMapSingleCrystal_->Fill(xebphi,xebeta);
704 
705  mes1s9_->Fill( eMax/e3x3 );
706  if ( eMax > 3.0 ) mes1s9thr_->Fill( eMax/e3x3 );
707  mes9s25_->Fill( e3x3/e5x5 );
708 
709  if ( nscc >= 2 ) {
710  // look for the two most energetic super clusters
711  if ( sCluster->energy() > sc1_p.Energy() ) {
712  sc2_p=sc1_p;
713  sc1_p.SetPtEtaPhiE(std::abs(sCluster->energy()*sin(sCluster->position().theta())),
714  sCluster->eta(), sCluster->phi(), sCluster->energy());
715  } else if ( sCluster->energy() > sc2_p.Energy() ) {
716  sc2_p.SetPtEtaPhiE(std::abs(sCluster->energy()*sin(sCluster->position().theta())),
717  sCluster->eta(), sCluster->phi(), sCluster->energy());
718  }
719  }
720 
721  }
722  // Get the invariant mass of the two most energetic super clusters
723  if ( nscc >= 2 ) {
724  TLorentzVector sum = sc1_p+sc2_p;
725  float mass = sum.M();
726  if ( mass < 0.500 ) {
727  meInvMassPi0_->Fill( mass );
728  } else if ( mass > 2.9 && mass < 3.3 ) {
729  meInvMassJPsi_->Fill( mass );
730  } else if ( mass > 40 && mass < 110 ) {
731  meInvMassZ0_->Fill( mass );
732  } else if ( mass > 110 ) {
733  meInvMassHigh_->Fill( mass );
734  }
735  }
736 
737  } else {
738 
739  edm::LogWarning("EBClusterTask") << SuperClusterCollection_ << " not available";
740 
741  }
742 
743 }
T getParameter(std::string const &) const
MonitorElement * meBCSizMap_
Definition: EBClusterTask.h:80
T getUntrackedParameter(std::string const &, T const &) const
const std::string & getName(void) const
get name of ME
edm::InputTag EcalRawDataCollection_
Definition: EBClusterTask.h:68
MonitorElement * meBCEneMapProjPhi_
Definition: EBClusterTask.h:77
MonitorElement * meBCNumMapProjPhi_
Definition: EBClusterTask.h:78
MonitorElement * meSCSiz_
Definition: EBClusterTask.h:84
MonitorElement * meSCSeedEne_
Definition: EBClusterTask.h:87
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:717
void rmdir(const std::string &fullpath)
Definition: DQMStore.cc:2530
MonitorElement * meBCSiz_
Definition: EBClusterTask.h:75
MonitorElement * meBCSizMapProjEta_
Definition: EBClusterTask.h:80
MonitorElement * meInvMassPi0Sel_
Some &quot;id&quot; conversions.
MonitorElement * mes9s25_
Definition: EBClusterTask.h:96
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
std::vector< T >::const_iterator const_iterator
MonitorElement * mes1s9thr_
Definition: EBClusterTask.h:95
MonitorElement * meSCEne_
Definition: EBClusterTask.h:82
MonitorElement * meBCEneMap_
Definition: EBClusterTask.h:77
#define abs(x)
Definition: mlp_lapack.h:159
MonitorElement * meSCCrystalSiz_
Definition: EBClusterTask.h:86
MonitorElement * meBCEneMapProjEta_
Definition: EBClusterTask.h:77
MonitorElement * meInvMassJPsiSel_
void Fill(long long x)
MonitorElement * meInvMassZ0_
Definition: EBClusterTask.h:99
int iphi() const
get the crystal iphi
Definition: EBDetId.h:46
MonitorElement * meSCNum_
Definition: EBClusterTask.h:83
MonitorElement * meInvMassPi0_
Definition: EBClusterTask.h:97
MonitorElement * meBCSizMapProjPhi_
Definition: EBClusterTask.h:80
EBClusterTask(const edm::ParameterSet &ps)
Constructor.
edm::InputTag BasicClusterCollection_
Definition: EBClusterTask.h:69
MonitorElement * meBCEne_
Definition: EBClusterTask.h:73
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
MonitorElement * meSCSeedMapOcc_
Definition: EBClusterTask.h:91
void removeElement(const std::string &name)
Definition: DQMStore.cc:2572
static float e3x3(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
MonitorElement * meBCETMap_
Definition: EBClusterTask.h:79
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:1031
DQMStore * dqmStore_
Definition: EBClusterTask.h:60
int ieta() const
get the crystal ieta
Definition: EBDetId.h:44
bool isValid() const
Definition: HandleBase.h:76
MonitorElement * meSCEneVsEMax_
Definition: EBClusterTask.h:89
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
void reset(void)
Reset.
MonitorElement * meSCEneLowScale_
Definition: EBClusterTask.h:90
MonitorElement * meSCMapSingleCrystal_
Definition: EBClusterTask.h:92
MonitorElement * mes1s9_
Definition: EBClusterTask.h:94
const_iterator end() const
MonitorElement * meInvMassHigh_
Definition: DetId.h:20
MonitorElement * meInvMassHighSel_
MonitorElement * meBCNumMap_
Definition: EBClusterTask.h:78
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:50
void beginJob(void)
BeginJob.
MonitorElement * meBCNumMapProjEta_
Definition: EBClusterTask.h:78
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
std::vector< BasicCluster > BasicClusterCollection
collection of BasicCluster objects
T const * product() const
Definition: Handle.h:74
edm::InputTag EcalRecHitCollection_
Definition: EBClusterTask.h:71
MonitorElement * meSCEne2_
Definition: EBClusterTask.h:88
MonitorElement * meBCNum_
Definition: EBClusterTask.h:74
iterator find(key_type k)
tuple mass
Definition: scaleCards.py:27
static float e5x5(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
MonitorElement * meBCETMapProjEta_
Definition: EBClusterTask.h:79
edm::InputTag SuperClusterCollection_
Definition: EBClusterTask.h:70
std::string prefixME_
Definition: EBClusterTask.h:62
static EcalSubdetector subDet(const EBDetId &id)
Definition: Numbers.cc:145
void endJob(void)
EndJob.
MonitorElement * meInvMassJPsi_
Definition: EBClusterTask.h:98
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:845
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:429
const_iterator begin() const
Definition: Run.h:33
MonitorElement * meBCETMapProjPhi_
Definition: EBClusterTask.h:79
int zside() const
get the z-side of the crystal (1/-1)
Definition: EBDetId.h:40
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:1175
static float e2x2(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)