CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Classes

struct  energysum
 
struct  etaRange
 
struct  idType
 

Public Member Functions

 SimHitsValidationHcal (const edm::ParameterSet &ps)
 
 ~SimHitsValidationHcal ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector
< ProductResolverIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr
< dqmDetails::NoCache
globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr
< dqmDetails::NoCache
globalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 
void analyzeHits (std::vector< PCaloHit > &)
 
virtual void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

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_, HLT_FULL_cff::InputTag, 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 ( )

Definition at line 22 of file SimHitsValidationHcal.cc.

22 {}

Member Function Documentation

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

Implements edm::stream::EDAnalyzerBase.

Definition at line 149 of file SimHitsValidationHcal.cc.

References analyzeHits(), HLT_FULL_cff::depth, eta, edm::EventID::event(), edm::Event::getByToken(), HcalDDDRecConstants::getHCID(), HcalBarrel, HcalEndcap, HcalForward, HcalOuter, hcons, i, edm::EventBase::id(), edm::HandleBase::isValid(), phi, DetId::rawId(), edm::EventID::run(), jetcorrextractor::sign(), testNumber_, tok_hits_, HcalTestNumbering::unpackHcalIndex(), and z.

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();
175  int subdet, z, depth0, eta0, phi0, lay;
176  HcalTestNumbering::unpackHcalIndex(id_, subdet, z, depth0, eta0, phi0, lay);
177  int sign = (z==0) ? (-1):(1);
178 #ifdef DebugLog
179  edm::LogInfo("HitsValidationHcal") << "Hit[" << i
180  << "] subdet|z|depth|eta|phi|lay "
181  << subdet << "|" << z << "|"
182  << depth0 << "|" << eta0 << "|"
183  << phi0 << "|" << lay;
184 #endif
185  HcalDDDRecConstants::HcalID id = hcons->getHCID(subdet, eta0, phi0, lay, depth0);
186 
187  HcalDetId hid;
188  if (subdet==int(HcalBarrel)) {
189  hid = HcalDetId(HcalBarrel,sign*id.eta,id.phi,id.depth);
190  } else if (subdet==int(HcalEndcap)) {
191  hid = HcalDetId(HcalEndcap,sign*id.eta,id.phi,id.depth);
192  } else if (subdet==int(HcalOuter)) {
193  hid = HcalDetId(HcalOuter,sign*id.eta,id.phi,id.depth);
194  } else if (subdet==int(HcalForward)) {
195  hid = HcalDetId(HcalForward,sign*id.eta,id.phi,id.depth);
196  }
197  caloHits[i].setID(hid.rawId());
198 #ifdef DebugLog
199  edm::LogInfo("HitsValidationHcal") << "Hit[" << i << "] " << hid;
200 #endif
201  }
202  }
203 #ifdef DebugLog
204  edm::LogInfo("HitsValidationHcal") << "HitsValidationHcal: Hit buffer "
205  << caloHits.size();
206 #endif
207  analyzeHits (caloHits);
208  }
209 }
RunNumber_t run() const
Definition: EventID.h:39
EventNumber_t event() const
Definition: EventID.h:41
int i
Definition: DBlmapReader.cc:9
const HcalDDDRecConstants * hcons
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
double sign(double x)
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
HcalID getHCID(int subdet, int ieta, int iphi, int lay, int idepth) const
static void unpackHcalIndex(const uint32_t &idx, int &det, int &z, int &depth, int &eta, int &phi, int &lay)
bool isValid() const
Definition: HandleBase.h:75
edm::EventID id() const
Definition: EventBase.h:58
edm::EDGetTokenT< edm::PCaloHitContainer > tok_hits_
void analyzeHits(std::vector< PCaloHit > &)
void SimHitsValidationHcal::analyzeHits ( std::vector< PCaloHit > &  hits)
protected

Definition at line 211 of file SimHitsValidationHcal.cc.

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

Referenced by analyze().

211  {
212 
213  int nHit = hits.size();
214  double entotHB = 0, entotHE = 0, entotHF = 0, entotHO = 0;
215  double timetotHB = 0, timetotHE = 0, timetotHF = 0, timetotHO = 0;
216  int nHB=0, nHE=0, nHO=0, nHF=0;
217 
218  std::map<std::pair<HcalDetId,unsigned int>,energysum> map_try;
219  map_try.clear();
220  std::map<std::pair<HcalDetId,unsigned int>,energysum>::iterator itr;
221 
222  for (int i=0; i<nHit; i++) {
223  double energy = hits[i].energy();
224  double time = hits[i].time();
225  HcalDetId id = HcalDetId(hits[i].id());
226  int itime = (int)(time);
227  int subdet = id.subdet();
228  int depth = id.depth();
229  int eta = id.ieta();
230  unsigned int dep = hits[i].depth();
231 
232  std::pair<int,int> types = histId(subdet, eta, depth, dep);
233  if (subdet == static_cast<int>(HcalBarrel)) {
234  entotHB += energy;
235  timetotHB += time;
236  nHB++;
237  } else if (subdet == static_cast<int>(HcalEndcap)) {
238  entotHE += energy;
239  timetotHE += time;
240  nHE++;
241  } else if (subdet == static_cast<int>(HcalOuter)) {
242  entotHO += energy;
243  timetotHO += time;
244  nHO++;
245  } else if (subdet == static_cast<int>(HcalForward)) {
246  entotHF += energy;
247  timetotHF += time;
248  nHF++;
249  }
250 
251  std::pair<HcalDetId,unsigned int> id0(id,dep);
252  energysum ensum;
253  if (map_try.count(id0) != 0) ensum = map_try[id0];
254  if (itime<250) {
255  ensum.e250 += energy;
256  if (itime<100) {
257  ensum.e100 += energy;
258  if (itime<50) {
259  ensum.e50 += energy;
260  if (itime<25) ensum.e25 += energy;
261  }
262  }
263  }
264  map_try[id0] = ensum;
265 
266 #ifdef DebugLog
267  edm::LogInfo("HitsValidationHcal") << "Hit[" << i << "] ID " << std::dec
268  << " " << id << std::dec << " Det "
269  << id.det() << " Sub " << subdet
270  << " depth " << depth << " depthX "
271  << dep << " Eta " << eta << " Phi "
272  << id.iphi() << " E " << energy
273  << " time " << time << " type "
274  << types.first << " " << types.second;
275 #endif
276 
277  double etax = eta - 0.5;
278  if (eta < 0) etax += 1;
279  if (types.first >= 0) {
280  meHcalHitEta_[types.first]->Fill(etax,energy);
281  meHcalHitTimeEta_[types.first]->Fill(etax,time);
282  }
283  if (types.second >= 0) {
284  meHcalHitEta_[types.second]->Fill(etax,energy);
285  meHcalHitTimeEta_[types.second]->Fill(etax,time);
286  }
287  }
288 
289  meEnergy_HB->Fill(entotHB);
290  meEnergy_HE->Fill(entotHE);
291  meEnergy_HF->Fill(entotHF);
292  meEnergy_HO->Fill(entotHO);
293 
294  metime_HB->Fill(timetotHB);
295  metime_HE->Fill(timetotHE);
296  metime_HF->Fill(timetotHF);
297  metime_HO->Fill(timetotHO);
298 
299  metime_enweighted_HB->Fill(timetotHB,entotHB);
300  metime_enweighted_HE->Fill(timetotHE,entotHE);
301  metime_enweighted_HF->Fill(timetotHF,entotHF);
302  metime_enweighted_HO->Fill(timetotHO,entotHO);
303 
304 
305  for (itr = map_try.begin(); itr != map_try.end(); ++itr) {
306  HcalDetId id = (*itr).first.first;
307  energysum ensum = (*itr).second;
308  std::pair<int,int> types = histId((int)(id.subdet()), id.ieta(), id.depth(), (*itr).first.second);
309  int eta = id.ieta();
310  int phi = id.iphi();
311  double etax= eta-0.5;
312  double phix= phi-0.5;
313  if (types.first >= 0) {
314  meHcalEnergyl25_[types.first]->Fill(etax,phix,ensum.e25);
315  meHcalEnergyl50_[types.first]->Fill(etax,phix,ensum.e50);
316  meHcalEnergyl100_[types.first]->Fill(etax,phix,ensum.e100);
317  meHcalEnergyl250_[types.first]->Fill(etax,phix,ensum.e250);
318  }
319  if (types.second >= 0) {
320  meHcalEnergyl25_[types.second]->Fill(etax,phix,ensum.e25);
321  meHcalEnergyl50_[types.second]->Fill(etax,phix,ensum.e50);
322  meHcalEnergyl100_[types.second]->Fill(etax,phix,ensum.e100);
323  meHcalEnergyl250_[types.second]->Fill(etax,phix,ensum.e250);
324  }
325 
326 #ifdef DebugLog
327  edm::LogInfo("HitsValidationHcal") << " energy of tower =" << (*itr).first.first
328  << " in time 25ns is == " << (*itr).second.e25
329  << " in time 25-50ns == " << (*itr).second.e50
330  << " in time 50-100ns == " << (*itr).second.e100
331  << " in time 100-250 ns == " << (*itr).second.e250;
332 #endif
333  }
334 
335 }
MonitorElement * meEnergy_HF
std::vector< MonitorElement * > meHcalHitEta_
int i
Definition: DBlmapReader.cc:9
MonitorElement * metime_enweighted_HO
std::vector< MonitorElement * > meHcalEnergyl25_
void Fill(long long x)
MonitorElement * metime_enweighted_HB
MonitorElement * meEnergy_HB
std::vector< MonitorElement * > meHcalEnergyl250_
std::vector< idType > types
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 
)
protectedvirtual

Implements DQMEDAnalyzer.

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, i, MessageLogger_cff::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, mergeVDriftHistosByStation::name, edm::second(), DQMStore::IBooker::setCurrentFolder(), SiPixelPhase1TrackClusters_cfi::title, and types.

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 }
int getNPhi(const int type) const
MonitorElement * meEnergy_HF
std::vector< MonitorElement * > meHcalHitEta_
int i
Definition: DBlmapReader.cc:9
const HcalDDDRecConstants * hcons
MonitorElement * metime_enweighted_HO
std::vector< MonitorElement * > meHcalEnergyl25_
MonitorElement * metime_enweighted_HB
U second(std::pair< T, U > const &p)
int getMaxDepth(const int type) const
MonitorElement * meEnergy_HB
std::vector< MonitorElement * > meHcalEnergyl250_
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
std::vector< idType > types
MonitorElement * metime_enweighted_HF
std::vector< MonitorElement * > meHcalEnergyl100_
std::vector< MonitorElement * > meHcalEnergyl50_
MonitorElement * metime_enweighted_HE
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
MonitorElement * meEnergy_HE
std::pair< int, int > getEtaRange(const int i) const
std::vector< MonitorElement * > meHcalHitTimeEta_
MonitorElement * meEnergy_HO
std::vector< std::pair< std::string, std::string > > getHistogramTypes()
void SimHitsValidationHcal::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 495 of file SimHitsValidationHcal.cc.

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

495  {
497  desc.add<std::string>("ModuleLabel","g4SimHits");
498  desc.add<std::string>("HitCollection","HcalHits");
499  desc.add<bool>("Verbose",false);
500  desc.add<bool>("TestNumber",false);
501 
502  descriptions.addDefault(desc);
503 }
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 418 of file SimHitsValidationHcal.cc.

References HLT_FULL_cff::depth, HcalBarrel, HcalEmpty, HcalEndcap, HcalForward, HcalOuter, relval_2017::k, bookConverter::max, HLT_FULL_cff::maxDepth, maxDepthHB_, maxDepthHE_, maxDepthHF_, maxDepthHO_, cscdqm::h::names, AlCaHLTBitMon_QueryRunRegistry::string, and types.

Referenced by bookHistograms().

418  {
419 
421  maxDepth = std::max(maxDepth,maxDepthHF_);
422  maxDepth = std::max(maxDepth,maxDepthHO_);
423 
424  std::vector<std::pair<std::string,std::string> > divisions;
425  std::pair<std::string,std::string> names;
426  char name1[40], name2[40];
428  //first overall Hcal
429  for (int depth=0; depth<maxDepth; ++depth) {
430  snprintf (name1, 40, "HC%d", depth);
431  snprintf (name2, 40, "HCAL depth%d", depth+1);
432  names = std::pair<std::string,std::string>(std::string(name1),std::string(name2));
434  divisions.push_back(names);
435  types.push_back(type);
436  }
437  //HB
438  for (int depth=0; depth<maxDepthHB_; ++depth) {
439  snprintf (name1, 40, "HB%d", depth);
440  snprintf (name2, 40, "HB depth%d", depth+1);
441  names = std::pair<std::string,std::string>(std::string(name1),std::string(name2));
443  divisions.push_back(names);
444  types.push_back(type);
445  }
446  //HE
447  for (int depth=0; depth<maxDepthHE_; ++depth) {
448  snprintf (name1, 40, "HE%d+z", depth);
449  snprintf (name2, 40, "HE +z depth%d", depth+1);
450  names = std::pair<std::string,std::string>(std::string(name1),std::string(name2));
452  divisions.push_back(names);
453  types.push_back(type);
454  snprintf (name1, 40, "HE%d-z", depth);
455  snprintf (name2, 40, "HE -z depth%d", depth+1);
456  names = std::pair<std::string,std::string>(std::string(name1),std::string(name2));
458  divisions.push_back(names);
459  types.push_back(type);
460  }
461  //HO
462  {
463  int depth = maxDepthHO_;
464  snprintf (name1, 40, "HO%d", depth);
465  snprintf (name2, 40, "HO depth%d", depth);
466  names = std::pair<std::string,std::string>(std::string(name1),std::string(name2));
467  type = SimHitsValidationHcal::idType(HcalOuter,0,depth,depth);
468  divisions.push_back(names);
469  types.push_back(type);
470  }
471  //HF (first absorber, then different types of abnormal hits)
472  std::string hfty1[4] = {"A","W","B","J"};
473  std::string hfty2[4] = {"Absorber", "Window", "Bundle", "Jungle"};
474  int dept0[4] = {0, 1, 2, 3};
475  for (int k=0; k<4; ++k) {
476  for (int depth=0; depth<maxDepthHF_; ++depth) {
477  snprintf (name1, 40, "HF%s%d+z", hfty1[k].c_str(), depth);
478  snprintf (name2, 40, "HF (%s) +z depth%d", hfty2[k].c_str(), depth+1);
479  names = std::pair<std::string,std::string>(std::string(name1),std::string(name2));
480  type = SimHitsValidationHcal::idType(HcalForward,1,depth+1,dept0[k]);
481  divisions.push_back(names);
482  types.push_back(type);
483  snprintf (name1, 40, "HF%s%d-z", hfty1[k].c_str(), depth);
484  snprintf (name2, 40, "HF (%s) -z depth%d", hfty2[k].c_str(), depth+1);
485  names = std::pair<std::string,std::string>(std::string(name1),std::string(name2));
486  type = SimHitsValidationHcal::idType(HcalForward,-1,depth+1,dept0[k]);
487  divisions.push_back(names);
488  types.push_back(type);
489  }
490  }
491 
492  return divisions;
493 }
type
Definition: HCALResponse.h:21
static const HistoName names[]
std::vector< idType > types
SimHitsValidationHcal::etaRange SimHitsValidationHcal::getLimits ( idType  type)
private

Definition at line 337 of file SimHitsValidationHcal.cc.

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

Referenced by bookHistograms().

337  {
338 
339  int bins;
340  std::pair<int,int> range;
341  double low, high;
342 
343  if (type.subdet == HcalBarrel) {
344  range = hcons->getEtaRange(0);
345  low =-range.second;
346  high = range.second;
347  bins = (high-low);
348  } else if (type.subdet == HcalEndcap) {
349  range = hcons->getEtaRange(1);
350  bins = range.second- range.first;
351  if (type.z == 1) {
352  low = range.first;
353  high = range.second;
354  } else {
355  low =-range.second;
356  high =-range.first;
357  }
358  } else if (type.subdet == HcalOuter) {
359  range = hcons->getEtaRange(3);
360  low =-range.second;
361  high = range.second;
362  bins = high-low;
363  } else if (type.subdet == HcalForward) {
364  range = hcons->getEtaRange(2);
365  bins = range.second-range.first;
366  if (type.z == 1) {
367  low = range.first;
368  high = range.second;
369  } else {
370  low =-range.second;
371  high =-range.first;
372  }
373  } else {
374  bins = 82;
375  low =-41;
376  high = 41;
377  }
378 #ifdef DebugLog
379  edm::LogInfo("HitsValidationHcal") << "Subdetector:" << type.subdet << " z:"
380  << type.z << " range.first:" << range.first
381  << " and second:" << range.second;
382  edm::LogInfo("HitsValidationHcal") << "bins: " << bins << " low:" << low
383  << " high:" << high;
384 #endif
385  return SimHitsValidationHcal::etaRange(bins, low, high);
386 }
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 388 of file SimHitsValidationHcal.cc.

References HcalEmpty, HcalEndcap, HcalForward, relval_2017::k, types, and z.

Referenced by analyzeHits().

388  {
389 
390  int id1(-1), id2(-1);
391  for (unsigned int k=0; k<types.size(); ++k) {
392  if (subdet == HcalForward) {
393  if (subdet == (int)(types[k].subdet) && depth == types[k].depth1 &&
394  eta*types[k].z > 0 && dep == (unsigned int)(types[k].depth2)) {
395  id1 = k; break;
396  }
397  } else if (subdet == HcalEndcap) {
398  if (subdet == (int)(types[k].subdet) && depth == types[k].depth1 &&
399  eta*types[k].z > 0) {
400  id1 = k; break;
401  }
402  } else {
403  if (subdet == (int)(types[k].subdet) && depth == types[k].depth1) {
404  id1 = k; break;
405  }
406  }
407  }
408  if (subdet == HcalForward) depth += 2*dep;
409  for (unsigned int k=0; k<types.size(); ++k) {
410  if (types[k].subdet == HcalEmpty && types[k].depth1 == depth) {
411  id2 = k;
412  break;
413  }
414  }
415  return std::pair<int,int>(id1,id2);
416 }
std::vector< idType > types

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 analyzeHits(), bookHistograms(), getHistogramTypes(), and histId().

bool SimHitsValidationHcal::verbose_
private

Definition at line 72 of file SimHitsValidationHcal.h.

Referenced by SimHitsValidationHcal().