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 | 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 ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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

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::getUntrackedParameter(), hcalHits_, HLT_25ns10e33_v2_cff::InputTag, AlCaHLTBitMon_QueryRunRegistry::string, testNumber_, tok_hits_, and verbose_.

8  {
9 
10  g4Label_ = ps.getUntrackedParameter<std::string>("moduleLabel","g4SimHits");
11  hcalHits_ = ps.getUntrackedParameter<std::string>("HitCollection","HcalHits");
12  verbose_ = ps.getUntrackedParameter<bool>("Verbose", false);
13  testNumber_= ps.getUntrackedParameter<bool>("TestNumber", false);
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 getUntrackedParameter(std::string const &, T 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 101 of file SimHitsValidationHcal.cc.

References analyzeHits(), HLT_25ns10e33_v2_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.

102  {
103 
104 
105 #ifdef DebugLog
106  edm::LogInfo("HitsValidationHcal") << "Run = " << e.id().run() << " Event = "
107  << e.id().event();
108 #endif
109  std::vector<PCaloHit> caloHits;
111 
112  bool getHits = false;
113  e.getByToken(tok_hits_,hitsHcal);
114  if (hitsHcal.isValid()) getHits = true;
115 #ifdef DebugLog
116  edm::LogInfo("HitsValidationHcal") << "HitsValidationHcal.: Input flags Hits "
117  << getHits;
118 #endif
119  if (getHits) {
120  caloHits.insert(caloHits.end(),hitsHcal->begin(),hitsHcal->end());
121 #ifdef DebugLog
122  edm::LogInfo("HitsValidationHcal") << "testNumber_:" << testNumber_;
123 #endif
124  if (testNumber_) {
125  for (unsigned int i=0; i<caloHits.size(); ++i) {
126  unsigned int id_ = caloHits[i].id();
127  int subdet, z, depth0, eta0, phi0, lay;
128  HcalTestNumbering::unpackHcalIndex(id_, subdet, z, depth0, eta0, phi0, lay);
129  int sign = (z==0) ? (-1):(1);
130 #ifdef DebugLog
131  edm::LogInfo("HitsValidationHcal") << "Hit[" << i
132  << "] subdet|z|depth|eta|phi|lay "
133  << subdet << "|" << z << "|"
134  << depth0 << "|" << eta0 << "|"
135  << phi0 << "|" << lay;
136 #endif
137  HcalDDDRecConstants::HcalID id = hcons->getHCID(subdet, eta0, phi0, lay, depth0);
138 
139  HcalDetId hid;
140  if (subdet==int(HcalBarrel)) {
141  hid = HcalDetId(HcalBarrel,sign*id.eta,id.phi,id.depth);
142  } else if (subdet==int(HcalEndcap)) {
143  hid = HcalDetId(HcalEndcap,sign*id.eta,id.phi,id.depth);
144  } else if (subdet==int(HcalOuter)) {
145  hid = HcalDetId(HcalOuter,sign*id.eta,id.phi,id.depth);
146  } else if (subdet==int(HcalForward)) {
147  hid = HcalDetId(HcalForward,sign*id.eta,id.phi,id.depth);
148  }
149  caloHits[i].setID(hid.rawId());
150 #ifdef DebugLog
151  edm::LogInfo("HitsValidationHcal") << "Hit[" << i << "] " << hid;
152 #endif
153  }
154  }
155 #ifdef DebugLog
156  edm::LogInfo("HitsValidationHcal") << "HitsValidationHcal: Hit buffer "
157  << caloHits.size();
158 #endif
159  analyzeHits (caloHits);
160  }
161 }
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:462
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:59
edm::EDGetTokenT< edm::PCaloHitContainer > tok_hits_
void analyzeHits(std::vector< PCaloHit > &)
void SimHitsValidationHcal::analyzeHits ( std::vector< PCaloHit > &  hits)
protected

Definition at line 163 of file SimHitsValidationHcal.cc.

References TauDecayModes::dec, HLT_25ns10e33_v2_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().

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

24  {
25 
27  es.get<HcalRecNumberingRecord>().get( pHRNDC );
28  hcons = &(*pHRNDC);
33 #ifdef DebugLog
34  edm::LogInfo("HitsValidationHcal") << " Maximum Depths HB:"<< maxDepthHB_
35  << " HE:" << maxDepthHE_ << " HO:"
36  << maxDepthHO_ << " HF:" << maxDepthHF_;
37 #endif
38  std::vector<std::pair<std::string,std::string> > divisions = getHistogramTypes();
39 
40  edm::LogInfo("HitsValidationHcal") << "Booking the Histograms";
41  ib.setCurrentFolder("HcalHitsV/SimHitsValidationHcal");
42 
43  //Histograms for Hits
44 
45  char name[100], title[200];
46  for (unsigned int i=0; i<types.size(); ++i) {
48  sprintf (name, "HcalHitEta%s", divisions[i].first.c_str());
49  sprintf (title, "Hit energy as a function of eta tower index in %s", divisions[i].second.c_str());
50  meHcalHitEta_.push_back(ib.book1D(name, title, limit.bins, limit.low, limit.high));
51 
52  sprintf (name, "HcalHitTimeAEta%s", divisions[i].first.c_str());
53  sprintf (title, "Hit time as a function of eta tower index in %s", divisions[i].second.c_str());
54  meHcalHitTimeEta_.push_back(ib.book1D(name, title, limit.bins, limit.low, limit.high));
55 
56  sprintf (name, "HcalHitE25%s", divisions[i].first.c_str());
57  sprintf (title, "Energy in time window 0 to 25 for a tower in %s", divisions[i].second.c_str());
58  meHcalEnergyl25_.push_back(ib.book2D(name, title, limit.bins, limit.low, limit.high, 72, 0., 72.));
59 
60  sprintf (name, "HcalHitE50%s", divisions[i].first.c_str());
61  sprintf (title, "Energy in time window 0 to 50 for a tower in %s", divisions[i].second.c_str());
62  meHcalEnergyl50_.push_back(ib.book2D(name, title, limit.bins, limit.low, limit.high, 72, 0., 72.));
63 
64  sprintf (name, "HcalHitE100%s", divisions[i].first.c_str());
65  sprintf (title, "Energy in time window 0 to 100 for a tower in %s", divisions[i].second.c_str());
66  meHcalEnergyl100_.push_back(ib.book2D(name, title, limit.bins, limit.low, limit.high, 72, 0., 72.));
67 
68  sprintf (name, "HcalHitE250%s", divisions[i].first.c_str());
69  sprintf (title, "Energy in time window 0 to 250 for a tower in %s", divisions[i].second.c_str());
70  meHcalEnergyl250_.push_back(ib.book2D(name, title, limit.bins, limit.low, limit.high, 72, 0., 72.));
71  }
72 
73  sprintf (name, "Energy_HB");
74  meEnergy_HB = ib.book1D(name, name, 100,0,1);
75  sprintf (name, "Energy_HE");
76  meEnergy_HE = ib.book1D(name, name, 100,0,1);
77  sprintf (name, "Energy_HO");
78  meEnergy_HO = ib.book1D(name, name, 100,0,1);
79  sprintf (name, "Energy_HF");
80  meEnergy_HF = ib.book1D(name, name, 100,0,50);
81 
82  sprintf (name, "Time_HB");
83  metime_HB = ib.book1D(name, name, 300,-150,150);
84  sprintf (name, "Time_HE");
85  metime_HE = ib.book1D(name, name, 300,-150,150);
86  sprintf (name, "Time_HO");
87  metime_HO = ib.book1D(name, name, 300,-150, 150);
88  sprintf (name, "Time_HF");
89  metime_HF = ib.book1D(name, name, 300,-150,150);
90 
91  sprintf (name, "Time_Enweighted_HB");
92  metime_enweighted_HB = ib.book1D(name, name, 300,-150,150);
93  sprintf (name, "Time_Enweighted_HE");
94  metime_enweighted_HE = ib.book1D(name, name, 300,-150,150);
95  sprintf (name, "Time_Enweighted_HO");
96  metime_enweighted_HO = ib.book1D(name, name, 300,-150, 150);
97  sprintf (name, "Time_Enweighted_HF");
98  metime_enweighted_HF = ib.book1D(name, name, 300,-150,150);
99 }
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:276
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
MonitorElement * meEnergy_HE
std::vector< MonitorElement * > meHcalHitTimeEta_
MonitorElement * meEnergy_HO
std::vector< std::pair< std::string, std::string > > getHistogramTypes()
std::vector< std::pair< std::string, std::string > > SimHitsValidationHcal::getHistogramTypes ( )
private

Definition at line 370 of file SimHitsValidationHcal.cc.

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

Referenced by bookHistograms().

370  {
371 
373  maxDepth = std::max(maxDepth,maxDepthHF_);
374  maxDepth = std::max(maxDepth,maxDepthHO_);
375 
376  std::vector<std::pair<std::string,std::string> > divisions;
377  std::pair<std::string,std::string> names;
378  char name1[40], name2[40];
380  //first overall Hcal
381  for (int depth=0; depth<maxDepth; ++depth) {
382  snprintf (name1, 40, "HC%d", depth);
383  snprintf (name2, 40, "HCAL depth%d", depth+1);
384  names = std::pair<std::string,std::string>(std::string(name1),std::string(name2));
386  divisions.push_back(names);
387  types.push_back(type);
388  }
389  //HB
390  for (int depth=0; depth<maxDepthHB_; ++depth) {
391  snprintf (name1, 40, "HB%d", depth);
392  snprintf (name2, 40, "HB depth%d", depth+1);
393  names = std::pair<std::string,std::string>(std::string(name1),std::string(name2));
395  divisions.push_back(names);
396  types.push_back(type);
397  }
398  //HE
399  for (int depth=0; depth<maxDepthHE_; ++depth) {
400  snprintf (name1, 40, "HE%d+z", depth);
401  snprintf (name2, 40, "HE +z depth%d", depth+1);
402  names = std::pair<std::string,std::string>(std::string(name1),std::string(name2));
404  divisions.push_back(names);
405  types.push_back(type);
406  snprintf (name1, 40, "HE%d-z", depth);
407  snprintf (name2, 40, "HE -z depth%d", depth+1);
408  names = std::pair<std::string,std::string>(std::string(name1),std::string(name2));
410  divisions.push_back(names);
411  types.push_back(type);
412  }
413  //HO
414  {
415  int depth = maxDepthHO_;
416  snprintf (name1, 40, "HO%d", depth);
417  snprintf (name2, 40, "HO depth%d", depth);
418  names = std::pair<std::string,std::string>(std::string(name1),std::string(name2));
419  type = SimHitsValidationHcal::idType(HcalOuter,0,depth,depth);
420  divisions.push_back(names);
421  types.push_back(type);
422  }
423  //HF (first absorber, then different types of abnormal hits)
424  std::string hfty1[4] = {"A","W","B","J"};
425  std::string hfty2[4] = {"Absorber", "Window", "Bundle", "Jungle"};
426  int dept0[4] = {0, 1, 2, 3};
427  for (int k=0; k<4; ++k) {
428  for (int depth=0; depth<maxDepthHF_; ++depth) {
429  snprintf (name1, 40, "HF%s%d+z", hfty1[k].c_str(), depth);
430  snprintf (name2, 40, "HF (%s) +z depth%d", hfty2[k].c_str(), depth+1);
431  names = std::pair<std::string,std::string>(std::string(name1),std::string(name2));
432  type = SimHitsValidationHcal::idType(HcalForward,1,depth+1,dept0[k]);
433  divisions.push_back(names);
434  types.push_back(type);
435  snprintf (name1, 40, "HF%s%d-z", hfty1[k].c_str(), depth);
436  snprintf (name2, 40, "HF (%s) -z depth%d", hfty2[k].c_str(), depth+1);
437  names = std::pair<std::string,std::string>(std::string(name1),std::string(name2));
438  type = SimHitsValidationHcal::idType(HcalForward,-1,depth+1,dept0[k]);
439  divisions.push_back(names);
440  types.push_back(type);
441  }
442  }
443 
444  return divisions;
445 }
type
Definition: HCALResponse.h:21
static const HistoName names[]
std::vector< idType > types
SimHitsValidationHcal::etaRange SimHitsValidationHcal::getLimits ( idType  type)
private

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

289  {
290 
291  int bins;
292  std::pair<int,int> range;
293  double low, high;
294 
295  if (type.subdet == HcalBarrel) {
296  range = hcons->getEtaRange(0);
297  low =-range.second;
298  high = range.second;
299  bins = (high-low);
300  } else if (type.subdet == HcalEndcap) {
301  range = hcons->getEtaRange(1);
302  bins = range.second- range.first;
303  if (type.z == 1) {
304  low = range.first;
305  high = range.second;
306  } else {
307  low =-range.second;
308  high =-range.first;
309  }
310  } else if (type.subdet == HcalOuter) {
311  range = hcons->getEtaRange(3);
312  low =-range.second;
313  high = range.second;
314  bins = high-low;
315  } else if (type.subdet == HcalForward) {
316  range = hcons->getEtaRange(2);
317  bins = range.second-range.first;
318  if (type.z == 1) {
319  low = range.first;
320  high = range.second;
321  } else {
322  low =-range.second;
323  high =-range.first;
324  }
325  } else {
326  bins = 82;
327  low =-41;
328  high = 41;
329  }
330 #ifdef DebugLog
331  edm::LogInfo("HitsValidationHcal") << "Subdetector:" << type.subdet << " z:"
332  << type.z << " range.first:" << range.first
333  << " and second:" << range.second;
334  edm::LogInfo("HitsValidationHcal") << "bins: " << bins << " low:" << low
335  << " high:" << high;
336 #endif
337  return SimHitsValidationHcal::etaRange(bins, low, high);
338 }
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 340 of file SimHitsValidationHcal.cc.

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

Referenced by analyzeHits().

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