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:
one::DQMEDAnalyzer< T > one::dqmimplementation::DQMBaseClass< T... >

Classes

struct  energysum
 
struct  etaRange
 
struct  idType
 

Public Member Functions

 SimHitsValidationHcal (const edm::ParameterSet &ps)
 
 ~SimHitsValidationHcal () override
 
- Public Member Functions inherited from one::DQMEDAnalyzer< T >
 DQMEDAnalyzer ()=default
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > &&)=delete
 
 ~DQMEDAnalyzer () override=default
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

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
 

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_
 
std::vector< idTypetypes
 
bool verbose_
 

Detailed Description

Definition at line 29 of file SimHitsValidationHcal.h.

Constructor & Destructor Documentation

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

Definition at line 8 of file SimHitsValidationHcal.cc.

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

8  {
9 
10  g4Label_ = ps.getParameter<std::string>("ModuleLabel");
11  hcalHits_ = ps.getParameter<std::string>("HitCollection");
12  verbose_ = ps.getParameter<bool>("Verbose");
13  testNumber_= ps.getParameter<bool>("TestNumber");
14 
15  tok_hits_ = consumes<edm::PCaloHitContainer>(edm::InputTag(g4Label_,hcalHits_));
16 
17  edm::LogInfo("HitsValidationHcal") << "Module Label: " << g4Label_
18  << " Hits: " << hcalHits_
19  << " TestNumbering " << testNumber_;
20 }
T getParameter(std::string const &) const
edm::EDGetTokenT< edm::PCaloHitContainer > tok_hits_
SimHitsValidationHcal::~SimHitsValidationHcal ( )
override

Definition at line 22 of file SimHitsValidationHcal.cc.

22 {}

Member Function Documentation

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

Definition at line 149 of file SimHitsValidationHcal.cc.

References analyzeHits(), edm::EventID::event(), edm::Event::getByToken(), hcons, mps_fire::i, edm::EventBase::id(), edm::HandleBase::isValid(), DetId::rawId(), HcalHitRelabeller::relabel(), edm::EventID::run(), testNumber_, and tok_hits_.

150  {
151 
152 
153 #ifdef DebugLog
154  edm::LogInfo("HitsValidationHcal") << "Run = " << e.id().run() << " Event = "
155  << e.id().event();
156 #endif
157  std::vector<PCaloHit> caloHits;
159 
160  bool getHits = false;
161  e.getByToken(tok_hits_,hitsHcal);
162  if (hitsHcal.isValid()) getHits = true;
163 #ifdef DebugLog
164  edm::LogInfo("HitsValidationHcal") << "HitsValidationHcal.: Input flags Hits "
165  << getHits;
166 #endif
167  if (getHits) {
168  caloHits.insert(caloHits.end(),hitsHcal->begin(),hitsHcal->end());
169 #ifdef DebugLog
170  edm::LogInfo("HitsValidationHcal") << "testNumber_:" << testNumber_;
171 #endif
172  if (testNumber_) {
173  for (unsigned int i=0; i<caloHits.size(); ++i) {
174  unsigned int id_ = caloHits[i].id();
176  caloHits[i].setID(hid.rawId());
177 #ifdef DebugLog
178  edm::LogInfo("HitsValidationHcal") << "Hit[" << i << "] " << hid;
179 #endif
180  }
181  }
182 #ifdef DebugLog
183  edm::LogInfo("HitsValidationHcal") << "HitsValidationHcal: Hit buffer "
184  << caloHits.size();
185 #endif
186  analyzeHits (caloHits);
187  }
188 }
RunNumber_t run() const
Definition: EventID.h:39
EventNumber_t event() const
Definition: EventID.h:41
const HcalDDDRecConstants * hcons
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:47
bool isValid() const
Definition: HandleBase.h:74
edm::EventID id() const
Definition: EventBase.h:60
DetId relabel(const uint32_t testId) const
edm::EDGetTokenT< edm::PCaloHitContainer > tok_hits_
void analyzeHits(std::vector< PCaloHit > &)
void SimHitsValidationHcal::analyzeHits ( std::vector< PCaloHit > &  hits)
protected

Definition at line 190 of file SimHitsValidationHcal.cc.

References TauDecayModes::dec, egammaForCoreTracking_cff::depth, SimHitsValidationHcal::energysum::e100, SimHitsValidationHcal::energysum::e25, SimHitsValidationHcal::energysum::e250, SimHitsValidationHcal::energysum::e50, PVValHelper::eta, MonitorElement::Fill(), HcalBarrel, HcalEndcap, HcalForward, HcalOuter, histId(), mps_fire::i, 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().

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

Definition at line 24 of file SimHitsValidationHcal.cc.

References SimHitsValidationHcal::etaRange::bins, DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), plotBeamSpotDB::first, edm::EventSetup::get(), HcalDDDRecConstants::getEtaRange(), getHistogramTypes(), getLimits(), HcalDDDRecConstants::getMaxDepth(), HcalDDDRecConstants::getNPhi(), hcons, SimHitsValidationHcal::etaRange::high, mps_fire::i, hcalTTPDigis_cfi::iEtaMax, createfilelist::int, MessageLogger_cfi::limit, SimHitsValidationHcal::etaRange::low, 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, dataset::name, edm::second(), DQMStore::IBooker::setCurrentFolder(), and fftjetcommon_cfi::title.

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

Definition at line 474 of file SimHitsValidationHcal.cc.

References edm::ParameterSetDescription::add(), edm::ConfigurationDescriptions::addDefault(), DEFINE_FWK_MODULE, and AlCaHLTBitMon_QueryRunRegistry::string.

474  {
476  desc.add<std::string>("ModuleLabel","g4SimHits");
477  desc.add<std::string>("HitCollection","HcalHits");
478  desc.add<bool>("Verbose",false);
479  desc.add<bool>("TestNumber",false);
480 
481  descriptions.addDefault(desc);
482 }
void addDefault(ParameterSetDescription const &psetDescription)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
std::vector< std::pair< std::string, std::string > > SimHitsValidationHcal::getHistogramTypes ( )
private

Definition at line 397 of file SimHitsValidationHcal.cc.

References egammaForCoreTracking_cff::depth, HcalBarrel, HcalEmpty, HcalEndcap, HcalForward, HcalOuter, gen::k, SiStripPI::max, CMSBoostedTauSeedingParameters_cfi::maxDepth, maxDepthHB_, maxDepthHE_, maxDepthHF_, maxDepthHO_, names, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by bookHistograms().

397  {
398 
400  maxDepth = std::max(maxDepth,maxDepthHF_);
401  maxDepth = std::max(maxDepth,maxDepthHO_);
402 
403  std::vector<std::pair<std::string,std::string> > divisions;
404  std::pair<std::string,std::string> names;
405  char name1[40], name2[40];
407  //first overall Hcal
408  for (int depth=0; depth<maxDepth; ++depth) {
409  snprintf (name1, 40, "HC%d", depth);
410  snprintf (name2, 40, "HCAL depth%d", depth+1);
411  names = std::pair<std::string,std::string>(std::string(name1),std::string(name2));
413  divisions.push_back(names);
414  types.push_back(type);
415  }
416  //HB
417  for (int depth=0; depth<maxDepthHB_; ++depth) {
418  snprintf (name1, 40, "HB%d", depth);
419  snprintf (name2, 40, "HB 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  //HE
426  for (int depth=0; depth<maxDepthHE_; ++depth) {
427  snprintf (name1, 40, "HE%d+z", depth);
428  snprintf (name2, 40, "HE +z depth%d", depth+1);
429  names = std::pair<std::string,std::string>(std::string(name1),std::string(name2));
431  divisions.push_back(names);
432  types.push_back(type);
433  snprintf (name1, 40, "HE%d-z", depth);
434  snprintf (name2, 40, "HE -z depth%d", depth+1);
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  //HO
441  {
442  int depth = maxDepthHO_;
443  snprintf (name1, 40, "HO%d", depth);
444  snprintf (name2, 40, "HO depth%d", depth);
445  names = std::pair<std::string,std::string>(std::string(name1),std::string(name2));
446  type = SimHitsValidationHcal::idType(HcalOuter,0,depth,depth);
447  divisions.push_back(names);
448  types.push_back(type);
449  }
450  //HF (first absorber, then different types of abnormal hits)
451  std::string hfty1[4] = {"A","W","B","J"};
452  std::string hfty2[4] = {"Absorber", "Window", "Bundle", "Jungle"};
453  int dept0[4] = {0, 1, 2, 3};
454  for (int k=0; k<4; ++k) {
455  for (int depth=0; depth<maxDepthHF_; ++depth) {
456  snprintf (name1, 40, "HF%s%d+z", hfty1[k].c_str(), depth);
457  snprintf (name2, 40, "HF (%s) +z depth%d", hfty2[k].c_str(), depth+1);
458  names = std::pair<std::string,std::string>(std::string(name1),std::string(name2));
459  type = SimHitsValidationHcal::idType(HcalForward,1,depth+1,dept0[k]);
460  divisions.push_back(names);
461  types.push_back(type);
462  snprintf (name1, 40, "HF%s%d-z", hfty1[k].c_str(), depth);
463  snprintf (name2, 40, "HF (%s) -z depth%d", hfty2[k].c_str(), depth+1);
464  names = std::pair<std::string,std::string>(std::string(name1),std::string(name2));
465  type = SimHitsValidationHcal::idType(HcalForward,-1,depth+1,dept0[k]);
466  divisions.push_back(names);
467  types.push_back(type);
468  }
469  }
470 
471  return divisions;
472 }
type
Definition: HCALResponse.h:21
const std::string names[nVars_]
int k[5][pyjets_maxn]
SimHitsValidationHcal::etaRange SimHitsValidationHcal::getLimits ( idType  type)
private

Definition at line 316 of file SimHitsValidationHcal.cc.

References create_public_pileup_plots::bins, MuonErrorMatrixValues_cff::etaRange, HcalDDDRecConstants::getEtaRange(), HcalBarrel, HcalEndcap, HcalForward, HcalOuter, hcons, SimHitsValidationHcal::idType::subdet, and SimHitsValidationHcal::idType::z.

Referenced by bookHistograms().

316  {
317 
318  int bins;
319  std::pair<int,int> range;
320  double low, high;
321 
322  if (type.subdet == HcalBarrel) {
323  range = hcons->getEtaRange(0);
324  low =-range.second;
325  high = range.second;
326  bins = (high-low);
327  } else if (type.subdet == HcalEndcap) {
328  range = hcons->getEtaRange(1);
329  bins = range.second- range.first;
330  if (type.z == 1) {
331  low = range.first;
332  high = range.second;
333  } else {
334  low =-range.second;
335  high =-range.first;
336  }
337  } else if (type.subdet == HcalOuter) {
338  range = hcons->getEtaRange(3);
339  low =-range.second;
340  high = range.second;
341  bins = high-low;
342  } else if (type.subdet == HcalForward) {
343  range = hcons->getEtaRange(2);
344  bins = range.second-range.first;
345  if (type.z == 1) {
346  low = range.first;
347  high = range.second;
348  } else {
349  low =-range.second;
350  high =-range.first;
351  }
352  } else {
353  bins = 82;
354  low =-41;
355  high = 41;
356  }
357 #ifdef DebugLog
358  edm::LogInfo("HitsValidationHcal") << "Subdetector:" << type.subdet << " z:"
359  << type.z << " range.first:" << range.first
360  << " and second:" << range.second;
361  edm::LogInfo("HitsValidationHcal") << "bins: " << bins << " low:" << low
362  << " high:" << high;
363 #endif
364  return SimHitsValidationHcal::etaRange(bins, low, high);
365 }
type
Definition: HCALResponse.h:21
const HcalDDDRecConstants * hcons
std::pair< int, int > getEtaRange(const int &i) const
std::pair< int, int > SimHitsValidationHcal::histId ( int  subdet,
int  eta,
int  depth,
unsigned int  dep 
)
private

Definition at line 367 of file SimHitsValidationHcal.cc.

References HcalEmpty, HcalEndcap, HcalForward, globals_cff::id1, globals_cff::id2, gen::k, and z.

Referenced by analyzeHits().

367  {
368 
369  int id1(-1), id2(-1);
370  for (unsigned int k=0; k<types.size(); ++k) {
371  if (subdet == HcalForward) {
372  if (subdet == (int)(types[k].subdet) && depth == types[k].depth1 &&
373  eta*types[k].z > 0 && dep == (unsigned int)(types[k].depth2)) {
374  id1 = k; break;
375  }
376  } else if (subdet == HcalEndcap) {
377  if (subdet == (int)(types[k].subdet) && depth == types[k].depth1 &&
378  eta*types[k].z > 0) {
379  id1 = k; break;
380  }
381  } else {
382  if (subdet == (int)(types[k].subdet) && depth == types[k].depth1) {
383  id1 = k; break;
384  }
385  }
386  }
387  if (subdet == HcalForward) depth += 2*dep;
388  for (unsigned int k=0; k<types.size(); ++k) {
389  if (types[k].subdet == HcalEmpty && types[k].depth1 == depth) {
390  id2 = k;
391  break;
392  }
393  }
394  return std::pair<int,int>(id1,id2);
395 }
int k[5][pyjets_maxn]

Member Data Documentation

std::string SimHitsValidationHcal::g4Label_
private

Definition at line 68 of file SimHitsValidationHcal.h.

Referenced by SimHitsValidationHcal().

std::string SimHitsValidationHcal::hcalHits_
private

Definition at line 68 of file SimHitsValidationHcal.h.

Referenced by SimHitsValidationHcal().

const HcalDDDRecConstants* SimHitsValidationHcal::hcons
private

Definition at line 70 of file SimHitsValidationHcal.h.

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

bool SimHitsValidationHcal::initialized
private

Definition at line 67 of file SimHitsValidationHcal.h.

int SimHitsValidationHcal::maxDepthHB_
private

Definition at line 73 of file SimHitsValidationHcal.h.

Referenced by bookHistograms(), and getHistogramTypes().

int SimHitsValidationHcal::maxDepthHE_
private

Definition at line 73 of file SimHitsValidationHcal.h.

Referenced by bookHistograms(), and getHistogramTypes().

int SimHitsValidationHcal::maxDepthHF_
private

Definition at line 74 of file SimHitsValidationHcal.h.

Referenced by bookHistograms(), and getHistogramTypes().

int SimHitsValidationHcal::maxDepthHO_
private

Definition at line 74 of file SimHitsValidationHcal.h.

Referenced by bookHistograms(), and getHistogramTypes().

MonitorElement* SimHitsValidationHcal::meEnergy_HB
private

Definition at line 79 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

MonitorElement* SimHitsValidationHcal::meEnergy_HE
private

Definition at line 80 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

MonitorElement* SimHitsValidationHcal::meEnergy_HF
private

Definition at line 82 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

MonitorElement* SimHitsValidationHcal::meEnergy_HO
private

Definition at line 81 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

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

Definition at line 78 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

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

Definition at line 78 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

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

Definition at line 77 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

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

Definition at line 77 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

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

Definition at line 76 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

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

Definition at line 76 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

MonitorElement * SimHitsValidationHcal::metime_enweighted_HB
private

Definition at line 79 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

MonitorElement * SimHitsValidationHcal::metime_enweighted_HE
private

Definition at line 80 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

MonitorElement * SimHitsValidationHcal::metime_enweighted_HF
private

Definition at line 82 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

MonitorElement * SimHitsValidationHcal::metime_enweighted_HO
private

Definition at line 81 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

MonitorElement * SimHitsValidationHcal::metime_HB
private

Definition at line 79 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

MonitorElement * SimHitsValidationHcal::metime_HE
private

Definition at line 80 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

MonitorElement * SimHitsValidationHcal::metime_HF
private

Definition at line 82 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

MonitorElement * SimHitsValidationHcal::metime_HO
private

Definition at line 81 of file SimHitsValidationHcal.h.

Referenced by analyzeHits(), and bookHistograms().

bool SimHitsValidationHcal::testNumber_
private

Definition at line 72 of file SimHitsValidationHcal.h.

Referenced by analyze(), and SimHitsValidationHcal().

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

Definition at line 69 of file SimHitsValidationHcal.h.

Referenced by analyze(), and SimHitsValidationHcal().

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

Definition at line 71 of file SimHitsValidationHcal.h.

Referenced by DQMIO2histo.DQMIO::print_index().

bool SimHitsValidationHcal::verbose_
private

Definition at line 72 of file SimHitsValidationHcal.h.

Referenced by SimHitsValidationHcal().