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 beginRun (const edm::EventSetup &es) override
 actions at the start/end of run More...
 
void endRun () 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 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 131 of file MTDDigitizer.h.

Member Typedef Documentation

◆ DeviceSim

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

Definition at line 133 of file MTDDigitizer.h.

◆ DigiCollection

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

Definition at line 135 of file MTDDigitizer.h.

◆ ElectronicsSim

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

Definition at line 134 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 137 of file MTDDigitizer.h.

138  : MTDDigitizerBase(config, producesCollector, iC),
139  geom_(nullptr),
140  deviceSim_(config.getParameterSet("DeviceSimulation")),
141  electronicsSim_(config.getParameterSet("ElectronicsSimulation")),
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 231 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 184 of file MTDDigitizer.h.

184  {
186  e.getByLabel(inputSimHits_, simHits);
187  accumulate(simHits, 0, hre);
188  }

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 200 of file MTDDigitizer.h.

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

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

◆ 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 191 of file MTDDigitizer.h.

193  {
195  e.getByLabel(inputSimHits_, simHits);
196  accumulate(simHits, e.bunchCrossing(), hre);
197  }

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

◆ beginRun()

template<class Traits >
void mtd_digitizer::MTDDigitizer< Traits >::beginRun ( const edm::EventSetup es)
overridevirtual

actions at the start/end of run

Implements MTDDigitizerBase.

Definition at line 260 of file MTDDigitizer.h.

260  {
263  geom_ = geom.product();
264 
265  deviceSim_.getEventSetup(es);
266  if (not premixStage1_) {
267  electronicsSim_.getEventSetup(es);
268  }
269  }

References relativeConstraints::geom, edm::EventSetup::get(), and get.

◆ endRun()

template<class Traits >
void mtd_digitizer::MTDDigitizer< Traits >::endRun ( )
inlineoverridevirtual

Implements MTDDigitizerBase.

Definition at line 167 of file MTDDigitizer.h.

167 {}

◆ 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 244 of file MTDDigitizer.h.

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

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 236 of file MTDDigitizer.h.

236  {
237  deviceSim_.getEvent(e);
238  if (not premixStage1_) {
239  electronicsSim_.getEvent(e);
240  }
241  }

References 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 175 of file MTDDigitizer.h.

◆ electronicsSim_

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

Definition at line 176 of file MTDDigitizer.h.

◆ geom_

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

Definition at line 172 of file MTDDigitizer.h.

◆ maxSimHitsAccTime_

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

Definition at line 179 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
MTDDigiGeometryRecord
Definition: MTDDigiGeometryRecord.h:15
mtd_digitizer::MTDDigitizer::resetSimHitDataAccumulator
void resetSimHitDataAccumulator()
Definition: MTDDigitizer.h:170
mtd_digitizer::MTDDigitizer::simHitAccumulator_
MTDSimHitDataAccumulator simHitAccumulator_
Definition: MTDDigitizer.h:180
mps_fire.i
i
Definition: mps_fire.py:355
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
mtd_digitizer::MTDDigitizer::electronicsSim_
ElectronicsSim electronicsSim_
Definition: MTDDigitizer.h:176
edm::LogInfo
Definition: MessageLogger.h:254
MTDDigitizerBase::inputSimHits_
const edm::InputTag inputSimHits_
Definition: MTDDigitizerBase.h:91
FastTrackerRecHitCombiner_cfi.simHits
simHits
Definition: FastTrackerRecHitCombiner_cfi.py:5
MTDDigitizerBase::premixStage1_
const bool premixStage1_
Definition: MTDDigitizerBase.h:106
edm::Handle< edm::PSimHitContainer >
MTDDigitizerBase::premixStage1MaxCharge_
double premixStage1MaxCharge_
Definition: MTDDigitizerBase.h:103
MTDDigitizerBase::digiCollection_
const std::string digiCollection_
Definition: MTDDigitizerBase.h:92
config
Definition: config.py:1
DetId
Definition: DetId.h:17
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
mtd_digitizer::MTDDigitizer::deviceSim_
DeviceSim deviceSim_
Definition: MTDDigitizer.h:175
edm::ESHandle
Definition: DTSurvey.h:22
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
mtd_digitizer::loadSimHitAccumulator
void loadSimHitAccumulator(MTDSimHitDataAccumulator &simData, const PMTDSimAccumulator &simAccumulator, const float minCharge, const float maxCharge)
Definition: MTDDigitizer.h:93
mtd_digitizer::MTDDigitizer::geom_
const MTDGeometry * geom_
Definition: MTDDigitizer.h:172
createfilelist.int
int
Definition: createfilelist.py:10
MTDDigitizerBase::verbosity_
const uint32_t verbosity_
Definition: MTDDigitizerBase.h:95
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:184
get
#define get
mtd_digitizer::saveSimHitAccumulator
void saveSimHitAccumulator(PMTDSimAccumulator &simResult, const MTDSimHitDataAccumulator &simData, const float minCharge, const float maxCharge)
Definition: MTDDigitizer.h:57
mtd_digitizer::MTDHelpers::orderByDetIdThenTime
bool orderByDetIdThenTime(const MTDCaloHitTuple_t &a, const MTDCaloHitTuple_t &b)
Definition: MTDDigitizer.h:41
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:179
MTDDigitizerBase::premixStage1MinCharge_
double premixStage1MinCharge_
Definition: MTDDigitizerBase.h:101
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37