CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
HGCDigitizer Class Reference

#include <HGCDigitizer.h>

Public Types

typedef std::tuple< int, uint32_t, float > HGCCaloHitTuple_t
 

Public Member Functions

void accumulate (edm::Event const &e, edm::EventSetup const &c, CLHEP::HepRandomEngine *hre)
 handle SimHit accumulation More...
 
template<typename GEOM >
void accumulate (edm::Handle< edm::PCaloHitContainer > const &hits, int bxCrossing, const GEOM *geom, CLHEP::HepRandomEngine *hre)
 
void accumulate (PileUpEventPrincipal const &e, edm::EventSetup const &c, CLHEP::HepRandomEngine *hre)
 
void accumulate_forPreMix (const PHGCSimAccumulator &simAccumulator, const bool minbiasFlag)
 
void accumulate_forPreMix (edm::Event const &e, edm::EventSetup const &c, CLHEP::HepRandomEngine *hre)
 
template<typename GEOM >
void accumulate_forPreMix (edm::Handle< edm::PCaloHitContainer > const &hits, int bxCrossing, const GEOM *geom, CLHEP::HepRandomEngine *hre)
 
void accumulate_forPreMix (PileUpEventPrincipal const &e, edm::EventSetup const &c, CLHEP::HepRandomEngine *hre)
 
void beginRun (const edm::EventSetup &es)
 actions at the start/end of run More...
 
std::string digiCollection ()
 
void endRun ()
 
void finalizeEvent (edm::Event &e, edm::EventSetup const &c, CLHEP::HepRandomEngine *hre)
 
int geometryType ()
 
 HGCDigitizer (const edm::ParameterSet &ps, edm::ConsumesCollector &iC)
 
void initializeEvent (edm::Event const &e, edm::EventSetup const &c)
 actions at the start/end of event More...
 
bool producesEEDigis ()
 
bool producesHEbackDigis ()
 
bool producesHEfrontDigis ()
 
bool producesHFNoseDigis ()
 
 ~HGCDigitizer ()
 

Static Public Member Functions

static bool orderByDetIdThenTime (const HGCCaloHitTuple_t &a, const HGCCaloHitTuple_t &b)
 

Private Member Functions

void checkPosition (const HGCalDigiCollection *digis) const
 
uint32_t getType () const
 
bool getWeight (std::array< float, 3 > &tdcForToAOnset, float &keV2fC) const
 
void resetPUSimHitDataAccumulator ()
 
void resetSimHitDataAccumulator ()
 

Private Attributes

std::array< double, 4 > averageOccupancies_
 
double bxTime_
 
std::vector< float > cce_
 
std::string digiCollection_
 
int digitizationType_
 
double ev_per_eh_pair_
 
int geometryType_
 
const HcalGeometrygHcal_
 
const HGCalGeometrygHGCal_
 
std::string hitCollection_
 
std::unordered_map< uint32_t, bool > hitOrder_monitor
 
std::unordered_map< uint32_t, std::vector< std::pair< float, float > > > hitRefs_bx0
 
int maxSimHitsAccTime_
 
DetId::Detector myDet_
 
ForwardSubdetector mySubDet_
 
uint32_t nEvents_
 
std::unordered_map< uint32_t, std::vector< std::tuple< float, float, float > > > PhitRefs_bx0
 
bool premixStage1_
 
double premixStage1MaxCharge_
 
double premixStage1MinCharge_
 
std::unique_ptr< hgc::HGCPUSimHitDataAccumulatorpusimHitAccumulator_
 
float refSpeed_
 
std::unique_ptr< hgc::HGCSimHitDataAccumulatorsimHitAccumulator_
 
std::unique_ptr< HFNoseDigitizertheHFNoseDigitizer_
 
std::unique_ptr< HGCEEDigitizertheHGCEEDigitizer_
 
std::unique_ptr< HGCHEbackDigitizertheHGCHEbackDigitizer_
 
std::unique_ptr< HGCHEfrontDigitizertheHGCHEfrontDigitizer_
 
float tofDelay_
 
std::unordered_set< DetIdvalidIds_
 
uint32_t verbosity_
 

Static Private Attributes

static const unsigned int maxBx_ = 14
 
static const unsigned int thisBx_ = 9
 

Detailed Description

Definition at line 30 of file HGCDigitizer.h.

Member Typedef Documentation

◆ HGCCaloHitTuple_t

typedef std::tuple<int, uint32_t, float> HGCDigitizer::HGCCaloHitTuple_t

Definition at line 36 of file HGCDigitizer.h.

Constructor & Destructor Documentation

◆ HGCDigitizer()

HGCDigitizer::HGCDigitizer ( const edm::ParameterSet ps,
edm::ConsumesCollector iC 
)

Definition at line 264 of file HGCDigitizer.cc.

269  refSpeed_(0.1 * CLHEP::c_light), //[CLHEP::c_light]=mm/ns convert to cm/ns
270  averageOccupancies_(occupancyGuesses),
271  nEvents_(1) {
272  //configure from cfg
273 
274  hitCollection_ = ps.getParameter<std::string>("hitCollection");
275  digiCollection_ = ps.getParameter<std::string>("digiCollection");
276  maxSimHitsAccTime_ = ps.getParameter<uint32_t>("maxSimHitsAccTime");
277  bxTime_ = ps.getParameter<double>("bxTime");
278  geometryType_ = ps.getParameter<uint32_t>("geometryType");
279  digitizationType_ = ps.getParameter<uint32_t>("digitizationType");
280  verbosity_ = ps.getUntrackedParameter<uint32_t>("verbosity", 0);
281  tofDelay_ = ps.getParameter<double>("tofDelay");
282  premixStage1_ = ps.getParameter<bool>("premixStage1");
283  premixStage1MinCharge_ = ps.getParameter<double>("premixStage1MinCharge");
284  premixStage1MaxCharge_ = ps.getParameter<double>("premixStage1MaxCharge");
285  std::unordered_set<DetId>().swap(validIds_);
286  iC.consumes<std::vector<PCaloHit>>(edm::InputTag("g4SimHits", hitCollection_));
287  const auto& myCfg_ = ps.getParameter<edm::ParameterSet>("digiCfg");
288 
289  if (myCfg_.existsAs<edm::ParameterSet>("chargeCollectionEfficiencies")) {
290  cce_.clear();
291  const auto& temp = myCfg_.getParameter<edm::ParameterSet>("chargeCollectionEfficiencies")
292  .getParameter<std::vector<double>>("values");
293  for (double cce : temp) {
294  cce_.emplace_back(cce);
295  }
296  } else {
297  std::vector<float>().swap(cce_);
298  }
299 
300  if (hitCollection_.find("HitsEE") != std::string::npos) {
301  if (geometryType_ == 0) {
303  } else {
305  }
306  theHGCEEDigitizer_ = std::make_unique<HGCEEDigitizer>(ps);
307  }
308  if (hitCollection_.find("HitsHEfront") != std::string::npos) {
309  if (geometryType_ == 0) {
311  } else {
313  }
314  theHGCHEfrontDigitizer_ = std::make_unique<HGCHEfrontDigitizer>(ps);
315  }
316  if (hitCollection_.find("HcalHits") != std::string::npos and geometryType_ == 0) {
318  theHGCHEbackDigitizer_ = std::make_unique<HGCHEbackDigitizer>(ps);
319  }
320  if (hitCollection_.find("HitsHEback") != std::string::npos and geometryType_ == 1) {
322  theHGCHEbackDigitizer_ = std::make_unique<HGCHEbackDigitizer>(ps);
323  }
324  if (hitCollection_.find("HFNoseHits") != std::string::npos) {
327  theHFNoseDigitizer_ = std::make_unique<HFNoseDigitizer>(ps);
328  }
329 }

References bxTime_, cce_, edm::ConsumesCollector::consumes(), digiCollection_, digitizationType_, DetId::Forward, geometryType_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), HFNose, DetId::HGCalEE, DetId::HGCalHSc, DetId::HGCalHSi, HGCEE, HGCHEB, HGCHEF, hitCollection_, HLT_FULL_cff::InputTag, maxSimHitsAccTime_, myDet_, mySubDet_, premixStage1_, premixStage1MaxCharge_, premixStage1MinCharge_, AlCaHLTBitMon_QueryRunRegistry::string, groupFilesInBlocks::temp, theHFNoseDigitizer_, theHGCEEDigitizer_, theHGCHEbackDigitizer_, theHGCHEfrontDigitizer_, tofDelay_, validIds_, and verbosity_.

◆ ~HGCDigitizer()

HGCDigitizer::~HGCDigitizer ( )
inline

Definition at line 33 of file HGCDigitizer.h.

33 {}

Member Function Documentation

◆ accumulate() [1/3]

void HGCDigitizer::accumulate ( edm::Event const &  e,
edm::EventSetup const &  c,
CLHEP::HepRandomEngine *  hre 
)

handle SimHit accumulation

Definition at line 442 of file HGCDigitizer.cc.

442  {
443  //get inputs
445  e.getByLabel(edm::InputTag("g4SimHits", hitCollection_), hits);
446  if (!hits.isValid()) {
447  edm::LogError("HGCDigitizer") << " @ accumulate : can't find " << hitCollection_ << " collection of g4SimHits";
448  return;
449  }
450 
451  //accumulate in-time the main event
452  if (nullptr != gHGCal_) {
453  accumulate(hits, 0, gHGCal_, hre);
454  } else if (nullptr != gHcal_) {
455  accumulate(hits, 0, gHcal_, hre);
456  } else {
457  throw cms::Exception("BadConfiguration") << "HGCDigitizer is not producing EE, FH, or BH digis!";
458  }
459 }

References MillePedeFileConverter_cfg::e, Exception, gHcal_, gHGCal_, hitCollection_, and hfClusterShapes_cfi::hits.

Referenced by HGCDigiProducer::accumulate(), and accumulate().

◆ accumulate() [2/3]

template<typename GEOM >
void HGCDigitizer::accumulate ( edm::Handle< edm::PCaloHitContainer > const &  hits,
int  bxCrossing,
const GEOM *  geom,
CLHEP::HepRandomEngine *  hre 
)

Definition at line 632 of file HGCDigitizer.cc.

635  {
636  if (nullptr == geom)
637  return;
638 
639  //configuration to apply for the computation of time-of-flight
640  std::array<float, 3> tdcForToAOnset{{0.f, 0.f, 0.f}};
641  float keV2fC(0.f);
642  bool weightToAbyEnergy = getWeight(tdcForToAOnset, keV2fC);
643 
644  //create list of tuples (pos in container, RECO DetId, time) to be sorted first
645  int nchits = (int)hits->size();
646 
647  std::vector<HGCCaloHitTuple_t> hitRefs;
648  hitRefs.reserve(nchits);
649  for (int i = 0; i < nchits; ++i) {
650  const auto& the_hit = hits->at(i);
651  DetId id = simToReco(geom, the_hit.id());
652 
653  if (verbosity_ > 0) {
654  if (producesEEDigis())
655  edm::LogVerbatim("HGCDigitizer") << "HGCDigitizer::i/p " << std::hex << the_hit.id() << " o/p " << id.rawId()
656  << std::dec;
657  else
658  edm::LogVerbatim("HGCDigitizer") << "HGCDigitizer::i/p " << std::hex << the_hit.id() << " o/p " << id.rawId()
659  << std::dec;
660  }
661 
662  if (0 != id.rawId()) {
663  hitRefs.emplace_back(i, id.rawId(), (float)the_hit.time());
664  }
665  }
666 
667  std::sort(hitRefs.begin(), hitRefs.end(), this->orderByDetIdThenTime);
668  //loop over sorted hits
669  nchits = hitRefs.size();
670  for (int i = 0; i < nchits; ++i) {
671  const int hitidx = std::get<0>(hitRefs[i]);
672  const uint32_t id = std::get<1>(hitRefs[i]);
673 
674  //get the data for this cell, if not available then we skip it
675 
676  if (!validIds_.count(id))
677  continue;
678  HGCSimHitDataAccumulator::iterator simHitIt = simHitAccumulator_->emplace(id, HGCCellInfo()).first;
679 
680  if (id == 0)
681  continue; // to be ignored at RECO level
682 
683  const float toa = std::get<2>(hitRefs[i]);
684  const PCaloHit& hit = hits->at(hitidx);
685  const float charge = hit.energy() * 1e6 * keV2fC;
686 
687  //distance to the center of the detector
688  const float dist2center(getPositionDistance(geom, id));
689 
690  //hit time: [time()]=ns [centerDist]=cm [refSpeed_]=cm/ns + delay by 1ns
691  //accumulate in 15 buckets of 25ns (9 pre-samples, 1 in-time, 5 post-samples)
692  const float tof = toa - dist2center / refSpeed_ + tofDelay_;
693  const int itime = std::floor(tof / bxTime_) + 9;
694 
695  //no need to add bx crossing - tof comes already corrected from the mixing module
696  //itime += bxCrossing;
697  //itime += 9;
698 
699  if (itime < 0 || itime > (int)maxBx_)
700  continue;
701 
702  //check if time index is ok and store energy
703  if (itime >= (int)simHitIt->second.hit_info[0].size())
704  continue;
705 
706  (simHitIt->second).hit_info[0][itime] += charge;
707 
708  //for time-of-arrival: save the time-sorted list of timestamps with cumulative charge just above threshold
709  //working version with pileup only for in-time hits
710  int waferThickness = getCellThickness(geom, id);
711  bool orderChanged = false;
712  if (itime == (int)thisBx_) {
713  //if start empty => just add charge and time
714  if (hitRefs_bx0[id].empty()) {
715  hitRefs_bx0[id].emplace_back(charge, tof);
716 
717  } else if (tof <= hitRefs_bx0[id].back().second) {
718  //find position to insert new entry preserving time sorting
719  std::vector<std::pair<float, float>>::iterator findPos =
720  std::upper_bound(hitRefs_bx0[id].begin(),
721  hitRefs_bx0[id].end(),
722  std::pair<float, float>(0.f, tof),
723  [](const auto& i, const auto& j) { return i.second <= j.second; });
724 
725  std::vector<std::pair<float, float>>::iterator insertedPos = findPos;
726  if (findPos->second == tof) {
727  //just merge timestamps with exact timing
728  findPos->first += charge;
729  } else {
730  //insert new element cumulating the charge
731  insertedPos = hitRefs_bx0[id].insert(findPos,
732  (findPos == hitRefs_bx0[id].begin())
733  ? std::pair<float, float>(charge, tof)
734  : std::pair<float, float>((findPos - 1)->first + charge, tof));
735  }
736 
737  //cumulate the charge of new entry for all elements that follow in the sorted list
738  //and resize list accounting for cases when the inserted element itself crosses the threshold
739  for (std::vector<std::pair<float, float>>::iterator step = insertedPos; step != hitRefs_bx0[id].end(); ++step) {
740  if (step != insertedPos)
741  step->first += charge;
742  // resize the list stopping with the first timeStamp with cumulative charge above threshold
743  if (step->first > tdcForToAOnset[waferThickness - 1] && step->second != hitRefs_bx0[id].back().second) {
744  hitRefs_bx0[id].resize(std::upper_bound(hitRefs_bx0[id].begin(),
745  hitRefs_bx0[id].end(),
746  std::pair<float, float>(0.f, step->second),
747  [](const auto& i, const auto& j) { return i.second < j.second; }) -
748  hitRefs_bx0[id].begin());
749  for (auto stepEnd = step + 1; stepEnd != hitRefs_bx0[id].end(); ++stepEnd)
750  stepEnd->first += charge;
751  break;
752  }
753  }
754 
755  orderChanged = true;
756  } else {
757  //add new entry at the end of the list
758  if (hitRefs_bx0[id].back().first <= tdcForToAOnset[waferThickness - 1]) {
759  hitRefs_bx0[id].emplace_back(hitRefs_bx0[id].back().first + charge, tof);
760  }
761  }
762  }
763  float accChargeForToA = hitRefs_bx0[id].empty() ? 0.f : hitRefs_bx0[id].back().first;
764  //now compute the firing ToA through the interpolation of the consecutive time-stamps at threshold
765  if (weightToAbyEnergy)
766  (simHitIt->second).hit_info[1][itime] += charge * tof;
767  else if (accChargeForToA > tdcForToAOnset[waferThickness - 1] &&
768  ((simHitIt->second).hit_info[1][itime] == 0 || orderChanged == true)) {
769  float fireTDC = hitRefs_bx0[id].back().second;
770  if (hitRefs_bx0[id].size() > 1) {
771  float chargeBeforeThr = (hitRefs_bx0[id].end() - 2)->first;
772  float tofchargeBeforeThr = (hitRefs_bx0[id].end() - 2)->second;
773 
774  float deltaQ = accChargeForToA - chargeBeforeThr;
775  float deltaTOF = fireTDC - tofchargeBeforeThr;
776  fireTDC = (tdcForToAOnset[waferThickness - 1] - chargeBeforeThr) * deltaTOF / deltaQ + tofchargeBeforeThr;
777  }
778  (simHitIt->second).hit_info[1][itime] = fireTDC;
779  }
780  }
781  hitRefs.clear();
782 }

References bxTime_, ALCARECOTkAlJpsiMuMu_cff::charge, TauDecayModes::dec, relativeConstraints::empty, mps_fire::end, f, dqmdumpme::first, relativeConstraints::geom, getWeight(), hitRefs_bx0, hfClusterShapes_cfi::hits, mps_fire::i, triggerObjects_cff::id, createfilelist::int, dqmiolumiharvest::j, hgcalTriggerNtuples_cfi::keV2fC, maxBx_, orderByDetIdThenTime(), producesEEDigis(), refSpeed_, edm::second(), simHitAccumulator_, findQualityFiles::size, thisBx_, tofDelay_, pfDeepBoostedJetPreprocessParams_cfi::upper_bound, validIds_, trackerHitRTTI::vector, and verbosity_.

◆ accumulate() [3/3]

void HGCDigitizer::accumulate ( PileUpEventPrincipal const &  e,
edm::EventSetup const &  c,
CLHEP::HepRandomEngine *  hre 
)

Definition at line 483 of file HGCDigitizer.cc.

485  {
486  //get inputs
488  e.getByLabel(edm::InputTag("g4SimHits", hitCollection_), hits);
489 
490  if (!hits.isValid()) {
491  edm::LogError("HGCDigitizer") << " @ accumulate : can't find " << hitCollection_ << " collection of g4SimHits";
492  return;
493  }
494 
495  //accumulate for the simulated bunch crossing
496  if (nullptr != gHGCal_) {
497  accumulate(hits, e.bunchCrossing(), gHGCal_, hre);
498  } else if (nullptr != gHcal_) {
499  accumulate(hits, e.bunchCrossing(), gHcal_, hre);
500  } else {
501  throw cms::Exception("BadConfiguration") << "HGCDigitizer is not producing EE, FH, or BH digis!";
502  }
503 }

References accumulate(), MillePedeFileConverter_cfg::e, Exception, gHcal_, gHGCal_, hitCollection_, and hfClusterShapes_cfi::hits.

◆ accumulate_forPreMix() [1/4]

void HGCDigitizer::accumulate_forPreMix ( const PHGCSimAccumulator simAccumulator,
const bool  minbiasFlag 
)

Definition at line 783 of file HGCDigitizer.cc.

783  {
784  //configuration to apply for the computation of time-of-flight
785  std::array<float, 3> tdcForToAOnset{{0.f, 0.f, 0.f}};
786  float keV2fC(0.f);
787  bool weightToAbyEnergy = getWeight(tdcForToAOnset, keV2fC);
788 
789  if (nullptr != gHGCal_) {
790  loadSimHitAccumulator_forPreMix(*simHitAccumulator_,
792  gHGCal_,
793  hitRefs_bx0,
794  simAccumulator,
797  !weightToAbyEnergy,
798  tdcForToAOnset,
799  minbiasFlag,
801  thisBx_);
802  } else if (nullptr != gHcal_) {
803  loadSimHitAccumulator_forPreMix(*simHitAccumulator_,
805  gHcal_,
806  hitRefs_bx0,
807  simAccumulator,
810  !weightToAbyEnergy,
811  tdcForToAOnset,
812  minbiasFlag,
814  thisBx_);
815  }
816 }

References f, getWeight(), gHcal_, gHGCal_, hitOrder_monitor, hitRefs_bx0, hgcalTriggerNtuples_cfi::keV2fC, premixStage1MaxCharge_, premixStage1MinCharge_, pusimHitAccumulator_, simHitAccumulator_, and thisBx_.

◆ accumulate_forPreMix() [2/4]

void HGCDigitizer::accumulate_forPreMix ( edm::Event const &  e,
edm::EventSetup const &  c,
CLHEP::HepRandomEngine *  hre 
)

Definition at line 418 of file HGCDigitizer.cc.

420  {
421  //get inputs
422 
424  e.getByLabel(edm::InputTag("g4SimHits", hitCollection_), hits);
425  if (!hits.isValid()) {
426  edm::LogError("HGCDigitizer") << " @ accumulate_minbias : can't find " << hitCollection_
427  << " collection of g4SimHits";
428  return;
429  }
430 
431  //accumulate in-time the main event
432  if (nullptr != gHGCal_) {
434  } else if (nullptr != gHcal_) {
435  accumulate_forPreMix(hits, 0, gHcal_, hre);
436  } else {
437  throw cms::Exception("BadConfiguration") << "HGCDigitizer is not producing EE, FH, or BH digis!";
438  }
439 }

References MillePedeFileConverter_cfg::e, Exception, gHcal_, gHGCal_, hitCollection_, and hfClusterShapes_cfi::hits.

Referenced by HGCDigiProducer::accumulate(), accumulate_forPreMix(), PreMixingHGCalWorker::addPileups(), and PreMixingHGCalWorker::addSignals().

◆ accumulate_forPreMix() [3/4]

template<typename GEOM >
void HGCDigitizer::accumulate_forPreMix ( edm::Handle< edm::PCaloHitContainer > const &  hits,
int  bxCrossing,
const GEOM *  geom,
CLHEP::HepRandomEngine *  hre 
)

Definition at line 507 of file HGCDigitizer.cc.

510  {
511  if (nullptr == geom)
512  return;
513 
514  float keV2fC(0.f);
515  //configuration to apply for the computation of time-of-flight
516  std::array<float, 3> tdcForToAOnset{{0.f, 0.f, 0.f}};
517 
518  int nchits = (int)hits->size();
519  int count_thisbx = 0;
520  std::vector<HGCCaloHitTuple_t> hitRefs;
521  hitRefs.reserve(nchits);
522  for (int i = 0; i < nchits; ++i) {
523  const auto& the_hit = hits->at(i);
524  DetId id = simToReco(geom, the_hit.id());
525  // to be written the verbosity block
526  if (id.rawId() != 0) {
527  hitRefs.emplace_back(i, id.rawId(), (float)the_hit.time());
528  }
529  }
530  std::sort(hitRefs.begin(), hitRefs.end(), this->orderByDetIdThenTime);
531 
532  nchits = hitRefs.size();
533  for (int i = 0; i < nchits; ++i) {
534  const int hitidx = std::get<0>(hitRefs[i]);
535  const uint32_t id = std::get<1>(hitRefs[i]);
536  if (!validIds_.count(id))
537  continue;
538 
539  if (id == 0)
540  continue;
541 
542  const float toa = std::get<2>(hitRefs[i]);
543  const PCaloHit& hit = hits->at(hitidx);
544  const float charge = hit.energy() * 1e6 * keV2fC; // * getCCE(geom, id, cce_);
545 
546  const float dist2center(getPositionDistance(geom, id));
547  const float tof = toa - dist2center / refSpeed_ + tofDelay_;
548  const int itime = std::floor(tof / bxTime_) + 9;
549 
550  if (itime < 0 || itime > (int)maxBx_)
551  continue;
552 
553  if (itime >= (int)(maxBx_ + 1))
554  continue;
555 
556  int waferThickness = getCellThickness(geom, id);
557  if (itime == (int)thisBx_) {
558  ++count_thisbx;
559  if (PhitRefs_bx0[id].empty()) {
560  PhitRefs_bx0[id].emplace_back(charge, charge, tof);
561  } else if (tof > std::get<2>(PhitRefs_bx0[id].back())) {
562  PhitRefs_bx0[id].emplace_back(charge, charge + std::get<1>(PhitRefs_bx0[id].back()), tof);
563  } else if (tof == std::get<2>(PhitRefs_bx0[id].back())) {
564  std::get<0>(PhitRefs_bx0[id].back()) += charge;
565  std::get<1>(PhitRefs_bx0[id].back()) += charge;
566  } else {
567  //find position to insert new entry preserving time sorting
568  hitRec_itr findPos =
569  std::upper_bound(PhitRefs_bx0[id].begin(),
570  PhitRefs_bx0[id].end(),
571  hit_timeStamp(charge, 0.f, tof),
572  [](const auto& i, const auto& j) { return std::get<2>(i) <= std::get<2>(j); });
573 
574  hitRec_itr insertedPos = findPos;
575 
576  if (tof == std::get<2>(*(findPos - 1))) {
577  std::get<0>(*(findPos - 1)) += charge;
578  std::get<1>(*(findPos - 1)) += charge;
579 
580  } else {
581  insertedPos = PhitRefs_bx0[id].insert(findPos,
582  (findPos == PhitRefs_bx0[id].begin())
583  ? hit_timeStamp(charge, charge, tof)
584  : hit_timeStamp(charge, charge + std::get<1>(*(findPos - 1)), tof));
585  }
586  //cumulate the charge of new entry for all elements that follow in the sorted list
587  //and resize list accounting for cases when the inserted element itself crosses the threshold
588 
589  for (hitRec_itr step = insertedPos; step != PhitRefs_bx0[id].end(); ++step) {
590  if (step != insertedPos)
591  std::get<1>(*(step)) += charge;
592 
593  // resize the list stopping with the first timeStamp with cumulative charge above threshold
594  if (std::get<1>(*step) > tdcForToAOnset[waferThickness - 1] &&
595  std::get<2>(*step) != std::get<2>(PhitRefs_bx0[id].back())) {
596  PhitRefs_bx0[id].resize(
597  std::upper_bound(PhitRefs_bx0[id].begin(),
598  PhitRefs_bx0[id].end(),
599  hit_timeStamp(charge, 0.f, std::get<2>(*step)),
600  [](const auto& i, const auto& j) { return std::get<2>(i) < std::get<2>(j); }) -
601  PhitRefs_bx0[id].begin());
602  for (auto stepEnd = step + 1; stepEnd != PhitRefs_bx0[id].end(); ++stepEnd)
603  std::get<1>(*stepEnd) += charge;
604  break;
605  }
606  }
607  }
608  }
609  }
610 
611  for (const auto& hitCollection : PhitRefs_bx0) {
612  const uint32_t detectorId = hitCollection.first;
613  auto simHitIt = pusimHitAccumulator_->emplace(detectorId, HGCCellHitInfo()).first;
614 
615  for (const auto& hit_timestamp : PhitRefs_bx0[detectorId]) {
616  (simHitIt->second).PUhit_info[1][thisBx_].push_back(std::get<2>(hit_timestamp));
617  (simHitIt->second).PUhit_info[0][thisBx_].push_back(std::get<0>(hit_timestamp));
618  }
619  }
620 
621  if (nchits == 0) {
622  HGCPUSimHitDataAccumulator::iterator simHitIt = pusimHitAccumulator_->emplace(0, HGCCellHitInfo()).first;
623  (simHitIt->second).PUhit_info[1][9].push_back(0.0);
624  (simHitIt->second).PUhit_info[0][9].push_back(0.0);
625  }
626  hitRefs.clear();
627  PhitRefs_bx0.clear();
628 }

References bxTime_, ALCARECOTkAlJpsiMuMu_cff::charge, relativeConstraints::empty, mps_fire::end, f, relativeConstraints::geom, egammaRechitFilter_cfi::hitCollection, hfClusterShapes_cfi::hits, mps_fire::i, triggerObjects_cff::id, createfilelist::int, dqmiolumiharvest::j, hgcalTriggerNtuples_cfi::keV2fC, maxBx_, orderByDetIdThenTime(), PhitRefs_bx0, pusimHitAccumulator_, refSpeed_, thisBx_, tofDelay_, pfDeepBoostedJetPreprocessParams_cfi::upper_bound, and validIds_.

◆ accumulate_forPreMix() [4/4]

void HGCDigitizer::accumulate_forPreMix ( PileUpEventPrincipal const &  e,
edm::EventSetup const &  c,
CLHEP::HepRandomEngine *  hre 
)

Definition at line 462 of file HGCDigitizer.cc.

464  {
466  e.getByLabel(edm::InputTag("g4SimHits", hitCollection_), hits);
467 
468  if (!hits.isValid()) {
469  edm::LogError("HGCDigitizer") << " @ accumulate : can't find " << hitCollection_ << " collection of g4SimHits";
470  return;
471  }
472 
473  if (nullptr != gHGCal_) {
474  accumulate_forPreMix(hits, e.bunchCrossing(), gHGCal_, hre);
475  } else if (nullptr != gHcal_) {
476  accumulate_forPreMix(hits, e.bunchCrossing(), gHcal_, hre);
477  } else {
478  throw cms::Exception("BadConfiguration") << "HGCDigitizer is not producing EE, FH, or BH digis!";
479  }
480 }

References accumulate_forPreMix(), MillePedeFileConverter_cfg::e, Exception, gHcal_, gHGCal_, hitCollection_, and hfClusterShapes_cfi::hits.

◆ beginRun()

void HGCDigitizer::beginRun ( const edm::EventSetup es)

actions at the start/end of run

Definition at line 819 of file HGCDigitizer.cc.

819  {
820  //get geometry
823 
824  gHGCal_ = nullptr;
825  gHcal_ = nullptr;
826 
827  if (producesEEDigis())
828  gHGCal_ = dynamic_cast<const HGCalGeometry*>(geom->getSubdetectorGeometry(myDet_, mySubDet_));
829  if (producesHEfrontDigis())
830  gHGCal_ = dynamic_cast<const HGCalGeometry*>(geom->getSubdetectorGeometry(myDet_, mySubDet_));
831  if (producesHFNoseDigis())
832  gHGCal_ = dynamic_cast<const HGCalGeometry*>(geom->getSubdetectorGeometry(myDet_, mySubDet_));
833 
834  if (producesHEbackDigis()) {
835  if (geometryType_ == 0) {
836  gHcal_ = dynamic_cast<const HcalGeometry*>(geom->getSubdetectorGeometry(DetId::Hcal, HcalEndcap));
837  } else {
838  gHGCal_ = dynamic_cast<const HGCalGeometry*>(geom->getSubdetectorGeometry(myDet_, mySubDet_));
839  }
840  }
841 
842  int nadded(0);
843  //valid ID lists
844  if (nullptr != gHGCal_) {
845  getValidDetIds(gHGCal_, validIds_);
846  } else if (nullptr != gHcal_) {
847  getValidDetIds(gHcal_, validIds_);
848  } else {
849  throw cms::Exception("BadConfiguration") << "HGCDigitizer is not producing EE, FH, or BH digis!";
850  }
851 
852  if (verbosity_ > 0)
853  edm::LogInfo("HGCDigitizer") << "Added " << nadded << ":" << validIds_.size() << " detIds without "
854  << hitCollection_ << " in first event processed" << std::endl;
855 }

References Exception, relativeConstraints::geom, geometryType_, edm::EventSetup::get(), get, gHcal_, gHGCal_, DetId::Hcal, HcalEndcap, hitCollection_, myDet_, mySubDet_, producesEEDigis(), producesHEbackDigis(), producesHEfrontDigis(), producesHFNoseDigis(), validIds_, and verbosity_.

Referenced by PreMixingHGCalWorker::beginRun(), and HGCDigiProducer::beginRun().

◆ checkPosition()

void HGCDigitizer::checkPosition ( const HGCalDigiCollection digis) const
private

Definition at line 964 of file HGCDigitizer.cc.

964  {
965  const double tol(0.5);
966  if (geometryType_ != 0 && nullptr != gHGCal_) {
967  for (const auto& digi : *(digis)) {
968  const DetId& id = digi.id();
969  const GlobalPoint& global = gHGCal_->getPosition(id);
970  double r = global.perp();
971  double z = std::abs(global.z());
972  std::pair<double, double> zrange = gHGCal_->topology().dddConstants().rangeZ(true);
973  std::pair<double, double> rrange = gHGCal_->topology().dddConstants().rangeR(z, true);
974  bool ok = ((r >= rrange.first) && (r <= rrange.second) && (z >= zrange.first) && (z <= zrange.second));
975  std::string ck = (((r < rrange.first - tol) || (r > rrange.second + tol) || (z < zrange.first - tol) ||
976  (z > zrange.second + tol))
977  ? "***** ERROR *****"
978  : "");
979  bool val = gHGCal_->topology().valid(id);
980  if ((!ok) || (!val)) {
981  if (id.det() == DetId::HGCalEE || id.det() == DetId::HGCalHSi) {
982  edm::LogVerbatim("HGCDigitizer") << "Check " << HGCSiliconDetId(id) << " " << global << " R " << r << ":"
983  << rrange.first << ":" << rrange.second << " Z " << z << ":" << zrange.first
984  << ":" << zrange.second << " Flag " << ok << ":" << val << " " << ck;
985  } else if (id.det() == DetId::HGCalHSc) {
986  edm::LogVerbatim("HGCDigitizer") << "Check " << HGCScintillatorDetId(id) << " " << global << " R " << r << ":"
987  << rrange.first << ":" << rrange.second << " Z " << z << ":" << zrange.first
988  << ":" << zrange.second << " Flag " << ok << ":" << val << " " << ck;
989  } else if ((id.det() == DetId::Forward) && (id.subdetId() == static_cast<int>(HFNose))) {
990  edm::LogVerbatim("HGCDigitizer") << "Check " << HFNoseDetId(id) << " " << global << " R " << r << ":"
991  << rrange.first << ":" << rrange.second << " Z " << z << ":" << zrange.first
992  << ":" << zrange.second << " Flag " << ok << ":" << val << " " << ck;
993  } else {
994  edm::LogVerbatim("HGCDigitizer")
995  << "Check " << std::hex << id.rawId() << std::dec << " " << id.det() << ":" << id.subdetId() << " "
996  << global << " R " << r << ":" << rrange.first << ":" << rrange.second << " Z " << z << ":"
997  << zrange.first << ":" << zrange.second << " Flag " << ok << ":" << val << " " << ck;
998  }
999  }
1000  }
1001  }
1002 }

References funct::abs(), HGCalTopology::dddConstants(), TauDecayModes::dec, DetId::Forward, geometryType_, HGCalGeometry::getPosition(), gHGCal_, HFNose, DetId::HGCalEE, DetId::HGCalHSc, DetId::HGCalHSi, convertSQLiteXML::ok, PV3DBase< T, PVType, FrameType >::perp(), alignCSCRings::r, HGCalDDDConstants::rangeR(), HGCalDDDConstants::rangeZ(), AlCaHLTBitMon_QueryRunRegistry::string, HGCalGeometry::topology(), heppy_batch::val, HGCalTopology::valid(), z, PV3DBase< T, PVType, FrameType >::z(), and TkClusParameters_cff::zrange.

Referenced by finalizeEvent().

◆ digiCollection()

std::string HGCDigitizer::digiCollection ( )
inline

◆ endRun()

void HGCDigitizer::endRun ( )

Definition at line 858 of file HGCDigitizer.cc.

858 { std::unordered_set<DetId>().swap(validIds_); }

References validIds_.

Referenced by PreMixingHGCalWorker::endRun(), and HGCDigiProducer::endRun().

◆ finalizeEvent()

void HGCDigitizer::finalizeEvent ( edm::Event e,
edm::EventSetup const &  c,
CLHEP::HepRandomEngine *  hre 
)

Definition at line 340 of file HGCDigitizer.cc.

340  {
341  hitRefs_bx0.clear();
342  PhitRefs_bx0.clear();
343  hitOrder_monitor.clear();
344 
345  const CaloSubdetectorGeometry* theGeom = (nullptr == gHGCal_ ? static_cast<const CaloSubdetectorGeometry*>(gHcal_)
346  : static_cast<const CaloSubdetectorGeometry*>(gHGCal_));
347 
348  ++nEvents_;
349 
350  unsigned idx = getType();
351  // release memory for unfilled parts of hash table
352  if (validIds_.size() * averageOccupancies_[idx] > simHitAccumulator_->size()) {
353  simHitAccumulator_->reserve(simHitAccumulator_->size());
354  pusimHitAccumulator_->reserve(simHitAccumulator_->size());
355  }
356  //update occupancy guess
357  const double thisOcc = simHitAccumulator_->size() / ((double)validIds_.size());
359 
360  if (premixStage1_) {
361  auto simRecord = std::make_unique<PHGCSimAccumulator>();
362 
363  if (!pusimHitAccumulator_->empty()) {
364  saveSimHitAccumulator_forPreMix(
366  }
367 
368  e.put(std::move(simRecord), digiCollection());
369 
370  } else {
371  if (producesEEDigis()) {
372  auto digiResult = std::make_unique<HGCalDigiCollection>();
373 
374  theHGCEEDigitizer_->run(digiResult, *simHitAccumulator_, theGeom, validIds_, digitizationType_, hre);
375 
376  edm::LogVerbatim("HGCDigitizer") << "HGCDigitizer:: finalize event - produced " << digiResult->size()
377  << " EE hits";
378 #ifdef EDM_ML_DEBUG
379  checkPosition(&(*digiResult));
380 #endif
381  e.put(std::move(digiResult), digiCollection());
382  }
383  if (producesHEfrontDigis()) {
384  auto digiResult = std::make_unique<HGCalDigiCollection>();
385  theHGCHEfrontDigitizer_->run(digiResult, *simHitAccumulator_, theGeom, validIds_, digitizationType_, hre);
386  edm::LogVerbatim("HGCDigitizer") << "HGCDigitizer:: finalize event - produced " << digiResult->size()
387  << " HE silicon hits";
388 #ifdef EDM_ML_DEBUG
389  checkPosition(&(*digiResult));
390 #endif
391  e.put(std::move(digiResult), digiCollection());
392  }
393  if (producesHEbackDigis()) {
394  auto digiResult = std::make_unique<HGCalDigiCollection>();
395  theHGCHEbackDigitizer_->run(digiResult, *simHitAccumulator_, theGeom, validIds_, digitizationType_, hre);
396  edm::LogVerbatim("HGCDigitizer") << "HGCDigitizer:: finalize event - produced " << digiResult->size()
397  << " HE Scintillator hits";
398 #ifdef EDM_ML_DEBUG
399  checkPosition(&(*digiResult));
400 #endif
401  e.put(std::move(digiResult), digiCollection());
402  }
403  if (producesHFNoseDigis()) {
404  auto digiResult = std::make_unique<HGCalDigiCollection>();
405  theHFNoseDigitizer_->run(digiResult, *simHitAccumulator_, theGeom, validIds_, digitizationType_, hre);
406  edm::LogVerbatim("HGCDigitizer") << "HGCDigitizer:: finalize event - produced " << digiResult->size()
407  << " HFNose hits";
408 #ifdef EDM_ML_DEBUG
409  checkPosition(&(*digiResult));
410 #endif
411  e.put(std::move(digiResult), digiCollection());
412  }
413  }
414 
417 }

References averageOccupancies_, checkPosition(), digiCollection(), digitizationType_, MillePedeFileConverter_cfg::e, getType(), gHcal_, gHGCal_, hitOrder_monitor, hitRefs_bx0, heavyIonCSV_trainingSettings::idx, eostools::move(), nEvents_, PhitRefs_bx0, premixStage1_, premixStage1MaxCharge_, premixStage1MinCharge_, producesEEDigis(), producesHEbackDigis(), producesHEfrontDigis(), producesHFNoseDigis(), pusimHitAccumulator_, simHitAccumulator_, theHFNoseDigitizer_, theHGCEEDigitizer_, theHGCHEbackDigitizer_, theHGCHEfrontDigitizer_, and validIds_.

Referenced by HGCDigiProducer::finalizeEvent(), and PreMixingHGCalWorker::put().

◆ geometryType()

int HGCDigitizer::geometryType ( )
inline

Definition at line 86 of file HGCDigitizer.h.

86 { return geometryType_; }

References geometryType_.

◆ getType()

uint32_t HGCDigitizer::getType ( void  ) const
private

Definition at line 868 of file HGCDigitizer.cc.

868  {
870  if (geometryType_ == 0) {
871  switch (mySubDet_) {
873  idx = 0;
874  break;
876  idx = 1;
877  break;
879  idx = 2;
880  break;
882  idx = 3;
883  break;
884  default:
885  break;
886  }
887  } else {
888  switch (myDet_) {
889  case DetId::HGCalEE:
890  idx = 0;
891  break;
892  case DetId::HGCalHSi:
893  idx = 1;
894  break;
895  case DetId::HGCalHSc:
896  idx = 2;
897  break;
898  case DetId::Forward:
899  idx = 3;
900  break;
901  default:
902  break;
903  }
904  }
905  return idx;
906 }

References DetId::Forward, geometryType_, HFNose, DetId::HGCalEE, DetId::HGCalHSc, DetId::HGCalHSi, HGCEE, HGCHEB, HGCHEF, heavyIonCSV_trainingSettings::idx, SiStripPI::max, myDet_, and mySubDet_.

Referenced by finalizeEvent(), and initializeEvent().

◆ getWeight()

bool HGCDigitizer::getWeight ( std::array< float, 3 > &  tdcForToAOnset,
float &  keV2fC 
) const
private

Definition at line 908 of file HGCDigitizer.cc.

908  {
909  bool weightToAbyEnergy(false);
910  if (geometryType_ == 0) {
911  switch (mySubDet_) {
913  weightToAbyEnergy = theHGCEEDigitizer_->toaModeByEnergy();
914  tdcForToAOnset = theHGCEEDigitizer_->tdcForToAOnset();
915  keV2fC = theHGCEEDigitizer_->keV2fC();
916  break;
918  weightToAbyEnergy = theHGCHEfrontDigitizer_->toaModeByEnergy();
919  tdcForToAOnset = theHGCHEfrontDigitizer_->tdcForToAOnset();
920  keV2fC = theHGCHEfrontDigitizer_->keV2fC();
921  break;
923  weightToAbyEnergy = theHGCHEbackDigitizer_->toaModeByEnergy();
924  tdcForToAOnset = theHGCHEbackDigitizer_->tdcForToAOnset();
925  keV2fC = theHGCHEbackDigitizer_->keV2fC();
926  break;
928  weightToAbyEnergy = theHFNoseDigitizer_->toaModeByEnergy();
929  tdcForToAOnset = theHFNoseDigitizer_->tdcForToAOnset();
930  keV2fC = theHFNoseDigitizer_->keV2fC();
931  break;
932  default:
933  break;
934  }
935  } else {
936  switch (myDet_) {
937  case DetId::HGCalEE:
938  weightToAbyEnergy = theHGCEEDigitizer_->toaModeByEnergy();
939  tdcForToAOnset = theHGCEEDigitizer_->tdcForToAOnset();
940  keV2fC = theHGCEEDigitizer_->keV2fC();
941  break;
942  case DetId::HGCalHSi:
943  weightToAbyEnergy = theHGCHEfrontDigitizer_->toaModeByEnergy();
944  tdcForToAOnset = theHGCHEfrontDigitizer_->tdcForToAOnset();
945  keV2fC = theHGCHEfrontDigitizer_->keV2fC();
946  break;
947  case DetId::HGCalHSc:
948  weightToAbyEnergy = theHGCHEbackDigitizer_->toaModeByEnergy();
949  tdcForToAOnset = theHGCHEbackDigitizer_->tdcForToAOnset();
950  keV2fC = theHGCHEbackDigitizer_->keV2fC();
951  break;
952  case DetId::Forward:
953  weightToAbyEnergy = theHFNoseDigitizer_->toaModeByEnergy();
954  tdcForToAOnset = theHFNoseDigitizer_->tdcForToAOnset();
955  keV2fC = theHFNoseDigitizer_->keV2fC();
956  break;
957  default:
958  break;
959  }
960  }
961  return weightToAbyEnergy;
962 }

References DetId::Forward, geometryType_, HFNose, DetId::HGCalEE, DetId::HGCalHSc, DetId::HGCalHSi, HGCEE, HGCHEB, HGCHEF, hgcalTriggerNtuples_cfi::keV2fC, myDet_, mySubDet_, theHFNoseDigitizer_, theHGCEEDigitizer_, theHGCHEbackDigitizer_, and theHGCHEfrontDigitizer_.

Referenced by accumulate(), and accumulate_forPreMix().

◆ initializeEvent()

void HGCDigitizer::initializeEvent ( edm::Event const &  e,
edm::EventSetup const &  c 
)

actions at the start/end of event

Definition at line 332 of file HGCDigitizer.cc.

332  {
333  // reserve memory for a full detector
334  unsigned idx = getType();
337 }

References averageOccupancies_, getType(), heavyIonCSV_trainingSettings::idx, pusimHitAccumulator_, simHitAccumulator_, and validIds_.

Referenced by HGCDigiProducer::initializeEvent().

◆ orderByDetIdThenTime()

static bool HGCDigitizer::orderByDetIdThenTime ( const HGCCaloHitTuple_t a,
const HGCCaloHitTuple_t b 
)
inlinestatic

Definition at line 37 of file HGCDigitizer.h.

37  {
38  unsigned int detId_a(std::get<1>(a)), detId_b(std::get<1>(b));
39 
40  if (detId_a < detId_b)
41  return true;
42  if (detId_a > detId_b)
43  return false;
44 
45  double time_a(std::get<2>(a)), time_b(std::get<2>(b));
46  if (time_a < time_b)
47  return true;
48 
49  return false;
50  }

References a, and b.

Referenced by accumulate(), and accumulate_forPreMix().

◆ producesEEDigis()

bool HGCDigitizer::producesEEDigis ( )
inline

Definition at line 81 of file HGCDigitizer.h.

References DetId::HGCalEE, HGCEE, myDet_, and mySubDet_.

Referenced by accumulate(), beginRun(), and finalizeEvent().

◆ producesHEbackDigis()

bool HGCDigitizer::producesHEbackDigis ( )
inline

Definition at line 83 of file HGCDigitizer.h.

References DetId::HGCalHSc, HGCHEB, myDet_, and mySubDet_.

Referenced by beginRun(), and finalizeEvent().

◆ producesHEfrontDigis()

bool HGCDigitizer::producesHEfrontDigis ( )
inline

Definition at line 82 of file HGCDigitizer.h.

References DetId::HGCalHSi, HGCHEF, myDet_, and mySubDet_.

Referenced by beginRun(), and finalizeEvent().

◆ producesHFNoseDigis()

bool HGCDigitizer::producesHFNoseDigis ( )
inline

Definition at line 84 of file HGCDigitizer.h.

References DetId::Forward, HFNose, myDet_, and mySubDet_.

Referenced by beginRun(), and finalizeEvent().

◆ resetPUSimHitDataAccumulator()

void HGCDigitizer::resetPUSimHitDataAccumulator ( )
private

◆ resetSimHitDataAccumulator()

void HGCDigitizer::resetSimHitDataAccumulator ( )
private

Definition at line 861 of file HGCDigitizer.cc.

861  {
862  for (HGCSimHitDataAccumulator::iterator it = simHitAccumulator_->begin(); it != simHitAccumulator_->end(); it++) {
863  it->second.hit_info[0].fill(0.);
864  it->second.hit_info[1].fill(0.);
865  }
866 }

References simHitAccumulator_.

Member Data Documentation

◆ averageOccupancies_

std::array<double, 4> HGCDigitizer::averageOccupancies_
private

Definition at line 148 of file HGCDigitizer.h.

Referenced by finalizeEvent(), and initializeEvent().

◆ bxTime_

double HGCDigitizer::bxTime_
private

Definition at line 115 of file HGCDigitizer.h.

Referenced by accumulate(), accumulate_forPreMix(), and HGCDigitizer().

◆ cce_

std::vector<float> HGCDigitizer::cce_
private

Definition at line 154 of file HGCDigitizer.h.

Referenced by HGCDigitizer().

◆ digiCollection_

std::string HGCDigitizer::digiCollection_
private

Definition at line 97 of file HGCDigitizer.h.

Referenced by digiCollection(), and HGCDigitizer().

◆ digitizationType_

int HGCDigitizer::digitizationType_
private

Definition at line 103 of file HGCDigitizer.h.

Referenced by finalizeEvent(), and HGCDigitizer().

◆ ev_per_eh_pair_

double HGCDigitizer::ev_per_eh_pair_
private

Definition at line 115 of file HGCDigitizer.h.

◆ geometryType_

int HGCDigitizer::geometryType_
private

Definition at line 100 of file HGCDigitizer.h.

Referenced by beginRun(), checkPosition(), geometryType(), getType(), getWeight(), and HGCDigitizer().

◆ gHcal_

const HcalGeometry* HGCDigitizer::gHcal_
private

Definition at line 132 of file HGCDigitizer.h.

Referenced by accumulate(), accumulate_forPreMix(), beginRun(), and finalizeEvent().

◆ gHGCal_

const HGCalGeometry* HGCDigitizer::gHGCal_
private

◆ hitCollection_

std::string HGCDigitizer::hitCollection_
private

Definition at line 97 of file HGCDigitizer.h.

Referenced by accumulate(), accumulate_forPreMix(), beginRun(), and HGCDigitizer().

◆ hitOrder_monitor

std::unordered_map<uint32_t, bool> HGCDigitizer::hitOrder_monitor
private

Definition at line 157 of file HGCDigitizer.h.

Referenced by accumulate_forPreMix(), and finalizeEvent().

◆ hitRefs_bx0

std::unordered_map<uint32_t, std::vector<std::pair<float, float> > > HGCDigitizer::hitRefs_bx0
private

Definition at line 155 of file HGCDigitizer.h.

Referenced by accumulate(), accumulate_forPreMix(), and finalizeEvent().

◆ maxBx_

const unsigned int HGCDigitizer::maxBx_ = 14
staticprivate

Definition at line 152 of file HGCDigitizer.h.

Referenced by accumulate(), and accumulate_forPreMix().

◆ maxSimHitsAccTime_

int HGCDigitizer::maxSimHitsAccTime_
private

Definition at line 114 of file HGCDigitizer.h.

Referenced by HGCDigitizer().

◆ myDet_

DetId::Detector HGCDigitizer::myDet_
private

◆ mySubDet_

ForwardSubdetector HGCDigitizer::mySubDet_
private

◆ nEvents_

uint32_t HGCDigitizer::nEvents_
private

Definition at line 149 of file HGCDigitizer.h.

Referenced by finalizeEvent().

◆ PhitRefs_bx0

std::unordered_map<uint32_t, std::vector<std::tuple<float, float, float> > > HGCDigitizer::PhitRefs_bx0
private

Definition at line 156 of file HGCDigitizer.h.

Referenced by accumulate_forPreMix(), and finalizeEvent().

◆ premixStage1_

bool HGCDigitizer::premixStage1_
private

Definition at line 106 of file HGCDigitizer.h.

Referenced by finalizeEvent(), and HGCDigitizer().

◆ premixStage1MaxCharge_

double HGCDigitizer::premixStage1MaxCharge_
private

Definition at line 111 of file HGCDigitizer.h.

Referenced by accumulate_forPreMix(), finalizeEvent(), and HGCDigitizer().

◆ premixStage1MinCharge_

double HGCDigitizer::premixStage1MinCharge_
private

Definition at line 109 of file HGCDigitizer.h.

Referenced by accumulate_forPreMix(), finalizeEvent(), and HGCDigitizer().

◆ pusimHitAccumulator_

std::unique_ptr<hgc::HGCPUSimHitDataAccumulator> HGCDigitizer::pusimHitAccumulator_
private

Definition at line 117 of file HGCDigitizer.h.

Referenced by accumulate_forPreMix(), finalizeEvent(), and initializeEvent().

◆ refSpeed_

float HGCDigitizer::refSpeed_
private

Definition at line 142 of file HGCDigitizer.h.

Referenced by accumulate(), and accumulate_forPreMix().

◆ simHitAccumulator_

std::unique_ptr<hgc::HGCSimHitDataAccumulator> HGCDigitizer::simHitAccumulator_
private

◆ theHFNoseDigitizer_

std::unique_ptr<HFNoseDigitizer> HGCDigitizer::theHFNoseDigitizer_
private

Definition at line 127 of file HGCDigitizer.h.

Referenced by finalizeEvent(), getWeight(), and HGCDigitizer().

◆ theHGCEEDigitizer_

std::unique_ptr<HGCEEDigitizer> HGCDigitizer::theHGCEEDigitizer_
private

Definition at line 124 of file HGCDigitizer.h.

Referenced by finalizeEvent(), getWeight(), and HGCDigitizer().

◆ theHGCHEbackDigitizer_

std::unique_ptr<HGCHEbackDigitizer> HGCDigitizer::theHGCHEbackDigitizer_
private

Definition at line 125 of file HGCDigitizer.h.

Referenced by finalizeEvent(), getWeight(), and HGCDigitizer().

◆ theHGCHEfrontDigitizer_

std::unique_ptr<HGCHEfrontDigitizer> HGCDigitizer::theHGCHEfrontDigitizer_
private

Definition at line 126 of file HGCDigitizer.h.

Referenced by finalizeEvent(), getWeight(), and HGCDigitizer().

◆ thisBx_

const unsigned int HGCDigitizer::thisBx_ = 9
staticprivate

Definition at line 153 of file HGCDigitizer.h.

Referenced by accumulate(), and accumulate_forPreMix().

◆ tofDelay_

float HGCDigitizer::tofDelay_
private

Definition at line 145 of file HGCDigitizer.h.

Referenced by accumulate(), accumulate_forPreMix(), and HGCDigitizer().

◆ validIds_

std::unordered_set<DetId> HGCDigitizer::validIds_
private

◆ verbosity_

uint32_t HGCDigitizer::verbosity_
private

Definition at line 139 of file HGCDigitizer.h.

Referenced by accumulate(), beginRun(), and HGCDigitizer().

HGCDigitizer::thisBx_
static const unsigned int thisBx_
Definition: HGCDigitizer.h:153
pfDeepBoostedJetPreprocessParams_cfi.upper_bound
upper_bound
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:16
HGCDigitizer::producesHFNoseDigis
bool producesHFNoseDigis()
Definition: HGCDigitizer.h:84
mps_fire.i
i
Definition: mps_fire.py:428
HGCDigitizer::producesHEfrontDigis
bool producesHEfrontDigis()
Definition: HGCDigitizer.h:82
hgc_digi::HGCCellHitInfo
Definition: HGCDigitizerTypes.h:25
HGCalTopology::dddConstants
const HGCalDDDConstants & dddConstants() const
Definition: HGCalTopology.h:98
hitRec_itr
std::vector< hit_timeStamp >::iterator hitRec_itr
Definition: HGCDigitizer.cc:33
TkClusParameters_cff.zrange
zrange
Definition: TkClusParameters_cff.py:7
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
HGCalDDDConstants::rangeZ
std::pair< double, double > rangeZ(bool reco) const
Definition: HGCalDDDConstants.cc:992
ForwardEmpty
Definition: ForwardSubdetector.h:5
HGCDigitizer::premixStage1MinCharge_
double premixStage1MinCharge_
Definition: HGCDigitizer.h:109
HGCDigitizer::simHitAccumulator_
std::unique_ptr< hgc::HGCSimHitDataAccumulator > simHitAccumulator_
Definition: HGCDigitizer.h:116
HGCDigitizer::digiCollection
std::string digiCollection()
Definition: HGCDigitizer.h:85
HGCDigitizer::gHGCal_
const HGCalGeometry * gHGCal_
Definition: HGCDigitizer.h:131
step
step
Definition: StallMonitor.cc:94
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
HGCDigitizer::theHGCHEbackDigitizer_
std::unique_ptr< HGCHEbackDigitizer > theHGCHEbackDigitizer_
Definition: HGCDigitizer.h:125
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
DetId::Hcal
Definition: DetId.h:28
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89287
HGCDigitizer::nEvents_
uint32_t nEvents_
Definition: HGCDigitizer.h:149
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
HGCDigitizer::maxBx_
static const unsigned int maxBx_
Definition: HGCDigitizer.h:152
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
HGCDigitizer::refSpeed_
float refSpeed_
Definition: HGCDigitizer.h:142
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
HGCDigitizer::producesHEbackDigis
bool producesHEbackDigis()
Definition: HGCDigitizer.h:83
HGCDigitizer::premixStage1_
bool premixStage1_
Definition: HGCDigitizer.h:106
watchdog.const
const
Definition: watchdog.py:83
HFNoseDetId
Definition: HFNoseDetId.h:22
convertSQLiteXML.ok
bool ok
Definition: convertSQLiteXML.py:98
edm::Handle
Definition: AssociativeIterator.h:50
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
dqmdumpme.first
first
Definition: dqmdumpme.py:55
HGCSiliconDetId
Definition: HGCSiliconDetId.h:22
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
DetId
Definition: DetId.h:17
DetId::HGCalHSi
Definition: DetId.h:33
DetId::HGCalEE
Definition: DetId.h:32
HGCDigitizer::accumulate_forPreMix
void accumulate_forPreMix(edm::Event const &e, edm::EventSetup const &c, CLHEP::HepRandomEngine *hre)
Definition: HGCDigitizer.cc:418
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
HFNose
Definition: ForwardSubdetector.h:11
mps_fire.end
end
Definition: mps_fire.py:242
DDAxes::z
edm::ESHandle< CaloGeometry >
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
HGCDigitizer::pusimHitAccumulator_
std::unique_ptr< hgc::HGCPUSimHitDataAccumulator > pusimHitAccumulator_
Definition: HGCDigitizer.h:117
egammaRechitFilter_cfi.hitCollection
hitCollection
Definition: egammaRechitFilter_cfi.py:10
HGCDigitizer::orderByDetIdThenTime
static bool orderByDetIdThenTime(const HGCCaloHitTuple_t &a, const HGCCaloHitTuple_t &b)
Definition: HGCDigitizer.h:37
HGCDigitizer::gHcal_
const HcalGeometry * gHcal_
Definition: HGCDigitizer.h:132
Point3DBase< float, GlobalTag >
b
double b
Definition: hdecay.h:118
HGCalGeometry::topology
const HGCalTopology & topology() const
Definition: HGCalGeometry.h:111
HGCalDDDConstants::rangeR
std::pair< double, double > rangeR(double z, bool reco) const
Definition: HGCalDDDConstants.cc:947
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
hgc_digi::HGCCellInfo
Definition: HGCDigitizerTypes.h:31
HGCEE
Definition: ForwardSubdetector.h:8
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
HGCDigitizer::hitCollection_
std::string hitCollection_
Definition: HGCDigitizer.h:97
edm::ParameterSet
Definition: ParameterSet.h:47
a
double a
Definition: hdecay.h:119
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
HGCDigitizer::theHGCEEDigitizer_
std::unique_ptr< HGCEEDigitizer > theHGCEEDigitizer_
Definition: HGCDigitizer.h:124
HGCDigitizer::accumulate
void accumulate(edm::Event const &e, edm::EventSetup const &c, CLHEP::HepRandomEngine *hre)
handle SimHit accumulation
Definition: HGCDigitizer.cc:442
HGCDigitizer::maxSimHitsAccTime_
int maxSimHitsAccTime_
Definition: HGCDigitizer.h:114
HGCDigitizer::theHGCHEfrontDigitizer_
std::unique_ptr< HGCHEfrontDigitizer > theHGCHEfrontDigitizer_
Definition: HGCDigitizer.h:126
HGCDigitizer::hitRefs_bx0
std::unordered_map< uint32_t, std::vector< std::pair< float, float > > > hitRefs_bx0
Definition: HGCDigitizer.h:155
createfilelist.int
int
Definition: createfilelist.py:10
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
HGCalGeometry::getPosition
GlobalPoint getPosition(const DetId &id) const
Definition: HGCalGeometry.cc:191
HGCDigitizer::digitizationType_
int digitizationType_
Definition: HGCDigitizer.h:103
PCaloHit
Definition: PCaloHit.h:8
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
HGCDigitizer::PhitRefs_bx0
std::unordered_map< uint32_t, std::vector< std::tuple< float, float, float > > > PhitRefs_bx0
Definition: HGCDigitizer.h:156
get
#define get
hgc_digi::HGCSimHitDataAccumulator
std::unordered_map< uint32_t, HGCCellInfo > HGCSimHitDataAccumulator
Definition: HGCDigitizerTypes.h:38
HGCDigitizer::validIds_
std::unordered_set< DetId > validIds_
Definition: HGCDigitizer.h:130
HGCDigitizer::bxTime_
double bxTime_
Definition: HGCDigitizer.h:115
alignCSCRings.r
r
Definition: alignCSCRings.py:93
hit_timeStamp
std::tuple< float, float, float > hit_timeStamp
Definition: HGCDigitizer.cc:31
HGCDigitizer::tofDelay_
float tofDelay_
Definition: HGCDigitizer.h:145
HGCDigitizer::premixStage1MaxCharge_
double premixStage1MaxCharge_
Definition: HGCDigitizer.h:111
HGCDigitizer::myDet_
DetId::Detector myDet_
Definition: HGCDigitizer.h:135
heppy_batch.val
val
Definition: heppy_batch.py:351
eostools.move
def move(src, dest)
Definition: eostools.py:511
HGCDigitizer::verbosity_
uint32_t verbosity_
Definition: HGCDigitizer.h:139
HGCDigitizer::digiCollection_
std::string digiCollection_
Definition: HGCDigitizer.h:97
HcalEndcap
Definition: HcalAssistant.h:34
hgc_digi::HGCPUSimHitDataAccumulator
std::unordered_map< uint32_t, HGCCellHitInfo > HGCPUSimHitDataAccumulator
Definition: HGCDigitizerTypes.h:39
HGCScintillatorDetId
Definition: HGCScintillatorDetId.h:23
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
DetId::HGCalHSc
Definition: DetId.h:34
HGCDigitizer::getWeight
bool getWeight(std::array< float, 3 > &tdcForToAOnset, float &keV2fC) const
Definition: HGCDigitizer.cc:908
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
Exception
Definition: hltDiff.cc:246
HGCDigitizer::theHFNoseDigitizer_
std::unique_ptr< HFNoseDigitizer > theHFNoseDigitizer_
Definition: HGCDigitizer.h:127
HGCDigitizer::checkPosition
void checkPosition(const HGCalDigiCollection *digis) const
Definition: HGCDigitizer.cc:964
CaloSubdetectorGeometry
Definition: CaloSubdetectorGeometry.h:22
HGCDigitizer::producesEEDigis
bool producesEEDigis()
Definition: HGCDigitizer.h:81
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
HGCDigitizer::cce_
std::vector< float > cce_
Definition: HGCDigitizer.h:154
HGCalTopology::valid
bool valid(const DetId &id) const override
Is this a valid cell id.
Definition: HGCalTopology.cc:463
HGCDigitizer::mySubDet_
ForwardSubdetector mySubDet_
Definition: HGCDigitizer.h:136
HGCHEF
Definition: ForwardSubdetector.h:9
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
DetId::Forward
Definition: DetId.h:30
edm::Log
Definition: MessageLogger.h:70
HGCDigitizer::getType
uint32_t getType() const
Definition: HGCDigitizer.cc:868
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69
edm::InputTag
Definition: InputTag.h:15
hit
Definition: SiStripHitEffFromCalibTree.cc:88
HGCDigitizer::hitOrder_monitor
std::unordered_map< uint32_t, bool > hitOrder_monitor
Definition: HGCDigitizer.h:157
hgcalTriggerNtuples_cfi.keV2fC
keV2fC
Definition: hgcalTriggerNtuples_cfi.py:11
HGCHEB
Definition: ForwardSubdetector.h:10
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
HGCDigitizer::averageOccupancies_
std::array< double, 4 > averageOccupancies_
Definition: HGCDigitizer.h:148
HGCDigitizer::geometryType_
int geometryType_
Definition: HGCDigitizer.h:100