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
 
- 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
 
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::vector< ModuleDescription const * > &modules, 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>
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<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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_
 
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 45 of file EcalSimHitStudy.cc.

Constructor & Destructor Documentation

◆ EcalSimHitStudy()

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

Definition at line 79 of file EcalSimHitStudy.cc.

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

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

230  {
231 #ifdef EDM_ML_DEBUG
232  edm::LogVerbatim("HitStudy") << "Run = " << e.id().run() << " Event = " << e.id().event();
233 #endif
234  // get handles to calogeometry
236  iS.get<CaloGeometryRecord>().get(pG);
237  geometry_ = pG.product();
238 
240  e.getByToken(tok_evt_, EvtHandle);
241  const HepMC::GenEvent* myGenEvent = EvtHandle->GetEvent();
242 
243  double eInc = 0, etaInc = 0, phiInc = 0;
244  HepMC::GenEvent::particle_const_iterator p = myGenEvent->particles_begin();
245  if (p != myGenEvent->particles_end()) {
246  eInc = (*p)->momentum().e();
247  etaInc = (*p)->momentum().eta();
248  phiInc = (*p)->momentum().phi();
249  }
250  double ptInc = eInc / std::cosh(etaInc);
251  ptInc_->Fill(ptInc);
252  eneInc_->Fill(eInc);
253  etaInc_->Fill(etaInc);
254  phiInc_->Fill(phiInc);
255 
256  int type(-1);
257  if (std::abs(etaInc) < 1.46)
258  type = 0;
259  else if (std::abs(etaInc) > 1.49 && std::abs(etaInc) < 3.0)
260  type = 1;
261  if (type >= 0) {
262  bool getHits(false);
264  e.getByToken(toks_calo_[type], hitsCalo);
265  if (hitsCalo.isValid())
266  getHits = true;
267 #ifdef EDM_ML_DEBUG
268  edm::LogVerbatim("HitStudy") << "EcalSimHitStudy: Input flags Hits " << getHits << " with " << hitsCalo->size()
269  << " hits";
270 #endif
271  if (getHits) {
272  std::vector<PCaloHit> caloHits;
273  caloHits.insert(caloHits.end(), hitsCalo->begin(), hitsCalo->end());
274  if (!caloHits.empty())
275  analyzeHits(caloHits, type);
276  }
277  }
278 }

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

280  {
281  unsigned int nEC(0);
282  std::map<unsigned int, EcalHit> hitMap;
283  double etot(0), etotG(0);
284  for (auto hit : hits) {
285  double edep = hit.energy();
286  double time = hit.time();
287  unsigned int id_ = hit.id();
288  double edepEM = hit.energyEM();
289  double edepHad = hit.energyHad();
290  if (indx == 0) {
291  if ((hit.depth() == 1) || (hit.depth() == 2))
292  continue;
293  }
294  if (time <= tmax_) {
295  auto it = hitMap.find(id_);
296  if (it == hitMap.end()) {
297  uint16_t dep = hit.depth();
298  hitMap[id_] = EcalHit(dep, time, edep);
299  } else {
300  (it->second).energy += edep;
301  }
302  etotG += edep;
303  ++nEC;
304  }
305  time_[indx]->Fill(time);
306  edep_[indx]->Fill(edep);
307  edepEM_[indx]->Fill(edepEM);
308  edepHad_[indx]->Fill(edepHad);
309  etot += edep;
310  }
311 
312  double edepM(0);
313  unsigned int idM(0);
314  uint16_t depM(0);
315  for (auto it : hitMap) {
316  if (it.second.energy > edepM) {
317  idM = it.first;
318  edepM = it.second.energy;
319  depM = it.second.id;
320  }
321  }
322 
323  bool select(true);
324  if (selX_ >= 0) {
325  if ((depM & 0X4) != 0)
326  select = (selX_ > 0);
327  else
328  select = (selX_ == 0);
329  }
330 #ifdef EDM_ML_DEBUG
331  edm::LogVerbatim("HitStudy") << "EcalSimHitStudy::analyzeHits: Index " << indx << " Emax " << edepM << " IDMax "
332  << std::hex << idM << ":" << depM << std::dec << " Select " << select << ":" << selX_
333  << " Hits " << hits.size() << ":" << nEC << ":" << hitMap.size() << " ETotal " << etot
334  << ":" << etotG;
335 #endif
336  if (select) {
337  etot_[indx]->Fill(etot);
338  etotg_[indx]->Fill(etotG);
339  hit_[indx]->Fill(double(nEC));
340  for (auto it : hitMap) {
341  timeAll_[indx]->Fill((it.second).time);
342  edepAll_[indx]->Fill((it.second).energy);
343  }
344 
345  math::XYZVector meanPosition(0.0, 0.0, 0.0);
346  std::vector<math::XYZVector> position;
347  std::vector<double> energy;
348  double e9(0), e25(0);
349  for (auto it : hitMap) {
350  DetId id(it.first);
351  int deta(99), dphi(99), dz(0);
352  if (indx == 0) {
353  deta = std::abs(EBDetId(id).ietaAbs() - EBDetId(idM).ietaAbs());
354  dphi = std::abs(EBDetId(id).iphi() - EBDetId(idM).iphi());
355  if (dphi > 180)
356  dphi = std::abs(dphi - 360);
357  dz = std::abs(EBDetId(id).zside() - EBDetId(idM).zside());
358  } else {
359  deta = std::abs(EEDetId(id).ix() - EEDetId(idM).ix());
360  dphi = std::abs(EEDetId(id).iy() - EEDetId(idM).iy());
361  dz = std::abs(EEDetId(id).zside() - EEDetId(idM).zside());
362  }
363  if (deta <= 1 && dphi <= 1 && dz < 1)
364  e9 += (it.second).energy;
365  if (deta <= 2 && dphi <= 2 && dz < 1) {
366  e25 += (it.second).energy;
367  GlobalPoint gpos = geometry_->getGeometry(id)->getPosition();
368  math::XYZVector pos(gpos.x(), gpos.y(), gpos.z());
369  meanPosition += (it.second).energy * pos;
370  position.push_back(pos);
371  energy.push_back((it.second).energy);
372  }
373  }
374  double r1by9 = (e9 > 0) ? (edepM / e9) : -1;
375  double r1by25 = (e25 > 0) ? (edepM / e25) : -1;
376  double r9by25 = (e25 > 0) ? (e9 / e25) : -1;
377 
378  meanPosition /= e25;
379  double denom(0), numEtaEta(0), numEtaPhi(0), numPhiPhi(0);
380  for (unsigned int k = 0; k < position.size(); ++k) {
381  double dEta = position[k].eta() - meanPosition.eta();
382  double dPhi = position[k].phi() - meanPosition.phi();
383  if (dPhi > +M_PI) {
384  dPhi = 2 * M_PI - dPhi;
385  }
386  if (dPhi < -M_PI) {
387  dPhi = 2 * M_PI + dPhi;
388  }
389 
390  double w = std::max(0.0, (w0_ + std::log(energy[k] / e25)));
391  denom += w;
392  numEtaEta += std::abs(w * dEta * dEta);
393  numEtaPhi += std::abs(w * dEta * dPhi);
394  numPhiPhi += std::abs(w * dPhi * dPhi);
395 #ifdef EDM_ML_DEBUG
396  edm::LogVerbatim("HitStudy") << "[" << k << "] dEta " << dEta << " dPhi " << dPhi << " Wt " << energy[k] / e25
397  << ":" << std::log(energy[k] / e25) << ":" << w;
398 #endif
399  }
400  double sEtaEta = (denom > 0) ? (numEtaEta / denom) : -1.0;
401  double sEtaPhi = (denom > 0) ? (numEtaPhi / denom) : -1.0;
402  double sPhiPhi = (denom > 0) ? (numPhiPhi / denom) : -1.0;
403 
404 #ifdef EDM_ML_DEBUG
405  edm::LogVerbatim("HitStudy") << "EcalSimHitStudy::Ratios " << r1by9 << " : " << r1by25 << " : " << r9by25
406  << " Covariances " << sEtaEta << " : " << sEtaPhi << " : " << sPhiPhi;
407 #endif
408  r1by9_[indx]->Fill(r1by9);
409  r1by25_[indx]->Fill(r1by25);
410  r9by25_[indx]->Fill(r9by25);
411  sEtaEta_[indx]->Fill(sEtaEta);
412  sEtaPhi_[indx]->Fill(sEtaPhi);
413  sPhiPhi_[indx]->Fill(sPhiPhi);
414  }
415 }

References funct::abs(), TauDecayModes::dec, makePileupJSON::denom, HLT_2018_cff::dEta, HLT_2018_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, r1by25_, r1by9_, r9by25_, singleTopDQM_cfi::select, selX_, sEtaEta_, sEtaPhi_, sPhiPhi_, ntuplemaker::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 111 of file EcalSimHitStudy.cc.

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

References edep_, edepAll_, edepEM_, edepHad_, eneInc_, etaInc_, etot_, etotg_, hit_, mps_fire::i, maxEnergy_, Skims_PA_cff::name, ndets_, phiInc_, ptInc_, r1by25_, r1by9_, r9by25_, sEtaEta_, sEtaPhi_, sPhiPhi_, AlCaHLTBitMon_QueryRunRegistry::string, compare::tfile, time_, timeAll_, overlapproblemtsosanalyzer_cfi::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 99 of file EcalSimHitStudy.cc.

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

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

Member Data Documentation

◆ edep_

TH1F * EcalSimHitStudy::edep_[ndets_]
private

Definition at line 73 of file EcalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ edepAll_

TH1F * EcalSimHitStudy::edepAll_[ndets_]
private

Definition at line 74 of file EcalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ edepEM_

TH1F* EcalSimHitStudy::edepEM_[ndets_]
private

Definition at line 73 of file EcalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ edepHad_

TH1F * EcalSimHitStudy::edepHad_[ndets_]
private

Definition at line 73 of file EcalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ eneInc_

TH1F * EcalSimHitStudy::eneInc_
private

Definition at line 71 of file EcalSimHitStudy.cc.

Referenced by analyze(), and beginJob().

◆ etaInc_

TH1F * EcalSimHitStudy::etaInc_
private

Definition at line 71 of file EcalSimHitStudy.cc.

Referenced by analyze(), and beginJob().

◆ etot_

TH1F* EcalSimHitStudy::etot_[ndets_]
private

Definition at line 74 of file EcalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ etotg_

TH1F * EcalSimHitStudy::etotg_[ndets_]
private

Definition at line 74 of file EcalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ g4Label_

std::string EcalSimHitStudy::g4Label_
private

Definition at line 65 of file EcalSimHitStudy.cc.

Referenced by EcalSimHitStudy().

◆ geometry_

const CaloGeometry* EcalSimHitStudy::geometry_
private

Definition at line 70 of file EcalSimHitStudy.cc.

Referenced by analyze(), and analyzeHits().

◆ hit_

TH1F* EcalSimHitStudy::hit_[ndets_]
private

Definition at line 72 of file EcalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ hitLab_

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

Definition at line 65 of file EcalSimHitStudy.cc.

Referenced by EcalSimHitStudy().

◆ maxEnergy_

double EcalSimHitStudy::maxEnergy_
private

Definition at line 68 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 71 of file EcalSimHitStudy.cc.

Referenced by analyze(), and beginJob().

◆ ptInc_

TH1F* EcalSimHitStudy::ptInc_
private

Definition at line 71 of file EcalSimHitStudy.cc.

Referenced by analyze(), and beginJob().

◆ r1by25_

TH1F * EcalSimHitStudy::r1by25_[ndets_]
private

Definition at line 75 of file EcalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ r1by9_

TH1F* EcalSimHitStudy::r1by9_[ndets_]
private

Definition at line 75 of file EcalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ r9by25_

TH1F * EcalSimHitStudy::r9by25_[ndets_]
private

Definition at line 75 of file EcalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ selX_

int EcalSimHitStudy::selX_
private

Definition at line 69 of file EcalSimHitStudy.cc.

Referenced by analyzeHits(), and EcalSimHitStudy().

◆ sEtaEta_

TH1F* EcalSimHitStudy::sEtaEta_[ndets_]
private

Definition at line 76 of file EcalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ sEtaPhi_

TH1F * EcalSimHitStudy::sEtaPhi_[ndets_]
private

Definition at line 76 of file EcalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ sPhiPhi_

TH1F * EcalSimHitStudy::sPhiPhi_[ndets_]
private

Definition at line 76 of file EcalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ time_

TH1F * EcalSimHitStudy::time_[ndets_]
private

Definition at line 72 of file EcalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ timeAll_

TH1F * EcalSimHitStudy::timeAll_[ndets_]
private

Definition at line 72 of file EcalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ tmax_

double EcalSimHitStudy::tmax_
private

Definition at line 68 of file EcalSimHitStudy.cc.

Referenced by analyzeHits(), and EcalSimHitStudy().

◆ tok_evt_

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

Definition at line 66 of file EcalSimHitStudy.cc.

Referenced by analyze(), and EcalSimHitStudy().

◆ toks_calo_

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

Definition at line 67 of file EcalSimHitStudy.cc.

Referenced by analyze(), and EcalSimHitStudy().

◆ w0_

double EcalSimHitStudy::w0_
private

Definition at line 68 of file EcalSimHitStudy.cc.

Referenced by analyzeHits(), and EcalSimHitStudy().

edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
mps_fire.i
i
Definition: mps_fire.py:355
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:73
EcalSimHitStudy::sEtaEta_
TH1F * sEtaEta_[ndets_]
Definition: EcalSimHitStudy.cc:76
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
EcalSimHitStudy::edepEM_
TH1F * edepEM_[ndets_]
Definition: EcalSimHitStudy.cc:73
edm::Handle< edm::HepMCProduct >
EcalSimHitStudy::geometry_
const CaloGeometry * geometry_
Definition: EcalSimHitStudy.cc:70
EcalSimHitStudy::ptInc_
TH1F * ptInc_
Definition: EcalSimHitStudy.cc:71
EcalSimHitStudy::toks_calo_
edm::EDGetTokenT< edm::PCaloHitContainer > toks_calo_[2]
Definition: EcalSimHitStudy.cc:67
HLT_2018_cff.dEta
dEta
Definition: HLT_2018_cff.py:12289
EcalSimHitStudy::analyzeHits
void analyzeHits(std::vector< PCaloHit > &, int)
Definition: EcalSimHitStudy.cc:280
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:68
L1TOccupancyClient_cfi.ymax
ymax
Definition: L1TOccupancyClient_cfi.py:43
EcalSimHitStudy::tok_evt_
edm::EDGetTokenT< edm::HepMCProduct > tok_evt_
Definition: EcalSimHitStudy.cc:66
EcalSimHitStudy::sPhiPhi_
TH1F * sPhiPhi_[ndets_]
Definition: EcalSimHitStudy.cc:76
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
EcalSimHitStudy::r9by25_
TH1F * r9by25_[ndets_]
Definition: EcalSimHitStudy.cc:75
EcalSimHitStudy::g4Label_
std::string g4Label_
Definition: EcalSimHitStudy.cc:65
w
const double w
Definition: UKUtility.cc:23
tfile
Definition: tfile.py:1
HLT_2018_cff.dPhi
dPhi
Definition: HLT_2018_cff.py:12290
EcalSimHitStudy::phiInc_
TH1F * phiInc_
Definition: EcalSimHitStudy.cc:71
edm::ESHandle< CaloGeometry >
EcalSimHitStudy::timeAll_
TH1F * timeAll_[ndets_]
Definition: EcalSimHitStudy.cc:72
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:76
EEDetId
Definition: EEDetId.h:14
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
EcalSimHitStudy::r1by25_
TH1F * r1by25_[ndets_]
Definition: EcalSimHitStudy.cc:75
edm::ParameterSetDescription::addUntracked
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:100
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
EcalSimHitStudy::etot_
TH1F * etot_[ndets_]
Definition: EcalSimHitStudy.cc:74
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:71
edm::Service< TFileService >
EcalSimHitStudy::eneInc_
TH1F * eneInc_
Definition: EcalSimHitStudy.cc:71
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:50
edm::LogVerbatim
Definition: MessageLogger.h:297
edm::HepMCProduct::GetEvent
const HepMC::GenEvent * GetEvent() const
Definition: HepMCProduct.h:34
EcalSimHitStudy::r1by9_
TH1F * r1by9_[ndets_]
Definition: EcalSimHitStudy.cc:75
get
#define get
compare.tfile
tfile
Definition: compare.py:325
overlapproblemtsosanalyzer_cfi.title
title
Definition: overlapproblemtsosanalyzer_cfi.py:7
EcalSimHitStudy::time_
TH1F * time_[ndets_]
Definition: EcalSimHitStudy.cc:72
type
type
Definition: HCALResponse.h:21
EcalSimHitStudy::hit_
TH1F * hit_[ndets_]
Definition: EcalSimHitStudy.cc:72
PVValHelper::dz
Definition: PVValidationHelpers.h:50
EcalSimHitStudy::edep_
TH1F * edep_[ndets_]
Definition: EcalSimHitStudy.cc:73
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
TFileService::kSharedResource
static const std::string kSharedResource
Definition: TFileService.h:76
EcalSimHitStudy::edepAll_
TH1F * edepAll_[ndets_]
Definition: EcalSimHitStudy.cc:74
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
EcalSimHitStudy::selX_
int selX_
Definition: EcalSimHitStudy.cc:69
EcalSimHitStudy::maxEnergy_
double maxEnergy_
Definition: EcalSimHitStudy.cc:68
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
ntuplemaker.time
time
Definition: ntuplemaker.py:310
EcalSimHitStudy::etotg_
TH1F * etotg_[ndets_]
Definition: EcalSimHitStudy.cc:74
EcalSimHitStudy::tmax_
double tmax_
Definition: EcalSimHitStudy.cc:68
EcalSimHitStudy::hitLab_
std::string hitLab_[ndets_]
Definition: EcalSimHitStudy.cc:65
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