CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

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::PCaloHitContainer
EEHitsToken
 
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 >
using CacheTypes = CacheContexts< T...>
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T...>
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::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
< DQMEDAnalyzerGlobalCache
initializeGlobalCache (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

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 ( const edm::ParameterSet ps)

Constructor.

Definition at line 17 of file EcalEndcapSimHitsValidation.cc.

References EEHitsCollection, EEHitsToken, eRLength, g4InfoLabel, edm::ParameterSet::getUntrackedParameter(), HLT_FULL_cff::InputTag, myEntries, AlCaHLTBitMon_QueryRunRegistry::string, ValidationCollection, ValidationCollectionToken, and verbose_.

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 }
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< PEcalValidInfo > ValidationCollectionToken
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< edm::PCaloHitContainer > EEHitsToken

Member Function Documentation

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

Analyze.

Reimplemented from DQMEDAnalyzer.

Definition at line 117 of file EcalEndcapSimHitsValidation.cc.

References makePileupJSON::bx, eCluster2x2(), eCluster4x4(), EEHitsToken, relval_parameters_module::energy, energyInMatrixEE(), eRLength, edm::EventID::event(), dqm::impl::MonitorElement::Fill(), fillEEMatrix(), edm::Event::getByToken(), getIdsAroundMax(), getUnitWithMaxEnergy(), mps_fire::i, edm::EventBase::id(), edm::HandleBase::isValid(), EEDetId::ix(), EEDetId::iy(), dqmiolumiharvest::j, LogDebug, 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(), edm::EventID::run(), ValidationCollectionToken, and EEDetId::zside().

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 }
RunNumber_t run() const
Definition: EventID.h:38
EventNumber_t event() const
Definition: EventID.h:40
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
edm::EDGetTokenT< PEcalValidInfo > ValidationCollectionToken
virtual float energyInMatrixEE(int nCellInX, int nCellInY, int centralX, int centralY, int centralZ, MapType &themap)
std::map< uint32_t, float, std::less< uint32_t > > MapType
void Fill(long long x)
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
float eCluster4x4(float e33, MapType &themap)
bool isValid() const
Definition: HandleBase.h:70
bool fillEEMatrix(int nCellInX, int nCellInY, int CentralX, int CentralY, int CentralZ, MapType &fillmap, MapType &themap)
Log< level::Info, false > LogInfo
edm::EDGetTokenT< edm::PCaloHitContainer > EEHitsToken
edm::EventID id() const
Definition: EventBase.h:59
uint32_t getUnitWithMaxEnergy(MapType &themap)
std::vector< uint32_t > getIdsAroundMax(int nCellInX, int nCellInY, int centralX, int centralY, int centralZ, MapType &themap)
#define LogDebug(id)
void EcalEndcapSimHitsValidation::bookHistograms ( DQMStore::IBooker ib,
edm::Run const &  ,
edm::EventSetup const &  c 
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 34 of file EcalEndcapSimHitsValidation.cc.

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), dqm::implementation::IBooker::bookProfile(), timingPdfMaker::histo, 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_, dqm::implementation::NavigatorBase::setCurrentFolder(), dqm::implementation::IBooker::setScope(), and AlCaHLTBitMon_QueryRunRegistry::string.

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 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
virtual MonitorElementData::Scope setScope(MonitorElementData::Scope newscope)
Definition: DQMStore.cc:46
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
Definition: DQMStore.h:322
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:177
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
float EcalEndcapSimHitsValidation::eCluster2x2 ( MapType themap)
private

Definition at line 369 of file EcalEndcapSimHitsValidation.cc.

Referenced by analyze().

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  E22 = themap[0] + themap[1] + themap[3] + themap[4];
378  else if ((e012 > e678 || e012 == e678) && (e036 < e258 || e036 == e258))
379  E22 = themap[1] + themap[2] + themap[4] + themap[5];
380  else if ((e012 < e678 || e012 == e678) && (e036 > e258 || e036 == e258))
381  E22 = themap[3] + themap[4] + themap[6] + themap[7];
382  else if ((e012 < e678 || e012 == e678) && (e036 < e258 || e036 == e258))
383  E22 = themap[4] + themap[5] + themap[7] + themap[8];
384 
385  return E22;
386 }
float EcalEndcapSimHitsValidation::eCluster4x4 ( float  e33,
MapType themap 
)
private

Definition at line 388 of file EcalEndcapSimHitsValidation.cc.

Referenced by analyze().

388  {
389  float E44 = 0.;
390  float e0_4 = themap[0] + themap[1] + themap[2] + themap[3] + themap[4];
391  float e0_20 = themap[0] + themap[5] + themap[10] + themap[15] + themap[20];
392  float e4_24 = themap[4] + themap[9] + themap[14] + themap[19] + themap[24];
393  float e0_24 = themap[20] + themap[21] + themap[22] + themap[23] + themap[24];
394 
395  if ((e0_4 > e0_24 || e0_4 == e0_24) && (e0_20 > e4_24 || e0_20 == e4_24))
396  E44 = e33 + themap[0] + themap[1] + themap[2] + themap[3] + themap[5] + themap[10] + themap[15];
397  else if ((e0_4 > e0_24 || e0_4 == e0_24) && (e0_20 < e4_24 || e0_20 == e4_24))
398  E44 = e33 + themap[1] + themap[2] + themap[3] + themap[4] + themap[9] + themap[14] + themap[19];
399  else if ((e0_4 < e0_24 || e0_4 == e0_24) && (e0_20 > e4_24 || e0_20 == e4_24))
400  E44 = e33 + themap[5] + themap[10] + themap[15] + themap[20] + themap[21] + themap[22] + themap[23];
401  else if ((e0_4 < e0_24 || e0_4 == e0_24) && (e0_20 < e4_24 || e0_20 == e4_24))
402  E44 = e33 + themap[21] + themap[22] + themap[23] + themap[24] + themap[9] + themap[14] + themap[19];
403 
404  return E44;
405 }
float EcalEndcapSimHitsValidation::energyInMatrixEE ( int  nCellInX,
int  nCellInY,
int  centralX,
int  centralY,
int  centralZ,
MapType themap 
)
privatevirtual

Definition at line 282 of file EcalEndcapSimHitsValidation.cc.

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

Referenced by analyze().

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 }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
#define LogDebug(id)
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.

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

Referenced by analyze().

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 }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
uint32_t getUnitWithMaxEnergy(MapType &themap)
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.

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

Referenced by analyze().

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 }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
uint32_t EcalEndcapSimHitsValidation::getUnitWithMaxEnergy ( MapType themap)
private

Definition at line 407 of file EcalEndcapSimHitsValidation.cc.

References LogDebug.

Referenced by analyze(), and fillEEMatrix().

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

Member Data Documentation

std::string EcalEndcapSimHitsValidation::EEHitsCollection
private

Definition at line 62 of file EcalEndcapSimHitsValidation.h.

Referenced by EcalEndcapSimHitsValidation().

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

Definition at line 65 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and EcalEndcapSimHitsValidation().

float EcalEndcapSimHitsValidation::eRLength[26]
private

Definition at line 71 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and EcalEndcapSimHitsValidation().

std::string EcalEndcapSimHitsValidation::g4InfoLabel
private

Definition at line 61 of file EcalEndcapSimHitsValidation.h.

Referenced by EcalEndcapSimHitsValidation().

MonitorElement* EcalEndcapSimHitsValidation::meEEcrystalEnergy2_
private

Definition at line 95 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EcalEndcapSimHitsValidation::meEEcrystalEnergy_
private

Definition at line 94 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EcalEndcapSimHitsValidation::meEEe16_
private

Definition at line 100 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EcalEndcapSimHitsValidation::meEEe16oe25_
private

Definition at line 109 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EcalEndcapSimHitsValidation::meEEe1_
private

Definition at line 97 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EcalEndcapSimHitsValidation::meEEe1oe25_
private

Definition at line 107 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EcalEndcapSimHitsValidation::meEEe1oe4_
private

Definition at line 103 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EcalEndcapSimHitsValidation::meEEe1oe9_
private

Definition at line 104 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EcalEndcapSimHitsValidation::meEEe25_
private

Definition at line 101 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EcalEndcapSimHitsValidation::meEEe4_
private

Definition at line 98 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EcalEndcapSimHitsValidation::meEEe4oe9_
private

Definition at line 105 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EcalEndcapSimHitsValidation::meEEe9_
private

Definition at line 99 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EcalEndcapSimHitsValidation::meEEe9oe16_
private

Definition at line 106 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EcalEndcapSimHitsValidation::meEEe9oe25_
private

Definition at line 108 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EcalEndcapSimHitsValidation::meEEHitEnergy2_
private

Definition at line 92 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EcalEndcapSimHitsValidation::meEEHitEnergy_
private

Definition at line 84 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EcalEndcapSimHitsValidation::meEEhitLog10Energy25Norm_
private

Definition at line 90 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EcalEndcapSimHitsValidation::meEEhitLog10Energy_
private

Definition at line 86 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EcalEndcapSimHitsValidation::meEEhitLog10EnergyNorm_
private

Definition at line 88 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EcalEndcapSimHitsValidation::meEELongitudinalShower_
private

Definition at line 82 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EcalEndcapSimHitsValidation::meEEzmCrystals_
private

Definition at line 77 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EcalEndcapSimHitsValidation::meEEzmHits_
private

Definition at line 74 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EcalEndcapSimHitsValidation::meEEzmOccupancy_
private

Definition at line 80 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EcalEndcapSimHitsValidation::meEEzpCrystals_
private

Definition at line 76 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EcalEndcapSimHitsValidation::meEEzpHits_
private

Definition at line 73 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EcalEndcapSimHitsValidation::meEEzpOccupancy_
private

Definition at line 79 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and bookHistograms().

int EcalEndcapSimHitsValidation::myEntries
private

Definition at line 70 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and EcalEndcapSimHitsValidation().

std::string EcalEndcapSimHitsValidation::ValidationCollection
private

Definition at line 63 of file EcalEndcapSimHitsValidation.h.

Referenced by EcalEndcapSimHitsValidation().

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

Definition at line 66 of file EcalEndcapSimHitsValidation.h.

Referenced by analyze(), and EcalEndcapSimHitsValidation().

bool EcalEndcapSimHitsValidation::verbose_
private

Definition at line 68 of file EcalEndcapSimHitsValidation.h.

Referenced by EcalEndcapSimHitsValidation().