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:303
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, LEDCalibrationChannels::depth, SimHitsValidationHcal::energysum::e100, SimHitsValidationHcal::energysum::e25, SimHitsValidationHcal::energysum::e250, SimHitsValidationHcal::energysum::e50, HCALHighEnergyHPDFilter_cfi::energy, PVValHelper::eta, dqm::impl::MonitorElement::Fill(), HcalBarrel, HcalEndcap, HcalForward, HcalOuter, histId(), hfClusterShapes_cfi::hits, mps_fire::i, LEDCalibrationChannels::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, and protons_cff::time.

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

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_
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 459 of file SimHitsValidationHcal.cc.

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

459  {
461  desc.add<std::string>("ModuleLabel", "g4SimHits");
462  desc.add<std::string>("HitCollection", "HcalHits");
463  desc.add<bool>("Verbose", false);
464  desc.add<bool>("TestNumber", false);
465 
466  descriptions.addDefault(desc);
467 }
void addDefault(ParameterSetDescription const &psetDescription)

◆ getHistogramTypes()

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

Definition at line 381 of file SimHitsValidationHcal.cc.

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

Referenced by bookHistograms().

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

◆ getLimits()

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

Definition at line 301 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().

301  {
302  int bins;
303  std::pair<int, int> range;
304  double low, high;
305 
306  if (type.subdet == HcalBarrel) {
307  range = hcons->getEtaRange(0);
308  low = -range.second;
309  high = range.second;
310  bins = (high - low);
311  } else if (type.subdet == HcalEndcap) {
312  range = hcons->getEtaRange(1);
313  bins = range.second - range.first;
314  if (type.z == 1) {
315  low = range.first;
316  high = range.second;
317  } else {
318  low = -range.second;
319  high = -range.first;
320  }
321  } else if (type.subdet == HcalOuter) {
322  range = hcons->getEtaRange(3);
323  low = -range.second;
324  high = range.second;
325  bins = high - low;
326  } else if (type.subdet == HcalForward) {
327  range = hcons->getEtaRange(2);
328  bins = range.second - range.first;
329  if (type.z == 1) {
330  low = range.first;
331  high = range.second;
332  } else {
333  low = -range.second;
334  high = -range.first;
335  }
336  } else {
337  bins = 82;
338  low = -41;
339  high = 41;
340  }
341 #ifdef EDM_ML_DEBUG
342  edm::LogVerbatim("HitsValidationHcal") << "Subdetector:" << type.subdet << " z:" << type.z
343  << " range.first:" << range.first << " and second:" << range.second;
344  edm::LogVerbatim("HitsValidationHcal") << "bins: " << bins << " low:" << low << " high:" << high;
345 #endif
347 }
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 349 of file SimHitsValidationHcal.cc.

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

Referenced by analyzeHits().

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

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.

◆ verbose_

const bool SimHitsValidationHcal::verbose_
private

Definition at line 82 of file SimHitsValidationHcal.h.