CMS 3D CMS Logo

EcalPhiSymRecHitProducers.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Calibration/EcalCalibAlgos
4 // Class: EcalPhiSymRecHitProducer
5 //
6 //
7 // Original Author: Simone Pigazzini
8 // Created: Wed, 16 Mar 2022 15:52:48 GMT
9 //
10 //
21 
25 
29 
34 
40 
43 
44 //---Wrapper to handle stream data
45 struct PhiSymCache {
49 
50  void clear() {
52  recHitCollEB.clear();
53  recHitCollEE.clear();
54  }
55 };
56 
57 // cache structure for LuminosityBlock/Run Cache
58 struct ConfigCache {
61  std::vector<DetId> barrelDetIds;
62  std::vector<DetId> endcapDetIds;
63 };
64 
65 //****************************************************************************************
66 // - EcalPhiSymRecHitProducerBase: base class implementing the main algorithm
67 // - EcalPhiSymRecHitProducerLumi: produces reduced collections per LuminosityBlock
68 // - EcalPhiSymRecHitProducerRun: produces reduced collections per Run
70 public:
73 
74  //---methods
75  // job
76  void initializeJob();
77  // event
78  void processEvent(edm::Event const& event,
79  edm::EventSetup const& setup,
80  ConfigCache const* config,
81  PhiSymCache* cache) const;
82  // helpers
86  ConfigCache const* config,
87  std::shared_ptr<PhiSymCache>& cache) const;
90  std::shared_ptr<ConfigCache>& cache) const;
91  void sumCache(PhiSymCache* summaryc, PhiSymCache* streamc) const;
92 
93  //---data memebers
94  // available to derived classes
95 protected:
100  float etCutEB_;
101  std::vector<double> eThresholdsEB_;
102  float etCutEE_;
103  std::vector<double> A_;
104  std::vector<double> B_;
105  float thrEEmod_;
108  std::vector<double> misCalibRangeEB_;
109  std::vector<float> misCalibStepsEB_;
110  std::vector<double> misCalibRangeEE_;
111  std::vector<float> misCalibStepsEE_;
112  //---geometry
116  static const short ringsInOneEE = kNRingsEE / 2;
118 };
119 
120 //----------IMPLEMENTATION----------------------------------------------------------------
122  : geoToken_(cc.esConsumes()),
123  laserDbToken_(cc.esConsumes()),
124  ebToken_(cc.consumes<EBRecHitCollection>(pSet.getParameter<edm::InputTag>("barrelHitCollection"))),
125  eeToken_(cc.consumes<EBRecHitCollection>(pSet.getParameter<edm::InputTag>("endcapHitCollection"))),
126  etCutEB_(pSet.getParameter<double>("etCut_barrel")),
127  eThresholdsEB_(pSet.getParameter<std::vector<double> >("eThresholds_barrel")),
128  etCutEE_(pSet.getParameter<double>("etCut_endcap")),
129  A_(pSet.getParameter<std::vector<double> >("A")),
130  B_(pSet.getParameter<std::vector<double> >("B")),
131  thrEEmod_(pSet.getParameter<double>("thrEEmod")),
132  nMisCalib_(pSet.getParameter<int>("nMisCalib") / 2),
133  nSumEtValues_(nMisCalib_ * 2 + 1),
134  misCalibRangeEB_(pSet.getParameter<std::vector<double> >("misCalibRangeEB")),
135  misCalibRangeEE_(pSet.getParameter<std::vector<double> >("misCalibRangeEE")) {}
136 
138  //---Compute the endcap thresholds using the provived parametric formula
139  for (int iRing = 0; iRing < ringsInOneEE; ++iRing) {
140  if (iRing < 30)
141  eThresholdsEE_[iRing] = thrEEmod_ * (B_[0] + A_[0] * iRing) / 1000;
142  else
143  eThresholdsEE_[iRing] = thrEEmod_ * (B_[1] + A_[1] * iRing) / 1000;
144  eThresholdsEE_[iRing + ringsInOneEE] = eThresholdsEE_[iRing];
145  }
146 
147  //---misCalib value init (nMisCalib is half of the correct value!)
148  float misCalibStepEB = std::abs(misCalibRangeEB_[1] - misCalibRangeEB_[0]) / (nMisCalib_ * 2);
149  float misCalibStepEE = std::abs(misCalibRangeEE_[1] - misCalibRangeEE_[0]) / (nMisCalib_ * 2);
152  for (int iMis = -nMisCalib_; iMis <= nMisCalib_; ++iMis) {
153  //--- 0 -> 0; -i -> [1...n/2]; +i -> [n/2+1...n]
154  int index = iMis > 0 ? iMis + nMisCalib_ : iMis == 0 ? 0 : iMis + nMisCalib_ + 1;
155  misCalibStepsEB_[index] = iMis * misCalibStepEB;
156  misCalibStepsEE_[index] = iMis * misCalibStepEE;
157  }
158 }
159 
161  edm::EventSetup const& setup,
162  ConfigCache const* configCache,
163  PhiSymCache* streamCache) const {
164  uint64_t totHitsEB = 0;
165  uint64_t totHitsEE = 0;
166 
167  //---get recHits collections
168  auto barrelRecHits = event.get(ebToken_);
169  auto endcapRecHits = event.get(eeToken_);
170 
171  //---get the laser corrections
172  edm::Timestamp evtTimeStamp(event.time().value());
173  auto const& laser = setup.getData(laserDbToken_);
174 
175  //---get the geometry
176  auto const& geometry = setup.getData(geoToken_);
177  auto barrelGeometry = geometry.getSubdetectorGeometry(DetId::Ecal, EcalBarrel);
178  auto endcapGeometry = geometry.getSubdetectorGeometry(DetId::Ecal, EcalEndcap);
179 
180  //---EB---
181  for (auto& recHit : barrelRecHits) {
182  float energy = recHit.energy();
183  EBDetId ebHit = EBDetId(recHit.id());
184  int ring = calibRing_.getRingIndex(ebHit);
185  //---if recHit energy is below thr even with the highest miscalib skip this recHit
187  continue;
188  float eta = barrelGeometry->getGeometry(ebHit)->getPosition().eta();
189 
190  //---compute et + miscalibration
191  std::vector<float> etValues(nSumEtValues_, 0);
192  //---one can do this in one for loop from -nMis to +nMis but in this way the
193  //---program is faster
194  //---NOTE: nMisCalib is half on the value set in the cfg python
195  etValues[0] = recHit.energy() / cosh(eta);
196  for (int iMis = -nMisCalib_; iMis < 0; ++iMis) {
197  //--- 0 -> 0; -i -> [1...n/2]; +i -> [n/2+1...n]
198  int index = iMis + nMisCalib_ + 1;
199  etValues[index] = etValues[0] * (1 + misCalibStepsEB_[index]);
200  //---set et to zero if out of range [e_thr, et_thr+1]
201  if (etValues[index] * cosh(eta) < eThresholdsEB_[ring] || etValues[index] > configCache->etCutsEB[ring])
202  etValues[index] = 0;
203  }
204  for (int iMis = 1; iMis <= nMisCalib_; ++iMis) {
205  //--- 0 -> 0; -i -> [1...n/2]; +i -> [n/2+1...n]
206  int index = iMis + nMisCalib_;
207  etValues[index] = etValues[0] * (1 + misCalibStepsEB_[index]);
208  //---set et to zero if out of range [e_thr, et_thr+1]
209  if (etValues[index] * cosh(eta) < eThresholdsEB_[ring] || etValues[index] > configCache->etCutsEB[ring])
210  etValues[index] = 0;
211  }
212  //---set et to zero if out of range [e_thr, et_thr+1]
213  if (energy < eThresholdsEB_[ring] || etValues[0] > configCache->etCutsEB[ring])
214  etValues[0] = 0;
215  else
216  ++totHitsEB;
217  //---update the rechHit sumEt
218  streamCache->recHitCollEB.at(ebHit.denseIndex())
219  .addHit(etValues, laser.getLaserCorrection(recHit.id(), evtTimeStamp));
220  }
221 
222  //---EE---
223  for (auto& recHit : endcapRecHits) {
224  EEDetId eeHit = EEDetId(recHit.id());
225  int ring = calibRing_.getRingIndex(eeHit) - kNRingsEB;
226  float energy = recHit.energy();
227  //---if recHit energy is below thr even with the highest miscalib skip this recHit
229  continue;
230  float eta = endcapGeometry->getGeometry(eeHit)->getPosition().eta();
231 
232  //---compute et + miscalibration
233  std::vector<float> etValues(nSumEtValues_, 0);
234  //---one can do this in one for loop from -nMis to +nMis but in this way the
235  //---program is faster
236  //---NOTE: nMisCalib is half on the value set in the cfg python
237  etValues[0] = recHit.energy() / cosh(eta);
238  for (int iMis = -nMisCalib_; iMis < 0; ++iMis) {
239  //--- 0 -> 0; -i -> [1...n/2]; +i -> [n/2+1...n]
240  int index = iMis + nMisCalib_ + 1;
241  etValues[index] = etValues[0] * (1 + misCalibStepsEE_[index]);
242  //---set et to zero if out of range [e_thr, et_thr+1]
243  if (etValues[index] * cosh(eta) < eThresholdsEE_[ring] || etValues[index] > configCache->etCutsEE[ring])
244  etValues[index] = 0;
245  }
246  for (int iMis = 1; iMis <= nMisCalib_; ++iMis) {
247  //--- 0 -> 0; -i -> [1...n/2]; +i -> [n/2+1...n]
248  int index = iMis + nMisCalib_;
249  etValues[index] = etValues[0] * (1 + misCalibStepsEE_[index]);
250  //---set et to zero if out of range [e_thr, et_thr+1]
251  if (etValues[index] * cosh(eta) < eThresholdsEE_[ring] || etValues[index] > configCache->etCutsEE[ring])
252  etValues[index] = 0;
253  }
254  //---set et to zero if out of range [e_thr, et_thr+1]
255  if (energy < eThresholdsEE_[ring] || etValues[0] > configCache->etCutsEE[ring])
256  etValues[0] = 0;
257  else
258  ++totHitsEE;
259  //---update the rechHit sumEt
260  streamCache->recHitCollEE.at(eeHit.denseIndex())
261  .addHit(etValues, laser.getLaserCorrection(recHit.id(), evtTimeStamp));
262  }
263 
264  //---update the lumi info
265  EcalPhiSymInfo thisEvent(totHitsEB, totHitsEE, 1, 0, 0, 0, 0);
266  streamCache->ecalLumiInfo += thisEvent;
267 }
268 
270  //---Initialize the per-stream RecHitCollection
271  // both collections are initialized to contain the total
272  // number of crystals, ordered accrodingly to the hashedIndex.
273  cache->clear();
274  cache->recHitCollEB.resize(config->barrelDetIds.size());
275  cache->recHitCollEE.resize(config->endcapDetIds.size());
276  for (auto& ebDetId : config->barrelDetIds) {
277  EBDetId id(ebDetId);
278  cache->recHitCollEB.at(id.denseIndex()) = EcalPhiSymRecHit(id.rawId(), nSumEtValues_);
279  }
280  for (auto& eeDetId : config->endcapDetIds) {
281  EEDetId id(eeDetId);
282  cache->recHitCollEE.at(id.denseIndex()) = EcalPhiSymRecHit(id.rawId(), nSumEtValues_);
283  }
284 }
285 
287  edm::EventSetup const& setup,
289  ConfigCache const* config,
290  std::shared_ptr<PhiSymCache>& cache) const {
291  cache->clear();
292 
293  //---get the channels status
294  auto const& chStatus = setup.getData(chStatusToken);
295 
296  cache->recHitCollEB.resize(config->barrelDetIds.size());
297  cache->recHitCollEE.resize(config->endcapDetIds.size());
298  for (auto& ebDetId : config->barrelDetIds) {
299  EBDetId id(ebDetId);
300  cache->recHitCollEB.at(id.denseIndex()) =
301  EcalPhiSymRecHit(ebDetId.rawId(), nSumEtValues_, chStatus[id].getStatusCode());
302  }
303  for (auto& eeDetId : config->endcapDetIds) {
304  EEDetId id(eeDetId);
306  cache->recHitCollEE.at(id.denseIndex()) =
307  EcalPhiSymRecHit(eeDetId.rawId(), nSumEtValues_, chStatus[id].getStatusCode());
308  cache->recHitCollEE.at(id.denseIndex())
309  .setEERing(ring < kNRingsEE / 2 ? ring - kNRingsEE / 2 : ring - kNRingsEE / 2 + 1);
310  }
311 }
312 
314  edm::EventSetup const& setup,
316  std::shared_ptr<ConfigCache>& cache) const {
317  //---get the ecal geometry
318  const auto* geometry = &setup.getData(geoToken);
320 
321  const auto* barrelGeometry = geometry->getSubdetectorGeometry(DetId::Ecal, EcalBarrel);
322  const auto* endcapGeometry = geometry->getSubdetectorGeometry(DetId::Ecal, EcalEndcap);
323  cache->barrelDetIds = barrelGeometry->getValidDetIds(DetId::Ecal, EcalBarrel);
324  cache->endcapDetIds = endcapGeometry->getValidDetIds(DetId::Ecal, EcalEndcap);
325 
326  for (auto& ebDetId : cache->barrelDetIds) {
327  EBDetId id(ebDetId);
328  int ring = calibRing_.getRingIndex(id);
329  //---set etCut if first pass
330  if (id.iphi() == 1) {
331  auto cellGeometry = barrelGeometry->getGeometry(id);
332  float eta = cellGeometry->getPosition().eta();
333  cache->etCutsEB[ring] = eThresholdsEB_[ring] / cosh(eta) + etCutEB_;
334  }
335  }
336  for (auto& eeDetId : cache->endcapDetIds) {
337  EEDetId id(eeDetId);
339  //---set eCutEE if first pass
340  if (ring < ringsInOneEE && id.ix() == EEDetId::IX_MAX / 2) {
341  auto cellGeometry = endcapGeometry->getGeometry(id);
342  cache->etCutsEE[ring] = eThresholdsEE_[ring] / cosh(cellGeometry->getPosition().eta()) + etCutEE_;
343  cache->etCutsEE[ring + ringsInOneEE] = cache->etCutsEE[ring];
344  }
345  }
346 }
347 
349  //---The first argument is the summary cache that
350  // contains the lumi/run summary information.
351  // The stream partial sums are passed as second argument
352  summaryc->ecalLumiInfo += streamc->ecalLumiInfo;
353  for (unsigned int i = 0; i < summaryc->recHitCollEB.size(); ++i)
354  summaryc->recHitCollEB[i] += streamc->recHitCollEB[i];
355  for (unsigned int i = 0; i < summaryc->recHitCollEE.size(); ++i)
356  summaryc->recHitCollEE[i] += streamc->recHitCollEE[i];
357 }
358 
359 //****************************************************************************************
360 // Lumi producer
361 // The StreamCache and LuminosityBlockSummaryCache contain the rec hit data, summed per
362 // stream, in the stream cache, and per lumi in the summary cache.
363 // The LuminosityBlockCache contains a set of information (detIds and thresholds)
364 // that requires access to the geometry record to be created. Not using the LuminosityBlockCache
365 // would require making the objects contained in it mutable class members which is
366 // discouraged.
367 class EcalPhiSymRecHitProducerLumi : public edm::global::EDProducer<edm::StreamCache<PhiSymCache>,
368  edm::LuminosityBlockCache<ConfigCache>,
369  edm::LuminosityBlockSummaryCache<PhiSymCache>,
370  edm::EndLuminosityBlockProducer,
371  edm::Accumulator>,
373 public:
374  explicit EcalPhiSymRecHitProducerLumi(const edm::ParameterSet& pSet);
376 
377 private:
378  //---methods
379  // job
380  void beginJob() override { initializeJob(); };
381  // lumi
382  std::shared_ptr<ConfigCache> globalBeginLuminosityBlock(edm::LuminosityBlock const& lumi,
383  edm::EventSetup const& setup) const override;
385  std::shared_ptr<PhiSymCache> globalBeginLuminosityBlockSummary(edm::LuminosityBlock const& lumi,
386  edm::EventSetup const& setup) const override;
388  edm::EventSetup const& setup,
389  PhiSymCache* cache) const override{};
391  edm::EventSetup const& setup,
392  PhiSymCache const* cache) const override;
393  // stream
394  std::unique_ptr<PhiSymCache> beginStream(edm::StreamID stream) const override;
396  edm::LuminosityBlock const& lumi,
397  edm::EventSetup const& setup) const override;
399  edm::LuminosityBlock const& lumi,
400  edm::EventSetup const& setup,
401  PhiSymCache* cache) const override;
402 
403  // event
404  void accumulate(edm::StreamID stream, edm::Event const& event, edm::EventSetup const& setup) const override;
405 
406  // data members
410 };
411 
412 //----------IMPLEMENTATION----------------------------------------------------------------
414  : EcalPhiSymRecHitProducerBase(pSet, consumesCollector()),
415  lhcInfoTokenLumi_(esConsumes<edm::Transition::BeginLuminosityBlock>()),
416  chStatusTokenLumi_(esConsumes<edm::Transition::BeginLuminosityBlock>()),
417  geoTokenLumi_(esConsumes<edm::Transition::BeginLuminosityBlock>()) {
418  produces<EcalPhiSymInfo, edm::Transition::EndLuminosityBlock>();
419  produces<EcalPhiSymRecHitCollection, edm::Transition::EndLuminosityBlock>("EB");
420  produces<EcalPhiSymRecHitCollection, edm::Transition::EndLuminosityBlock>("EE");
421 }
422 
424  edm::LuminosityBlock const& lumi, edm::EventSetup const& setup) const {
425  auto cache = std::make_shared<ConfigCache>();
426 
427  //---Reset cache with config values
429 
430  return cache;
431 }
432 
434  edm::LuminosityBlock const& lumi, edm::EventSetup const& setup) const {
435  auto cache = std::make_shared<PhiSymCache>();
436 
437  //---Get LHC info
438  const auto& lhcinfo = setup.getData(lhcInfoTokenLumi_);
439  EcalPhiSymInfo thisLumi(0, 0, 0, 1, lhcinfo.fillNumber(), lhcinfo.delivLumi(), lhcinfo.recLumi());
440 
441  //---Reset global cache
442  initializePhiSymCache(setup, chStatusTokenLumi_, luminosityBlockCache(lumi.index()), cache);
443  cache->ecalLumiInfo = thisLumi;
444 
445  return cache;
446 }
447 
449  edm::EventSetup const& setup,
450  PhiSymCache const* cache) const {
451  //---put the collections in the LuminosityBlocks tree
452  auto ecalLumiInfo = std::make_unique<EcalPhiSymInfo>(cache->ecalLumiInfo);
453  ecalLumiInfo->setMiscalibInfo(
455  auto recHitCollEB =
456  std::make_unique<EcalPhiSymRecHitCollection>(cache->recHitCollEB.begin(), cache->recHitCollEB.end());
457  auto recHitCollEE =
458  std::make_unique<EcalPhiSymRecHitCollection>(cache->recHitCollEE.begin(), cache->recHitCollEE.end());
459 
460  lumi.put(std::move(ecalLumiInfo));
461  lumi.put(std::move(recHitCollEB), "EB");
462  lumi.put(std::move(recHitCollEE), "EE");
463 }
464 
466  //---create stream cache
467  return std::make_unique<PhiSymCache>();
468 }
469 
471  edm::LuminosityBlock const& lumi,
472  edm::EventSetup const& setup) const {
473  //---Reset stream cache
474  initializeStreamCache(luminosityBlockCache(lumi.index()), streamCache(stream));
475 }
476 
478  edm::LuminosityBlock const& lumi,
479  edm::EventSetup const& setup,
480  PhiSymCache* scache) const {
481  //---sum stream cache to summary cache
482  sumCache(scache, streamCache(stream));
483 }
484 
486  edm::Event const& event,
487  edm::EventSetup const& setup) const {
488  processEvent(event, setup, luminosityBlockCache(event.getLuminosityBlock().index()), streamCache(stream));
489 }
490 
491 //****************************************************************************************
492 // Run producer
493 // The StreamCache and RunSummaryCache contain the rec hit data, summed per
494 // stream, in the stream cache, and per run in the summary cache.
495 // The RunCache contains a set of information (detIds and thresholds)
496 // that requires access to the geometry record to be created. Not using the RunCache
497 // would require making the objects contained in it mutable class members which is
498 // discouraged.
499 class EcalPhiSymRecHitProducerRun : public edm::global::EDProducer<edm::StreamCache<PhiSymCache>,
500  edm::RunCache<ConfigCache>,
501  edm::RunSummaryCache<PhiSymCache>,
502  edm::EndRunProducer,
503  edm::Accumulator>,
505 public:
506  explicit EcalPhiSymRecHitProducerRun(const edm::ParameterSet& pSet);
508 
509 private:
510  //---methods
511  // job
512  void beginJob() override { initializeJob(); };
513  // run
514  std::shared_ptr<ConfigCache> globalBeginRun(edm::Run const& run, edm::EventSetup const& setup) const override;
515  std::shared_ptr<PhiSymCache> globalBeginRunSummary(edm::Run const& run, edm::EventSetup const& setup) const override;
516  void globalEndRun(edm::Run const& run, edm::EventSetup const& setup) const override{};
517  void globalEndRunSummary(edm::Run const& run, edm::EventSetup const& setup, PhiSymCache* cache) const override{};
518  void globalEndRunProduce(edm::Run& run, edm::EventSetup const& setup, PhiSymCache const* cache) const override;
519  // stream
520  std::unique_ptr<PhiSymCache> beginStream(edm::StreamID stream) const override;
522  edm::LuminosityBlock const& lumi,
523  edm::EventSetup const& setup) const override;
524  void streamBeginRun(edm::StreamID stream, edm::Run const& run, edm::EventSetup const& setup) const override;
526  edm::Run const& run,
527  edm::EventSetup const& setup,
528  PhiSymCache* cache) const override;
529  // event
530  void accumulate(edm::StreamID stream, edm::Event const& event, edm::EventSetup const& setup) const override;
531 
532  // data members
536 };
537 
538 //----------IMPLEMENTATION----------------------------------------------------------------
540  : EcalPhiSymRecHitProducerBase(pSet, consumesCollector()),
541  lhcInfoTokenLumi_(esConsumes<edm::Transition::BeginLuminosityBlock>()),
542  chStatusTokenRun_(esConsumes<edm::Transition::BeginRun>()),
543  geoTokenRun_(esConsumes<edm::Transition::BeginRun>()) {
544  produces<EcalPhiSymInfo, edm::Transition::EndRun>();
545  produces<EcalPhiSymRecHitCollection, edm::Transition::EndRun>("EB");
546  produces<EcalPhiSymRecHitCollection, edm::Transition::EndRun>("EE");
547 }
548 
549 std::shared_ptr<ConfigCache> EcalPhiSymRecHitProducerRun::globalBeginRun(edm::Run const& run,
550  edm::EventSetup const& setup) const {
551  auto cache = std::make_shared<ConfigCache>();
552 
553  //---Reset cache with config values
555 
556  return cache;
557 }
558 
560  edm::EventSetup const& setup) const {
561  auto cache = std::make_shared<PhiSymCache>();
562  initializePhiSymCache(setup, chStatusTokenRun_, runCache(run.index()), cache);
563  return cache;
564 }
565 
567  edm::EventSetup const& setup,
568  PhiSymCache const* cache) const {
569  //---put the collections in the Runs tree
570  auto ecalLumiInfo = std::make_unique<EcalPhiSymInfo>(cache->ecalLumiInfo);
571  ecalLumiInfo->setMiscalibInfo(
573  auto recHitCollEB =
574  std::make_unique<EcalPhiSymRecHitCollection>(cache->recHitCollEB.begin(), cache->recHitCollEB.end());
575  auto recHitCollEE =
576  std::make_unique<EcalPhiSymRecHitCollection>(cache->recHitCollEE.begin(), cache->recHitCollEE.end());
577 
578  run.put(std::move(ecalLumiInfo));
579  run.put(std::move(recHitCollEB), "EB");
580  run.put(std::move(recHitCollEE), "EE");
581 }
582 
583 std::unique_ptr<PhiSymCache> EcalPhiSymRecHitProducerRun::beginStream(edm::StreamID stream) const {
584  //---create stream cache
585  return std::make_unique<PhiSymCache>();
586 }
587 
589  edm::Run const& run,
590  edm::EventSetup const& setup) const {
591  //---Reset stream cache
592  initializeStreamCache(runCache(run.index()), streamCache(stream));
593 }
594 
596  edm::LuminosityBlock const& lumi,
597  edm::EventSetup const& setup) const {
598  //---Get LHC info
599  // LHCInfo only returns the correct luminosity information
600  // for each lumisection, accessing LHCInfo at the beginning
601  // of each run would return only the luminosity info of the
602  // first LS.
603  // Therefore the LHCInfo is accessed only by the first stream
604  // each time a new LS is processed
605  if (stream.value() == 0) {
606  const auto& lhcinfo = setup.getData(lhcInfoTokenLumi_);
607  EcalPhiSymInfo thisLumi(0, 0, 0, 1, lhcinfo.fillNumber(), lhcinfo.delivLumi(), lhcinfo.recLumi());
608 
609  streamCache(stream)->ecalLumiInfo += thisLumi;
610  }
611 }
612 
614  edm::Run const& run,
615  edm::EventSetup const& setup,
616  PhiSymCache* scache) const {
617  //---sum stream cache to run cache
618  sumCache(scache, streamCache(stream));
619 }
620 
622  edm::Event const& event,
623  edm::EventSetup const& setup) const {
624  processEvent(event, setup, runCache(event.getRun().index()), streamCache(stream));
625 }
626 
void sumCache(PhiSymCache *summaryc, PhiSymCache *streamc) const
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
void globalEndRun(edm::Run const &run, edm::EventSetup const &setup) const override
void initializePhiSymCache(edm::EventSetup const &setup, edm::ESGetToken< EcalChannelStatus, EcalChannelStatusRcd > const &chStatusToken, ConfigCache const *config, std::shared_ptr< PhiSymCache > &cache) const
edm::ESGetToken< EcalChannelStatus, EcalChannelStatusRcd > chStatusTokenRun_
std::shared_ptr< ConfigCache > globalBeginLuminosityBlock(edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) const override
static void setCaloGeometry(const CaloGeometry *geometry)
float etCutsEB[EcalRingCalibrationTools::N_RING_BARREL]
edm::ESGetToken< EcalLaserDbService, EcalLaserDbRecord > laserDbToken_
std::shared_ptr< ConfigCache > globalBeginRun(edm::Run const &run, edm::EventSetup const &setup) const override
static constexpr short N_RING_ENDCAP
std::shared_ptr< PhiSymCache > globalBeginRunSummary(edm::Run const &run, edm::EventSetup const &setup) const override
for(int i=first, nt=offsets[nh];i< nt;i+=gridDim.x *blockDim.x)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geoTokenRun_
void processEvent(edm::Event const &event, edm::EventSetup const &setup, ConfigCache const *config, PhiSymCache *cache) const
void globalEndRunSummary(edm::Run const &run, edm::EventSetup const &setup, PhiSymCache *cache) const override
void accumulate(edm::StreamID stream, edm::Event const &event, edm::EventSetup const &setup) const override
EcalPhiSymInfo ecalLumiInfo
void streamEndLuminosityBlockSummary(edm::StreamID stream, edm::LuminosityBlock const &lumi, edm::EventSetup const &setup, PhiSymCache *cache) const override
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geoTokenLumi_
Definition: config.py:1
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geoToken_
static short getRingIndex(DetId aDetId)
Retrieve the phi-ring index corresponding to a DetId.
uint32_t denseIndex() const
Definition: EBDetId.h:84
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
void streamBeginLuminosityBlock(edm::StreamID stream, edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) const override
EcalPhiSymRecHitProducerRun(const edm::ParameterSet &pSet)
EcalPhiSymRecHitProducerBase(const edm::ParameterSet &pSet, edm::ConsumesCollector &&cc)
void globalEndLuminosityBlockProduce(edm::LuminosityBlock &lumi, edm::EventSetup const &setup, PhiSymCache const *cache) const override
std::vector< DetId > endcapDetIds
std::unique_ptr< PhiSymCache > beginStream(edm::StreamID stream) const override
void initializeConfigCache(edm::EventSetup const &setup, edm::ESGetToken< CaloGeometry, CaloGeometryRecord > const &geoToken, std::shared_ptr< ConfigCache > &cache) const
float etCutsEE[EcalRingCalibrationTools::N_RING_ENDCAP]
edm::EDGetTokenT< EBRecHitCollection > eeToken_
void streamBeginLuminosityBlock(edm::StreamID stream, edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) const override
std::unique_ptr< PhiSymCache > beginStream(edm::StreamID stream) const override
void globalEndLuminosityBlockSummary(edm::LuminosityBlock const &lumi, edm::EventSetup const &setup, PhiSymCache *cache) const override
EcalPhiSymRecHitProducerLumi(const edm::ParameterSet &pSet)
std::vector< DetId > barrelDetIds
void globalEndRunProduce(edm::Run &run, edm::EventSetup const &setup, PhiSymCache const *cache) const override
static constexpr short N_RING_BARREL
uint32_t denseIndex() const
Definition: EEDetId.h:192
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
Transition
Definition: Transition.h:12
edm::ESGetToken< LHCInfo, LHCInfoRcd > lhcInfoTokenLumi_
static const int IX_MAX
Definition: EEDetId.h:298
void accumulate(edm::StreamID stream, edm::Event const &event, edm::EventSetup const &setup) const override
unsigned long long uint64_t
Definition: Time.h:13
edm::ESGetToken< LHCInfo, LHCInfoRcd > lhcInfoTokenLumi_
std::shared_ptr< PhiSymCache > globalBeginLuminosityBlockSummary(edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) const override
void globalEndLuminosityBlock(edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) const override
std::vector< EcalPhiSymRecHit > EcalPhiSymRecHitCollection
HLT enums.
edm::EDGetTokenT< EBRecHitCollection > ebToken_
edm::ESGetToken< EcalChannelStatus, EcalChannelStatusRcd > chStatusTokenLumi_
def cache(function)
Definition: utilities.py:3
void streamBeginRun(edm::StreamID stream, edm::Run const &run, edm::EventSetup const &setup) const override
void streamEndRunSummary(edm::StreamID stream, edm::Run const &run, edm::EventSetup const &setup, PhiSymCache *cache) const override
EcalPhiSymRecHitCollection recHitCollEB
EcalPhiSymRecHitCollection recHitCollEE
def move(src, dest)
Definition: eostools.py:511
Definition: event.py:1
Definition: Run.h:45
void initializeStreamCache(ConfigCache const *config, PhiSymCache *cache) const