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
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
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_
 
const edm::ESGetToken< CaloGeometry, CaloGeometryRecordtokGeom_
 
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 45 of file EcalSimHitStudy.cc.

Constructor & Destructor Documentation

◆ EcalSimHitStudy()

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

Definition at line 81 of file EcalSimHitStudy.cc.

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

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 48 of file EcalSimHitStudy.cc.

48 {}

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 256 of file EcalSimHitStudy.cc.

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

References funct::abs(), analyzeHits(), MillePedeFileConverter_cfg::e, eneInc_, etaInc_, geometry_, edm::EventSetup::getData(), edm::HepMCProduct::GetEvent(), edm::HandleBase::isValid(), AlCaHLTBitMon_ParallelJobs::p, phiInc_, ptInc_, tok_evt_, tokGeom_, and toks_calo_.

◆ analyzeHits()

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

Definition at line 307 of file EcalSimHitStudy.cc.

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

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 114 of file EcalSimHitStudy.cc.

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

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 54 of file EcalSimHitStudy.cc.

54 {}

◆ endRun()

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

Definition at line 55 of file EcalSimHitStudy.cc.

55 {}

◆ fillDescriptions()

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

Definition at line 102 of file EcalSimHitStudy.cc.

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

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

◆ tokGeom_

const edm::ESGetToken<CaloGeometry, CaloGeometryRecord> EcalSimHitStudy::tokGeom_
private

Definition at line 65 of file EcalSimHitStudy.cc.

Referenced by analyze().

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

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:146
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
ecaldqm::zside
int zside(DetId const &)
Definition: EcalDQMCommonUtils.cc:189
EBDetId
Definition: EBDetId.h:17
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:35
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:13695
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:307
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
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::tokGeom_
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > tokGeom_
Definition: EcalSimHitStudy.cc:65
EcalSimHitStudy::sEtaPhi_
TH1F * sEtaPhi_[ndets_]
Definition: EcalSimHitStudy.cc:77
EEDetId
Definition: EEDetId.h:14
EcalSimHitStudy::r1by25_
TH1F * r1by25_[ndets_]
Definition: EcalSimHitStudy.cc:76
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
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:39
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
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
compare.tfile
tfile
Definition: compare.py:324
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:13694
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:64
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:142
edm::InputTag
Definition: InputTag.h:15
hit
Definition: SiStripHitEffFromCalibTree.cc:88
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37