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

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

std::string g4Label_
 
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
 
bool testNumber_
 
edm::EDGetTokenT< edm::PCaloHitContainertok_hits_
 
edm::ESGetToken< HcalDDDRecConstants, HcalRecNumberingRecordtok_HRNDC_
 
std::vector< idTypetypes
 
bool verbose_
 

Additional Inherited Members

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

Detailed Description

Definition at line 30 of file SimHitsValidationHcal.h.

Constructor & Destructor Documentation

◆ SimHitsValidationHcal()

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

Definition at line 7 of file SimHitsValidationHcal.cc.

7  {
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 
13  tok_hits_ = consumes<edm::PCaloHitContainer>(edm::InputTag(g4Label_, hcalHits_));
14  tok_HRNDC_ = esConsumes<HcalDDDRecConstants, HcalRecNumberingRecord, edm::Transition::BeginRun>();
15 
16  edm::LogVerbatim("HitsValidationHcal") << "Module Label: " << g4Label_ << " Hits: " << hcalHits_
17  << " TestNumbering " << testNumber_;
18 }

References g4Label_, edm::ParameterSet::getParameter(), hcalHits_, AlCaHLTBitMon_QueryRunRegistry::string, testNumber_, tok_hits_, tok_HRNDC_, and verbose_.

◆ ~SimHitsValidationHcal()

SimHitsValidationHcal::~SimHitsValidationHcal ( )
override

Definition at line 20 of file SimHitsValidationHcal.cc.

20 {}

Member Function Documentation

◆ analyze()

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

Reimplemented from DQMEDAnalyzer.

Definition at line 149 of file SimHitsValidationHcal.cc.

149  {
150 #ifdef DebugLog
151  edm::LogVerbatim("HitsValidationHcal") << "Run = " << e.id().run() << " Event = " << e.id().event();
152 #endif
153  std::vector<PCaloHit> caloHits;
155 
156  bool getHits = false;
157  e.getByToken(tok_hits_, hitsHcal);
158  if (hitsHcal.isValid())
159  getHits = true;
160 #ifdef DebugLog
161  edm::LogVerbatim("HitsValidationHcal") << "HitsValidationHcal.: Input flags Hits " << getHits;
162 #endif
163  if (getHits) {
164  caloHits.insert(caloHits.end(), hitsHcal->begin(), hitsHcal->end());
165 #ifdef DebugLog
166  edm::LogVerbatim("HitsValidationHcal") << "testNumber_:" << testNumber_;
167 #endif
168  if (testNumber_) {
169  for (unsigned int i = 0; i < caloHits.size(); ++i) {
170  unsigned int id_ = caloHits[i].id();
172  caloHits[i].setID(hid.rawId());
173 #ifdef DebugLog
174  edm::LogVerbatim("HitsValidationHcal") << "Hit[" << i << "] " << hid;
175 #endif
176  }
177  }
178 #ifdef DebugLog
179  edm::LogVerbatim("HitsValidationHcal") << "HitsValidationHcal: Hit buffer " << caloHits.size();
180 #endif
181  analyzeHits(caloHits);
182  }
183 }

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

◆ analyzeHits()

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

Definition at line 185 of file SimHitsValidationHcal.cc.

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

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 ntuplemaker::time.

Referenced by analyze().

◆ bookHistograms()

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

Implements DQMEDAnalyzer.

Definition at line 22 of file SimHitsValidationHcal.cc.

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

References edm::EventSetup::getData(), HcalDDDRecConstants::getEtaRange(), getHistogramTypes(), getLimits(), HcalDDDRecConstants::getMaxDepth(), HcalDDDRecConstants::getNPhi(), hcons, mps_fire::i, cuy::ib, hcalTTPDigis_cfi::iEtaMax, createfilelist::int, remoteMonitoring_LED_IterMethod_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_.

◆ fillDescriptions()

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

Definition at line 464 of file SimHitsValidationHcal.cc.

464  {
466  desc.add<std::string>("ModuleLabel", "g4SimHits");
467  desc.add<std::string>("HitCollection", "HcalHits");
468  desc.add<bool>("Verbose", false);
469  desc.add<bool>("TestNumber", false);
470 
471  descriptions.addDefault(desc);
472 }

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

◆ getHistogramTypes()

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

Definition at line 386 of file SimHitsValidationHcal.cc.

386  {
390 
391  std::vector<std::pair<std::string, std::string>> divisions;
392  // divisions and types need to be in sync
393  types.clear();
394  std::pair<std::string, std::string> names;
395  char name1[40], name2[40];
397  // first overall Hcal
398  for (int depth = 0; depth < maxDepth; ++depth) {
399  snprintf(name1, 40, "HC%d", depth);
400  snprintf(name2, 40, "HCAL depth%d", depth + 1);
401  names = std::pair<std::string, std::string>(std::string(name1), std::string(name2));
403  divisions.push_back(names);
404  types.push_back(type);
405  }
406  // HB
407  for (int depth = 0; depth < maxDepthHB_; ++depth) {
408  snprintf(name1, 40, "HB%d", depth);
409  snprintf(name2, 40, "HB depth%d", depth + 1);
410  names = std::pair<std::string, std::string>(std::string(name1), std::string(name2));
412  divisions.push_back(names);
413  types.push_back(type);
414  }
415  // HE
416  for (int depth = 0; depth < maxDepthHE_; ++depth) {
417  snprintf(name1, 40, "HE%d+z", depth);
418  snprintf(name2, 40, "HE +z depth%d", depth + 1);
419  names = std::pair<std::string, std::string>(std::string(name1), std::string(name2));
421  divisions.push_back(names);
422  types.push_back(type);
423  snprintf(name1, 40, "HE%d-z", depth);
424  snprintf(name2, 40, "HE -z depth%d", depth + 1);
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  // HO
431  {
432  int depth = maxDepthHO_;
433  snprintf(name1, 40, "HO%d", depth);
434  snprintf(name2, 40, "HO depth%d", depth);
435  names = std::pair<std::string, std::string>(std::string(name1), std::string(name2));
437  divisions.push_back(names);
438  types.push_back(type);
439  }
440  // HF (first absorber, then different types of abnormal hits)
441  std::string hfty1[4] = {"A", "W", "B", "J"};
442  std::string hfty2[4] = {"Absorber", "Window", "Bundle", "Jungle"};
443  int dept0[4] = {0, 1, 2, 3};
444  for (int k = 0; k < 4; ++k) {
445  for (int depth = 0; depth < maxDepthHF_; ++depth) {
446  snprintf(name1, 40, "HF%s%d+z", hfty1[k].c_str(), depth);
447  snprintf(name2, 40, "HF (%s) +z depth%d", hfty2[k].c_str(), depth + 1);
448  names = std::pair<std::string, std::string>(std::string(name1), std::string(name2));
450  divisions.push_back(names);
451  types.push_back(type);
452  snprintf(name1, 40, "HF%s%d-z", hfty1[k].c_str(), depth);
453  snprintf(name2, 40, "HF (%s) -z depth%d", hfty2[k].c_str(), depth + 1);
454  names = std::pair<std::string, std::string>(std::string(name1), std::string(name2));
456  divisions.push_back(names);
457  types.push_back(type);
458  }
459  }
460 
461  return divisions;
462 }

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

Referenced by bookHistograms().

◆ getLimits()

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

Definition at line 306 of file SimHitsValidationHcal.cc.

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

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().

◆ histId()

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

Definition at line 354 of file SimHitsValidationHcal.cc.

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

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

Referenced by analyzeHits().

Member Data Documentation

◆ g4Label_

std::string SimHitsValidationHcal::g4Label_
private

Definition at line 82 of file SimHitsValidationHcal.h.

Referenced by SimHitsValidationHcal().

◆ hcalHits_

std::string SimHitsValidationHcal::hcalHits_
private

Definition at line 82 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 81 of file SimHitsValidationHcal.h.

◆ maxDepthHB_

int SimHitsValidationHcal::maxDepthHB_
private

Definition at line 88 of file SimHitsValidationHcal.h.

Referenced by bookHistograms(), and getHistogramTypes().

◆ maxDepthHE_

int SimHitsValidationHcal::maxDepthHE_
private

Definition at line 88 of file SimHitsValidationHcal.h.

Referenced by bookHistograms(), and getHistogramTypes().

◆ maxDepthHF_

int SimHitsValidationHcal::maxDepthHF_
private

Definition at line 89 of file SimHitsValidationHcal.h.

Referenced by bookHistograms(), and getHistogramTypes().

◆ maxDepthHO_

int SimHitsValidationHcal::maxDepthHO_
private

Definition at line 89 of file SimHitsValidationHcal.h.

Referenced by bookHistograms(), and getHistogramTypes().

◆ meEnergy_HB

MonitorElement* SimHitsValidationHcal::meEnergy_HB
private

Definition at line 94 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

◆ meEnergy_HE

MonitorElement* SimHitsValidationHcal::meEnergy_HE
private

Definition at line 95 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

◆ meEnergy_HF

MonitorElement* SimHitsValidationHcal::meEnergy_HF
private

Definition at line 97 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

◆ meEnergy_HO

MonitorElement* SimHitsValidationHcal::meEnergy_HO
private

Definition at line 96 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

◆ meHcalEnergyl100_

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

Definition at line 93 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

◆ meHcalEnergyl250_

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

Definition at line 93 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

◆ meHcalEnergyl25_

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

Definition at line 92 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

◆ meHcalEnergyl50_

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

Definition at line 92 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

◆ meHcalHitEta_

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

Definition at line 91 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

◆ meHcalHitTimeEta_

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

Definition at line 91 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

◆ metime_enweighted_HB

MonitorElement * SimHitsValidationHcal::metime_enweighted_HB
private

Definition at line 94 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

◆ metime_enweighted_HE

MonitorElement * SimHitsValidationHcal::metime_enweighted_HE
private

Definition at line 95 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

◆ metime_enweighted_HF

MonitorElement * SimHitsValidationHcal::metime_enweighted_HF
private

Definition at line 97 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

◆ metime_enweighted_HO

MonitorElement * SimHitsValidationHcal::metime_enweighted_HO
private

Definition at line 96 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

◆ metime_HB

MonitorElement * SimHitsValidationHcal::metime_HB
private

Definition at line 94 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

◆ metime_HE

MonitorElement * SimHitsValidationHcal::metime_HE
private

Definition at line 95 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

◆ metime_HF

MonitorElement * SimHitsValidationHcal::metime_HF
private

Definition at line 97 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

◆ metime_HO

MonitorElement * SimHitsValidationHcal::metime_HO
private

Definition at line 96 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

◆ testNumber_

bool SimHitsValidationHcal::testNumber_
private

Definition at line 87 of file SimHitsValidationHcal.h.

Referenced by analyze(), and SimHitsValidationHcal().

◆ tok_hits_

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

Definition at line 83 of file SimHitsValidationHcal.h.

Referenced by analyze(), and SimHitsValidationHcal().

◆ tok_HRNDC_

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

Definition at line 84 of file SimHitsValidationHcal.h.

Referenced by bookHistograms(), and SimHitsValidationHcal().

◆ types

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

Definition at line 86 of file SimHitsValidationHcal.h.

◆ verbose_

bool SimHitsValidationHcal::verbose_
private

Definition at line 87 of file SimHitsValidationHcal.h.

Referenced by SimHitsValidationHcal().

SimHitsValidationHcal::metime_enweighted_HF
MonitorElement * metime_enweighted_HF
Definition: SimHitsValidationHcal.h:97
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
runGCPTkAlMap.title
string title
Definition: runGCPTkAlMap.py:94
mps_fire.i
i
Definition: mps_fire.py:428
SimHitsValidationHcal::tok_HRNDC_
edm::ESGetToken< HcalDDDRecConstants, HcalRecNumberingRecord > tok_HRNDC_
Definition: SimHitsValidationHcal.h:84
generateTowerEtThresholdLUT.etaRange
etaRange
Definition: generateTowerEtThresholdLUT.py:55
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
SimHitsValidationHcal::metime_HO
MonitorElement * metime_HO
Definition: SimHitsValidationHcal.h:96
globals_cff.id1
id1
Definition: globals_cff.py:33
SimHitsValidationHcal::hcons
const HcalDDDRecConstants * hcons
Definition: SimHitsValidationHcal.h:85
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
SimHitsValidationHcal::hcalHits_
std::string hcalHits_
Definition: SimHitsValidationHcal.h:82
SimHitsValidationHcal::meEnergy_HO
MonitorElement * meEnergy_HO
Definition: SimHitsValidationHcal.h:96
SimHitsValidationHcal::tok_hits_
edm::EDGetTokenT< edm::PCaloHitContainer > tok_hits_
Definition: SimHitsValidationHcal.h:83
HcalDDDRecConstants::getNPhi
int getNPhi(const int &type) const
Definition: HcalDDDRecConstants.h:93
SimHitsValidationHcal::maxDepthHF_
int maxDepthHF_
Definition: SimHitsValidationHcal.h:89
HcalBarrel
Definition: HcalAssistant.h:33
HcalEmpty
Definition: HcalAssistant.h:32
SimHitsValidationHcal::meHcalEnergyl100_
std::vector< MonitorElement * > meHcalEnergyl100_
Definition: SimHitsValidationHcal.h:93
edm::Handle
Definition: AssociativeIterator.h:50
SimHitsValidationHcal::meHcalEnergyl50_
std::vector< MonitorElement * > meHcalEnergyl50_
Definition: SimHitsValidationHcal.h:92
HLT_FULL_cff.maxDepth
maxDepth
Definition: HLT_FULL_cff.py:8735
names
const std::string names[nVars_]
Definition: PhotonIDValueMapProducer.cc:124
PVValHelper::eta
Definition: PVValidationHelpers.h:69
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
DDAxes::z
SimHitsValidationHcal::metime_enweighted_HO
MonitorElement * metime_enweighted_HO
Definition: SimHitsValidationHcal.h:96
HcalOuter
Definition: HcalAssistant.h:35
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
SimHitsValidationHcal::maxDepthHO_
int maxDepthHO_
Definition: SimHitsValidationHcal.h:89
dqmdumpme.k
k
Definition: dqmdumpme.py:60
SimHitsValidationHcal::metime_HE
MonitorElement * metime_HE
Definition: SimHitsValidationHcal.h:95
SimHitsValidationHcal::metime_enweighted_HB
MonitorElement * metime_enweighted_HB
Definition: SimHitsValidationHcal.h:94
LEDCalibrationChannels.depth
depth
Definition: LEDCalibrationChannels.py:65
SimHitsValidationHcal::meHcalEnergyl25_
std::vector< MonitorElement * > meHcalEnergyl25_
Definition: SimHitsValidationHcal.h:92
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
SimHitsValidationHcal::meHcalHitTimeEta_
std::vector< MonitorElement * > meHcalHitTimeEta_
Definition: SimHitsValidationHcal.h:91
SimHitsValidationHcal::histId
std::pair< int, int > histId(int subdet, int eta, int depth, unsigned int dep)
Definition: SimHitsValidationHcal.cc:354
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
gainCalibHelper::gainCalibPI::type
type
Definition: SiPixelGainCalibHelper.h:39
SimHitsValidationHcal::meEnergy_HE
MonitorElement * meEnergy_HE
Definition: SimHitsValidationHcal.h:95
SimHitsValidationHcal::g4Label_
std::string g4Label_
Definition: SimHitsValidationHcal.h:82
HcalDetId
Definition: HcalDetId.h:12
createfilelist.int
int
Definition: createfilelist.py:10
SimHitsValidationHcal::getLimits
etaRange getLimits(idType)
Definition: SimHitsValidationHcal.cc:306
cuy.ib
ib
Definition: cuy.py:662
itr
std::vector< std::pair< float, float > >::iterator itr
Definition: HGCDigitizer.cc:29
SimHitsValidationHcal::metime_HF
MonitorElement * metime_HF
Definition: SimHitsValidationHcal.h:97
SimHitsValidationHcal::meEnergy_HB
MonitorElement * meEnergy_HB
Definition: SimHitsValidationHcal.h:94
types
types
Definition: AlignPCLThresholds_PayloadInspector.cc:30
HcalForward
Definition: HcalAssistant.h:36
DDAxes::phi
SimHitsValidationHcal::idType
Definition: SimHitsValidationHcal.h:48
HcalHitRelabeller::relabel
DetId relabel(const uint32_t testId) const
Definition: HcalHitRelabeller.cc:49
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
LaserClient_cfi.high
high
Definition: LaserClient_cfi.py:50
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
SimHitsValidationHcal::meHcalEnergyl250_
std::vector< MonitorElement * > meHcalEnergyl250_
Definition: SimHitsValidationHcal.h:93
HcalDDDRecConstants::getEtaRange
std::pair< int, int > getEtaRange(const int &i) const
Definition: HcalDDDRecConstants.h:74
remoteMonitoring_LED_IterMethod_cfg.limit
limit
Definition: remoteMonitoring_LED_IterMethod_cfg.py:427
HcalEndcap
Definition: HcalAssistant.h:34
hcalTTPDigis_cfi.iEtaMax
iEtaMax
Definition: hcalTTPDigis_cfi.py:16
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
SimHitsValidationHcal::meHcalHitEta_
std::vector< MonitorElement * > meHcalHitEta_
Definition: SimHitsValidationHcal.h:91
SimHitsValidationHcal::metime_HB
MonitorElement * metime_HB
Definition: SimHitsValidationHcal.h:94
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
SimHitsValidationHcal::verbose_
bool verbose_
Definition: SimHitsValidationHcal.h:87
HcalDDDRecConstants::getMaxDepth
int getMaxDepth(const int &type) const
Definition: HcalDDDRecConstants.h:88
SimHitsValidationHcal::maxDepthHB_
int maxDepthHB_
Definition: SimHitsValidationHcal.h:88
SimHitsValidationHcal::getHistogramTypes
std::vector< std::pair< std::string, std::string > > getHistogramTypes()
Definition: SimHitsValidationHcal.cc:386
SimHitsValidationHcal::analyzeHits
void analyzeHits(std::vector< PCaloHit > &)
Definition: SimHitsValidationHcal.cc:185
trigObjTnPSource_cfi.bins
bins
Definition: trigObjTnPSource_cfi.py:20
SimHitsValidationHcal::meEnergy_HF
MonitorElement * meEnergy_HF
Definition: SimHitsValidationHcal.h:97
globals_cff.id2
id2
Definition: globals_cff.py:34
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
ntuplemaker.time
time
Definition: ntuplemaker.py:310
hfnoseParametersInitialization_cfi.name2
name2
Definition: hfnoseParametersInitialization_cfi.py:8
SimHitsValidationHcal::metime_enweighted_HE
MonitorElement * metime_enweighted_HE
Definition: SimHitsValidationHcal.h:95
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:99
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
SimHitsValidationHcal::maxDepthHE_
int maxDepthHE_
Definition: SimHitsValidationHcal.h:88
SimHitsValidationHcal::testNumber_
bool testNumber_
Definition: SimHitsValidationHcal.h:87
LaserClient_cfi.low
low
Definition: LaserClient_cfi.py:52
edm::InputTag
Definition: InputTag.h:15
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37