CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
SimHitsValidationHcal Class Reference

#include <SimHitsValidationHcal.h>

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

Classes

struct  energysum
 
struct  etaRange
 
struct  idType
 

Public Member Functions

 SimHitsValidationHcal (const edm::ParameterSet &ps)
 
 ~SimHitsValidationHcal () override=default
 
- 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
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- 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 Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c) override
 
void analyzeHits (std::vector< PCaloHit > &)
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 

Private Member Functions

std::vector< std::pair< std::string, std::string > > getHistogramTypes ()
 
etaRange getLimits (idType)
 
std::pair< int, int > histId (int subdet, int eta, int depth, unsigned int dep)
 

Private Attributes

const std::string g4Label_
 
const std::string hcalHits_
 
const HcalDDDRecConstantshcons
 
bool initialized
 
int maxDepthHB_
 
int maxDepthHE_
 
int maxDepthHF_
 
int maxDepthHO_
 
MonitorElementmeEnergy_HB
 
MonitorElementmeEnergy_HE
 
MonitorElementmeEnergy_HF
 
MonitorElementmeEnergy_HO
 
std::vector< MonitorElement * > meHcalEnergyl100_
 
std::vector< MonitorElement * > meHcalEnergyl250_
 
std::vector< MonitorElement * > meHcalEnergyl25_
 
std::vector< MonitorElement * > meHcalEnergyl50_
 
std::vector< MonitorElement * > meHcalHitEta_
 
std::vector< MonitorElement * > meHcalHitTimeEta_
 
MonitorElementmetime_enweighted_HB
 
MonitorElementmetime_enweighted_HE
 
MonitorElementmetime_enweighted_HF
 
MonitorElementmetime_enweighted_HO
 
MonitorElementmetime_HB
 
MonitorElementmetime_HE
 
MonitorElementmetime_HF
 
MonitorElementmetime_HO
 
const bool testNumber_
 
const edm::EDGetTokenT< edm::PCaloHitContainertok_hits_
 
const edm::ESGetToken< HcalDDDRecConstants, HcalRecNumberingRecordtok_HRNDC_
 
std::vector< idTypetypes
 
const 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
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Definition at line 29 of file SimHitsValidationHcal.h.

Constructor & Destructor Documentation

◆ SimHitsValidationHcal()

SimHitsValidationHcal::SimHitsValidationHcal ( const edm::ParameterSet ps)

Definition at line 7 of file SimHitsValidationHcal.cc.

References g4Label_, hcalHits_, and testNumber_.

8  : g4Label_(ps.getParameter<std::string>("ModuleLabel")),
9  hcalHits_(ps.getParameter<std::string>("HitCollection")),
10  verbose_(ps.getParameter<bool>("Verbose")),
11  testNumber_(ps.getParameter<bool>("TestNumber")),
12  tok_hits_(consumes<edm::PCaloHitContainer>(edm::InputTag(g4Label_, hcalHits_))),
13  tok_HRNDC_(esConsumes<HcalDDDRecConstants, HcalRecNumberingRecord, edm::Transition::BeginRun>()) {
14  edm::LogVerbatim("HitsValidationHcal") << "Module Label: " << g4Label_ << " Hits: " << hcalHits_
15  << " TestNumbering " << testNumber_;
16 }
Log< level::Info, true > LogVerbatim
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
const std::string hcalHits_
const edm::ESGetToken< HcalDDDRecConstants, HcalRecNumberingRecord > tok_HRNDC_
const edm::EDGetTokenT< edm::PCaloHitContainer > tok_hits_
const std::string g4Label_

◆ ~SimHitsValidationHcal()

SimHitsValidationHcal::~SimHitsValidationHcal ( )
overridedefault

Member Function Documentation

◆ analyze()

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

Reimplemented from DQMEDAnalyzer.

Definition at line 145 of file SimHitsValidationHcal.cc.

References analyzeHits(), MillePedeFileConverter_cfg::e, hcons, mps_fire::i, edm::HandleBase::isValid(), DetId::rawId(), HcalHitRelabeller::relabel(), testNumber_, and tok_hits_.

145  {
146 #ifdef EDM_ML_DEBUG
147  edm::LogVerbatim("HitsValidationHcal") << "Run = " << e.id().run() << " Event = " << e.id().event();
148 #endif
149 
150  bool getHits = false;
151  const edm::Handle<edm::PCaloHitContainer> &hitsHcal = e.getHandle(tok_hits_);
152  if (hitsHcal.isValid())
153  getHits = true;
154 #ifdef EDM_ML_DEBUG
155  edm::LogVerbatim("HitsValidationHcal") << "HitsValidationHcal.: Input flags Hits " << getHits;
156 #endif
157  if (getHits) {
158  std::vector<PCaloHit> caloHits;
159  caloHits.insert(caloHits.end(), hitsHcal->begin(), hitsHcal->end());
160 #ifdef EDM_ML_DEBUG
161  edm::LogVerbatim("HitsValidationHcal") << "testNumber_:" << testNumber_;
162 #endif
163  if (testNumber_) {
164  for (unsigned int i = 0; i < caloHits.size(); ++i) {
165  unsigned int id_ = caloHits[i].id();
167  caloHits[i].setID(hid.rawId());
168 #ifdef EDM_ML_DEBUG
169  edm::LogVerbatim("HitsValidationHcal") << "Hit[" << i << "] " << hid;
170 #endif
171  }
172  }
173 #ifdef EDM_ML_DEBUG
174  edm::LogVerbatim("HitsValidationHcal") << "HitsValidationHcal: Hit buffer " << caloHits.size();
175 #endif
176  analyzeHits(caloHits);
177  }
178 }
Log< level::Info, true > LogVerbatim
const HcalDDDRecConstants * hcons
DetId relabel(const uint32_t testId) const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
bool isValid() const
Definition: HandleBase.h:70
const edm::EDGetTokenT< edm::PCaloHitContainer > tok_hits_
void analyzeHits(std::vector< PCaloHit > &)

◆ analyzeHits()

void SimHitsValidationHcal::analyzeHits ( std::vector< PCaloHit > &  hits)
protected

Definition at line 180 of file SimHitsValidationHcal.cc.

References TauDecayModes::dec, hcalRecHitTable_cff::depth, SimHitsValidationHcal::energysum::e100, SimHitsValidationHcal::energysum::e25, SimHitsValidationHcal::energysum::e250, SimHitsValidationHcal::energysum::e50, hcalRecHitTable_cff::energy, PVValHelper::eta, dqm::impl::MonitorElement::Fill(), HcalBarrel, HcalEndcap, HcalForward, HcalOuter, histId(), hfClusterShapes_cfi::hits, mps_fire::i, hcalRecHitTable_cff::ieta, createfilelist::int, meEnergy_HB, meEnergy_HE, meEnergy_HF, meEnergy_HO, meHcalEnergyl100_, meHcalEnergyl250_, meHcalEnergyl25_, meHcalEnergyl50_, meHcalHitEta_, meHcalHitTimeEta_, metime_enweighted_HB, metime_enweighted_HE, metime_enweighted_HF, metime_enweighted_HO, metime_HB, metime_HE, metime_HF, metime_HO, phi, hcalRecHitTable_cff::time, and types.

Referenced by analyze().

180  {
181  int nHit = hits.size();
182  double entotHB = 0, entotHE = 0, entotHF = 0, entotHO = 0;
183  double timetotHB = 0, timetotHE = 0, timetotHF = 0, timetotHO = 0;
184 
185  std::map<std::pair<HcalDetId, unsigned int>, energysum> map_try;
186  map_try.clear();
187  std::map<std::pair<HcalDetId, unsigned int>, energysum>::iterator itr;
188 
189  for (int i = 0; i < nHit; i++) {
190  double energy = hits[i].energy();
191  double time = hits[i].time();
192  HcalDetId id = HcalDetId(hits[i].id());
193  int itime = (int)(time);
194  int subdet = id.subdet();
195  int depth = id.depth();
196  int eta = id.ieta();
197  unsigned int dep = hits[i].depth();
198 
199  std::pair<int, int> types = histId(subdet, eta, depth, dep);
200  if (subdet == static_cast<int>(HcalBarrel)) {
201  entotHB += energy;
202  timetotHB += time;
203  } else if (subdet == static_cast<int>(HcalEndcap)) {
204  entotHE += energy;
205  timetotHE += time;
206  } else if (subdet == static_cast<int>(HcalOuter)) {
207  entotHO += energy;
208  timetotHO += time;
209  } else if (subdet == static_cast<int>(HcalForward)) {
210  entotHF += energy;
211  timetotHF += time;
212  }
213 
214  std::pair<HcalDetId, unsigned int> id0(id, dep);
215  energysum ensum;
216  if (map_try.count(id0) != 0)
217  ensum = map_try[id0];
218  if (itime < 250) {
219  ensum.e250 += energy;
220  if (itime < 100) {
221  ensum.e100 += energy;
222  if (itime < 50) {
223  ensum.e50 += energy;
224  if (itime < 25)
225  ensum.e25 += energy;
226  }
227  }
228  }
229  map_try[id0] = ensum;
230 
231 #ifdef EDM_ML_DEBUG
232  edm::LogVerbatim("HitsValidationHcal")
233  << "Hit[" << i << "] ID " << std::dec << " " << id << std::dec << " Det " << id.det() << " Sub " << subdet
234  << " depth " << depth << " depthX " << dep << " Eta " << eta << " Phi " << id.iphi() << " E " << energy
235  << " time " << time << " type " << types.first << " " << types.second;
236 #endif
237 
238  double etax = eta - 0.5;
239  if (eta < 0)
240  etax += 1;
241  if (types.first >= 0) {
242  meHcalHitEta_[types.first]->Fill(etax, energy);
243  meHcalHitTimeEta_[types.first]->Fill(etax, time);
244  }
245  if (types.second >= 0) {
246  meHcalHitEta_[types.second]->Fill(etax, energy);
247  meHcalHitTimeEta_[types.second]->Fill(etax, time);
248  }
249  }
250 
251  meEnergy_HB->Fill(entotHB);
252  meEnergy_HE->Fill(entotHE);
253  meEnergy_HF->Fill(entotHF);
254  meEnergy_HO->Fill(entotHO);
255 
256  metime_HB->Fill(timetotHB);
257  metime_HE->Fill(timetotHE);
258  metime_HF->Fill(timetotHF);
259  metime_HO->Fill(timetotHO);
260 
261  metime_enweighted_HB->Fill(timetotHB, entotHB);
262  metime_enweighted_HE->Fill(timetotHE, entotHE);
263  metime_enweighted_HF->Fill(timetotHF, entotHF);
264  metime_enweighted_HO->Fill(timetotHO, entotHO);
265 
266  for (itr = map_try.begin(); itr != map_try.end(); ++itr) {
267  HcalDetId id = (*itr).first.first;
268  energysum ensum = (*itr).second;
269  std::pair<int, int> types = histId((int)(id.subdet()), id.ieta(), id.depth(), (*itr).first.second);
270  int eta = id.ieta();
271  int phi = id.iphi();
272  double etax = eta - 0.5;
273  double phix = phi - 0.5;
274  if (types.first >= 0) {
275  meHcalEnergyl25_[types.first]->Fill(etax, phix, ensum.e25);
276  meHcalEnergyl50_[types.first]->Fill(etax, phix, ensum.e50);
277  meHcalEnergyl100_[types.first]->Fill(etax, phix, ensum.e100);
278  meHcalEnergyl250_[types.first]->Fill(etax, phix, ensum.e250);
279  }
280  if (types.second >= 0) {
281  meHcalEnergyl25_[types.second]->Fill(etax, phix, ensum.e25);
282  meHcalEnergyl50_[types.second]->Fill(etax, phix, ensum.e50);
283  meHcalEnergyl100_[types.second]->Fill(etax, phix, ensum.e100);
284  meHcalEnergyl250_[types.second]->Fill(etax, phix, ensum.e250);
285  }
286 
287 #ifdef EDM_ML_DEBUG
288  edm::LogVerbatim("HitsValidationHcal")
289  << " energy of tower =" << (*itr).first.first << " in time 25ns is == " << (*itr).second.e25
290  << " in time 25-50ns == " << (*itr).second.e50 << " in time 50-100ns == " << (*itr).second.e100
291  << " in time 100-250 ns == " << (*itr).second.e250;
292 #endif
293  }
294 }
Log< level::Info, true > LogVerbatim
MonitorElement * meEnergy_HF
MonitorElement * metime_enweighted_HO
MonitorElement * metime_enweighted_HB
void Fill(long long x)
std::vector< MonitorElement * > meHcalEnergyl25_
MonitorElement * meEnergy_HB
std::vector< MonitorElement * > meHcalEnergyl100_
std::vector< idType > types
MonitorElement * metime_enweighted_HF
MonitorElement * metime_enweighted_HE
std::vector< MonitorElement * > meHcalEnergyl250_
std::vector< MonitorElement * > meHcalHitEta_
MonitorElement * meEnergy_HE
std::vector< MonitorElement * > meHcalEnergyl50_
std::vector< MonitorElement * > meHcalHitTimeEta_
std::pair< int, int > histId(int subdet, int eta, int depth, unsigned int dep)
MonitorElement * meEnergy_HO

◆ bookHistograms()

void SimHitsValidationHcal::bookHistograms ( DQMStore::IBooker ib,
edm::Run const &  run,
edm::EventSetup const &  es 
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 18 of file SimHitsValidationHcal.cc.

References edm::EventSetup::getData(), HcalDDDRecConstants::getEtaRange(), getHistogramTypes(), getLimits(), HcalDDDRecConstants::getMaxDepth(), HcalDDDRecConstants::getNPhi(), hcons, mps_fire::i, cuy::ib, hcalTTPDigis_cfi::iEtaMax, createfilelist::int, remoteMonitoring_LASER_era2018_cfg::limit, SiStripPI::max, maxDepthHB_, maxDepthHE_, maxDepthHF_, maxDepthHO_, meEnergy_HB, meEnergy_HE, meEnergy_HF, meEnergy_HO, meHcalEnergyl100_, meHcalEnergyl250_, meHcalEnergyl25_, meHcalEnergyl50_, meHcalHitEta_, meHcalHitTimeEta_, metime_enweighted_HB, metime_enweighted_HE, metime_enweighted_HF, metime_enweighted_HO, metime_HB, metime_HE, metime_HF, metime_HO, Skims_PA_cff::name, AlCaHLTBitMon_QueryRunRegistry::string, runGCPTkAlMap::title, tok_HRNDC_, and types.

18  {
19  const auto &pHRNDC = es.getData(tok_HRNDC_);
20  hcons = &pHRNDC;
25 
26  // Get Phi segmentation from geometry, use the max phi number so that all iphi
27  // values are included.
28 
29  int NphiMax = hcons->getNPhi(0);
30 
31  NphiMax = (hcons->getNPhi(1) > NphiMax ? hcons->getNPhi(1) : NphiMax);
32  NphiMax = (hcons->getNPhi(2) > NphiMax ? hcons->getNPhi(2) : NphiMax);
33  NphiMax = (hcons->getNPhi(3) > NphiMax ? hcons->getNPhi(3) : NphiMax);
34 
35  // Center the iphi bins on the integers
36  float iphi_min = 0.5;
37  float iphi_max = NphiMax + 0.5;
38  int iphi_bins = (int)(iphi_max - iphi_min);
39 
40  int iEtaHBMax = hcons->getEtaRange(0).second;
41  int iEtaHEMax = std::max(hcons->getEtaRange(1).second, 1);
42  int iEtaHFMax = hcons->getEtaRange(2).second;
43  int iEtaHOMax = hcons->getEtaRange(3).second;
44 
45  // Retain classic behavior, all plots have same ieta range.
46  // Comment out code to allow each subdetector to have its on range
47 
48  int iEtaMax = (iEtaHBMax > iEtaHEMax ? iEtaHBMax : iEtaHEMax);
49  iEtaMax = (iEtaMax > iEtaHFMax ? iEtaMax : iEtaHFMax);
50  iEtaMax = (iEtaMax > iEtaHOMax ? iEtaMax : iEtaHOMax);
51 
52  iEtaHBMax = iEtaMax;
53  iEtaHEMax = iEtaMax;
54  iEtaHFMax = iEtaMax;
55  iEtaHOMax = iEtaMax;
56 
57  // Give an empty bin around the subdet ieta range to make it clear that all
58  // ieta rings have been included float ieta_min_HB = -iEtaHBMax - 1.5; float
59  // ieta_max_HB = iEtaHBMax + 1.5; int ieta_bins_HB = (int) (ieta_max_HB -
60  // ieta_min_HB);
61 
62  // float ieta_min_HE = -iEtaHEMax - 1.5;
63  // float ieta_max_HE = iEtaHEMax + 1.5;
64  // int ieta_bins_HE = (int) (ieta_max_HE - ieta_min_HE);
65 
66  // float ieta_min_HF = -iEtaHFMax - 1.5;
67  // float ieta_max_HF = iEtaHFMax + 1.5;
68  // int ieta_bins_HF = (int) (ieta_max_HF - ieta_min_HF);
69 
70  // float ieta_min_HO = -iEtaHOMax - 1.5;
71  // float ieta_max_HO = iEtaHOMax + 1.5;
72  // int ieta_bins_HO = (int) (ieta_max_HO - ieta_min_HO);
73 
74 #ifdef EDM_ML_DEBUG
75  edm::LogVerbatim("HitsValidationHcal") << " Maximum Depths HB:" << maxDepthHB_ << " HE:" << maxDepthHE_
76  << " HO:" << maxDepthHO_ << " HF:" << maxDepthHF_;
77 #endif
78  std::vector<std::pair<std::string, std::string>> divisions = getHistogramTypes();
79 
80  edm::LogVerbatim("HitsValidationHcal") << "Booking the Histograms";
81  ib.setCurrentFolder("HcalHitsV/SimHitsValidationHcal");
82 
83  // Histograms for Hits
84 
86  for (unsigned int i = 0; i < types.size(); ++i) {
88  name = "HcalHitEta" + divisions[i].first;
89  title = "Hit energy as a function of eta tower index in " + divisions[i].second;
90  meHcalHitEta_.push_back(ib.book1D(name, title, limit.bins, limit.low, limit.high));
91 
92  name = "HcalHitTimeAEta" + divisions[i].first;
93  title = "Hit time as a function of eta tower index in" + divisions[i].second;
94  meHcalHitTimeEta_.push_back(ib.book1D(name, title, limit.bins, limit.low, limit.high));
95 
96  name = "HcalHitE25" + divisions[i].first;
97  title = "Energy in time window 0 to 25 for a tower in " + divisions[i].second;
98  meHcalEnergyl25_.push_back(
99  ib.book2D(name, title, limit.bins, limit.low, limit.high, iphi_bins, iphi_min, iphi_max));
100 
101  name = "HcalHitE50" + divisions[i].first;
102  title = "Energy in time window 0 to 50 for a tower in " + divisions[i].second;
103  meHcalEnergyl50_.push_back(
104  ib.book2D(name, title, limit.bins, limit.low, limit.high, iphi_bins, iphi_min, iphi_max));
105 
106  name = "HcalHitE100" + divisions[i].first;
107  title = "Energy in time window 0 to 100 for a tower in " + divisions[i].second;
108  meHcalEnergyl100_.push_back(
109  ib.book2D(name, title, limit.bins, limit.low, limit.high, iphi_bins, iphi_min, iphi_max));
110 
111  name = "HcalHitE250" + divisions[i].first;
112  title = "Energy in time window 0 to 250 for a tower in " + divisions[i].second;
113  meHcalEnergyl250_.push_back(
114  ib.book2D(name, title, limit.bins, limit.low, limit.high, iphi_bins, iphi_min, iphi_max));
115  }
116 
117  name = "Energy_HB";
118  meEnergy_HB = ib.book1D(name, name, 100, 0, 1);
119  name = "Energy_HE";
120  meEnergy_HE = ib.book1D(name, name, 100, 0, 1);
121  name = "Energy_HO";
122  meEnergy_HO = ib.book1D(name, name, 100, 0, 1);
123  name = "Energy_HF";
124  meEnergy_HF = ib.book1D(name, name, 100, 0, 50);
125 
126  name = "Time_HB";
127  metime_HB = ib.book1D(name, name, 300, -150, 150);
128  name = "Time_HE";
129  metime_HE = ib.book1D(name, name, 300, -150, 150);
130  name = "Time_HO";
131  metime_HO = ib.book1D(name, name, 300, -150, 150);
132  name = "Time_HF";
133  metime_HF = ib.book1D(name, name, 300, -150, 150);
134 
135  name = "Time_Enweighted_HB";
136  metime_enweighted_HB = ib.book1D(name, name, 300, -150, 150);
137  name = "Time_Enweighted_HE";
138  metime_enweighted_HE = ib.book1D(name, name, 300, -150, 150);
139  name = "Time_Enweighted_HO";
140  metime_enweighted_HO = ib.book1D(name, name, 300, -150, 150);
141  name = "Time_Enweighted_HF";
142  metime_enweighted_HF = ib.book1D(name, name, 300, -150, 150);
143 }
Log< level::Info, true > LogVerbatim
MonitorElement * meEnergy_HF
std::pair< int, int > getEtaRange(const int &i) const
const HcalDDDRecConstants * hcons
int getNPhi(const int &type) const
MonitorElement * metime_enweighted_HO
MonitorElement * metime_enweighted_HB
std::vector< MonitorElement * > meHcalEnergyl25_
MonitorElement * meEnergy_HB
std::vector< MonitorElement * > meHcalEnergyl100_
std::vector< idType > types
MonitorElement * metime_enweighted_HF
int getMaxDepth(const int &type) const
MonitorElement * metime_enweighted_HE
std::vector< MonitorElement * > meHcalEnergyl250_
std::vector< MonitorElement * > meHcalHitEta_
MonitorElement * meEnergy_HE
std::vector< MonitorElement * > meHcalEnergyl50_
const edm::ESGetToken< HcalDDDRecConstants, HcalRecNumberingRecord > tok_HRNDC_
std::vector< MonitorElement * > meHcalHitTimeEta_
MonitorElement * meEnergy_HO
ib
Definition: cuy.py:661
std::vector< std::pair< std::string, std::string > > getHistogramTypes()

◆ fillDescriptions()

void SimHitsValidationHcal::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 454 of file SimHitsValidationHcal.cc.

References edm::ConfigurationDescriptions::addDefault(), submitPVResolutionJobs::desc, and AlCaHLTBitMon_QueryRunRegistry::string.

454  {
456  desc.add<std::string>("ModuleLabel", "g4SimHits");
457  desc.add<std::string>("HitCollection", "HcalHits");
458  desc.add<bool>("Verbose", false);
459  desc.add<bool>("TestNumber", false);
460 
461  descriptions.addDefault(desc);
462 }
void addDefault(ParameterSetDescription const &psetDescription)

◆ getHistogramTypes()

std::vector< std::pair< std::string, std::string > > SimHitsValidationHcal::getHistogramTypes ( )
private

Definition at line 376 of file SimHitsValidationHcal.cc.

References hcalRecHitTable_cff::depth, HcalBarrel, HcalEmpty, HcalEndcap, HcalForward, HcalOuter, dqmdumpme::k, SiStripPI::max, HLT_2024v10_cff::maxDepth, maxDepthHB_, maxDepthHE_, maxDepthHF_, maxDepthHO_, hfnoseParametersInitialization_cfi::name2, names, AlCaHLTBitMon_QueryRunRegistry::string, and types.

Referenced by bookHistograms().

376  {
380 
381  std::vector<std::pair<std::string, std::string>> divisions;
382  // divisions and types need to be in sync
383  types.clear();
384  std::pair<std::string, std::string> names;
385  char name1[40], name2[40];
387  // first overall Hcal
388  for (int depth = 0; depth < maxDepth; ++depth) {
389  snprintf(name1, 40, "HC%d", depth);
390  snprintf(name2, 40, "HCAL depth%d", depth + 1);
391  names = std::pair<std::string, std::string>(std::string(name1), std::string(name2));
393  divisions.push_back(names);
394  types.push_back(type);
395  }
396  // HB
397  for (int depth = 0; depth < maxDepthHB_; ++depth) {
398  snprintf(name1, 40, "HB%d", depth);
399  snprintf(name2, 40, "HB depth%d", depth + 1);
400  names = std::pair<std::string, std::string>(std::string(name1), std::string(name2));
402  divisions.push_back(names);
403  types.push_back(type);
404  }
405  // HE
406  for (int depth = 0; depth < maxDepthHE_; ++depth) {
407  snprintf(name1, 40, "HE%d+z", depth);
408  snprintf(name2, 40, "HE +z depth%d", depth + 1);
409  names = std::pair<std::string, std::string>(std::string(name1), std::string(name2));
411  divisions.push_back(names);
412  types.push_back(type);
413  snprintf(name1, 40, "HE%d-z", depth);
414  snprintf(name2, 40, "HE -z depth%d", depth + 1);
415  names = std::pair<std::string, std::string>(std::string(name1), std::string(name2));
417  divisions.push_back(names);
418  types.push_back(type);
419  }
420  // HO
421  {
422  int depth = maxDepthHO_;
423  snprintf(name1, 40, "HO%d", depth);
424  snprintf(name2, 40, "HO depth%d", depth);
425  names = std::pair<std::string, std::string>(std::string(name1), std::string(name2));
427  divisions.push_back(names);
428  types.push_back(type);
429  }
430  // HF (first absorber, then different types of abnormal hits)
431  std::string hfty1[4] = {"A", "W", "B", "J"};
432  std::string hfty2[4] = {"Absorber", "Window", "Bundle", "Jungle"};
433  int dept0[4] = {0, 1, 2, 3};
434  for (int k = 0; k < 4; ++k) {
435  for (int depth = 0; depth < maxDepthHF_; ++depth) {
436  snprintf(name1, 40, "HF%s%d+z", hfty1[k].c_str(), depth);
437  snprintf(name2, 40, "HF (%s) +z depth%d", hfty2[k].c_str(), depth + 1);
438  names = std::pair<std::string, std::string>(std::string(name1), std::string(name2));
440  divisions.push_back(names);
441  types.push_back(type);
442  snprintf(name1, 40, "HF%s%d-z", hfty1[k].c_str(), depth);
443  snprintf(name2, 40, "HF (%s) -z depth%d", hfty2[k].c_str(), depth + 1);
444  names = std::pair<std::string, std::string>(std::string(name1), std::string(name2));
446  divisions.push_back(names);
447  types.push_back(type);
448  }
449  }
450 
451  return divisions;
452 }
const std::string names[nVars_]
std::vector< idType > types

◆ getLimits()

SimHitsValidationHcal::etaRange SimHitsValidationHcal::getLimits ( idType  type)
private

Definition at line 296 of file SimHitsValidationHcal.cc.

References trigObjTnPSource_cfi::bins, generateTowerEtThresholdLUT::etaRange, HcalDDDRecConstants::getEtaRange(), HcalBarrel, HcalEndcap, HcalForward, HcalOuter, hcons, LaserClient_cfi::high, LaserClient_cfi::low, and FastTimerService_cff::range.

Referenced by bookHistograms().

296  {
297  int bins;
298  std::pair<int, int> range;
299  double low, high;
300 
301  if (type.subdet == HcalBarrel) {
302  range = hcons->getEtaRange(0);
303  low = -range.second;
304  high = range.second;
305  bins = (high - low);
306  } else if (type.subdet == HcalEndcap) {
307  range = hcons->getEtaRange(1);
308  bins = range.second - range.first;
309  if (type.z == 1) {
310  low = range.first;
311  high = range.second;
312  } else {
313  low = -range.second;
314  high = -range.first;
315  }
316  } else if (type.subdet == HcalOuter) {
317  range = hcons->getEtaRange(3);
318  low = -range.second;
319  high = range.second;
320  bins = high - low;
321  } else if (type.subdet == HcalForward) {
322  range = hcons->getEtaRange(2);
323  bins = range.second - range.first;
324  if (type.z == 1) {
325  low = range.first;
326  high = range.second;
327  } else {
328  low = -range.second;
329  high = -range.first;
330  }
331  } else {
332  bins = 82;
333  low = -41;
334  high = 41;
335  }
336 #ifdef EDM_ML_DEBUG
337  edm::LogVerbatim("HitsValidationHcal") << "Subdetector:" << type.subdet << " z:" << type.z
338  << " range.first:" << range.first << " and second:" << range.second;
339  edm::LogVerbatim("HitsValidationHcal") << "bins: " << bins << " low:" << low << " high:" << high;
340 #endif
342 }
Log< level::Info, true > LogVerbatim
std::pair< int, int > getEtaRange(const int &i) const
const HcalDDDRecConstants * hcons

◆ histId()

std::pair< int, int > SimHitsValidationHcal::histId ( int  subdet,
int  eta,
int  depth,
unsigned int  dep 
)
private

Definition at line 344 of file SimHitsValidationHcal.cc.

References hcalRecHitTable_cff::depth, PVValHelper::eta, HcalEmpty, HcalEndcap, HcalForward, globals_cff::id1, globals_cff::id2, dqmdumpme::k, types, and z.

Referenced by analyzeHits().

344  {
345  int id1(-1), id2(-1);
346  for (unsigned int k = 0; k < types.size(); ++k) {
347  if (subdet == HcalForward) {
348  if (subdet == (int)(types[k].subdet) && depth == types[k].depth1 && eta * types[k].z > 0 &&
349  dep == (unsigned int)(types[k].depth2)) {
350  id1 = k;
351  break;
352  }
353  } else if (subdet == HcalEndcap) {
354  if (subdet == (int)(types[k].subdet) && depth == types[k].depth1 && eta * types[k].z > 0) {
355  id1 = k;
356  break;
357  }
358  } else {
359  if (subdet == (int)(types[k].subdet) && depth == types[k].depth1) {
360  id1 = k;
361  break;
362  }
363  }
364  }
365  if (subdet == HcalForward)
366  depth += 2 * dep;
367  for (unsigned int k = 0; k < types.size(); ++k) {
368  if (types[k].subdet == HcalEmpty && types[k].depth1 == depth) {
369  id2 = k;
370  break;
371  }
372  }
373  return std::pair<int, int>(id1, id2);
374 }
std::vector< idType > types

Member Data Documentation

◆ g4Label_

const std::string SimHitsValidationHcal::g4Label_
private

Definition at line 81 of file SimHitsValidationHcal.h.

Referenced by SimHitsValidationHcal().

◆ hcalHits_

const std::string SimHitsValidationHcal::hcalHits_
private

Definition at line 81 of file SimHitsValidationHcal.h.

Referenced by SimHitsValidationHcal().

◆ hcons

const HcalDDDRecConstants* SimHitsValidationHcal::hcons
private

Definition at line 85 of file SimHitsValidationHcal.h.

Referenced by analyze(), bookHistograms(), and getLimits().

◆ initialized

bool SimHitsValidationHcal::initialized
private

Definition at line 80 of file SimHitsValidationHcal.h.

◆ maxDepthHB_

int SimHitsValidationHcal::maxDepthHB_
private

Definition at line 87 of file SimHitsValidationHcal.h.

Referenced by bookHistograms(), and getHistogramTypes().

◆ maxDepthHE_

int SimHitsValidationHcal::maxDepthHE_
private

Definition at line 87 of file SimHitsValidationHcal.h.

Referenced by bookHistograms(), and getHistogramTypes().

◆ maxDepthHF_

int SimHitsValidationHcal::maxDepthHF_
private

Definition at line 88 of file SimHitsValidationHcal.h.

Referenced by bookHistograms(), and getHistogramTypes().

◆ maxDepthHO_

int SimHitsValidationHcal::maxDepthHO_
private

Definition at line 88 of file SimHitsValidationHcal.h.

Referenced by bookHistograms(), and getHistogramTypes().

◆ meEnergy_HB

MonitorElement* SimHitsValidationHcal::meEnergy_HB
private

Definition at line 93 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

◆ meEnergy_HE

MonitorElement* SimHitsValidationHcal::meEnergy_HE
private

Definition at line 94 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

◆ meEnergy_HF

MonitorElement* SimHitsValidationHcal::meEnergy_HF
private

Definition at line 96 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

◆ meEnergy_HO

MonitorElement* SimHitsValidationHcal::meEnergy_HO
private

Definition at line 95 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

◆ meHcalEnergyl100_

std::vector<MonitorElement *> SimHitsValidationHcal::meHcalEnergyl100_
private

Definition at line 92 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

◆ meHcalEnergyl250_

std::vector<MonitorElement *> SimHitsValidationHcal::meHcalEnergyl250_
private

Definition at line 92 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

◆ meHcalEnergyl25_

std::vector<MonitorElement *> SimHitsValidationHcal::meHcalEnergyl25_
private

Definition at line 91 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

◆ meHcalEnergyl50_

std::vector<MonitorElement *> SimHitsValidationHcal::meHcalEnergyl50_
private

Definition at line 91 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

◆ meHcalHitEta_

std::vector<MonitorElement *> SimHitsValidationHcal::meHcalHitEta_
private

Definition at line 90 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

◆ meHcalHitTimeEta_

std::vector<MonitorElement *> SimHitsValidationHcal::meHcalHitTimeEta_
private

Definition at line 90 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

◆ metime_enweighted_HB

MonitorElement * SimHitsValidationHcal::metime_enweighted_HB
private

Definition at line 93 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

◆ metime_enweighted_HE

MonitorElement * SimHitsValidationHcal::metime_enweighted_HE
private

Definition at line 94 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

◆ metime_enweighted_HF

MonitorElement * SimHitsValidationHcal::metime_enweighted_HF
private

Definition at line 96 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

◆ metime_enweighted_HO

MonitorElement * SimHitsValidationHcal::metime_enweighted_HO
private

Definition at line 95 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

◆ metime_HB

MonitorElement * SimHitsValidationHcal::metime_HB
private

Definition at line 93 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

◆ metime_HE

MonitorElement * SimHitsValidationHcal::metime_HE
private

Definition at line 94 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

◆ metime_HF

MonitorElement * SimHitsValidationHcal::metime_HF
private

Definition at line 96 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

◆ metime_HO

MonitorElement * SimHitsValidationHcal::metime_HO
private

Definition at line 95 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

◆ testNumber_

const bool SimHitsValidationHcal::testNumber_
private

Definition at line 82 of file SimHitsValidationHcal.h.

Referenced by analyze(), and SimHitsValidationHcal().

◆ tok_hits_

const edm::EDGetTokenT<edm::PCaloHitContainer> SimHitsValidationHcal::tok_hits_
private

Definition at line 83 of file SimHitsValidationHcal.h.

Referenced by analyze().

◆ tok_HRNDC_

const edm::ESGetToken<HcalDDDRecConstants, HcalRecNumberingRecord> SimHitsValidationHcal::tok_HRNDC_
private

Definition at line 84 of file SimHitsValidationHcal.h.

Referenced by bookHistograms().

◆ types

std::vector<idType> SimHitsValidationHcal::types
private

Definition at line 86 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), bookHistograms(), getHistogramTypes(), and histId().

◆ verbose_

const bool SimHitsValidationHcal::verbose_
private

Definition at line 82 of file SimHitsValidationHcal.h.