CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
mtd_digitizer::MTDDigitizer< Traits > Class Template Reference

#include <MTDDigitizer.h>

Inheritance diagram for mtd_digitizer::MTDDigitizer< Traits >:
MTDDigitizerBase

Public Types

typedef Traits::DeviceSim DeviceSim
 
typedef Traits::DigiCollection DigiCollection
 
typedef Traits::ElectronicsSim ElectronicsSim
 

Public Member Functions

void accumulate (const PMTDSimAccumulator &simAccumulator) override
 
void accumulate (edm::Event const &e, edm::EventSetup const &c, CLHEP::HepRandomEngine *hre) override
 handle SimHit accumulation More...
 
void accumulate (edm::Handle< edm::PSimHitContainer > const &hits, int bxCrossing, CLHEP::HepRandomEngine *hre) override
 
void accumulate (PileUpEventPrincipal const &e, edm::EventSetup const &c, CLHEP::HepRandomEngine *hre) override
 
void finalizeEvent (edm::Event &e, edm::EventSetup const &c, CLHEP::HepRandomEngine *hre) override
 
void initializeEvent (edm::Event const &e, edm::EventSetup const &c) override
 actions at the start/end of event More...
 
 MTDDigitizer (const edm::ParameterSet &config, edm::ProducesCollector producesCollector, edm::ConsumesCollector &iC)
 
 ~MTDDigitizer () override
 
- Public Member Functions inherited from MTDDigitizerBase
 MTDDigitizerBase (const edm::ParameterSet &config, edm::ProducesCollector producesCollector, edm::ConsumesCollector &iC)
 
const std::string & name () const
 
virtual ~MTDDigitizerBase ()
 

Private Member Functions

void resetSimHitDataAccumulator ()
 

Private Attributes

DeviceSim deviceSim_
 
ElectronicsSim electronicsSim_
 
const MTDGeometrygeom_
 
const edm::ESGetToken< MTDGeometry, MTDDigiGeometryRecordgeomToken_
 
const int maxSimHitsAccTime_
 
MTDSimHitDataAccumulator simHitAccumulator_
 

Additional Inherited Members

- Protected Attributes inherited from MTDDigitizerBase
const std::string digiCollection_
 
const edm::InputTag inputSimHits_
 
const bool premixStage1_
 
double premixStage1MaxCharge_
 
double premixStage1MinCharge_
 
const float refSpeed_
 
const uint32_t verbosity_
 

Detailed Description

template<class Traits>
class mtd_digitizer::MTDDigitizer< Traits >

Definition at line 130 of file MTDDigitizer.h.

Member Typedef Documentation

◆ DeviceSim

template<class Traits >
typedef Traits::DeviceSim mtd_digitizer::MTDDigitizer< Traits >::DeviceSim

Definition at line 132 of file MTDDigitizer.h.

◆ DigiCollection

template<class Traits >
typedef Traits::DigiCollection mtd_digitizer::MTDDigitizer< Traits >::DigiCollection

Definition at line 134 of file MTDDigitizer.h.

◆ ElectronicsSim

template<class Traits >
typedef Traits::ElectronicsSim mtd_digitizer::MTDDigitizer< Traits >::ElectronicsSim

Definition at line 133 of file MTDDigitizer.h.

Constructor & Destructor Documentation

◆ MTDDigitizer()

template<class Traits >
mtd_digitizer::MTDDigitizer< Traits >::MTDDigitizer ( const edm::ParameterSet config,
edm::ProducesCollector  producesCollector,
edm::ConsumesCollector iC 
)
inline

Definition at line 136 of file MTDDigitizer.h.

137  : MTDDigitizerBase(config, producesCollector, iC),
138  geomToken_(iC.esConsumes()),
139  geom_(nullptr),
140  deviceSim_(config.getParameterSet("DeviceSimulation"), iC),
141  electronicsSim_(config.getParameterSet("ElectronicsSimulation"), iC),
142  maxSimHitsAccTime_(config.getParameter<uint32_t>("maxSimHitsAccTime")) {}

◆ ~MTDDigitizer()

template<class Traits >
mtd_digitizer::MTDDigitizer< Traits >::~MTDDigitizer ( )
inlineoverride

Definition at line 144 of file MTDDigitizer.h.

144 {}

Member Function Documentation

◆ accumulate() [1/4]

template<class Traits >
void mtd_digitizer::MTDDigitizer< Traits >::accumulate ( const PMTDSimAccumulator simAccumulator)
overridevirtual

Implements MTDDigitizerBase.

Definition at line 226 of file MTDDigitizer.h.

References mtd_digitizer::loadSimHitAccumulator().

◆ accumulate() [2/4]

template<class Traits >
void mtd_digitizer::MTDDigitizer< Traits >::accumulate ( edm::Event const &  e,
edm::EventSetup const &  c,
CLHEP::HepRandomEngine *  hre 
)
overridevirtual

handle SimHit accumulation

Implements MTDDigitizerBase.

Definition at line 179 of file MTDDigitizer.h.

179  {
181  e.getByLabel(inputSimHits_, simHits);
182  accumulate(simHits, 0, hre);
183  }

References MillePedeFileConverter_cfg::e, and FastTrackerRecHitCombiner_cfi::simHits.

◆ accumulate() [3/4]

template<class Traits >
void mtd_digitizer::MTDDigitizer< Traits >::accumulate ( edm::Handle< edm::PSimHitContainer > const &  hits,
int  bxCrossing,
CLHEP::HepRandomEngine *  hre 
)
overridevirtual

Implements MTDDigitizerBase.

Definition at line 195 of file MTDDigitizer.h.

197  {
198  using namespace MTDHelpers;
199 
200  //create list of tuples (pos in container, RECO DetId, time) to be sorted first
201  int nchits = (int)hits->size();
202  std::vector<MTDCaloHitTuple_t> hitRefs;
203  hitRefs.reserve(nchits);
204  for (int i = 0; i < nchits; ++i) {
205  const auto& the_hit = hits->at(i);
206 
207  DetId id = the_hit.detUnitId();
208 
209  if (verbosity_ > 0) {
210  edm::LogInfo("MTDDigitizer") << " i/p " << std::hex << the_hit.detUnitId() << std::dec << " o/p " << id.rawId()
211  << std::endl;
212  }
213 
214  if (0 != id.rawId()) {
215  hitRefs.emplace_back(i, id.rawId(), the_hit.tof());
216  }
217  }
218  std::sort(hitRefs.begin(), hitRefs.end(), MTDHelpers::orderByDetIdThenTime);
219 
220  deviceSim_.getHitsResponse(hitRefs, hits, &simHitAccumulator_, hre);
221 
222  hitRefs.clear();
223  }

References TauDecayModes::dec, hfClusterShapes_cfi::hits, mps_fire::i, createfilelist::int, mtd_digitizer::MTDHelpers::orderByDetIdThenTime(), and jetUpdater_cfi::sort.

◆ accumulate() [4/4]

template<class Traits >
void mtd_digitizer::MTDDigitizer< Traits >::accumulate ( PileUpEventPrincipal const &  e,
edm::EventSetup const &  c,
CLHEP::HepRandomEngine *  hre 
)
overridevirtual

Implements MTDDigitizerBase.

Definition at line 186 of file MTDDigitizer.h.

188  {
190  e.getByLabel(inputSimHits_, simHits);
191  accumulate(simHits, e.bunchCrossing(), hre);
192  }

References MillePedeFileConverter_cfg::e, and FastTrackerRecHitCombiner_cfi::simHits.

◆ finalizeEvent()

template<class Traits >
void mtd_digitizer::MTDDigitizer< Traits >::finalizeEvent ( edm::Event e,
edm::EventSetup const &  c,
CLHEP::HepRandomEngine *  hre 
)
overridevirtual

Implements MTDDigitizerBase.

Definition at line 243 of file MTDDigitizer.h.

243  {
244  if (premixStage1_) {
245  auto simResult = std::make_unique<PMTDSimAccumulator>();
247  e.put(std::move(simResult), digiCollection_);
248  } else {
249  auto digiCollection = std::make_unique<DigiCollection>();
252  }
253 
254  //release memory for next event
256  }

References apvshotsanalyzer_cfi::digiCollection, MillePedeFileConverter_cfg::e, eostools::move(), and mtd_digitizer::saveSimHitAccumulator().

◆ initializeEvent()

template<class Traits >
void mtd_digitizer::MTDDigitizer< Traits >::initializeEvent ( edm::Event const &  e,
edm::EventSetup const &  c 
)
overridevirtual

actions at the start/end of event

Implements MTDDigitizerBase.

Definition at line 231 of file MTDDigitizer.h.

231  {
232  geom_ = &c.getData(geomToken_);
233 
234  deviceSim_.getEvent(e);
235  deviceSim_.getEventSetup(c);
236  if (not premixStage1_) {
237  electronicsSim_.getEvent(e);
238  electronicsSim_.getEventSetup(c);
239  }
240  }

References c, and MillePedeFileConverter_cfg::e.

◆ resetSimHitDataAccumulator()

template<class Traits >
void mtd_digitizer::MTDDigitizer< Traits >::resetSimHitDataAccumulator ( )
inlineprivate

Member Data Documentation

◆ deviceSim_

template<class Traits >
DeviceSim mtd_digitizer::MTDDigitizer< Traits >::deviceSim_
private

Definition at line 170 of file MTDDigitizer.h.

◆ electronicsSim_

template<class Traits >
ElectronicsSim mtd_digitizer::MTDDigitizer< Traits >::electronicsSim_
private

Definition at line 171 of file MTDDigitizer.h.

◆ geom_

template<class Traits >
const MTDGeometry* mtd_digitizer::MTDDigitizer< Traits >::geom_
private

Definition at line 167 of file MTDDigitizer.h.

◆ geomToken_

template<class Traits >
const edm::ESGetToken<MTDGeometry, MTDDigiGeometryRecord> mtd_digitizer::MTDDigitizer< Traits >::geomToken_
private

Definition at line 166 of file MTDDigitizer.h.

◆ maxSimHitsAccTime_

template<class Traits >
const int mtd_digitizer::MTDDigitizer< Traits >::maxSimHitsAccTime_
private

Definition at line 174 of file MTDDigitizer.h.

◆ simHitAccumulator_

template<class Traits >
MTDSimHitDataAccumulator mtd_digitizer::MTDDigitizer< Traits >::simHitAccumulator_
private
MTDDigitizerBase::MTDDigitizerBase
MTDDigitizerBase(const edm::ParameterSet &config, edm::ProducesCollector producesCollector, edm::ConsumesCollector &iC)
Definition: MTDDigitizerBase.h:33
mtd_digitizer::MTDDigitizer::resetSimHitDataAccumulator
void resetSimHitDataAccumulator()
Definition: MTDDigitizer.h:164
mtd_digitizer::MTDDigitizer::simHitAccumulator_
MTDSimHitDataAccumulator simHitAccumulator_
Definition: MTDDigitizer.h:175
mps_fire.i
i
Definition: mps_fire.py:428
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
mtd_digitizer::MTDDigitizer::electronicsSim_
ElectronicsSim electronicsSim_
Definition: MTDDigitizer.h:171
MTDDigitizerBase::inputSimHits_
const edm::InputTag inputSimHits_
Definition: MTDDigitizerBase.h:85
FastTrackerRecHitCombiner_cfi.simHits
simHits
Definition: FastTrackerRecHitCombiner_cfi.py:5
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
MTDDigitizerBase::premixStage1_
const bool premixStage1_
Definition: MTDDigitizerBase.h:100
edm::ConsumesCollector::esConsumes
auto esConsumes()
Definition: ConsumesCollector.h:97
edm::Handle< edm::PSimHitContainer >
MTDDigitizerBase::premixStage1MaxCharge_
double premixStage1MaxCharge_
Definition: MTDDigitizerBase.h:97
MTDDigitizerBase::digiCollection_
const std::string digiCollection_
Definition: MTDDigitizerBase.h:86
config
Definition: config.py:1
DetId
Definition: DetId.h:17
mtd_digitizer::MTDDigitizer::deviceSim_
DeviceSim deviceSim_
Definition: MTDDigitizer.h:170
mtd_digitizer::loadSimHitAccumulator
void loadSimHitAccumulator(MTDSimHitDataAccumulator &simData, const PMTDSimAccumulator &simAccumulator, const float minCharge, const float maxCharge)
Definition: MTDDigitizer.h:92
mtd_digitizer::MTDDigitizer::geom_
const MTDGeometry * geom_
Definition: MTDDigitizer.h:167
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
createfilelist.int
int
Definition: createfilelist.py:10
MTDDigitizerBase::verbosity_
const uint32_t verbosity_
Definition: MTDDigitizerBase.h:89
apvshotsanalyzer_cfi.digiCollection
digiCollection
Definition: apvshotsanalyzer_cfi.py:4
mtd_digitizer::MTDDigitizer::accumulate
void accumulate(edm::Event const &e, edm::EventSetup const &c, CLHEP::HepRandomEngine *hre) override
handle SimHit accumulation
Definition: MTDDigitizer.h:179
mtd_digitizer::MTDDigitizer::geomToken_
const edm::ESGetToken< MTDGeometry, MTDDigiGeometryRecord > geomToken_
Definition: MTDDigitizer.h:166
mtd_digitizer::saveSimHitAccumulator
void saveSimHitAccumulator(PMTDSimAccumulator &simResult, const MTDSimHitDataAccumulator &simData, const float minCharge, const float maxCharge)
Definition: MTDDigitizer.h:56
mtd_digitizer::MTDHelpers::orderByDetIdThenTime
bool orderByDetIdThenTime(const MTDCaloHitTuple_t &a, const MTDCaloHitTuple_t &b)
Definition: MTDDigitizer.h:40
eostools.move
def move(src, dest)
Definition: eostools.py:511
mtd_digitizer::MTDSimHitDataAccumulator
std::unordered_map< MTDCellId, MTDCellInfo > MTDSimHitDataAccumulator
Definition: MTDDigitizerTypes.h:39
mtd_digitizer::MTDDigitizer::maxSimHitsAccTime_
const int maxSimHitsAccTime_
Definition: MTDDigitizer.h:174
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
MTDDigitizerBase::premixStage1MinCharge_
double premixStage1MinCharge_
Definition: MTDDigitizerBase.h:95
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37