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 (edm::Event const &e, edm::EventSetup const &c, CLHEP::HepRandomEngine *hre) override
 handle SimHit accumulation More...
 
void accumulate (PileUpEventPrincipal const &e, edm::EventSetup const &c, CLHEP::HepRandomEngine *hre) override
 
void accumulate (edm::Handle< edm::PSimHitContainer > const &hits, int bxCrossing, 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::ConsumesCollector &iC, edm::ProducerBase &parent)
 
 ~MTDDigitizer () override
 
- Public Member Functions inherited from MTDDigitizerBase
 MTDDigitizerBase (const edm::ParameterSet &config, edm::ConsumesCollector &iC, edm::ProducerBase &parent)
 
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 float refSpeed_
 
const uint32_t verbosity_
 

Detailed Description

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

Definition at line 54 of file MTDDigitizer.h.

Member Typedef Documentation

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

Definition at line 58 of file MTDDigitizer.h.

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

Definition at line 60 of file MTDDigitizer.h.

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

Definition at line 59 of file MTDDigitizer.h.

Constructor & Destructor Documentation

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

Definition at line 62 of file MTDDigitizer.h.

64  :
65  MTDDigitizerBase(config,iC,parent),
66  geom_(nullptr),
67  deviceSim_( config.getParameterSet("DeviceSimulation") ),
68  electronicsSim_( config.getParameterSet("ElectronicsSimulation") ),
69  maxSimHitsAccTime_( config.getParameter< uint32_t >("maxSimHitsAccTime") ) { }
T getParameter(std::string const &) const
ParameterSet const & getParameterSet(std::string const &) const
const MTDGeometry * geom_
Definition: MTDDigitizer.h:98
ElectronicsSim electronicsSim_
Definition: MTDDigitizer.h:102
MTDDigitizerBase(const edm::ParameterSet &config, edm::ConsumesCollector &iC, edm::ProducerBase &parent)
template<class Traits >
mtd_digitizer::MTDDigitizer< Traits >::~MTDDigitizer ( )
inlineoverride

Definition at line 71 of file MTDDigitizer.h.

References EnergyCorrector::c, MillePedeFileConverter_cfg::e, and hfClusterShapes_cfi::hits.

71 { }

Member Function Documentation

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

References edm::Event::getByLabel(), and trackerHits::simHits.

113  {
115  e.getByLabel(inputSimHits_, simHits);
116  accumulate(simHits,0,hre);
117  }
void accumulate(edm::Event const &e, edm::EventSetup const &c, CLHEP::HepRandomEngine *hre) override
handle SimHit accumulation
Definition: MTDDigitizer.h:111
const edm::InputTag inputSimHits_
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 120 of file MTDDigitizer.h.

References PileUpEventPrincipal::bunchCrossing(), PileUpEventPrincipal::getByLabel(), and trackerHits::simHits.

122  {
124  e.getByLabel(inputSimHits_, simHits);
125  accumulate(simHits,e.bunchCrossing(),hre);
126  }
void accumulate(edm::Event const &e, edm::EventSetup const &c, CLHEP::HepRandomEngine *hre) override
handle SimHit accumulation
Definition: MTDDigitizer.h:111
const edm::InputTag inputSimHits_
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 129 of file MTDDigitizer.h.

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

131  {
132  using namespace MTDHelpers;
133 
134  //create list of tuples (pos in container, RECO DetId, time) to be sorted first
135  int nchits=(int)hits->size();
136  std::vector< MTDCaloHitTuple_t > hitRefs;
137  hitRefs.reserve(nchits);
138  for(int i=0; i<nchits; ++i) {
139  const auto& the_hit = hits->at(i);
140 
141  DetId id = the_hit.detUnitId();
142 
143  if (verbosity_>0) {
144  edm::LogInfo("MTDDigitizer") << " i/p " << std::hex << the_hit.detUnitId() << std::dec
145  << " o/p " << id.rawId() << std::endl;
146  }
147 
148  if( 0 != id.rawId() ) {
149  hitRefs.emplace_back( i, id.rawId(), the_hit.tof() );
150  }
151  }
152  std::sort(hitRefs.begin(),hitRefs.end(),MTDHelpers::orderByDetIdThenTime);
153 
154  deviceSim_.getHitsResponse(hitRefs, hits, &simHitAccumulator_, hre);
155 
156  hitRefs.clear();
157 
158  }
MTDSimHitDataAccumulator simHitAccumulator_
Definition: MTDDigitizer.h:106
const uint32_t verbosity_
Definition: DetId.h:18
bool orderByDetIdThenTime(const MTDCaloHitTuple_t &a, const MTDCaloHitTuple_t &b)
Definition: MTDDigitizer.h:39
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 180 of file MTDDigitizer.h.

References relativeConstraints::geom, edm::EventSetup::get(), and edm::ESHandle< T >::product().

180  {
181 
183  es.get<MTDDigiGeometryRecord>().get(geom);
184  geom_ = geom.product();
185 
186  deviceSim_.getEventSetup(es);
187  electronicsSim_.getEventSetup(es);
188 
189  }
const MTDGeometry * geom_
Definition: MTDDigitizer.h:98
T get() const
Definition: EventSetup.h:68
ElectronicsSim electronicsSim_
Definition: MTDDigitizer.h:102
T const * product() const
Definition: ESHandle.h:84
template<class Traits >
void mtd_digitizer::MTDDigitizer< Traits >::endRun ( )
inlineoverridevirtual

Implements MTDDigitizerBase.

Definition at line 90 of file MTDDigitizer.h.

90 {}
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 167 of file MTDDigitizer.h.

References hgcalDigitizer_cfi::digiCollection, eostools::move(), and edm::Event::put().

168  {
169 
170  auto digiCollection = std::make_unique<DigiCollection>();
173 
174  //release memory for next event
176  }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
MTDSimHitDataAccumulator simHitAccumulator_
Definition: MTDDigitizer.h:106
const std::string digiCollection_
ElectronicsSim electronicsSim_
Definition: MTDDigitizer.h:102
def move(src, dest)
Definition: eostools.py:511
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 161 of file MTDDigitizer.h.

161  {
162  deviceSim_.getEvent(e);
163  electronicsSim_.getEvent(e);
164  }
ElectronicsSim electronicsSim_
Definition: MTDDigitizer.h:102
template<class Traits >
void mtd_digitizer::MTDDigitizer< Traits >::resetSimHitDataAccumulator ( )
inlineprivate

Definition at line 94 of file MTDDigitizer.h.

94  {
96  }
MTDSimHitDataAccumulator simHitAccumulator_
Definition: MTDDigitizer.h:106
std::unordered_map< MTDCellId, MTDCellInfo > MTDSimHitDataAccumulator

Member Data Documentation

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

Definition at line 101 of file MTDDigitizer.h.

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

Definition at line 102 of file MTDDigitizer.h.

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

Definition at line 98 of file MTDDigitizer.h.

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

Definition at line 105 of file MTDDigitizer.h.

template<class Traits >
MTDSimHitDataAccumulator mtd_digitizer::MTDDigitizer< Traits >::simHitAccumulator_
private

Definition at line 106 of file MTDDigitizer.h.