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

Member Typedef Documentation

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

Definition at line 49 of file MTDDigitizer.h.

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

Definition at line 51 of file MTDDigitizer.h.

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

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

55  :
56  MTDDigitizerBase(config,iC,parent),
57  deviceSim_( config.getParameterSet("DeviceSimulation") ),
58  electronicsSim_( config.getParameterSet("ElectronicsSimulation") ),
59  maxSimHitsAccTime_( config.getParameter< uint32_t >("maxSimHitsAccTime") ) { }
T getParameter(std::string const &) const
ParameterSet const & getParameterSet(std::string const &) const
ElectronicsSim electronicsSim_
Definition: MTDDigitizer.h:90
MTDDigitizerBase(const edm::ParameterSet &config, edm::ConsumesCollector &iC, edm::ProducerBase &parent)
template<class Traits >
mtd_digitizer::MTDDigitizer< Traits >::~MTDDigitizer ( )
inlineoverride

Definition at line 61 of file MTDDigitizer.h.

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

61 { }

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

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

101  {
103  e.getByLabel(inputSimHits_, simHits);
104  accumulate(simHits,0,hre);
105  }
void accumulate(edm::Event const &e, edm::EventSetup const &c, CLHEP::HepRandomEngine *hre) override
handle SimHit accumulation
Definition: MTDDigitizer.h:99
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 108 of file MTDDigitizer.h.

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

110  {
112  e.getByLabel(inputSimHits_, simHits);
113  accumulate(simHits,e.bunchCrossing(),hre);
114  }
void accumulate(edm::Event const &e, edm::EventSetup const &c, CLHEP::HepRandomEngine *hre) override
handle SimHit accumulation
Definition: MTDDigitizer.h:99
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 117 of file MTDDigitizer.h.

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

119  {
120  using namespace MTDHelpers;
121 
122  //create list of tuples (pos in container, RECO DetId, time) to be sorted first
123  int nchits=(int)hits->size();
124  std::vector< MTDCaloHitTuple_t > hitRefs;
125  hitRefs.reserve(nchits);
126  for(int i=0; i<nchits; ++i) {
127  const auto& the_hit = hits->at(i);
128 
129  DetId id = the_hit.detUnitId();
130 
131  if (verbosity_>0) {
132  edm::LogInfo("MTDDigitizer") << " i/p " << std::hex << the_hit.detUnitId() << std::dec
133  << " o/p " << id.rawId() << std::endl;
134  }
135 
136  if( 0 != id.rawId() ) {
137  hitRefs.emplace_back( i, id.rawId(), the_hit.tof() );
138  }
139  }
140  std::sort(hitRefs.begin(),hitRefs.end(),MTDHelpers::orderByDetIdThenTime);
141 
142  deviceSim_.getHitsResponse(hitRefs, hits, &simHitAccumulator_, hre);
143 
144  hitRefs.clear();
145 
146  }
MTDSimHitDataAccumulator simHitAccumulator_
Definition: MTDDigitizer.h:94
const uint32_t verbosity_
Definition: DetId.h:18
bool orderByDetIdThenTime(const MTDCaloHitTuple_t &a, const MTDCaloHitTuple_t &b)
Definition: MTDDigitizer.h:30
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 168 of file MTDDigitizer.h.

168  {
169  deviceSim_.getEventSetup(es);
170  electronicsSim_.getEventSetup(es);
171  }
ElectronicsSim electronicsSim_
Definition: MTDDigitizer.h:90
template<class Traits >
void mtd_digitizer::MTDDigitizer< Traits >::endRun ( )
inlineoverridevirtual

Implements MTDDigitizerBase.

Definition at line 80 of file MTDDigitizer.h.

80 {}
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 155 of file MTDDigitizer.h.

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

156  {
157 
158  auto digiCollection = std::make_unique<DigiCollection>();
161 
162  //release memory for next event
164  }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
MTDSimHitDataAccumulator simHitAccumulator_
Definition: MTDDigitizer.h:94
const std::string digiCollection_
ElectronicsSim electronicsSim_
Definition: MTDDigitizer.h:90
def move(src, dest)
Definition: eostools.py:510
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 149 of file MTDDigitizer.h.

149  {
150  deviceSim_.getEvent(e);
151  electronicsSim_.getEvent(e);
152  }
ElectronicsSim electronicsSim_
Definition: MTDDigitizer.h:90
template<class Traits >
void mtd_digitizer::MTDDigitizer< Traits >::resetSimHitDataAccumulator ( )
inlineprivate

Definition at line 84 of file MTDDigitizer.h.

84  {
86  }
MTDSimHitDataAccumulator simHitAccumulator_
Definition: MTDDigitizer.h:94
std::unordered_map< uint32_t, MTDCellInfo > MTDSimHitDataAccumulator

Member Data Documentation

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

Definition at line 89 of file MTDDigitizer.h.

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

Definition at line 90 of file MTDDigitizer.h.

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

Definition at line 93 of file MTDDigitizer.h.

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

Definition at line 94 of file MTDDigitizer.h.