CMS 3D CMS Logo

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

#include <EcalEndcapSimHitsValidation.h>

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

Public Member Functions

 EcalEndcapSimHitsValidation (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 energyInMatrixEE (int nCellInX, int nCellInY, int centralX, int centralY, int centralZ, MapType &themap)
 
bool fillEEMatrix (int nCellInX, int nCellInY, int CentralX, int CentralY, int CentralZ, MapType &fillmap, MapType &themap)
 
std::vector< uint32_t > getIdsAroundMax (int nCellInX, int nCellInY, int centralX, int centralY, int centralZ, MapType &themap)
 
uint32_t getUnitWithMaxEnergy (MapType &themap)
 

Private Attributes

std::string EEHitsCollection
 
edm::EDGetTokenT< edm::PCaloHitContainerEEHitsToken
 
float eRLength [26]
 
std::string g4InfoLabel
 
MonitorElementmeEEcrystalEnergy2_
 
MonitorElementmeEEcrystalEnergy_
 
MonitorElementmeEEe16_
 
MonitorElementmeEEe16oe25_
 
MonitorElementmeEEe1_
 
MonitorElementmeEEe1oe25_
 
MonitorElementmeEEe1oe4_
 
MonitorElementmeEEe1oe9_
 
MonitorElementmeEEe25_
 
MonitorElementmeEEe4_
 
MonitorElementmeEEe4oe9_
 
MonitorElementmeEEe9_
 
MonitorElementmeEEe9oe16_
 
MonitorElementmeEEe9oe25_
 
MonitorElementmeEEHitEnergy2_
 
MonitorElementmeEEHitEnergy_
 
MonitorElementmeEEhitLog10Energy25Norm_
 
MonitorElementmeEEhitLog10Energy_
 
MonitorElementmeEEhitLog10EnergyNorm_
 
MonitorElementmeEELongitudinalShower_
 
MonitorElementmeEEzmCrystals_
 
MonitorElementmeEEzmHits_
 
MonitorElementmeEEzmOccupancy_
 
MonitorElementmeEEzpCrystals_
 
MonitorElementmeEEzpHits_
 
MonitorElementmeEEzpOccupancy_
 
int myEntries
 
std::string ValidationCollection
 
edm::EDGetTokenT< PEcalValidInfoValidationCollectionToken
 
bool verbose_
 

Additional Inherited Members

- 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
 
- 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 34 of file EcalEndcapSimHitsValidation.h.

Member Typedef Documentation

◆ MapType

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

Definition at line 35 of file EcalEndcapSimHitsValidation.h.

Constructor & Destructor Documentation

◆ EcalEndcapSimHitsValidation()

EcalEndcapSimHitsValidation::EcalEndcapSimHitsValidation ( const edm::ParameterSet ps)

Constructor.

Definition at line 17 of file EcalEndcapSimHitsValidation.cc.

18  : g4InfoLabel(ps.getParameter<std::string>("moduleLabelG4")),
19  EEHitsCollection(ps.getParameter<std::string>("EEHitsCollection")),
20  ValidationCollection(ps.getParameter<std::string>("ValidationCollection")) {
21  EEHitsToken =
22  consumes<edm::PCaloHitContainer>(edm::InputTag(std::string(g4InfoLabel), std::string(EEHitsCollection)));
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 EEHitsCollection, EEHitsToken, eRLength, g4InfoLabel, edm::ParameterSet::getUntrackedParameter(), myEntries, AlCaHLTBitMon_QueryRunRegistry::string, ValidationCollection, ValidationCollectionToken, and verbose_.

Member Function Documentation

◆ analyze()

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

Analyze.

Reimplemented from DQMEDAnalyzer.

Definition at line 117 of file EcalEndcapSimHitsValidation.cc.

117  {
118  edm::LogInfo("EventInfo") << " Run = " << e.id().run() << " Event = " << e.id().event();
119 
121  e.getByToken(EEHitsToken, EcalHitsEE);
122 
123  // Do nothing if no EndCap data available
124  if (!EcalHitsEE.isValid())
125  return;
126 
127  edm::Handle<PEcalValidInfo> MyPEcalValidInfo;
128  e.getByToken(ValidationCollectionToken, MyPEcalValidInfo);
129 
130  std::vector<PCaloHit> theEECaloHits;
131  theEECaloHits.insert(theEECaloHits.end(), EcalHitsEE->begin(), EcalHitsEE->end());
132 
133  myEntries++;
134 
135  std::map<unsigned int, std::vector<PCaloHit *>, std::less<unsigned int>> CaloHitMap;
136 
137  double EEetzp_ = 0.;
138  double EEetzm_ = 0.;
139 
140  double ee1 = 0.0;
141  double ee4 = 0.0;
142  double ee9 = 0.0;
143  double ee16 = 0.0;
144  double ee25 = 0.0;
145  std::vector<double> econtr(140, 0.);
146  std::vector<double> econtr25(140, 0.);
147 
148  MapType eemap;
149  MapType eemapzp;
150  MapType eemapzm;
151  uint32_t nEEzpHits = 0;
152  uint32_t nEEzmHits = 0;
153 
154  for (std::vector<PCaloHit>::iterator isim = theEECaloHits.begin(); isim != theEECaloHits.end(); ++isim) {
155  if (isim->time() > 500.) {
156  continue;
157  }
158 
159  CaloHitMap[isim->id()].push_back(&(*isim));
160 
161  EEDetId eeid(isim->id());
162 
163  LogDebug("HitInfo") << " CaloHit " << isim->getName() << "\n"
164  << " DetID = " << isim->id() << " EEDetId = " << eeid.ix() << " " << eeid.iy() << "\n"
165  << " Time = " << isim->time() << "\n"
166  << " Track Id = " << isim->geantTrackId() << "\n"
167  << " Energy = " << isim->energy();
168 
169  uint32_t crystid = eeid.rawId();
170 
171  if (eeid.zside() > 0) {
172  nEEzpHits++;
173  EEetzp_ += isim->energy();
174  eemapzp[crystid] += isim->energy();
175  meEEzpOccupancy_->Fill(eeid.ix(), eeid.iy());
176  } else if (eeid.zside() < 0) {
177  nEEzmHits++;
178  EEetzm_ += isim->energy();
179  eemapzm[crystid] += isim->energy();
180  meEEzmOccupancy_->Fill(eeid.ix(), eeid.iy());
181  }
182 
183  meEEHitEnergy_->Fill(isim->energy());
184  if (isim->energy() > 0) {
185  meEEhitLog10Energy_->Fill(log10(isim->energy()));
186  int log10i = int((log10(isim->energy()) + 10.) * 10.);
187  if (log10i >= 0 && log10i < 140)
188  econtr[log10i] += isim->energy();
189  }
190  meEEHitEnergy2_->Fill(isim->energy());
191  eemap[crystid] += isim->energy();
192  }
193 
194  meEEzpCrystals_->Fill(eemapzp.size());
195  meEEzmCrystals_->Fill(eemapzm.size());
196 
197  for (std::map<uint32_t, float, std::less<uint32_t>>::iterator it = eemap.begin(); it != eemap.end(); ++it)
198  meEEcrystalEnergy_->Fill((*it).second);
199  for (std::map<uint32_t, float, std::less<uint32_t>>::iterator it = eemap.begin(); it != eemap.end(); ++it)
200  meEEcrystalEnergy2_->Fill((*it).second);
201 
202  meEEzpHits_->Fill(nEEzpHits);
203  meEEzmHits_->Fill(nEEzmHits);
204 
205  int nEEHits = nEEzmHits + nEEzpHits;
206  if (nEEHits > 0) {
207  uint32_t eecenterid = getUnitWithMaxEnergy(eemap);
208  EEDetId myEEid(eecenterid);
209  int bx = myEEid.ix();
210  int by = myEEid.iy();
211  int bz = myEEid.zside();
212  ee1 = energyInMatrixEE(1, 1, bx, by, bz, eemap);
213  meEEe1_->Fill(ee1);
214  ee9 = energyInMatrixEE(3, 3, bx, by, bz, eemap);
215  meEEe9_->Fill(ee9);
216  ee25 = energyInMatrixEE(5, 5, bx, by, bz, eemap);
217  meEEe25_->Fill(ee25);
218 
219  std::vector<uint32_t> ids25;
220  ids25 = getIdsAroundMax(5, 5, bx, by, bz, eemap);
221 
222  for (unsigned i = 0; i < 25; i++) {
223  for (unsigned int j = 0; j < CaloHitMap[ids25[i]].size(); j++) {
224  if (CaloHitMap[ids25[i]][j]->energy() > 0) {
225  int log10i = int((log10(CaloHitMap[ids25[i]][j]->energy()) + 10.) * 10.);
226  if (log10i >= 0 && log10i < 140)
227  econtr25[log10i] += CaloHitMap[ids25[i]][j]->energy();
228  }
229  }
230  }
231 
232  MapType neweemap;
233  if (fillEEMatrix(3, 3, bx, by, bz, neweemap, eemap)) {
234  ee4 = eCluster2x2(neweemap);
235  meEEe4_->Fill(ee4);
236  }
237  if (fillEEMatrix(5, 5, bx, by, bz, neweemap, eemap)) {
238  ee16 = eCluster4x4(ee9, neweemap);
239  meEEe16_->Fill(ee16);
240  }
241 
242  if (ee4 > 0.1)
243  meEEe1oe4_->Fill(ee1 / ee4);
244  if (ee9 > 0.1)
245  meEEe1oe9_->Fill(ee1 / ee9);
246  if (ee9 > 0.1)
247  meEEe4oe9_->Fill(ee4 / ee9);
248  if (ee16 > 0.1)
249  meEEe9oe16_->Fill(ee9 / ee16);
250  if (ee25 > 0.1)
251  meEEe16oe25_->Fill(ee16 / ee25);
252  if (ee25 > 0.1)
253  meEEe1oe25_->Fill(ee1 / ee25);
254  if (ee25 > 0.1)
255  meEEe9oe25_->Fill(ee9 / ee25);
256 
257  if ((EEetzp_ + EEetzm_) != 0) {
258  for (int i = 0; i < 140; i++) {
259  meEEhitLog10EnergyNorm_->Fill(-10. + (float(i) + 0.5) / 10., econtr[i] / (EEetzp_ + EEetzm_));
260  }
261  }
262 
263  if (ee25 != 0) {
264  for (int i = 0; i < 140; i++) {
265  meEEhitLog10Energy25Norm_->Fill(-10. + (float(i) + 0.5) / 10., econtr25[i] / ee25);
266  }
267  }
268  }
269 
270  if (MyPEcalValidInfo.isValid()) {
271  if (MyPEcalValidInfo->ee1x1() > 0.) {
272  std::vector<float> EX0 = MyPEcalValidInfo->eX0();
274  for (int myStep = 0; myStep < 26; myStep++) {
275  eRLength[myStep] += EX0[myStep];
276  meEELongitudinalShower_->Fill(float(myStep), eRLength[myStep] / myEntries);
277  }
278  }
279  }
280 }

References l1GtPatternGenerator_cfi::bx, MillePedeFileConverter_cfg::e, eCluster2x2(), eCluster4x4(), PEcalValidInfo::ee1x1(), EEHitsToken, HCALHighEnergyHPDFilter_cfi::energy, energyInMatrixEE(), eRLength, PEcalValidInfo::eX0(), dqm::impl::MonitorElement::Fill(), fillEEMatrix(), getIdsAroundMax(), getUnitWithMaxEnergy(), mps_fire::i, createfilelist::int, edm::HandleBase::isValid(), EEDetId::ix(), EEDetId::iy(), dqmiolumiharvest::j, LogDebug, genParticles_cff::map, meEEcrystalEnergy2_, meEEcrystalEnergy_, meEEe16_, meEEe16oe25_, meEEe1_, meEEe1oe25_, meEEe1oe4_, meEEe1oe9_, meEEe25_, meEEe4_, meEEe4oe9_, meEEe9_, meEEe9oe16_, meEEe9oe25_, meEEHitEnergy2_, meEEHitEnergy_, meEEhitLog10Energy25Norm_, meEEhitLog10Energy_, meEEhitLog10EnergyNorm_, meEELongitudinalShower_, meEEzmCrystals_, meEEzmHits_, meEEzmOccupancy_, meEEzpCrystals_, meEEzpHits_, meEEzpOccupancy_, myEntries, dqm::impl::MonitorElement::Reset(), ValidationCollectionToken, and EEDetId::zside().

◆ bookHistograms()

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

Implements DQMEDAnalyzer.

Definition at line 34 of file EcalEndcapSimHitsValidation.cc.

34  {
35  ib.setCurrentFolder("EcalHitsV/EcalSimHitsValidation");
36  ib.setScope(MonitorElementData::Scope::RUN);
37 
38  std::string histo = "EE+ hits multiplicity";
39  meEEzpHits_ = ib.book1D(histo, histo, 50, 0., 5000.);
40 
41  histo = "EE- hits multiplicity";
42  meEEzmHits_ = ib.book1D(histo, histo, 50, 0., 5000.);
43 
44  histo = "EE+ crystals multiplicity";
45  meEEzpCrystals_ = ib.book1D(histo, histo, 200, 0., 2000.);
46 
47  histo = "EE- crystals multiplicity";
48  meEEzmCrystals_ = ib.book1D(histo, histo, 200, 0., 2000.);
49 
50  histo = "EE+ occupancy";
51  meEEzpOccupancy_ = ib.book2D(histo, histo, 100, 0., 100., 100, 0., 100.);
52 
53  histo = "EE- occupancy";
54  meEEzmOccupancy_ = ib.book2D(histo, histo, 100, 0., 100., 100, 0., 100.);
55 
56  histo = "EE longitudinal shower profile";
57  meEELongitudinalShower_ = ib.bookProfile(histo, histo, 26, 0, 26, 100, 0, 20000);
58 
59  histo = "EE hits energy spectrum";
60  meEEHitEnergy_ = ib.book1D(histo, histo, 4000, 0., 400.);
61 
62  histo = "EE hits log10energy spectrum";
63  meEEhitLog10Energy_ = ib.book1D(histo, histo, 140, -10., 4.);
64 
65  histo = "EE hits log10energy spectrum vs normalized energy";
66  meEEhitLog10EnergyNorm_ = ib.bookProfile(histo, histo, 140, -10., 4., 100, 0., 1.);
67 
68  histo = "EE hits log10energy spectrum vs normalized energy25";
69  meEEhitLog10Energy25Norm_ = ib.bookProfile(histo, histo, 140, -10., 4., 100, 0., 1.);
70 
71  histo = "EE hits energy spectrum 2";
72  meEEHitEnergy2_ = ib.book1D(histo, histo, 1000, 0., 0.001);
73 
74  histo = "EE crystal energy spectrum";
75  meEEcrystalEnergy_ = ib.book1D(histo, histo, 5000, 0., 50.);
76 
77  histo = "EE crystal energy spectrum 2";
78  meEEcrystalEnergy2_ = ib.book1D(histo, histo, 1000, 0., 0.001);
79 
80  histo = "EE E1";
81  meEEe1_ = ib.book1D(histo, histo, 400, 0., 400.);
82 
83  histo = "EE E4";
84  meEEe4_ = ib.book1D(histo, histo, 400, 0., 400.);
85 
86  histo = "EE E9";
87  meEEe9_ = ib.book1D(histo, histo, 400, 0., 400.);
88 
89  histo = "EE E16";
90  meEEe16_ = ib.book1D(histo, histo, 400, 0., 400.);
91 
92  histo = "EE E25";
93  meEEe25_ = ib.book1D(histo, histo, 400, 0., 400.);
94 
95  histo = "EE E1oE4";
96  meEEe1oe4_ = ib.book1D(histo, histo, 100, 0.4, 1.1);
97 
98  histo = "EE E1oE9";
99  meEEe1oe9_ = ib.book1D(histo, histo, 100, 0.4, 1.1);
100 
101  histo = "EE E4oE9";
102  meEEe4oe9_ = ib.book1D(histo, histo, 100, 0.4, 1.1);
103 
104  histo = "EE E9oE16";
105  meEEe9oe16_ = ib.book1D(histo, histo, 100, 0.4, 1.1);
106 
107  histo = "EE E1oE25";
108  meEEe1oe25_ = ib.book1D(histo, histo, 100, 0.4, 1.1);
109 
110  histo = "EE E9oE25";
111  meEEe9oe25_ = ib.book1D(histo, histo, 100, 0.4, 1.1);
112 
113  histo = "EE E16oE25";
114  meEEe16oe25_ = ib.book1D(histo, histo, 100, 0.4, 1.1);
115 }

References timingPdfMaker::histo, cuy::ib, meEEcrystalEnergy2_, meEEcrystalEnergy_, meEEe16_, meEEe16oe25_, meEEe1_, meEEe1oe25_, meEEe1oe4_, meEEe1oe9_, meEEe25_, meEEe4_, meEEe4oe9_, meEEe9_, meEEe9oe16_, meEEe9oe25_, meEEHitEnergy2_, meEEHitEnergy_, meEEhitLog10Energy25Norm_, meEEhitLog10Energy_, meEEhitLog10EnergyNorm_, meEELongitudinalShower_, meEEzmCrystals_, meEEzmHits_, meEEzmOccupancy_, meEEzpCrystals_, meEEzpHits_, meEEzpOccupancy_, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ eCluster2x2()

float EcalEndcapSimHitsValidation::eCluster2x2 ( MapType themap)
private

Definition at line 369 of file EcalEndcapSimHitsValidation.cc.

369  {
370  float E22 = 0.;
371  float e012 = themap[0] + themap[1] + themap[2];
372  float e036 = themap[0] + themap[3] + themap[6];
373  float e678 = themap[6] + themap[7] + themap[8];
374  float e258 = themap[2] + themap[5] + themap[8];
375 
376  if ((e012 > e678 || e012 == e678) && (e036 > e258 || e036 == e258))
377  return E22 = themap[0] + themap[1] + themap[3] + themap[4];
378  else if ((e012 > e678 || e012 == e678) && (e036 < e258 || e036 == e258))
379  return E22 = themap[1] + themap[2] + themap[4] + themap[5];
380  else if ((e012 < e678 || e012 == e678) && (e036 > e258 || e036 == e258))
381  return E22 = themap[3] + themap[4] + themap[6] + themap[7];
382  else if ((e012 < e678 || e012 == e678) && (e036 < e258 || e036 == e258))
383  return E22 = themap[4] + themap[5] + themap[7] + themap[8];
384  else {
385  return E22;
386  }
387 }

Referenced by analyze().

◆ eCluster4x4()

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

Definition at line 389 of file EcalEndcapSimHitsValidation.cc.

389  {
390  float E44 = 0.;
391  float e0_4 = themap[0] + themap[1] + themap[2] + themap[3] + themap[4];
392  float e0_20 = themap[0] + themap[5] + themap[10] + themap[15] + themap[20];
393  float e4_24 = themap[4] + themap[9] + themap[14] + themap[19] + themap[24];
394  float e0_24 = themap[20] + themap[21] + themap[22] + themap[23] + themap[24];
395 
396  if ((e0_4 > e0_24 || e0_4 == e0_24) && (e0_20 > e4_24 || e0_20 == e4_24))
397  return E44 = e33 + themap[0] + themap[1] + themap[2] + themap[3] + themap[5] + themap[10] + themap[15];
398  else if ((e0_4 > e0_24 || e0_4 == e0_24) && (e0_20 < e4_24 || e0_20 == e4_24))
399  return E44 = e33 + themap[1] + themap[2] + themap[3] + themap[4] + themap[9] + themap[14] + themap[19];
400  else if ((e0_4 < e0_24 || e0_4 == e0_24) && (e0_20 > e4_24 || e0_20 == e4_24))
401  return E44 = e33 + themap[5] + themap[10] + themap[15] + themap[20] + themap[21] + themap[22] + themap[23];
402  else if ((e0_4 < e0_24 || e0_4 == e0_24) && (e0_20 < e4_24 || e0_20 == e4_24))
403  return E44 = e33 + themap[21] + themap[22] + themap[23] + themap[24] + themap[9] + themap[14] + themap[19];
404  else {
405  return E44;
406  }
407 }

Referenced by analyze().

◆ energyInMatrixEE()

float EcalEndcapSimHitsValidation::energyInMatrixEE ( int  nCellInX,
int  nCellInY,
int  centralX,
int  centralY,
int  centralZ,
MapType themap 
)
privatevirtual

Definition at line 282 of file EcalEndcapSimHitsValidation.cc.

283  {
284  int ncristals = 0;
285  float totalEnergy = 0.;
286 
287  int goBackInX = nCellInX / 2;
288  int goBackInY = nCellInY / 2;
289  int startX = centralX - goBackInX;
290  int startY = centralY - goBackInY;
291 
292  for (int ix = startX; ix < startX + nCellInX; ix++) {
293  for (int iy = startY; iy < startY + nCellInY; iy++) {
294  uint32_t index;
295 
296  if (EEDetId::validDetId(ix, iy, centralZ)) {
297  index = EEDetId(ix, iy, centralZ).rawId();
298  } else {
299  continue;
300  }
301 
302  totalEnergy += themap[index];
303  ncristals += 1;
304  }
305  }
306 
307  LogDebug("GeomInfo") << nCellInX << " x " << nCellInY << " EE matrix energy = " << totalEnergy << " for " << ncristals
308  << " crystals";
309  return totalEnergy;
310 }

References LogDebug, DetId::rawId(), and EEDetId::validDetId().

Referenced by analyze().

◆ fillEEMatrix()

bool EcalEndcapSimHitsValidation::fillEEMatrix ( int  nCellInX,
int  nCellInY,
int  CentralX,
int  CentralY,
int  CentralZ,
MapType fillmap,
MapType themap 
)
private

Definition at line 340 of file EcalEndcapSimHitsValidation.cc.

341  {
342  int goBackInX = nCellInX / 2;
343  int goBackInY = nCellInY / 2;
344 
345  int startX = CentralX - goBackInX;
346  int startY = CentralY - goBackInY;
347 
348  int i = 0;
349  for (int ix = startX; ix < startX + nCellInX; ix++) {
350  for (int iy = startY; iy < startY + nCellInY; iy++) {
351  uint32_t index;
352 
353  if (EEDetId::validDetId(ix, iy, CentralZ)) {
354  index = EEDetId(ix, iy, CentralZ).rawId();
355  } else {
356  continue;
357  }
358  fillmap[i++] = themap[index];
359  }
360  }
361  uint32_t centerid = getUnitWithMaxEnergy(themap);
362 
363  if (fillmap[i / 2] == themap[centerid])
364  return true;
365  else
366  return false;
367 }

References getUnitWithMaxEnergy(), mps_fire::i, DetId::rawId(), and EEDetId::validDetId().

Referenced by analyze().

◆ getIdsAroundMax()

std::vector< uint32_t > EcalEndcapSimHitsValidation::getIdsAroundMax ( int  nCellInX,
int  nCellInY,
int  centralX,
int  centralY,
int  centralZ,
MapType themap 
)
private

Definition at line 312 of file EcalEndcapSimHitsValidation.cc.

313  {
314  int ncristals = 0;
315  std::vector<uint32_t> ids(nCellInX * nCellInY);
316 
317  int goBackInX = nCellInX / 2;
318  int goBackInY = nCellInY / 2;
319  int startX = centralX - goBackInX;
320  int startY = centralY - goBackInY;
321 
322  for (int ix = startX; ix < startX + nCellInX; ix++) {
323  for (int iy = startY; iy < startY + nCellInY; iy++) {
324  uint32_t index;
325 
326  if (EEDetId::validDetId(ix, iy, centralZ)) {
327  index = EEDetId(ix, iy, centralZ).rawId();
328  } else {
329  continue;
330  }
331 
332  ids[ncristals] = index;
333  ncristals += 1;
334  }
335  }
336 
337  return ids;
338 }

References DetId::rawId(), and EEDetId::validDetId().

Referenced by analyze().

◆ getUnitWithMaxEnergy()

uint32_t EcalEndcapSimHitsValidation::getUnitWithMaxEnergy ( MapType themap)
private

Definition at line 409 of file EcalEndcapSimHitsValidation.cc.

409  {
410  // look for max
411  uint32_t unitWithMaxEnergy = 0;
412  float maxEnergy = 0.;
413 
414  MapType::iterator iter;
415  for (iter = themap.begin(); iter != themap.end(); iter++) {
416  if (maxEnergy < (*iter).second) {
417  maxEnergy = (*iter).second;
418  unitWithMaxEnergy = (*iter).first;
419  }
420  }
421 
422  LogDebug("GeomInfo") << " max energy of " << maxEnergy << " GeV in Unit id " << unitWithMaxEnergy;
423  return unitWithMaxEnergy;
424 }

References LogDebug, and particleFlowClusterECALTimeSelected_cfi::maxEnergy.

Referenced by analyze(), and fillEEMatrix().

Member Data Documentation

◆ EEHitsCollection

std::string EcalEndcapSimHitsValidation::EEHitsCollection
private

Definition at line 62 of file EcalEndcapSimHitsValidation.h.

Referenced by EcalEndcapSimHitsValidation().

◆ EEHitsToken

edm::EDGetTokenT<edm::PCaloHitContainer> EcalEndcapSimHitsValidation::EEHitsToken
private

Definition at line 65 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and EcalEndcapSimHitsValidation().

◆ eRLength

float EcalEndcapSimHitsValidation::eRLength[26]
private

Definition at line 71 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and EcalEndcapSimHitsValidation().

◆ g4InfoLabel

std::string EcalEndcapSimHitsValidation::g4InfoLabel
private

Definition at line 61 of file EcalEndcapSimHitsValidation.h.

Referenced by EcalEndcapSimHitsValidation().

◆ meEEcrystalEnergy2_

MonitorElement* EcalEndcapSimHitsValidation::meEEcrystalEnergy2_
private

Definition at line 95 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEEcrystalEnergy_

MonitorElement* EcalEndcapSimHitsValidation::meEEcrystalEnergy_
private

Definition at line 94 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEEe16_

MonitorElement* EcalEndcapSimHitsValidation::meEEe16_
private

Definition at line 100 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEEe16oe25_

MonitorElement* EcalEndcapSimHitsValidation::meEEe16oe25_
private

Definition at line 109 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEEe1_

MonitorElement* EcalEndcapSimHitsValidation::meEEe1_
private

Definition at line 97 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEEe1oe25_

MonitorElement* EcalEndcapSimHitsValidation::meEEe1oe25_
private

Definition at line 107 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEEe1oe4_

MonitorElement* EcalEndcapSimHitsValidation::meEEe1oe4_
private

Definition at line 103 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEEe1oe9_

MonitorElement* EcalEndcapSimHitsValidation::meEEe1oe9_
private

Definition at line 104 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEEe25_

MonitorElement* EcalEndcapSimHitsValidation::meEEe25_
private

Definition at line 101 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEEe4_

MonitorElement* EcalEndcapSimHitsValidation::meEEe4_
private

Definition at line 98 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEEe4oe9_

MonitorElement* EcalEndcapSimHitsValidation::meEEe4oe9_
private

Definition at line 105 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEEe9_

MonitorElement* EcalEndcapSimHitsValidation::meEEe9_
private

Definition at line 99 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEEe9oe16_

MonitorElement* EcalEndcapSimHitsValidation::meEEe9oe16_
private

Definition at line 106 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEEe9oe25_

MonitorElement* EcalEndcapSimHitsValidation::meEEe9oe25_
private

Definition at line 108 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEEHitEnergy2_

MonitorElement* EcalEndcapSimHitsValidation::meEEHitEnergy2_
private

Definition at line 92 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEEHitEnergy_

MonitorElement* EcalEndcapSimHitsValidation::meEEHitEnergy_
private

Definition at line 84 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEEhitLog10Energy25Norm_

MonitorElement* EcalEndcapSimHitsValidation::meEEhitLog10Energy25Norm_
private

Definition at line 90 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEEhitLog10Energy_

MonitorElement* EcalEndcapSimHitsValidation::meEEhitLog10Energy_
private

Definition at line 86 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEEhitLog10EnergyNorm_

MonitorElement* EcalEndcapSimHitsValidation::meEEhitLog10EnergyNorm_
private

Definition at line 88 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEELongitudinalShower_

MonitorElement* EcalEndcapSimHitsValidation::meEELongitudinalShower_
private

Definition at line 82 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEEzmCrystals_

MonitorElement* EcalEndcapSimHitsValidation::meEEzmCrystals_
private

Definition at line 77 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEEzmHits_

MonitorElement* EcalEndcapSimHitsValidation::meEEzmHits_
private

Definition at line 74 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEEzmOccupancy_

MonitorElement* EcalEndcapSimHitsValidation::meEEzmOccupancy_
private

Definition at line 80 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEEzpCrystals_

MonitorElement* EcalEndcapSimHitsValidation::meEEzpCrystals_
private

Definition at line 76 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEEzpHits_

MonitorElement* EcalEndcapSimHitsValidation::meEEzpHits_
private

Definition at line 73 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEEzpOccupancy_

MonitorElement* EcalEndcapSimHitsValidation::meEEzpOccupancy_
private

Definition at line 79 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ myEntries

int EcalEndcapSimHitsValidation::myEntries
private

Definition at line 70 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and EcalEndcapSimHitsValidation().

◆ ValidationCollection

std::string EcalEndcapSimHitsValidation::ValidationCollection
private

Definition at line 63 of file EcalEndcapSimHitsValidation.h.

Referenced by EcalEndcapSimHitsValidation().

◆ ValidationCollectionToken

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

Definition at line 66 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and EcalEndcapSimHitsValidation().

◆ verbose_

bool EcalEndcapSimHitsValidation::verbose_
private

Definition at line 68 of file EcalEndcapSimHitsValidation.h.

Referenced by EcalEndcapSimHitsValidation().

EcalEndcapSimHitsValidation::meEEe1oe9_
MonitorElement * meEEe1oe9_
Definition: EcalEndcapSimHitsValidation.h:104
mps_fire.i
i
Definition: mps_fire.py:428
EcalEndcapSimHitsValidation::meEEe9oe25_
MonitorElement * meEEe9oe25_
Definition: EcalEndcapSimHitsValidation.h:108
EcalEndcapSimHitsValidation::meEEhitLog10EnergyNorm_
MonitorElement * meEEhitLog10EnergyNorm_
Definition: EcalEndcapSimHitsValidation.h:88
EcalEndcapSimHitsValidation::meEEe1_
MonitorElement * meEEe1_
Definition: EcalEndcapSimHitsValidation.h:97
EcalEndcapSimHitsValidation::meEEe1oe25_
MonitorElement * meEEe1oe25_
Definition: EcalEndcapSimHitsValidation.h:107
EcalEndcapSimHitsValidation::MapType
std::map< uint32_t, float, std::less< uint32_t > > MapType
Definition: EcalEndcapSimHitsValidation.h:35
EcalEndcapSimHitsValidation::eRLength
float eRLength[26]
Definition: EcalEndcapSimHitsValidation.h:71
EcalEndcapSimHitsValidation::fillEEMatrix
bool fillEEMatrix(int nCellInX, int nCellInY, int CentralX, int CentralY, int CentralZ, MapType &fillmap, MapType &themap)
Definition: EcalEndcapSimHitsValidation.cc:340
EcalEndcapSimHitsValidation::meEEe4_
MonitorElement * meEEe4_
Definition: EcalEndcapSimHitsValidation.h:98
EcalEndcapSimHitsValidation::meEEcrystalEnergy_
MonitorElement * meEEcrystalEnergy_
Definition: EcalEndcapSimHitsValidation.h:94
EcalEndcapSimHitsValidation::meEEe1oe4_
MonitorElement * meEEe1oe4_
Definition: EcalEndcapSimHitsValidation.h:103
EcalEndcapSimHitsValidation::meEEzmOccupancy_
MonitorElement * meEEzmOccupancy_
Definition: EcalEndcapSimHitsValidation.h:80
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
timingPdfMaker.histo
histo
Definition: timingPdfMaker.py:279
EcalEndcapSimHitsValidation::meEELongitudinalShower_
MonitorElement * meEELongitudinalShower_
Definition: EcalEndcapSimHitsValidation.h:82
EcalEndcapSimHitsValidation::ValidationCollection
std::string ValidationCollection
Definition: EcalEndcapSimHitsValidation.h:63
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
EcalEndcapSimHitsValidation::meEEzpCrystals_
MonitorElement * meEEzpCrystals_
Definition: EcalEndcapSimHitsValidation.h:76
edm::Handle
Definition: AssociativeIterator.h:50
EcalEndcapSimHitsValidation::getIdsAroundMax
std::vector< uint32_t > getIdsAroundMax(int nCellInX, int nCellInY, int centralX, int centralY, int centralZ, MapType &themap)
Definition: EcalEndcapSimHitsValidation.cc:312
EcalEndcapSimHitsValidation::meEEzmHits_
MonitorElement * meEEzmHits_
Definition: EcalEndcapSimHitsValidation.h:74
EcalEndcapSimHitsValidation::meEEzpOccupancy_
MonitorElement * meEEzpOccupancy_
Definition: EcalEndcapSimHitsValidation.h:79
EcalEndcapSimHitsValidation::energyInMatrixEE
virtual float energyInMatrixEE(int nCellInX, int nCellInY, int centralX, int centralY, int centralZ, MapType &themap)
Definition: EcalEndcapSimHitsValidation.cc:282
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
EcalEndcapSimHitsValidation::meEEzmCrystals_
MonitorElement * meEEzmCrystals_
Definition: EcalEndcapSimHitsValidation.h:77
EcalEndcapSimHitsValidation::verbose_
bool verbose_
Definition: EcalEndcapSimHitsValidation.h:68
EcalEndcapSimHitsValidation::myEntries
int myEntries
Definition: EcalEndcapSimHitsValidation.h:70
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
EcalEndcapSimHitsValidation::meEEe25_
MonitorElement * meEEe25_
Definition: EcalEndcapSimHitsValidation.h:101
EcalEndcapSimHitsValidation::meEEe4oe9_
MonitorElement * meEEe4oe9_
Definition: EcalEndcapSimHitsValidation.h:105
EcalEndcapSimHitsValidation::eCluster2x2
float eCluster2x2(MapType &themap)
Definition: EcalEndcapSimHitsValidation.cc:369
EEDetId
Definition: EEDetId.h:14
EcalEndcapSimHitsValidation::meEEHitEnergy_
MonitorElement * meEEHitEnergy_
Definition: EcalEndcapSimHitsValidation.h:84
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
EcalEndcapSimHitsValidation::meEEe16_
MonitorElement * meEEe16_
Definition: EcalEndcapSimHitsValidation.h:100
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
EcalEndcapSimHitsValidation::meEEzpHits_
MonitorElement * meEEzpHits_
Definition: EcalEndcapSimHitsValidation.h:73
EcalEndcapSimHitsValidation::meEEHitEnergy2_
MonitorElement * meEEHitEnergy2_
Definition: EcalEndcapSimHitsValidation.h:92
createfilelist.int
int
Definition: createfilelist.py:10
cuy.ib
ib
Definition: cuy.py:662
particleFlowClusterECALTimeSelected_cfi.maxEnergy
maxEnergy
Definition: particleFlowClusterECALTimeSelected_cfi.py:10
PEcalValidInfo::eX0
FloatVector eX0() const
Definition: PValidationFormats.h:1134
EcalEndcapSimHitsValidation::ValidationCollectionToken
edm::EDGetTokenT< PEcalValidInfo > ValidationCollectionToken
Definition: EcalEndcapSimHitsValidation.h:66
EcalEndcapSimHitsValidation::getUnitWithMaxEnergy
uint32_t getUnitWithMaxEnergy(MapType &themap)
Definition: EcalEndcapSimHitsValidation.cc:409
EcalEndcapSimHitsValidation::meEEcrystalEnergy2_
MonitorElement * meEEcrystalEnergy2_
Definition: EcalEndcapSimHitsValidation.h:95
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
EcalEndcapSimHitsValidation::eCluster4x4
float eCluster4x4(float e33, MapType &themap)
Definition: EcalEndcapSimHitsValidation.cc:389
EcalEndcapSimHitsValidation::meEEhitLog10Energy_
MonitorElement * meEEhitLog10Energy_
Definition: EcalEndcapSimHitsValidation.h:86
EcalEndcapSimHitsValidation::EEHitsToken
edm::EDGetTokenT< edm::PCaloHitContainer > EEHitsToken
Definition: EcalEndcapSimHitsValidation.h:65
EcalEndcapSimHitsValidation::g4InfoLabel
std::string g4InfoLabel
Definition: EcalEndcapSimHitsValidation.h:61
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
EEDetId::validDetId
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
EcalEndcapSimHitsValidation::EEHitsCollection
std::string EEHitsCollection
Definition: EcalEndcapSimHitsValidation.h:62
genParticles_cff.map
map
Definition: genParticles_cff.py:11
EcalEndcapSimHitsValidation::meEEe9_
MonitorElement * meEEe9_
Definition: EcalEndcapSimHitsValidation.h:99
PEcalValidInfo::ee1x1
float ee1x1() const
Definition: PValidationFormats.h:1095
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
EcalEndcapSimHitsValidation::meEEe16oe25_
MonitorElement * meEEe16oe25_
Definition: EcalEndcapSimHitsValidation.h:109
edm::InputTag
Definition: InputTag.h:15
EcalEndcapSimHitsValidation::meEEe9oe16_
MonitorElement * meEEe9oe16_
Definition: EcalEndcapSimHitsValidation.h:106
EcalEndcapSimHitsValidation::meEEhitLog10Energy25Norm_
MonitorElement * meEEhitLog10Energy25Norm_
Definition: EcalEndcapSimHitsValidation.h:90
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37