CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | Static Private Attributes
EcalSimHitStudy Class Reference
Inheritance diagram for EcalSimHitStudy:
edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Classes

struct  EcalHit
 

Public Member Functions

 EcalSimHitStudy (const edm::ParameterSet &ps)
 
 ~EcalSimHitStudy () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::SharedResources >
 EDAnalyzer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
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 & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Protected Member Functions

void analyze (edm::Event const &, edm::EventSetup const &) override
 
void analyzeHits (std::vector< PCaloHit > &, int)
 
void beginJob () override
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Private Attributes

TH1F * edep_ [ndets_]
 
TH1F * edepAll_ [ndets_]
 
TH1F * edepEM_ [ndets_]
 
TH1F * edepHad_ [ndets_]
 
TH1F * eneInc_
 
TH1F * etaInc_
 
TH1F * etot_ [ndets_]
 
TH1F * etotg_ [ndets_]
 
std::string g4Label_
 
const CaloGeometrygeometry_
 
TH1F * hit_ [ndets_]
 
std::string hitLab_ [ndets_]
 
double maxEnergy_
 
TH1F * phiInc_
 
TH2F * poszn_ [ndets_]
 
TH2F * poszp_ [ndets_]
 
TH1F * ptInc_
 
TH1F * r1by25_ [ndets_]
 
TH1F * r1by9_ [ndets_]
 
TH1F * r9by25_ [ndets_]
 
int selX_
 
TH1F * sEtaEta_ [ndets_]
 
TH1F * sEtaPhi_ [ndets_]
 
TH1F * sPhiPhi_ [ndets_]
 
TH1F * time_ [ndets_]
 
TH1F * timeAll_ [ndets_]
 
double tmax_
 
edm::EDGetTokenT< edm::HepMCProducttok_evt_
 
edm::EDGetTokenT< edm::PCaloHitContainertoks_calo_ [2]
 
double w0_
 

Static Private Attributes

static const int ndets_ = 2
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Detailed Description

Definition at line 46 of file EcalSimHitStudy.cc.

Constructor & Destructor Documentation

◆ EcalSimHitStudy()

EcalSimHitStudy::EcalSimHitStudy ( const edm::ParameterSet ps)

Definition at line 81 of file EcalSimHitStudy.cc.

81  {
82  usesResource(TFileService::kSharedResource);
83 
84  g4Label_ = ps.getUntrackedParameter<std::string>("ModuleLabel", "g4SimHits");
85  hitLab_[0] = ps.getUntrackedParameter<std::string>("EBCollection", "EcalHitsEB");
86  hitLab_[1] = ps.getUntrackedParameter<std::string>("EECollection", "EcalHitsEE");
87  tok_evt_ =
88  consumes<edm::HepMCProduct>(edm::InputTag(ps.getUntrackedParameter<std::string>("SourceLabel", "VtxSmeared")));
89  maxEnergy_ = ps.getUntrackedParameter<double>("MaxEnergy", 200.0);
90  tmax_ = ps.getUntrackedParameter<double>("TimeCut", 100.0);
91  w0_ = ps.getUntrackedParameter<double>("W0", 4.7);
92  selX_ = ps.getUntrackedParameter<int>("SelectX", -1);
93 
94  for (int i = 0; i < ndets_; ++i)
95  toks_calo_[i] = consumes<edm::PCaloHitContainer>(edm::InputTag(g4Label_, hitLab_[i]));
96 
97  edm::LogVerbatim("HitStudy") << "Module Label: " << g4Label_ << " Hits: " << hitLab_[0] << ", " << hitLab_[1]
98  << " MaxEnergy: " << maxEnergy_ << " Tmax: " << tmax_ << " Select " << selX_;
99 }

References g4Label_, edm::ParameterSet::getUntrackedParameter(), hitLab_, mps_fire::i, TFileService::kSharedResource, maxEnergy_, ndets_, selX_, AlCaHLTBitMon_QueryRunRegistry::string, tmax_, tok_evt_, toks_calo_, and w0_.

◆ ~EcalSimHitStudy()

EcalSimHitStudy::~EcalSimHitStudy ( )
inlineoverride

Definition at line 49 of file EcalSimHitStudy.cc.

49 {}

Member Function Documentation

◆ analyze()

void EcalSimHitStudy::analyze ( edm::Event const &  e,
edm::EventSetup const &  iS 
)
overrideprotectedvirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 255 of file EcalSimHitStudy.cc.

255  {
256 #ifdef EDM_ML_DEBUG
257  edm::LogVerbatim("HitStudy") << "Run = " << e.id().run() << " Event = " << e.id().event();
258 #endif
259  // get handles to calogeometry
261  iS.get<CaloGeometryRecord>().get(pG);
262  geometry_ = pG.product();
263 
264  double eInc = 0, etaInc = 0, phiInc = 0;
265  int type(-1);
267  e.getByToken(tok_evt_, EvtHandle);
268  if (EvtHandle.isValid()) {
269  const HepMC::GenEvent* myGenEvent = EvtHandle->GetEvent();
270 
271  HepMC::GenEvent::particle_const_iterator p = myGenEvent->particles_begin();
272  if (p != myGenEvent->particles_end()) {
273  eInc = (*p)->momentum().e();
274  etaInc = (*p)->momentum().eta();
275  phiInc = (*p)->momentum().phi();
276  }
277  double ptInc = eInc / std::cosh(etaInc);
278  ptInc_->Fill(ptInc);
279  eneInc_->Fill(eInc);
280  etaInc_->Fill(etaInc);
281  phiInc_->Fill(phiInc);
282 
283  if (std::abs(etaInc) < 1.46)
284  type = 0;
285  else if (std::abs(etaInc) > 1.49 && std::abs(etaInc) < 3.0)
286  type = 1;
287  }
288 
289  int typeMin = (type < 0) ? 0 : type;
290  int typeMax = (type < 0) ? 1 : type;
291  for (int type = typeMin; type <= typeMax; ++type) {
293  e.getByToken(toks_calo_[type], hitsCalo);
294  bool getHits = (hitsCalo.isValid());
295 #ifdef EDM_ML_DEBUG
296  edm::LogVerbatim("HitStudy") << "EcalSimHitStudy: Input flags Hits " << getHits << " with " << hitsCalo->size()
297  << " hits";
298 #endif
299  if (getHits) {
300  std::vector<PCaloHit> caloHits;
301  caloHits.insert(caloHits.end(), hitsCalo->begin(), hitsCalo->end());
302  if (!caloHits.empty())
303  analyzeHits(caloHits, type);
304  }
305  }
306 }

References funct::abs(), analyzeHits(), MillePedeFileConverter_cfg::e, eneInc_, etaInc_, geometry_, edm::EventSetup::get(), get, edm::HepMCProduct::GetEvent(), edm::HandleBase::isValid(), AlCaHLTBitMon_ParallelJobs::p, phiInc_, edm::ESHandle< T >::product(), ptInc_, tok_evt_, and toks_calo_.

◆ analyzeHits()

void EcalSimHitStudy::analyzeHits ( std::vector< PCaloHit > &  hits,
int  indx 
)
protected

Definition at line 308 of file EcalSimHitStudy.cc.

308  {
309  unsigned int nEC(0);
310  std::map<unsigned int, EcalHit> hitMap;
311  double etot(0), etotG(0);
312  for (auto hit : hits) {
313  double edep = hit.energy();
314  double time = hit.time();
315  unsigned int id_ = hit.id();
316  double edepEM = hit.energyEM();
317  double edepHad = hit.energyHad();
318  if (indx == 0) {
319  if ((hit.depth() == 1) || (hit.depth() == 2))
320  continue;
321  }
322  if (time <= tmax_) {
323  auto it = hitMap.find(id_);
324  if (it == hitMap.end()) {
325  uint16_t dep = hit.depth();
326  hitMap[id_] = EcalHit(dep, time, edep);
327  } else {
328  (it->second).energy += edep;
329  }
330  etotG += edep;
331  ++nEC;
332  }
333  time_[indx]->Fill(time);
334  edep_[indx]->Fill(edep);
335  edepEM_[indx]->Fill(edepEM);
336  edepHad_[indx]->Fill(edepHad);
337  etot += edep;
338  }
339 
340  double edepM(0);
341  unsigned int idM(0);
342  uint16_t depM(0);
343  for (auto it : hitMap) {
344  if (it.second.energy > edepM) {
345  idM = it.first;
346  edepM = it.second.energy;
347  depM = it.second.id;
348  }
349  }
350 
351  bool select(true);
352  if (selX_ >= 0) {
353  if ((depM & 0X4) != 0)
354  select = (selX_ > 0);
355  else
356  select = (selX_ == 0);
357  }
358 #ifdef EDM_ML_DEBUG
359  edm::LogVerbatim("HitStudy") << "EcalSimHitStudy::analyzeHits: Index " << indx << " Emax " << edepM << " IDMax "
360  << std::hex << idM << ":" << depM << std::dec << " Select " << select << ":" << selX_
361  << " Hits " << hits.size() << ":" << nEC << ":" << hitMap.size() << " ETotal " << etot
362  << ":" << etotG;
363 #endif
364  if (select) {
365  etot_[indx]->Fill(etot);
366  etotg_[indx]->Fill(etotG);
367  hit_[indx]->Fill(double(nEC));
368  for (auto it : hitMap) {
369  timeAll_[indx]->Fill((it.second).time);
370  edepAll_[indx]->Fill((it.second).energy);
371  DetId id(it.first);
372  if (indx == 0) {
373  if (EBDetId(id).zside() >= 0)
374  poszp_[indx]->Fill(EBDetId(id).ietaAbs(), EBDetId(id).iphi());
375  else
376  poszn_[indx]->Fill(EBDetId(id).ietaAbs(), EBDetId(id).iphi());
377  } else {
378  GlobalPoint gpos = geometry_->getGeometry(id)->getPosition();
379  if (EEDetId(id).zside() >= 0)
380  poszp_[indx]->Fill(gpos.x(), gpos.y());
381  else
382  poszn_[indx]->Fill(gpos.x(), gpos.y());
383  }
384  }
385 
386  math::XYZVector meanPosition(0.0, 0.0, 0.0);
387  std::vector<math::XYZVector> position;
388  std::vector<double> energy;
389  double e9(0), e25(0);
390  for (auto it : hitMap) {
391  DetId id(it.first);
392  int deta(99), dphi(99), dz(0);
393  if (indx == 0) {
394  deta = std::abs(EBDetId(id).ietaAbs() - EBDetId(idM).ietaAbs());
395  dphi = std::abs(EBDetId(id).iphi() - EBDetId(idM).iphi());
396  if (dphi > 180)
397  dphi = std::abs(dphi - 360);
398  dz = std::abs(EBDetId(id).zside() - EBDetId(idM).zside());
399  } else {
400  deta = std::abs(EEDetId(id).ix() - EEDetId(idM).ix());
401  dphi = std::abs(EEDetId(id).iy() - EEDetId(idM).iy());
402  dz = std::abs(EEDetId(id).zside() - EEDetId(idM).zside());
403  }
404  if (deta <= 1 && dphi <= 1 && dz < 1)
405  e9 += (it.second).energy;
406  if (deta <= 2 && dphi <= 2 && dz < 1) {
407  e25 += (it.second).energy;
408  GlobalPoint gpos = geometry_->getGeometry(id)->getPosition();
409  math::XYZVector pos(gpos.x(), gpos.y(), gpos.z());
410  meanPosition += (it.second).energy * pos;
411  position.push_back(pos);
412  energy.push_back((it.second).energy);
413  }
414  }
415  double r1by9 = (e9 > 0) ? (edepM / e9) : -1;
416  double r1by25 = (e25 > 0) ? (edepM / e25) : -1;
417  double r9by25 = (e25 > 0) ? (e9 / e25) : -1;
418 
419  meanPosition /= e25;
420  double denom(0), numEtaEta(0), numEtaPhi(0), numPhiPhi(0);
421  for (unsigned int k = 0; k < position.size(); ++k) {
422  double dEta = position[k].eta() - meanPosition.eta();
423  double dPhi = position[k].phi() - meanPosition.phi();
424  if (dPhi > +M_PI) {
425  dPhi = 2 * M_PI - dPhi;
426  }
427  if (dPhi < -M_PI) {
428  dPhi = 2 * M_PI + dPhi;
429  }
430 
431  double w = std::max(0.0, (w0_ + std::log(energy[k] / e25)));
432  denom += w;
433  numEtaEta += std::abs(w * dEta * dEta);
434  numEtaPhi += std::abs(w * dEta * dPhi);
435  numPhiPhi += std::abs(w * dPhi * dPhi);
436 #ifdef EDM_ML_DEBUG
437  edm::LogVerbatim("HitStudy") << "[" << k << "] dEta " << dEta << " dPhi " << dPhi << " Wt " << energy[k] / e25
438  << ":" << std::log(energy[k] / e25) << ":" << w;
439 #endif
440  }
441  double sEtaEta = (denom > 0) ? (numEtaEta / denom) : -1.0;
442  double sEtaPhi = (denom > 0) ? (numEtaPhi / denom) : -1.0;
443  double sPhiPhi = (denom > 0) ? (numPhiPhi / denom) : -1.0;
444 
445 #ifdef EDM_ML_DEBUG
446  edm::LogVerbatim("HitStudy") << "EcalSimHitStudy::Ratios " << r1by9 << " : " << r1by25 << " : " << r9by25
447  << " Covariances " << sEtaEta << " : " << sEtaPhi << " : " << sPhiPhi;
448 #endif
449  r1by9_[indx]->Fill(r1by9);
450  r1by25_[indx]->Fill(r1by25);
451  r9by25_[indx]->Fill(r9by25);
452  sEtaEta_[indx]->Fill(sEtaEta);
453  sEtaPhi_[indx]->Fill(sEtaPhi);
454  sPhiPhi_[indx]->Fill(sPhiPhi);
455  }
456 }

References funct::abs(), TauDecayModes::dec, makePileupJSON::denom, HLT_FULL_cff::dEta, HLT_FULL_cff::dPhi, PVValHelper::dz, edep_, edepAll_, edepEM_, edepHad_, HCALHighEnergyHPDFilter_cfi::energy, etot_, etotg_, geometry_, CaloGeometry::getGeometry(), hit_, hfClusterShapes_cfi::hits, triggerObjects_cff::id, hit::id, LEDCalibrationChannels::iphi, dqmdumpme::k, dqm-mbProfile::log, M_PI, SiStripPI::max, position, poszn_, poszp_, r1by25_, r1by9_, r9by25_, singleTopDQM_cfi::select, selX_, sEtaEta_, sEtaPhi_, sPhiPhi_, protons_cff::time, time_, timeAll_, tmax_, w, w0_, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), PV3DBase< T, PVType, FrameType >::z(), and ecaldqm::zside().

Referenced by analyze().

◆ beginJob()

void EcalSimHitStudy::beginJob ( void  )
overrideprotectedvirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 113 of file EcalSimHitStudy.cc.

113  {
115  if (!tfile.isAvailable())
116  throw cms::Exception("BadConfig") << "TFileService unavailable: "
117  << "please add it to config file";
118  char name[20], title[120];
119  sprintf(title, "Incident PT (GeV)");
120  ptInc_ = tfile->make<TH1F>("PtInc", title, 1000, 0., maxEnergy_);
121  ptInc_->GetXaxis()->SetTitle(title);
122  ptInc_->GetYaxis()->SetTitle("Events");
123  sprintf(title, "Incident Energy (GeV)");
124  eneInc_ = tfile->make<TH1F>("EneInc", title, 1000, 0., maxEnergy_);
125  eneInc_->GetXaxis()->SetTitle(title);
126  eneInc_->GetYaxis()->SetTitle("Events");
127  sprintf(title, "Incident #eta");
128  etaInc_ = tfile->make<TH1F>("EtaInc", title, 200, -5., 5.);
129  etaInc_->GetXaxis()->SetTitle(title);
130  etaInc_->GetYaxis()->SetTitle("Events");
131  sprintf(title, "Incident #phi");
132  phiInc_ = tfile->make<TH1F>("PhiInc", title, 200, -3.1415926, 3.1415926);
133  phiInc_->GetXaxis()->SetTitle(title);
134  phiInc_->GetYaxis()->SetTitle("Events");
135  std::string dets[ndets_] = {"EB", "EE"};
136  for (int i = 0; i < ndets_; i++) {
137  sprintf(name, "Hit%d", i);
138  sprintf(title, "Number of hits in %s", dets[i].c_str());
139  hit_[i] = tfile->make<TH1F>(name, dets[i].c_str(), 1000, 0., 20000.);
140  hit_[i]->GetXaxis()->SetTitle(title);
141  hit_[i]->GetYaxis()->SetTitle("Events");
142  hit_[i]->Sumw2();
143  sprintf(name, "Time%d", i);
144  sprintf(title, "Time of the hit (ns) in %s", dets[i].c_str());
145  time_[i] = tfile->make<TH1F>(name, dets[i].c_str(), 1000, 0., 1000.);
146  time_[i]->GetXaxis()->SetTitle(title);
147  time_[i]->GetYaxis()->SetTitle("Hits");
148  time_[i]->Sumw2();
149  sprintf(name, "TimeAll%d", i);
150  sprintf(title, "Hit time (ns) in %s (for first hit in the cell)", dets[i].c_str());
151  timeAll_[i] = tfile->make<TH1F>(name, dets[i].c_str(), 1000, 0., 1000.);
152  timeAll_[i]->GetXaxis()->SetTitle(title);
153  timeAll_[i]->GetYaxis()->SetTitle("Hits");
154  timeAll_[i]->Sumw2();
155  sprintf(name, "Edep%d", i);
156  sprintf(title, "Energy deposit (GeV) in %s", dets[i].c_str());
157  edep_[i] = tfile->make<TH1F>(name, dets[i].c_str(), 5000, 0., maxEnergy_);
158  edep_[i]->GetXaxis()->SetTitle(title);
159  edep_[i]->GetYaxis()->SetTitle("Hits");
160  edep_[i]->Sumw2();
161  sprintf(name, "EdepAll%d", i);
162  sprintf(title, "Total Energy deposit in the cell (GeV) in %s", dets[i].c_str());
163  edepAll_[i] = tfile->make<TH1F>(name, dets[i].c_str(), 5000, 0., maxEnergy_);
164  edepAll_[i]->GetXaxis()->SetTitle(title);
165  edepAll_[i]->GetYaxis()->SetTitle("Hits");
166  edepAll_[i]->Sumw2();
167  sprintf(name, "EdepEM%d", i);
168  sprintf(title, "Energy deposit (GeV) by EM particles in %s", dets[i].c_str());
169  edepEM_[i] = tfile->make<TH1F>(name, dets[i].c_str(), 5000, 0., maxEnergy_);
170  edepEM_[i]->GetXaxis()->SetTitle(title);
171  edepEM_[i]->GetYaxis()->SetTitle("Hits");
172  edepEM_[i]->Sumw2();
173  sprintf(name, "EdepHad%d", i);
174  sprintf(title, "Energy deposit (GeV) by hadrons in %s", dets[i].c_str());
175  edepHad_[i] = tfile->make<TH1F>(name, dets[i].c_str(), 5000, 0., maxEnergy_);
176  edepHad_[i]->GetXaxis()->SetTitle(title);
177  edepHad_[i]->GetYaxis()->SetTitle("Hits");
178  edepHad_[i]->Sumw2();
179  sprintf(name, "Etot%d", i);
180  sprintf(title, "Total energy deposit (GeV) in %s", dets[i].c_str());
181  etot_[i] = tfile->make<TH1F>(name, dets[i].c_str(), 5000, 0., maxEnergy_);
182  etot_[i]->GetXaxis()->SetTitle(title);
183  etot_[i]->GetYaxis()->SetTitle("Events");
184  etot_[i]->Sumw2();
185  sprintf(name, "EtotG%d", i);
186  sprintf(title, "Total energy deposit (GeV) in %s (t < 100 ns)", dets[i].c_str());
187  etotg_[i] = tfile->make<TH1F>(name, dets[i].c_str(), 5000, 0., maxEnergy_);
188  etotg_[i]->GetXaxis()->SetTitle(title);
189  etotg_[i]->GetYaxis()->SetTitle("Events");
190  etotg_[i]->Sumw2();
191  sprintf(name, "r1by9%d", i);
192  sprintf(title, "E1/E9 in %s", dets[i].c_str());
193  r1by9_[i] = tfile->make<TH1F>(name, dets[i].c_str(), 100, 0.0, 1.0);
194  r1by9_[i]->GetXaxis()->SetTitle(title);
195  r1by9_[i]->GetYaxis()->SetTitle("Events");
196  r1by9_[i]->Sumw2();
197  sprintf(name, "r1by25%d", i);
198  sprintf(title, "E1/E25 in %s", dets[i].c_str());
199  r1by25_[i] = tfile->make<TH1F>(name, dets[i].c_str(), 100, 0.0, 1.0);
200  r1by25_[i]->GetXaxis()->SetTitle(title);
201  r1by25_[i]->GetYaxis()->SetTitle("Events");
202  r1by25_[i]->Sumw2();
203  sprintf(name, "r9by25%d", i);
204  sprintf(title, "E9/E25 in %s", dets[i].c_str());
205  r9by25_[i] = tfile->make<TH1F>(name, dets[i].c_str(), 100, 0.0, 1.0);
206  r9by25_[i]->GetXaxis()->SetTitle(title);
207  r9by25_[i]->GetYaxis()->SetTitle("Events");
208  r9by25_[i]->Sumw2();
209  double ymax = (i == 0) ? 0.0005 : 0.005;
210  sprintf(name, "sEtaEta%d", i);
211  sprintf(title, "Cov(#eta,#eta) in %s", dets[i].c_str());
212  sEtaEta_[i] = tfile->make<TH1F>(name, dets[i].c_str(), 1000, 0.0, ymax);
213  sEtaEta_[i]->GetXaxis()->SetTitle(title);
214  sEtaEta_[i]->GetYaxis()->SetTitle("Events");
215  sEtaEta_[i]->Sumw2();
216  sprintf(name, "sEtaPhi%d", i);
217  sprintf(title, "Cov(#eta,#phi) in %s", dets[i].c_str());
218  sEtaPhi_[i] = tfile->make<TH1F>(name, dets[i].c_str(), 1000, 0.0, ymax);
219  sEtaPhi_[i]->GetXaxis()->SetTitle(title);
220  sEtaPhi_[i]->GetYaxis()->SetTitle("Events");
221  sEtaPhi_[i]->Sumw2();
222  ymax = (i == 0) ? 0.001 : 0.01;
223  sprintf(name, "sPhiPhi%d", i);
224  sprintf(title, "Cov(#phi,#phi) in %s", dets[i].c_str());
225  sPhiPhi_[i] = tfile->make<TH1F>(name, dets[i].c_str(), 1000, 0.0, ymax);
226  sPhiPhi_[i]->GetXaxis()->SetTitle(title);
227  sPhiPhi_[i]->GetYaxis()->SetTitle("Events");
228  sPhiPhi_[i]->Sumw2();
229  if (i == 0) {
230  sprintf(title, "%s+", dets[i].c_str());
231  poszp_[i] = tfile->make<TH2F>("poszp0", title, 100, 0, 100, 360, 0, 360);
232  poszp_[i]->GetXaxis()->SetTitle("i#eta");
233  poszp_[i]->GetYaxis()->SetTitle("i#phi");
234  sprintf(title, "%s-", dets[i].c_str());
235  poszn_[i] = tfile->make<TH2F>("poszn0", title, 100, 0, 100, 360, 0, 360);
236  poszn_[i]->GetXaxis()->SetTitle("i#eta");
237  poszn_[i]->GetYaxis()->SetTitle("i#phi");
238  } else {
239  sprintf(title, "%s+", dets[i].c_str());
240  poszp_[i] = tfile->make<TH2F>("poszp1", title, 100, -200, 200, 100, -200, 200);
241  poszp_[i]->GetXaxis()->SetTitle("x (cm)");
242  poszp_[i]->GetYaxis()->SetTitle("y (cm)");
243  sprintf(title, "%s-", dets[i].c_str());
244  poszn_[i] = tfile->make<TH2F>("poszn1", title, 100, -200, 200, 100, -200, 200);
245  poszn_[i]->GetXaxis()->SetTitle("x (cm)");
246  poszn_[i]->GetYaxis()->SetTitle("y (cm)");
247  }
248  poszp_[i]->GetYaxis()->SetTitleOffset(1.2);
249  poszp_[i]->Sumw2();
250  poszn_[i]->GetYaxis()->SetTitleOffset(1.2);
251  poszn_[i]->Sumw2();
252  }
253 }

References edep_, edepAll_, edepEM_, edepHad_, eneInc_, etaInc_, etot_, etotg_, hit_, mps_fire::i, maxEnergy_, Skims_PA_cff::name, ndets_, phiInc_, poszn_, poszp_, ptInc_, r1by25_, r1by9_, r9by25_, sEtaEta_, sEtaPhi_, sPhiPhi_, AlCaHLTBitMon_QueryRunRegistry::string, compare::tfile, time_, timeAll_, runGCPTkAlMap::title, and L1TOccupancyClient_cfi::ymax.

◆ beginRun()

void EcalSimHitStudy::beginRun ( edm::Run const &  ,
edm::EventSetup const &   
)
inlineoverrideprotected

Definition at line 55 of file EcalSimHitStudy.cc.

55 {}

◆ endRun()

void EcalSimHitStudy::endRun ( edm::Run const &  ,
edm::EventSetup const &   
)
inlineoverrideprotected

Definition at line 56 of file EcalSimHitStudy.cc.

56 {}

◆ fillDescriptions()

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

Definition at line 101 of file EcalSimHitStudy.cc.

101  {
103  desc.addUntracked<std::string>("ModuleLabel", "g4SimHits");
104  desc.addUntracked<std::string>("EBCollection", "EcalHitsEB");
105  desc.addUntracked<std::string>("EECollection", "EcalHitsEE");
106  desc.addUntracked<std::string>("SourceLabel", "VtxSmeared");
107  desc.addUntracked<double>("MaxEnergy", 200.0);
108  desc.addUntracked<double>("TimeCut", 100.0);
109  desc.addUntracked<int>("SelectX", -1);
110  descriptions.add("EcalSimHitStudy", desc);
111 }

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

Member Data Documentation

◆ edep_

TH1F * EcalSimHitStudy::edep_[ndets_]
private

Definition at line 74 of file EcalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ edepAll_

TH1F * EcalSimHitStudy::edepAll_[ndets_]
private

Definition at line 75 of file EcalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ edepEM_

TH1F* EcalSimHitStudy::edepEM_[ndets_]
private

Definition at line 74 of file EcalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ edepHad_

TH1F * EcalSimHitStudy::edepHad_[ndets_]
private

Definition at line 74 of file EcalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ eneInc_

TH1F * EcalSimHitStudy::eneInc_
private

Definition at line 72 of file EcalSimHitStudy.cc.

Referenced by analyze(), and beginJob().

◆ etaInc_

TH1F * EcalSimHitStudy::etaInc_
private

Definition at line 72 of file EcalSimHitStudy.cc.

Referenced by analyze(), and beginJob().

◆ etot_

TH1F* EcalSimHitStudy::etot_[ndets_]
private

Definition at line 75 of file EcalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ etotg_

TH1F * EcalSimHitStudy::etotg_[ndets_]
private

Definition at line 75 of file EcalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ g4Label_

std::string EcalSimHitStudy::g4Label_
private

Definition at line 66 of file EcalSimHitStudy.cc.

Referenced by EcalSimHitStudy().

◆ geometry_

const CaloGeometry* EcalSimHitStudy::geometry_
private

Definition at line 71 of file EcalSimHitStudy.cc.

Referenced by analyze(), and analyzeHits().

◆ hit_

TH1F* EcalSimHitStudy::hit_[ndets_]
private

Definition at line 73 of file EcalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ hitLab_

std::string EcalSimHitStudy::hitLab_[ndets_]
private

Definition at line 66 of file EcalSimHitStudy.cc.

Referenced by EcalSimHitStudy().

◆ maxEnergy_

double EcalSimHitStudy::maxEnergy_
private

Definition at line 69 of file EcalSimHitStudy.cc.

Referenced by beginJob(), and EcalSimHitStudy().

◆ ndets_

const int EcalSimHitStudy::ndets_ = 2
staticprivate

Definition at line 65 of file EcalSimHitStudy.cc.

Referenced by beginJob(), and EcalSimHitStudy().

◆ phiInc_

TH1F * EcalSimHitStudy::phiInc_
private

Definition at line 72 of file EcalSimHitStudy.cc.

Referenced by analyze(), and beginJob().

◆ poszn_

TH2F * EcalSimHitStudy::poszn_[ndets_]
private

Definition at line 78 of file EcalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ poszp_

TH2F* EcalSimHitStudy::poszp_[ndets_]
private

Definition at line 78 of file EcalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ ptInc_

TH1F* EcalSimHitStudy::ptInc_
private

Definition at line 72 of file EcalSimHitStudy.cc.

Referenced by analyze(), and beginJob().

◆ r1by25_

TH1F * EcalSimHitStudy::r1by25_[ndets_]
private

Definition at line 76 of file EcalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ r1by9_

TH1F* EcalSimHitStudy::r1by9_[ndets_]
private

Definition at line 76 of file EcalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ r9by25_

TH1F * EcalSimHitStudy::r9by25_[ndets_]
private

Definition at line 76 of file EcalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ selX_

int EcalSimHitStudy::selX_
private

Definition at line 70 of file EcalSimHitStudy.cc.

Referenced by analyzeHits(), and EcalSimHitStudy().

◆ sEtaEta_

TH1F* EcalSimHitStudy::sEtaEta_[ndets_]
private

Definition at line 77 of file EcalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ sEtaPhi_

TH1F * EcalSimHitStudy::sEtaPhi_[ndets_]
private

Definition at line 77 of file EcalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ sPhiPhi_

TH1F * EcalSimHitStudy::sPhiPhi_[ndets_]
private

Definition at line 77 of file EcalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ time_

TH1F * EcalSimHitStudy::time_[ndets_]
private

Definition at line 73 of file EcalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ timeAll_

TH1F * EcalSimHitStudy::timeAll_[ndets_]
private

Definition at line 73 of file EcalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ tmax_

double EcalSimHitStudy::tmax_
private

Definition at line 69 of file EcalSimHitStudy.cc.

Referenced by analyzeHits(), and EcalSimHitStudy().

◆ tok_evt_

edm::EDGetTokenT<edm::HepMCProduct> EcalSimHitStudy::tok_evt_
private

Definition at line 67 of file EcalSimHitStudy.cc.

Referenced by analyze(), and EcalSimHitStudy().

◆ toks_calo_

edm::EDGetTokenT<edm::PCaloHitContainer> EcalSimHitStudy::toks_calo_[2]
private

Definition at line 68 of file EcalSimHitStudy.cc.

Referenced by analyze(), and EcalSimHitStudy().

◆ w0_

double EcalSimHitStudy::w0_
private

Definition at line 69 of file EcalSimHitStudy.cc.

Referenced by analyzeHits(), and EcalSimHitStudy().

edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
runGCPTkAlMap.title
string title
Definition: runGCPTkAlMap.py:94
mps_fire.i
i
Definition: mps_fire.py:428
hit::id
unsigned int id
Definition: SiStripHitEffFromCalibTree.cc:92
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
makePileupJSON.denom
denom
Definition: makePileupJSON.py:147
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
ecaldqm::zside
int zside(DetId const &)
Definition: EcalDQMCommonUtils.cc:189
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
EBDetId
Definition: EBDetId.h:17
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
pos
Definition: PixelAliasList.h:18
singleTopDQM_cfi.select
select
Definition: singleTopDQM_cfi.py:50
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
EcalSimHitStudy::edepHad_
TH1F * edepHad_[ndets_]
Definition: EcalSimHitStudy.cc:74
protons_cff.time
time
Definition: protons_cff.py:39
EcalSimHitStudy::poszp_
TH2F * poszp_[ndets_]
Definition: EcalSimHitStudy.cc:78
EcalSimHitStudy::sEtaEta_
TH1F * sEtaEta_[ndets_]
Definition: EcalSimHitStudy.cc:77
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
EcalSimHitStudy::edepEM_
TH1F * edepEM_[ndets_]
Definition: EcalSimHitStudy.cc:74
HLT_FULL_cff.dPhi
dPhi
Definition: HLT_FULL_cff.py:13703
edm::Handle< edm::HepMCProduct >
EcalSimHitStudy::geometry_
const CaloGeometry * geometry_
Definition: EcalSimHitStudy.cc:71
EcalSimHitStudy::ptInc_
TH1F * ptInc_
Definition: EcalSimHitStudy.cc:72
EcalSimHitStudy::poszn_
TH2F * poszn_[ndets_]
Definition: EcalSimHitStudy.cc:78
EcalSimHitStudy::toks_calo_
edm::EDGetTokenT< edm::PCaloHitContainer > toks_calo_[2]
Definition: EcalSimHitStudy.cc:68
EcalSimHitStudy::analyzeHits
void analyzeHits(std::vector< PCaloHit > &, int)
Definition: EcalSimHitStudy.cc:308
HepMC::GenEvent
Definition: hepmc_rootio.cc:9
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
DetId
Definition: DetId.h:17
EcalSimHitStudy::w0_
double w0_
Definition: EcalSimHitStudy.cc:69
L1TOccupancyClient_cfi.ymax
ymax
Definition: L1TOccupancyClient_cfi.py:43
EcalSimHitStudy::tok_evt_
edm::EDGetTokenT< edm::HepMCProduct > tok_evt_
Definition: EcalSimHitStudy.cc:67
EcalSimHitStudy::sPhiPhi_
TH1F * sPhiPhi_[ndets_]
Definition: EcalSimHitStudy.cc:77
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
EcalSimHitStudy::r9by25_
TH1F * r9by25_[ndets_]
Definition: EcalSimHitStudy.cc:76
EcalSimHitStudy::g4Label_
std::string g4Label_
Definition: EcalSimHitStudy.cc:66
w
const double w
Definition: UKUtility.cc:23
tfile
Definition: tfile.py:1
EcalSimHitStudy::phiInc_
TH1F * phiInc_
Definition: EcalSimHitStudy.cc:72
edm::ESHandle< CaloGeometry >
EcalSimHitStudy::timeAll_
TH1F * timeAll_[ndets_]
Definition: EcalSimHitStudy.cc:73
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
dqmdumpme.k
k
Definition: dqmdumpme.py:60
Point3DBase< float, GlobalTag >
EcalSimHitStudy::sEtaPhi_
TH1F * sEtaPhi_[ndets_]
Definition: EcalSimHitStudy.cc:77
EEDetId
Definition: EEDetId.h:14
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
EcalSimHitStudy::r1by25_
TH1F * r1by25_[ndets_]
Definition: EcalSimHitStudy.cc:76
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
CaloGeometry::getGeometry
std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id.
Definition: CaloGeometry.cc:60
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
EcalSimHitStudy::etot_
TH1F * etot_[ndets_]
Definition: EcalSimHitStudy.cc:75
gainCalibHelper::gainCalibPI::type
type
Definition: SiPixelGainCalibHelper.h:40
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
EcalSimHitStudy::etaInc_
TH1F * etaInc_
Definition: EcalSimHitStudy.cc:72
edm::Service< TFileService >
EcalSimHitStudy::eneInc_
TH1F * eneInc_
Definition: EcalSimHitStudy.cc:72
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
edm::HepMCProduct::GetEvent
const HepMC::GenEvent * GetEvent() const
Definition: HepMCProduct.h:37
EcalSimHitStudy::r1by9_
TH1F * r1by9_[ndets_]
Definition: EcalSimHitStudy.cc:76
get
#define get
compare.tfile
tfile
Definition: compare.py:325
EcalSimHitStudy::time_
TH1F * time_[ndets_]
Definition: EcalSimHitStudy.cc:73
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
EcalSimHitStudy::hit_
TH1F * hit_[ndets_]
Definition: EcalSimHitStudy.cc:73
PVValHelper::dz
Definition: PVValidationHelpers.h:51
HLT_FULL_cff.dEta
dEta
Definition: HLT_FULL_cff.py:13702
EcalSimHitStudy::edep_
TH1F * edep_[ndets_]
Definition: EcalSimHitStudy.cc:74
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
TFileService::kSharedResource
static const std::string kSharedResource
Definition: TFileService.h:76
EcalSimHitStudy::edepAll_
TH1F * edepAll_[ndets_]
Definition: EcalSimHitStudy.cc:75
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
EcalSimHitStudy::selX_
int selX_
Definition: EcalSimHitStudy.cc:70
EcalSimHitStudy::maxEnergy_
double maxEnergy_
Definition: EcalSimHitStudy.cc:69
EcalSimHitStudy::ndets_
static const int ndets_
Definition: EcalSimHitStudy.cc:65
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
cms::Exception
Definition: Exception.h:70
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
EcalSimHitStudy::etotg_
TH1F * etotg_[ndets_]
Definition: EcalSimHitStudy.cc:75
EcalSimHitStudy::tmax_
double tmax_
Definition: EcalSimHitStudy.cc:69
EcalSimHitStudy::hitLab_
std::string hitLab_[ndets_]
Definition: EcalSimHitStudy.cc:66
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
edm::InputTag
Definition: InputTag.h:15
hit
Definition: SiStripHitEffFromCalibTree.cc:88
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37