CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes
EcalBarrelSimHitsValidation Class Reference

#include <EcalBarrelSimHitsValidation.h>

Inheritance diagram for EcalBarrelSimHitsValidation:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Types

typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Public Member Functions

 EcalBarrelSimHitsValidation (const edm::ParameterSet &ps)
 Constructor. More...
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c) override
 Analyze. More...
 
void bookHistograms (DQMStore::IBooker &ib, edm::Run const &, edm::EventSetup const &c) override
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 

Private Types

typedef std::map< uint32_t, float, std::less< uint32_t > > MapType
 

Private Member Functions

float eCluster2x2 (MapType &themap)
 
float eCluster4x4 (float e33, MapType &themap)
 
virtual float energyInMatrixEB (int nCellInEta, int nCellInPhi, int centralEta, int centralPhi, int centralZ, MapType &themap)
 
bool fillEBMatrix (int nCellInEta, int nCellInPhi, int CentralEta, int CentralPhi, int CentralZ, MapType &fillmap, MapType &themap)
 
std::vector< uint32_t > getIdsAroundMax (int nCellInEta, int nCellInPhi, int centralEta, int centralPhi, int centralZ, MapType &themap)
 
uint32_t getUnitWithMaxEnergy (MapType &themap)
 

Private Attributes

std::string EBHitsCollection
 
edm::EDGetTokenT< edm::PCaloHitContainerEBHitsToken
 
float eRLength [26]
 
std::string g4InfoLabel
 
MonitorElementmeEBcrystalEnergy2_
 
MonitorElementmeEBcrystalEnergy_
 
MonitorElementmeEBe16_
 
MonitorElementmeEBe16oe25_
 
MonitorElementmeEBe1_
 
MonitorElementmeEBe1oe25_
 
MonitorElementmeEBe1oe4_
 
MonitorElementmeEBe1oe9_
 
MonitorElementmeEBe25_
 
MonitorElementmeEBe4_
 
MonitorElementmeEBe4oe9_
 
MonitorElementmeEBe9_
 
MonitorElementmeEBe9oe16_
 
MonitorElementmeEBe9oe25_
 
MonitorElementmeEBhitEnergy2_
 
MonitorElementmeEBhitEnergy_
 
MonitorElementmeEBhitLog10Energy25Norm_
 
MonitorElementmeEBhitLog10Energy_
 
MonitorElementmeEBhitLog10EnergyNorm_
 
MonitorElementmeEBLongitudinalShower_
 
MonitorElementmeEBOccupancy_
 
MonitorElementmenEBCrystals_
 
MonitorElementmenEBHits_
 
int myEntries
 
std::string ValidationCollection
 
edm::EDGetTokenT< PEcalValidInfoValidationCollectionToken
 
bool verbose_
 

Additional Inherited Members

- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Definition at line 30 of file EcalBarrelSimHitsValidation.h.

Member Typedef Documentation

◆ DQMStore

Definition at line 34 of file EcalBarrelSimHitsValidation.h.

◆ MapType

typedef std::map<uint32_t, float, std::less<uint32_t> > EcalBarrelSimHitsValidation::MapType
private

Definition at line 31 of file EcalBarrelSimHitsValidation.h.

◆ MonitorElement

Definition at line 35 of file EcalBarrelSimHitsValidation.h.

Constructor & Destructor Documentation

◆ EcalBarrelSimHitsValidation()

EcalBarrelSimHitsValidation::EcalBarrelSimHitsValidation ( const edm::ParameterSet ps)

Constructor.

Definition at line 17 of file EcalBarrelSimHitsValidation.cc.

18  : g4InfoLabel(ps.getParameter<std::string>("moduleLabelG4")),
19  EBHitsCollection(ps.getParameter<std::string>("EBHitsCollection")),
20  ValidationCollection(ps.getParameter<std::string>("ValidationCollection")) {
21  EBHitsToken =
22  consumes<edm::PCaloHitContainer>(edm::InputTag(std::string(g4InfoLabel), std::string(EBHitsCollection)));
25  // verbosity switch
26  verbose_ = ps.getUntrackedParameter<bool>("verbose", false);
27 
28  myEntries = 0;
29  for (int myStep = 0; myStep < 26; myStep++) {
30  eRLength[myStep] = 0.0;
31  }
32 }

References EBHitsCollection, EBHitsToken, eRLength, g4InfoLabel, edm::ParameterSet::getUntrackedParameter(), myEntries, AlCaHLTBitMon_QueryRunRegistry::string, ValidationCollection, ValidationCollectionToken, and verbose_.

Member Function Documentation

◆ analyze()

void EcalBarrelSimHitsValidation::analyze ( const edm::Event e,
const edm::EventSetup c 
)
overrideprotectedvirtual

Analyze.

Reimplemented from DQMEDAnalyzer.

Definition at line 108 of file EcalBarrelSimHitsValidation.cc.

108  {
109  edm::LogInfo("EventInfo") << " Run = " << e.id().run() << " Event = " << e.id().event();
110 
112  e.getByToken(EBHitsToken, EcalHitsEB);
113 
114  // Do nothing if no Barrel data available
115  if (!EcalHitsEB.isValid())
116  return;
117 
118  edm::Handle<PEcalValidInfo> MyPEcalValidInfo;
119  e.getByToken(ValidationCollectionToken, MyPEcalValidInfo);
120 
121  std::vector<PCaloHit> theEBCaloHits;
122  theEBCaloHits.insert(theEBCaloHits.end(), EcalHitsEB->begin(), EcalHitsEB->end());
123 
124  myEntries++;
125 
126  double EBEnergy_ = 0.;
127  std::map<unsigned int, std::vector<PCaloHit *>, std::less<unsigned int>> CaloHitMap;
128 
129  double eb1 = 0.0;
130  double eb4 = 0.0;
131  double eb9 = 0.0;
132  double eb16 = 0.0;
133  double eb25 = 0.0;
134  std::vector<double> econtr(140, 0.);
135  std::vector<double> econtr25(140, 0.);
136 
137  MapType ebmap;
138  uint32_t nEBHits = 0;
139 
140  for (std::vector<PCaloHit>::iterator isim = theEBCaloHits.begin(); isim != theEBCaloHits.end(); ++isim) {
141  if (isim->time() > 500.) {
142  continue;
143  }
144 
145  CaloHitMap[isim->id()].push_back(&(*isim));
146 
147  EBDetId ebid(isim->id());
148 
149  LogDebug("HitInfo") << " CaloHit " << isim->getName() << "\n"
150  << " DetID = " << isim->id() << " EBDetId = " << ebid.ieta() << " " << ebid.iphi() << "\n"
151  << " Time = " << isim->time() << "\n"
152  << " Track Id = " << isim->geantTrackId() << "\n"
153  << " Energy = " << isim->energy();
154 
155  meEBOccupancy_->Fill(ebid.iphi(), ebid.ieta());
156 
157  uint32_t crystid = ebid.rawId();
158  ebmap[crystid] += isim->energy();
159 
160  EBEnergy_ += isim->energy();
161  nEBHits++;
162  meEBhitEnergy_->Fill(isim->energy());
163  if (isim->energy() > 0) {
164  meEBhitLog10Energy_->Fill(log10(isim->energy()));
165  int log10i = int((log10(isim->energy()) + 10.) * 10.);
166  if (log10i >= 0 && log10i < 140)
167  econtr[log10i] += isim->energy();
168  }
169  meEBhitEnergy2_->Fill(isim->energy());
170  }
171 
172  menEBCrystals_->Fill(ebmap.size());
173  if (meEBcrystalEnergy_) {
174  for (std::map<uint32_t, float, std::less<uint32_t>>::iterator it = ebmap.begin(); it != ebmap.end(); ++it)
175  meEBcrystalEnergy_->Fill((*it).second);
176  }
177  if (meEBcrystalEnergy2_) {
178  for (std::map<uint32_t, float, std::less<uint32_t>>::iterator it = ebmap.begin(); it != ebmap.end(); ++it)
179  meEBcrystalEnergy2_->Fill((*it).second);
180  }
181 
182  menEBHits_->Fill(nEBHits);
183 
184  if (nEBHits > 0) {
185  uint32_t ebcenterid = getUnitWithMaxEnergy(ebmap);
186  EBDetId myEBid(ebcenterid);
187  int bx = myEBid.ietaAbs();
188  int by = myEBid.iphi();
189  int bz = myEBid.zside();
190  eb1 = energyInMatrixEB(1, 1, bx, by, bz, ebmap);
191  meEBe1_->Fill(eb1);
192  eb9 = energyInMatrixEB(3, 3, bx, by, bz, ebmap);
193  meEBe9_->Fill(eb9);
194  eb25 = energyInMatrixEB(5, 5, bx, by, bz, ebmap);
195  meEBe25_->Fill(eb25);
196 
197  std::vector<uint32_t> ids25;
198  ids25 = getIdsAroundMax(5, 5, bx, by, bz, ebmap);
199 
200  for (unsigned i = 0; i < 25; i++) {
201  for (unsigned int j = 0; j < CaloHitMap[ids25[i]].size(); j++) {
202  if (CaloHitMap[ids25[i]][j]->energy() > 0) {
203  int log10i = int((log10(CaloHitMap[ids25[i]][j]->energy()) + 10.) * 10.);
204  if (log10i >= 0 && log10i < 140)
205  econtr25[log10i] += CaloHitMap[ids25[i]][j]->energy();
206  }
207  }
208  }
209 
210  MapType newebmap;
211  if (fillEBMatrix(3, 3, bx, by, bz, newebmap, ebmap)) {
212  eb4 = eCluster2x2(newebmap);
213  meEBe4_->Fill(eb4);
214  }
215  if (fillEBMatrix(5, 5, bx, by, bz, newebmap, ebmap)) {
216  eb16 = eCluster4x4(eb9, newebmap);
217  meEBe16_->Fill(eb16);
218  }
219 
220  if (eb4 > 0.1)
221  meEBe1oe4_->Fill(eb1 / eb4);
222  if (eb9 > 0.1)
223  meEBe1oe9_->Fill(eb1 / eb9);
224  if (eb9 > 0.1)
225  meEBe4oe9_->Fill(eb4 / eb9);
226  if (eb16 > 0.1)
227  meEBe9oe16_->Fill(eb9 / eb16);
228  if (eb25 > 0.1)
229  meEBe1oe25_->Fill(eb1 / eb25);
230  if (eb25 > 0.1)
231  meEBe9oe25_->Fill(eb9 / eb25);
232  if (eb25 > 0.1)
233  meEBe16oe25_->Fill(eb16 / eb25);
234 
235  if (EBEnergy_ != 0) {
236  for (int i = 0; i < 140; i++) {
237  meEBhitLog10EnergyNorm_->Fill(-10. + (float(i) + 0.5) / 10., econtr[i] / EBEnergy_);
238  }
239  }
240 
241  if (eb25 != 0) {
242  for (int i = 0; i < 140; i++) {
243  meEBhitLog10Energy25Norm_->Fill(-10. + (float(i) + 0.5) / 10., econtr25[i] / eb25);
244  }
245  }
246  }
247 
248  if (MyPEcalValidInfo.isValid()) {
249  if (MyPEcalValidInfo->eb1x1() > 0.) {
250  std::vector<float> BX0 = MyPEcalValidInfo->bX0();
252  for (int myStep = 0; myStep < 26; myStep++) {
253  eRLength[myStep] += BX0[myStep];
254  meEBLongitudinalShower_->Fill(float(myStep), eRLength[myStep] / myEntries);
255  }
256  }
257  }
258 }

References l1GtPatternGenerator_cfi::bx, PEcalValidInfo::bX0(), MillePedeFileConverter_cfg::e, PEcalValidInfo::eb1x1(), EBHitsToken, eCluster2x2(), eCluster4x4(), HCALHighEnergyHPDFilter_cfi::energy, energyInMatrixEB(), eRLength, dqm::impl::MonitorElement::Fill(), fillEBMatrix(), getIdsAroundMax(), getUnitWithMaxEnergy(), mps_fire::i, EBDetId::ietaAbs(), createfilelist::int, EBDetId::iphi(), edm::HandleBase::isValid(), dqmiolumiharvest::j, LogDebug, genParticles_cff::map, meEBcrystalEnergy2_, meEBcrystalEnergy_, meEBe16_, meEBe16oe25_, meEBe1_, meEBe1oe25_, meEBe1oe4_, meEBe1oe9_, meEBe25_, meEBe4_, meEBe4oe9_, meEBe9_, meEBe9oe16_, meEBe9oe25_, meEBhitEnergy2_, meEBhitEnergy_, meEBhitLog10Energy25Norm_, meEBhitLog10Energy_, meEBhitLog10EnergyNorm_, meEBLongitudinalShower_, meEBOccupancy_, menEBCrystals_, menEBHits_, myEntries, dqm::impl::MonitorElement::Reset(), ValidationCollectionToken, and EBDetId::zside().

◆ bookHistograms()

void EcalBarrelSimHitsValidation::bookHistograms ( DQMStore::IBooker ib,
edm::Run const &  ,
edm::EventSetup const &  c 
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 34 of file EcalBarrelSimHitsValidation.cc.

34  {
35  ib.setCurrentFolder("EcalHitsV/EcalSimHitsValidation");
36  ib.setScope(MonitorElementData::Scope::RUN);
37 
38  std::string histo = "EB hits multiplicity";
39  menEBHits_ = ib.book1D(histo, histo, 50, 0., 5000.);
40 
41  histo = "EB crystals multiplicity";
42  menEBCrystals_ = ib.book1D(histo, histo, 200, 0., 2000.);
43 
44  histo = "EB occupancy";
45  meEBOccupancy_ = ib.book2D(histo, histo, 360, 0., 360., 170, -85., 85.);
46 
47  histo = "EB longitudinal shower profile";
48  meEBLongitudinalShower_ = ib.bookProfile(histo, histo, 26, 0., 26., 100, 0., 20000.);
49 
50  histo = "EB hits energy spectrum";
51  meEBhitEnergy_ = ib.book1D(histo, histo, 4000, 0., 400.);
52 
53  histo = "EB hits log10energy spectrum";
54  meEBhitLog10Energy_ = ib.book1D(histo, histo, 140, -10., 4.);
55 
56  histo = "EB hits log10energy spectrum vs normalized energy";
57  meEBhitLog10EnergyNorm_ = ib.bookProfile(histo, histo, 140, -10., 4., 100, 0., 1.);
58 
59  histo = "EB hits log10energy spectrum vs normalized energy25";
60  meEBhitLog10Energy25Norm_ = ib.bookProfile(histo, histo, 140, -10., 4., 100, 0., 1.);
61 
62  histo = "EB hits energy spectrum 2";
63  meEBhitEnergy2_ = ib.book1D(histo, histo, 1000, 0., 0.001);
64 
65  histo = "EB crystal energy spectrum";
66  meEBcrystalEnergy_ = ib.book1D(histo, histo, 5000, 0., 50.);
67 
68  histo = "EB crystal energy spectrum 2";
69  meEBcrystalEnergy2_ = ib.book1D(histo, histo, 1000, 0., 0.001);
70 
71  histo = "EB E1";
72  meEBe1_ = ib.book1D(histo, histo, 400, 0., 400.);
73 
74  histo = "EB E4";
75  meEBe4_ = ib.book1D(histo, histo, 400, 0., 400.);
76 
77  histo = "EB E9";
78  meEBe9_ = ib.book1D(histo, histo, 400, 0., 400.);
79 
80  histo = "EB E16";
81  meEBe16_ = ib.book1D(histo, histo, 400, 0., 400.);
82 
83  histo = "EB E25";
84  meEBe25_ = ib.book1D(histo, histo, 400, 0., 400.);
85 
86  histo = "EB E1oE4";
87  meEBe1oe4_ = ib.book1D(histo, histo, 100, 0.4, 1.1);
88 
89  histo = "EB E1oE9";
90  meEBe1oe9_ = ib.book1D(histo, histo, 100, 0.4, 1.1);
91 
92  histo = "EB E4oE9";
93  meEBe4oe9_ = ib.book1D(histo, histo, 100, 0.4, 1.1);
94 
95  histo = "EB E9oE16";
96  meEBe9oe16_ = ib.book1D(histo, histo, 100, 0.4, 1.1);
97 
98  histo = "EB E1oE25";
99  meEBe1oe25_ = ib.book1D(histo, histo, 100, 0.4, 1.1);
100 
101  histo = "EB E9oE25";
102  meEBe9oe25_ = ib.book1D(histo, histo, 100, 0.4, 1.1);
103 
104  histo = "EB E16oE25";
105  meEBe16oe25_ = ib.book1D(histo, histo, 100, 0.4, 1.1);
106 }

References timingPdfMaker::histo, cuy::ib, meEBcrystalEnergy2_, meEBcrystalEnergy_, meEBe16_, meEBe16oe25_, meEBe1_, meEBe1oe25_, meEBe1oe4_, meEBe1oe9_, meEBe25_, meEBe4_, meEBe4oe9_, meEBe9_, meEBe9oe16_, meEBe9oe25_, meEBhitEnergy2_, meEBhitEnergy_, meEBhitLog10Energy25Norm_, meEBhitLog10Energy_, meEBhitLog10EnergyNorm_, meEBLongitudinalShower_, meEBOccupancy_, menEBCrystals_, menEBHits_, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ eCluster2x2()

float EcalBarrelSimHitsValidation::eCluster2x2 ( MapType themap)
private

Definition at line 359 of file EcalBarrelSimHitsValidation.cc.

359  {
360  float E22 = 0.;
361  float e012 = themap[0] + themap[1] + themap[2];
362  float e036 = themap[0] + themap[3] + themap[6];
363  float e678 = themap[6] + themap[7] + themap[8];
364  float e258 = themap[2] + themap[5] + themap[8];
365 
366  if ((e012 > e678 || e012 == e678) && (e036 > e258 || e036 == e258))
367  return E22 = themap[0] + themap[1] + themap[3] + themap[4];
368  else if ((e012 > e678 || e012 == e678) && (e036 < e258 || e036 == e258))
369  return E22 = themap[1] + themap[2] + themap[4] + themap[5];
370  else if ((e012 < e678 || e012 == e678) && (e036 > e258 || e036 == e258))
371  return E22 = themap[3] + themap[4] + themap[6] + themap[7];
372  else if ((e012 < e678 || e012 == e678) && (e036 < e258 || e036 == e258))
373  return E22 = themap[4] + themap[5] + themap[7] + themap[8];
374  else {
375  return E22;
376  }
377 }

Referenced by analyze().

◆ eCluster4x4()

float EcalBarrelSimHitsValidation::eCluster4x4 ( float  e33,
MapType themap 
)
private

Definition at line 379 of file EcalBarrelSimHitsValidation.cc.

379  {
380  float E44 = 0.;
381  float e0_4 = themap[0] + themap[1] + themap[2] + themap[3] + themap[4];
382  float e0_20 = themap[0] + themap[5] + themap[10] + themap[15] + themap[20];
383  float e4_24 = themap[4] + themap[9] + themap[14] + themap[19] + themap[24];
384  float e0_24 = themap[20] + themap[21] + themap[22] + themap[23] + themap[24];
385 
386  if ((e0_4 > e0_24 || e0_4 == e0_24) && (e0_20 > e4_24 || e0_20 == e4_24))
387  return E44 = e33 + themap[0] + themap[1] + themap[2] + themap[3] + themap[5] + themap[10] + themap[15];
388  else if ((e0_4 > e0_24 || e0_4 == e0_24) && (e0_20 < e4_24 || e0_20 == e4_24))
389  return E44 = e33 + themap[1] + themap[2] + themap[3] + themap[4] + themap[9] + themap[14] + themap[19];
390  else if ((e0_4 < e0_24 || e0_4 == e0_24) && (e0_20 > e4_24 || e0_20 == e4_24))
391  return E44 = e33 + themap[5] + themap[10] + themap[15] + themap[20] + themap[21] + themap[22] + themap[23];
392  else if ((e0_4 < e0_24 || e0_4 == e0_24) && (e0_20 < e4_24 || e0_20 == e4_24))
393  return E44 = e33 + themap[21] + themap[22] + themap[23] + themap[24] + themap[9] + themap[14] + themap[19];
394  else {
395  return E44;
396  }
397 }

Referenced by analyze().

◆ energyInMatrixEB()

float EcalBarrelSimHitsValidation::energyInMatrixEB ( int  nCellInEta,
int  nCellInPhi,
int  centralEta,
int  centralPhi,
int  centralZ,
MapType themap 
)
privatevirtual

Definition at line 260 of file EcalBarrelSimHitsValidation.cc.

261  {
262  int ncristals = 0;
263  float totalEnergy = 0.;
264 
265  int goBackInEta = nCellInEta / 2;
266  int goBackInPhi = nCellInPhi / 2;
267  int startEta = centralZ * centralEta - goBackInEta;
268  int startPhi = centralPhi - goBackInPhi;
269 
270  for (int ieta = startEta; ieta < startEta + nCellInEta; ieta++) {
271  for (int iphi = startPhi; iphi < startPhi + nCellInPhi; iphi++) {
272  uint32_t index;
273  if (abs(ieta) > 85 || abs(ieta) < 1) {
274  continue;
275  }
276  if (iphi < 1) {
277  index = EBDetId(ieta, iphi + 360).rawId();
278  } else if (iphi > 360) {
279  index = EBDetId(ieta, iphi - 360).rawId();
280  } else {
281  index = EBDetId(ieta, iphi).rawId();
282  }
283 
284  totalEnergy += themap[index];
285  ncristals += 1;
286  }
287  }
288 
289  LogDebug("GeomInfo") << nCellInEta << " x " << nCellInPhi << " EB matrix energy = " << totalEnergy << " for "
290  << ncristals << " crystals";
291  return totalEnergy;
292 }

References funct::abs(), LEDCalibrationChannels::ieta, LEDCalibrationChannels::iphi, LogDebug, and DetId::rawId().

Referenced by analyze().

◆ fillEBMatrix()

bool EcalBarrelSimHitsValidation::fillEBMatrix ( int  nCellInEta,
int  nCellInPhi,
int  CentralEta,
int  CentralPhi,
int  CentralZ,
MapType fillmap,
MapType themap 
)
private

Definition at line 325 of file EcalBarrelSimHitsValidation.cc.

326  {
327  int goBackInEta = nCellInEta / 2;
328  int goBackInPhi = nCellInPhi / 2;
329 
330  int startEta = CentralZ * CentralEta - goBackInEta;
331  int startPhi = CentralPhi - goBackInPhi;
332 
333  int i = 0;
334  for (int ieta = startEta; ieta < startEta + nCellInEta; ieta++) {
335  for (int iphi = startPhi; iphi < startPhi + nCellInPhi; iphi++) {
336  uint32_t index;
337  if (abs(ieta) > 85 || abs(ieta) < 1) {
338  continue;
339  }
340  if (iphi < 1) {
341  index = EBDetId(ieta, iphi + 360).rawId();
342  } else if (iphi > 360) {
343  index = EBDetId(ieta, iphi - 360).rawId();
344  } else {
345  index = EBDetId(ieta, iphi).rawId();
346  }
347  fillmap[i++] = themap[index];
348  }
349  }
350 
351  uint32_t ebcenterid = getUnitWithMaxEnergy(themap);
352 
353  if (fillmap[i / 2] == themap[ebcenterid])
354  return true;
355  else
356  return false;
357 }

References funct::abs(), getUnitWithMaxEnergy(), mps_fire::i, LEDCalibrationChannels::ieta, LEDCalibrationChannels::iphi, and DetId::rawId().

Referenced by analyze().

◆ getIdsAroundMax()

std::vector< uint32_t > EcalBarrelSimHitsValidation::getIdsAroundMax ( int  nCellInEta,
int  nCellInPhi,
int  centralEta,
int  centralPhi,
int  centralZ,
MapType themap 
)
private

Definition at line 294 of file EcalBarrelSimHitsValidation.cc.

295  {
296  int ncristals = 0;
297  std::vector<uint32_t> ids(nCellInEta * nCellInPhi);
298 
299  int goBackInEta = nCellInEta / 2;
300  int goBackInPhi = nCellInPhi / 2;
301  int startEta = centralZ * centralEta - goBackInEta;
302  int startPhi = centralPhi - goBackInPhi;
303 
304  for (int ieta = startEta; ieta < startEta + nCellInEta; ieta++) {
305  for (int iphi = startPhi; iphi < startPhi + nCellInPhi; iphi++) {
306  uint32_t index;
307  if (abs(ieta) > 85 || abs(ieta) < 1) {
308  continue;
309  }
310  if (iphi < 1) {
311  index = EBDetId(ieta, iphi + 360).rawId();
312  } else if (iphi > 360) {
313  index = EBDetId(ieta, iphi - 360).rawId();
314  } else {
315  index = EBDetId(ieta, iphi).rawId();
316  }
317  ids[ncristals] = index;
318  ncristals += 1;
319  }
320  }
321 
322  return ids;
323 }

References funct::abs(), LEDCalibrationChannels::ieta, LEDCalibrationChannels::iphi, and DetId::rawId().

Referenced by analyze().

◆ getUnitWithMaxEnergy()

uint32_t EcalBarrelSimHitsValidation::getUnitWithMaxEnergy ( MapType themap)
private

Definition at line 399 of file EcalBarrelSimHitsValidation.cc.

399  {
400  // look for max
401  uint32_t unitWithMaxEnergy = 0;
402  float maxEnergy = 0.;
403 
404  MapType::iterator iter;
405  for (iter = themap.begin(); iter != themap.end(); iter++) {
406  if (maxEnergy < (*iter).second) {
407  maxEnergy = (*iter).second;
408  unitWithMaxEnergy = (*iter).first;
409  }
410  }
411 
412  LogDebug("GeomInfo") << " max energy of " << maxEnergy << " GeV in Unit id " << unitWithMaxEnergy;
413  return unitWithMaxEnergy;
414 }

References LogDebug, and particleFlowClusterECALTimeSelected_cfi::maxEnergy.

Referenced by analyze(), and fillEBMatrix().

Member Data Documentation

◆ EBHitsCollection

std::string EcalBarrelSimHitsValidation::EBHitsCollection
private

Definition at line 62 of file EcalBarrelSimHitsValidation.h.

Referenced by EcalBarrelSimHitsValidation().

◆ EBHitsToken

edm::EDGetTokenT<edm::PCaloHitContainer> EcalBarrelSimHitsValidation::EBHitsToken
private

Definition at line 65 of file EcalBarrelSimHitsValidation.h.

Referenced by analyze(), and EcalBarrelSimHitsValidation().

◆ eRLength

float EcalBarrelSimHitsValidation::eRLength[26]
private

Definition at line 71 of file EcalBarrelSimHitsValidation.h.

Referenced by analyze(), and EcalBarrelSimHitsValidation().

◆ g4InfoLabel

std::string EcalBarrelSimHitsValidation::g4InfoLabel
private

Definition at line 61 of file EcalBarrelSimHitsValidation.h.

Referenced by EcalBarrelSimHitsValidation().

◆ meEBcrystalEnergy2_

MonitorElement* EcalBarrelSimHitsValidation::meEBcrystalEnergy2_
private

Definition at line 93 of file EcalBarrelSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEBcrystalEnergy_

MonitorElement* EcalBarrelSimHitsValidation::meEBcrystalEnergy_
private

Definition at line 91 of file EcalBarrelSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEBe16_

MonitorElement* EcalBarrelSimHitsValidation::meEBe16_
private

Definition at line 98 of file EcalBarrelSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEBe16oe25_

MonitorElement* EcalBarrelSimHitsValidation::meEBe16oe25_
private

Definition at line 107 of file EcalBarrelSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEBe1_

MonitorElement* EcalBarrelSimHitsValidation::meEBe1_
private

Definition at line 95 of file EcalBarrelSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEBe1oe25_

MonitorElement* EcalBarrelSimHitsValidation::meEBe1oe25_
private

Definition at line 105 of file EcalBarrelSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEBe1oe4_

MonitorElement* EcalBarrelSimHitsValidation::meEBe1oe4_
private

Definition at line 101 of file EcalBarrelSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEBe1oe9_

MonitorElement* EcalBarrelSimHitsValidation::meEBe1oe9_
private

Definition at line 102 of file EcalBarrelSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEBe25_

MonitorElement* EcalBarrelSimHitsValidation::meEBe25_
private

Definition at line 99 of file EcalBarrelSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEBe4_

MonitorElement* EcalBarrelSimHitsValidation::meEBe4_
private

Definition at line 96 of file EcalBarrelSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEBe4oe9_

MonitorElement* EcalBarrelSimHitsValidation::meEBe4oe9_
private

Definition at line 103 of file EcalBarrelSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEBe9_

MonitorElement* EcalBarrelSimHitsValidation::meEBe9_
private

Definition at line 97 of file EcalBarrelSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEBe9oe16_

MonitorElement* EcalBarrelSimHitsValidation::meEBe9oe16_
private

Definition at line 104 of file EcalBarrelSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEBe9oe25_

MonitorElement* EcalBarrelSimHitsValidation::meEBe9oe25_
private

Definition at line 106 of file EcalBarrelSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEBhitEnergy2_

MonitorElement* EcalBarrelSimHitsValidation::meEBhitEnergy2_
private

Definition at line 89 of file EcalBarrelSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEBhitEnergy_

MonitorElement* EcalBarrelSimHitsValidation::meEBhitEnergy_
private

Definition at line 81 of file EcalBarrelSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEBhitLog10Energy25Norm_

MonitorElement* EcalBarrelSimHitsValidation::meEBhitLog10Energy25Norm_
private

Definition at line 87 of file EcalBarrelSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEBhitLog10Energy_

MonitorElement* EcalBarrelSimHitsValidation::meEBhitLog10Energy_
private

Definition at line 83 of file EcalBarrelSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEBhitLog10EnergyNorm_

MonitorElement* EcalBarrelSimHitsValidation::meEBhitLog10EnergyNorm_
private

Definition at line 85 of file EcalBarrelSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEBLongitudinalShower_

MonitorElement* EcalBarrelSimHitsValidation::meEBLongitudinalShower_
private

Definition at line 79 of file EcalBarrelSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEBOccupancy_

MonitorElement* EcalBarrelSimHitsValidation::meEBOccupancy_
private

Definition at line 77 of file EcalBarrelSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ menEBCrystals_

MonitorElement* EcalBarrelSimHitsValidation::menEBCrystals_
private

Definition at line 75 of file EcalBarrelSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ menEBHits_

MonitorElement* EcalBarrelSimHitsValidation::menEBHits_
private

Definition at line 73 of file EcalBarrelSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ myEntries

int EcalBarrelSimHitsValidation::myEntries
private

Definition at line 70 of file EcalBarrelSimHitsValidation.h.

Referenced by analyze(), and EcalBarrelSimHitsValidation().

◆ ValidationCollection

std::string EcalBarrelSimHitsValidation::ValidationCollection
private

Definition at line 63 of file EcalBarrelSimHitsValidation.h.

Referenced by EcalBarrelSimHitsValidation().

◆ ValidationCollectionToken

edm::EDGetTokenT<PEcalValidInfo> EcalBarrelSimHitsValidation::ValidationCollectionToken
private

Definition at line 66 of file EcalBarrelSimHitsValidation.h.

Referenced by analyze(), and EcalBarrelSimHitsValidation().

◆ verbose_

bool EcalBarrelSimHitsValidation::verbose_
private

Definition at line 68 of file EcalBarrelSimHitsValidation.h.

Referenced by EcalBarrelSimHitsValidation().

EcalBarrelSimHitsValidation::myEntries
int myEntries
Definition: EcalBarrelSimHitsValidation.h:70
EcalBarrelSimHitsValidation::fillEBMatrix
bool fillEBMatrix(int nCellInEta, int nCellInPhi, int CentralEta, int CentralPhi, int CentralZ, MapType &fillmap, MapType &themap)
Definition: EcalBarrelSimHitsValidation.cc:325
EcalBarrelSimHitsValidation::eCluster4x4
float eCluster4x4(float e33, MapType &themap)
Definition: EcalBarrelSimHitsValidation.cc:379
mps_fire.i
i
Definition: mps_fire.py:428
EcalBarrelSimHitsValidation::energyInMatrixEB
virtual float energyInMatrixEB(int nCellInEta, int nCellInPhi, int centralEta, int centralPhi, int centralZ, MapType &themap)
Definition: EcalBarrelSimHitsValidation.cc:260
EcalBarrelSimHitsValidation::meEBe4oe9_
MonitorElement * meEBe4oe9_
Definition: EcalBarrelSimHitsValidation.h:103
EcalBarrelSimHitsValidation::meEBe4_
MonitorElement * meEBe4_
Definition: EcalBarrelSimHitsValidation.h:96
EcalBarrelSimHitsValidation::meEBhitLog10EnergyNorm_
MonitorElement * meEBhitLog10EnergyNorm_
Definition: EcalBarrelSimHitsValidation.h:85
EBDetId
Definition: EBDetId.h:17
EcalBarrelSimHitsValidation::meEBhitEnergy2_
MonitorElement * meEBhitEnergy2_
Definition: EcalBarrelSimHitsValidation.h:89
EcalBarrelSimHitsValidation::meEBe1_
MonitorElement * meEBe1_
Definition: EcalBarrelSimHitsValidation.h:95
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
EcalBarrelSimHitsValidation::meEBhitLog10Energy_
MonitorElement * meEBhitLog10Energy_
Definition: EcalBarrelSimHitsValidation.h:83
EcalBarrelSimHitsValidation::meEBe9oe16_
MonitorElement * meEBe9oe16_
Definition: EcalBarrelSimHitsValidation.h:104
timingPdfMaker.histo
histo
Definition: timingPdfMaker.py:279
EcalBarrelSimHitsValidation::meEBe9oe25_
MonitorElement * meEBe9oe25_
Definition: EcalBarrelSimHitsValidation.h:106
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::Handle
Definition: AssociativeIterator.h:50
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
EcalBarrelSimHitsValidation::meEBe9_
MonitorElement * meEBe9_
Definition: EcalBarrelSimHitsValidation.h:97
EcalBarrelSimHitsValidation::meEBcrystalEnergy_
MonitorElement * meEBcrystalEnergy_
Definition: EcalBarrelSimHitsValidation.h:91
EcalBarrelSimHitsValidation::g4InfoLabel
std::string g4InfoLabel
Definition: EcalBarrelSimHitsValidation.h:61
EcalBarrelSimHitsValidation::MapType
std::map< uint32_t, float, std::less< uint32_t > > MapType
Definition: EcalBarrelSimHitsValidation.h:31
EcalBarrelSimHitsValidation::meEBhitEnergy_
MonitorElement * meEBhitEnergy_
Definition: EcalBarrelSimHitsValidation.h:81
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
dqm::impl::MonitorElement::Reset
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
Definition: MonitorElement.cc:354
EcalBarrelSimHitsValidation::ValidationCollectionToken
edm::EDGetTokenT< PEcalValidInfo > ValidationCollectionToken
Definition: EcalBarrelSimHitsValidation.h:66
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
EcalBarrelSimHitsValidation::getUnitWithMaxEnergy
uint32_t getUnitWithMaxEnergy(MapType &themap)
Definition: EcalBarrelSimHitsValidation.cc:399
EcalBarrelSimHitsValidation::meEBe1oe25_
MonitorElement * meEBe1oe25_
Definition: EcalBarrelSimHitsValidation.h:105
EcalBarrelSimHitsValidation::menEBCrystals_
MonitorElement * menEBCrystals_
Definition: EcalBarrelSimHitsValidation.h:75
EcalBarrelSimHitsValidation::meEBhitLog10Energy25Norm_
MonitorElement * meEBhitLog10Energy25Norm_
Definition: EcalBarrelSimHitsValidation.h:87
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
EcalBarrelSimHitsValidation::EBHitsCollection
std::string EBHitsCollection
Definition: EcalBarrelSimHitsValidation.h:62
EcalBarrelSimHitsValidation::meEBe1oe9_
MonitorElement * meEBe1oe9_
Definition: EcalBarrelSimHitsValidation.h:102
EcalBarrelSimHitsValidation::meEBe16_
MonitorElement * meEBe16_
Definition: EcalBarrelSimHitsValidation.h:98
createfilelist.int
int
Definition: createfilelist.py:10
cuy.ib
ib
Definition: cuy.py:662
PEcalValidInfo::eb1x1
float eb1x1() const
Definition: PValidationFormats.h:1101
particleFlowClusterECALTimeSelected_cfi.maxEnergy
maxEnergy
Definition: particleFlowClusterECALTimeSelected_cfi.py:10
EcalBarrelSimHitsValidation::meEBOccupancy_
MonitorElement * meEBOccupancy_
Definition: EcalBarrelSimHitsValidation.h:77
EcalBarrelSimHitsValidation::meEBe1oe4_
MonitorElement * meEBe1oe4_
Definition: EcalBarrelSimHitsValidation.h:101
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
EcalBarrelSimHitsValidation::verbose_
bool verbose_
Definition: EcalBarrelSimHitsValidation.h:68
EcalBarrelSimHitsValidation::meEBLongitudinalShower_
MonitorElement * meEBLongitudinalShower_
Definition: EcalBarrelSimHitsValidation.h:79
EcalBarrelSimHitsValidation::meEBcrystalEnergy2_
MonitorElement * meEBcrystalEnergy2_
Definition: EcalBarrelSimHitsValidation.h:93
EcalBarrelSimHitsValidation::meEBe25_
MonitorElement * meEBe25_
Definition: EcalBarrelSimHitsValidation.h:99
EcalBarrelSimHitsValidation::EBHitsToken
edm::EDGetTokenT< edm::PCaloHitContainer > EBHitsToken
Definition: EcalBarrelSimHitsValidation.h:65
EcalBarrelSimHitsValidation::menEBHits_
MonitorElement * menEBHits_
Definition: EcalBarrelSimHitsValidation.h:73
PEcalValidInfo::bX0
FloatVector bX0() const
Definition: PValidationFormats.h:1133
EcalBarrelSimHitsValidation::ValidationCollection
std::string ValidationCollection
Definition: EcalBarrelSimHitsValidation.h:63
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
EcalBarrelSimHitsValidation::eRLength
float eRLength[26]
Definition: EcalBarrelSimHitsValidation.h:71
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
genParticles_cff.map
map
Definition: genParticles_cff.py:11
EcalBarrelSimHitsValidation::meEBe16oe25_
MonitorElement * meEBe16oe25_
Definition: EcalBarrelSimHitsValidation.h:107
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
EcalBarrelSimHitsValidation::getIdsAroundMax
std::vector< uint32_t > getIdsAroundMax(int nCellInEta, int nCellInPhi, int centralEta, int centralPhi, int centralZ, MapType &themap)
Definition: EcalBarrelSimHitsValidation.cc:294
edm::InputTag
Definition: InputTag.h:15
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
EcalBarrelSimHitsValidation::eCluster2x2
float eCluster2x2(MapType &themap)
Definition: EcalBarrelSimHitsValidation.cc:359