CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
SiStripDigitizer Class Reference

Accumulator to perform digitisation on the strip tracker sim hits. More...

#include <SiStripDigitizer.h>

Inheritance diagram for SiStripDigitizer:
DigiAccumulatorMixMod

Public Member Functions

virtual void accumulate (edm::Event const &e, edm::EventSetup const &c) override
 
virtual void accumulate (PileUpEventPrincipal const &e, edm::EventSetup const &c, edm::StreamID const &) override
 
virtual void finalizeEvent (edm::Event &e, edm::EventSetup const &c) override
 
virtual void initializeEvent (edm::Event const &e, edm::EventSetup const &c) override
 
 SiStripDigitizer (const edm::ParameterSet &conf, edm::one::EDProducerBase &mixMod, edm::ConsumesCollector &iC)
 
virtual ~SiStripDigitizer ()
 
- Public Member Functions inherited from DigiAccumulatorMixMod
virtual void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup)
 
virtual void beginRun (edm::Run const &run, edm::EventSetup const &setup)
 
 DigiAccumulatorMixMod ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup)
 
virtual void endRun (edm::Run const &run, edm::EventSetup const &setup)
 
virtual void finalizeBunchCrossing (edm::Event &event, edm::EventSetup const &setup, int bunchCrossing)
 
virtual PileupMixingContentgetEventPileupInfo ()
 
virtual void initializeBunchCrossing (edm::Event const &event, edm::EventSetup const &setup, int bunchCrossing)
 
virtual void StorePileupInformation (std::vector< int > &numInteractionList, std::vector< int > &bunchCrossingList, std::vector< float > &TrueInteractionList)
 
virtual ~DigiAccumulatorMixMod ()
 

Private Types

typedef std::map< unsigned int,
std::vector< std::pair< const
PSimHit *, int > >, std::less
< unsigned int > > 
simhit_map
 
typedef simhit_map::iterator simhit_map_iterator
 
typedef std::vector< std::string > vstring
 

Private Member Functions

void accumulateStripHits (edm::Handle< std::vector< PSimHit > >, const TrackerTopology *tTopo, size_t globalSimHitIndex, CLHEP::HepRandomEngine *)
 
CLHEP::HepRandomEngine * randomEngine (edm::StreamID const &streamID)
 

Private Attributes

std::map< std::string, size_t > crossingSimHitIndexOffset_
 Offset to add to the index of each sim hit to account for which crossing it's in. More...
 
std::map< unsigned int,
StripGeomDetUnit const * > 
detectorUnits
 
const std::string gainLabel
 
const std::string geometryType
 
const std::string hitsProducer
 
const bool makeDigiSimLinks_
 Whether or not to create the association to sim truth collection. Set in configuration. More...
 
edm::ESHandle< TrackerGeometrypDD
 
const std::string PRDigi
 
edm::ESHandle< MagneticFieldpSetup
 
std::vector
< CLHEP::HepRandomEngine * > 
randomEngines_
 
const std::string SCDigi
 
std::map< uint32_t,
std::vector< int > > 
theDetIdList
 
std::unique_ptr
< SiStripDigitizerAlgorithm
theDigiAlgo
 
const vstring trackerContainers
 
const bool useConfFromDB
 
const std::string VRDigi
 
const bool zeroSuppression
 
const std::string ZSDigi
 

Detailed Description

Accumulator to perform digitisation on the strip tracker sim hits.

Author
original author unknown; converted from a producer to a MixingModule accumulator by Bill Tanenbaum; functionality to create digi-sim links moved from Bill's DigiSimLinkProducer into here by Mark Grimes (mark..nosp@m.grim.nosp@m.es@br.nosp@m.isto.nosp@m.l.ac..nosp@m.uk).
Date
original date unknown; moved into a MixingModule accumulator mid to late 2012; digi sim links eventually finished May 2013

Definition at line 45 of file SiStripDigitizer.h.

Member Typedef Documentation

typedef std::map<unsigned int, std::vector<std::pair<const PSimHit*, int> >,std::less<unsigned int> > SiStripDigitizer::simhit_map
private

Definition at line 61 of file SiStripDigitizer.h.

typedef simhit_map::iterator SiStripDigitizer::simhit_map_iterator
private

Definition at line 62 of file SiStripDigitizer.h.

typedef std::vector<std::string> SiStripDigitizer::vstring
private

Definition at line 60 of file SiStripDigitizer.h.

Constructor & Destructor Documentation

SiStripDigitizer::SiStripDigitizer ( const edm::ParameterSet conf,
edm::one::EDProducerBase mixMod,
edm::ConsumesCollector iC 
)
explicit

Definition at line 60 of file SiStripDigitizer.cc.

References edm::ConsumesCollector::consumes(), edm::hlt::Exception, hitsProducer, edm::Service< T >::isAvailable(), PRDigi, SCDigi, AlCaHLTBitMon_QueryRunRegistry::string, GlobalPosition_Frontier_DevDB_cff::tag, theDigiAlgo, trackerContainers, VRDigi, and ZSDigi.

60  :
61  gainLabel(conf.getParameter<std::string>("Gain")),
62  hitsProducer(conf.getParameter<std::string>("hitsProducer")),
63  trackerContainers(conf.getParameter<std::vector<std::string> >("ROUList")),
64  ZSDigi(conf.getParameter<edm::ParameterSet>("DigiModeList").getParameter<std::string>("ZSDigi")),
65  SCDigi(conf.getParameter<edm::ParameterSet>("DigiModeList").getParameter<std::string>("SCDigi")),
66  VRDigi(conf.getParameter<edm::ParameterSet>("DigiModeList").getParameter<std::string>("VRDigi")),
67  PRDigi(conf.getParameter<edm::ParameterSet>("DigiModeList").getParameter<std::string>("PRDigi")),
68  geometryType(conf.getParameter<std::string>("GeometryType")),
69  useConfFromDB(conf.getParameter<bool>("TrackerConfigurationFromDB")),
70  zeroSuppression(conf.getParameter<bool>("ZeroSuppression")),
71  makeDigiSimLinks_(conf.getUntrackedParameter<bool>("makeDigiSimLinks", false))
72 {
73  const std::string alias("simSiStripDigis");
74 
75  mixMod.produces<edm::DetSetVector<SiStripDigi> >(ZSDigi).setBranchAlias(ZSDigi);
76  mixMod.produces<edm::DetSetVector<SiStripRawDigi> >(SCDigi).setBranchAlias(alias + SCDigi);
77  mixMod.produces<edm::DetSetVector<SiStripRawDigi> >(VRDigi).setBranchAlias(alias + VRDigi);
78  mixMod.produces<edm::DetSetVector<SiStripRawDigi> >(PRDigi).setBranchAlias(alias + PRDigi);
79  mixMod.produces<edm::DetSetVector<StripDigiSimLink> >().setBranchAlias(alias + "siStripDigiSimLink");
80  for(auto const& trackerContainer : trackerContainers) {
81  edm::InputTag tag(hitsProducer, trackerContainer);
82  iC.consumes<std::vector<PSimHit> >(edm::InputTag(hitsProducer, trackerContainer));
83  }
85  if ( ! rng.isAvailable()) {
86  throw cms::Exception("Configuration")
87  << "SiStripDigitizer requires the RandomNumberGeneratorService\n"
88  "which is not present in the configuration file. You must add the service\n"
89  "in the configuration file or remove the modules that require it.";
90  }
91  theDigiAlgo.reset(new SiStripDigitizerAlgorithm(conf));
92 }
const vstring trackerContainers
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
const std::string ZSDigi
T getUntrackedParameter(std::string const &, T const &) const
const bool zeroSuppression
const std::string hitsProducer
const bool useConfFromDB
bool isAvailable() const
Definition: Service.h:46
std::unique_ptr< SiStripDigitizerAlgorithm > theDigiAlgo
const std::string VRDigi
const std::string PRDigi
const std::string geometryType
const bool makeDigiSimLinks_
Whether or not to create the association to sim truth collection. Set in configuration.
const std::string gainLabel
const std::string SCDigi
SiStripDigitizer::~SiStripDigitizer ( )
virtual

Definition at line 95 of file SiStripDigitizer.cc.

95  {
96 }

Member Function Documentation

void SiStripDigitizer::accumulate ( edm::Event const &  e,
edm::EventSetup const &  c 
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 127 of file SiStripDigitizer.cc.

References accumulateStripHits(), crossingSimHitIndexOffset_, edm::InputTag::encode(), edm::EventSetup::get(), edm::Event::getByLabel(), hitsProducer, edm::HandleBase::isValid(), edm::ESHandle< class >::product(), randomEngine(), trackerHits::simHits, edm::Event::streamID(), GlobalPosition_Frontier_DevDB_cff::tag, and trackerContainers.

127  {
128  //Retrieve tracker topology from geometry
130  iSetup.get<IdealGeometryRecord>().get(tTopoHand);
131  const TrackerTopology *tTopo=tTopoHand.product();
132 
133  // Step A: Get Inputs
134  for(auto const& trackerContainer : trackerContainers) {
136  edm::InputTag tag(hitsProducer, trackerContainer);
137 
138  iEvent.getByLabel(tag, simHits);
139  accumulateStripHits(simHits,tTopo,crossingSimHitIndexOffset_[tag.encode()], randomEngine(iEvent.streamID()));
140  // Now that the hits have been processed, I'll add the amount of hits in this crossing on to
141  // the global counter. Next time accumulateStripHits() is called it will count the sim hits
142  // as though they were on the end of this collection.
143  // Note that this is only used for creating digi-sim links (if configured to do so).
144  if( simHits.isValid() ) crossingSimHitIndexOffset_[tag.encode()]+=simHits->size();
145  }
146  }
const vstring trackerContainers
const std::string hitsProducer
int iEvent
Definition: GenABIO.cc:230
std::map< std::string, size_t > crossingSimHitIndexOffset_
Offset to add to the index of each sim hit to account for which crossing it&#39;s in. ...
CLHEP::HepRandomEngine * randomEngine(edm::StreamID const &streamID)
bool isValid() const
Definition: HandleBase.h:76
void accumulateStripHits(edm::Handle< std::vector< PSimHit > >, const TrackerTopology *tTopo, size_t globalSimHitIndex, CLHEP::HepRandomEngine *)
T const * product() const
Definition: ESHandle.h:62
tuple simHits
Definition: trackerHits.py:16
void SiStripDigitizer::accumulate ( PileUpEventPrincipal const &  e,
edm::EventSetup const &  c,
edm::StreamID const &  streamID 
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 149 of file SiStripDigitizer.cc.

References accumulateStripHits(), crossingSimHitIndexOffset_, edm::InputTag::encode(), edm::EventSetup::get(), PileUpEventPrincipal::getByLabel(), hitsProducer, edm::HandleBase::isValid(), edm::ESHandle< class >::product(), randomEngine(), trackerHits::simHits, GlobalPosition_Frontier_DevDB_cff::tag, and trackerContainers.

149  {
150 
152  iSetup.get<IdealGeometryRecord>().get(tTopoHand);
153  const TrackerTopology *tTopo=tTopoHand.product();
154 
155  // Step A: Get Inputs
156  for(auto const& trackerContainer : trackerContainers) {
158  edm::InputTag tag(hitsProducer, trackerContainer);
159 
160  iEvent.getByLabel(tag, simHits);
161  accumulateStripHits(simHits,tTopo,crossingSimHitIndexOffset_[tag.encode()], randomEngine(streamID));
162  // Now that the hits have been processed, I'll add the amount of hits in this crossing on to
163  // the global counter. Next time accumulateStripHits() is called it will count the sim hits
164  // as though they were on the end of this collection.
165  // Note that this is only used for creating digi-sim links (if configured to do so).
166  if( simHits.isValid() ) crossingSimHitIndexOffset_[tag.encode()]+=simHits->size();
167  }
168  }
const vstring trackerContainers
const std::string hitsProducer
int iEvent
Definition: GenABIO.cc:230
std::map< std::string, size_t > crossingSimHitIndexOffset_
Offset to add to the index of each sim hit to account for which crossing it&#39;s in. ...
CLHEP::HepRandomEngine * randomEngine(edm::StreamID const &streamID)
bool isValid() const
Definition: HandleBase.h:76
void accumulateStripHits(edm::Handle< std::vector< PSimHit > >, const TrackerTopology *tTopo, size_t globalSimHitIndex, CLHEP::HepRandomEngine *)
T const * product() const
Definition: ESHandle.h:62
tuple simHits
Definition: trackerHits.py:16
void SiStripDigitizer::accumulateStripHits ( edm::Handle< std::vector< PSimHit > >  hSimHits,
const TrackerTopology tTopo,
size_t  globalSimHitIndex,
CLHEP::HepRandomEngine *  engine 
)
private

Definition at line 98 of file SiStripDigitizer.cc.

References detectorUnits, LogDebug, pSetup, trackerHits::simHits, DetId::subdetId(), StripSubdetector::TEC, theDigiAlgo, StripSubdetector::TIB, StripSubdetector::TID, and StripSubdetector::TOB.

Referenced by accumulate().

99  {
100  // globalSimHitIndex is the index the sim hit will have when it is put in a collection
101  // of sim hits for all crossings. This is only used when creating digi-sim links if
102  // configured to do so.
103 
104  if(hSimHits.isValid()) {
105  std::set<unsigned int> detIds;
106  std::vector<PSimHit> const& simHits = *hSimHits.product();
107  for(std::vector<PSimHit>::const_iterator it = simHits.begin(), itEnd = simHits.end(); it != itEnd; ++it, ++globalSimHitIndex ) {
108  unsigned int detId = (*it).detUnitId();
109  if(detIds.insert(detId).second) {
110  // The insert succeeded, so this detector element has not yet been processed.
111  unsigned int isub = DetId(detId).subdetId();
112  if((isub == StripSubdetector::TIB) || (isub == StripSubdetector::TID) || (isub == StripSubdetector::TOB) || (isub == StripSubdetector::TEC)) {
113  auto stripdet = detectorUnits[detId];
114  //access to magnetic field in global coordinates
115  GlobalVector bfield = pSetup->inTesla(stripdet->surface().position());
116  LogDebug ("Digitizer ") << "B-field(T) at " << stripdet->surface().position() << "(cm): "
117  << pSetup->inTesla(stripdet->surface().position());
118  theDigiAlgo->accumulateSimHits(it, itEnd, globalSimHitIndex, stripdet, bfield, tTopo, engine);
119  }
120  }
121  } // end of loop over sim hits
122  }
123 }
#define LogDebug(id)
bool isValid() const
Definition: HandleBase.h:76
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
Definition: DetId.h:18
std::unique_ptr< SiStripDigitizerAlgorithm > theDigiAlgo
edm::ESHandle< MagneticField > pSetup
tuple simHits
Definition: trackerHits.py:16
T const * product() const
Definition: Handle.h:81
std::map< unsigned int, StripGeomDetUnit const * > detectorUnits
void SiStripDigitizer::finalizeEvent ( edm::Event e,
edm::EventSetup const &  c 
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 214 of file SiStripDigitizer.cc.

References compareJSON::const, gainLabel, edm::EventSetup::get(), makeDigiSimLinks_, convertSQLitetoXML_cfg::output, pDD, PRDigi, edm::Event::put(), randomEngine(), SCDigi, edm::Event::streamID(), theDetIdList, theDigiAlgo, useConfFromDB, VRDigi, zeroSuppression, and ZSDigi.

214  {
215  edm::ESHandle<SiStripGain> gainHandle;
216  edm::ESHandle<SiStripNoises> noiseHandle;
217  edm::ESHandle<SiStripThreshold> thresholdHandle;
218  edm::ESHandle<SiStripPedestals> pedestalHandle;
219  iSetup.get<SiStripGainSimRcd>().get(gainLabel,gainHandle);
220  iSetup.get<SiStripNoisesRcd>().get(noiseHandle);
221  iSetup.get<SiStripThresholdRcd>().get(thresholdHandle);
222  iSetup.get<SiStripPedestalsRcd>().get(pedestalHandle);
223 
224  std::vector<edm::DetSet<SiStripDigi> > theDigiVector;
225  std::vector<edm::DetSet<SiStripRawDigi> > theRawDigiVector;
226  std::auto_ptr< edm::DetSetVector<StripDigiSimLink> > pOutputDigiSimLink( new edm::DetSetVector<StripDigiSimLink> );
227 
228  // Step B: LOOP on StripGeomDetUnit
229  theDigiVector.reserve(10000);
230  theDigiVector.clear();
231 
232  for(TrackingGeometry::DetUnitContainer::const_iterator iu = pDD->detUnits().begin(); iu != pDD->detUnits().end(); iu ++){
233  if(useConfFromDB){
234  //apply the cable map _before_ digitization: consider only the detis that are connected
235  if(theDetIdList.find((*iu)->geographicalId().rawId())==theDetIdList.end())
236  continue;
237  }
238  auto sgd = dynamic_cast<StripGeomDetUnit const*>((*iu));
239  if (sgd != 0){
240  edm::DetSet<SiStripDigi> collectorZS((*iu)->geographicalId().rawId());
241  edm::DetSet<SiStripRawDigi> collectorRaw((*iu)->geographicalId().rawId());
242  edm::DetSet<StripDigiSimLink> collectorLink((*iu)->geographicalId().rawId());
243  theDigiAlgo->digitize(collectorZS,collectorRaw,collectorLink,sgd,
244  gainHandle,thresholdHandle,noiseHandle,pedestalHandle, randomEngine(iEvent.streamID()));
245  if(zeroSuppression){
246  if(collectorZS.data.size()>0){
247  theDigiVector.push_back(collectorZS);
248  if( !collectorLink.data.empty() ) pOutputDigiSimLink->insert(collectorLink);
249  }
250  }else{
251  if(collectorRaw.data.size()>0){
252  theRawDigiVector.push_back(collectorRaw);
253  if( !collectorLink.data.empty() ) pOutputDigiSimLink->insert(collectorLink);
254  }
255  }
256  }
257  }
258 
259  if(zeroSuppression){
260  // Step C: create output collection
261  std::auto_ptr<edm::DetSetVector<SiStripRawDigi> > output_virginraw(new edm::DetSetVector<SiStripRawDigi>());
262  std::auto_ptr<edm::DetSetVector<SiStripRawDigi> > output_scopemode(new edm::DetSetVector<SiStripRawDigi>());
263  std::auto_ptr<edm::DetSetVector<SiStripRawDigi> > output_processedraw(new edm::DetSetVector<SiStripRawDigi>());
264  std::auto_ptr<edm::DetSetVector<SiStripDigi> > output(new edm::DetSetVector<SiStripDigi>(theDigiVector) );
265  // Step D: write output to file
266  iEvent.put(output, ZSDigi);
267  iEvent.put(output_scopemode, SCDigi);
268  iEvent.put(output_virginraw, VRDigi);
269  iEvent.put(output_processedraw, PRDigi);
270  if( makeDigiSimLinks_ ) iEvent.put( pOutputDigiSimLink ); // The previous EDProducer didn't name this collection so I won't either
271  }else{
272  // Step C: create output collection
273  std::auto_ptr<edm::DetSetVector<SiStripRawDigi> > output_virginraw(new edm::DetSetVector<SiStripRawDigi>(theRawDigiVector));
274  std::auto_ptr<edm::DetSetVector<SiStripRawDigi> > output_scopemode(new edm::DetSetVector<SiStripRawDigi>());
275  std::auto_ptr<edm::DetSetVector<SiStripRawDigi> > output_processedraw(new edm::DetSetVector<SiStripRawDigi>());
276  std::auto_ptr<edm::DetSetVector<SiStripDigi> > output(new edm::DetSetVector<SiStripDigi>() );
277  // Step D: write output to file
278  iEvent.put(output, ZSDigi);
279  iEvent.put(output_scopemode, SCDigi);
280  iEvent.put(output_virginraw, VRDigi);
281  iEvent.put(output_processedraw, PRDigi);
282  if( makeDigiSimLinks_ ) iEvent.put( pOutputDigiSimLink ); // The previous EDProducer didn't name this collection so I won't either
283  }
284 }
const std::string ZSDigi
edm::ESHandle< TrackerGeometry > pDD
const bool zeroSuppression
const bool useConfFromDB
std::map< uint32_t, std::vector< int > > theDetIdList
int iEvent
Definition: GenABIO.cc:230
CLHEP::HepRandomEngine * randomEngine(edm::StreamID const &streamID)
std::unique_ptr< SiStripDigitizerAlgorithm > theDigiAlgo
const std::string VRDigi
const std::string PRDigi
string const
Definition: compareJSON.py:14
const bool makeDigiSimLinks_
Whether or not to create the association to sim truth collection. Set in configuration.
const std::string gainLabel
const std::string SCDigi
void SiStripDigitizer::initializeEvent ( edm::Event const &  e,
edm::EventSetup const &  c 
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 171 of file SiStripDigitizer.cc.

References compareJSON::const, crossingSimHitIndexOffset_, detectorUnits, geometryType, edm::EventSetup::get(), pDD, pSetup, DetId::subdetId(), StripSubdetector::TEC, theDetIdList, theDigiAlgo, StripSubdetector::TIB, StripSubdetector::TID, StripSubdetector::TOB, and useConfFromDB.

171  {
172  // Make sure that the first crossing processed starts indexing the sim hits from zero.
173  // This variable is used so that the sim hits from all crossing frames have sequential
174  // indices used to create the digi-sim link (if configured to do so) rather than starting
175  // from zero for each crossing.
177 
178  // Step A: Get Inputs
179 
180  if(useConfFromDB){
182  iSetup.get<SiStripDetCablingRcd>().get(detCabling);
183  detCabling->addConnected(theDetIdList);
184  }
185 
186  theDigiAlgo->initializeEvent(iSetup);
187 
188  iSetup.get<TrackerDigiGeometryRecord>().get(geometryType,pDD);
189  iSetup.get<IdealMagneticFieldRecord>().get(pSetup);
190 
191  // FIX THIS! We only need to clear and (re)fill detectorUnits when the geometry type IOV changes. Use ESWatcher to determine this.
192  bool changes = true;
193  if(changes) { // Replace with ESWatcher
194  detectorUnits.clear();
195  }
196  for(TrackingGeometry::DetUnitContainer::const_iterator iu = pDD->detUnits().begin(); iu != pDD->detUnits().end(); ++iu) {
197  unsigned int detId = (*iu)->geographicalId().rawId();
198  DetId idet=DetId(detId);
199  unsigned int isub=idet.subdetId();
200  if((isub == StripSubdetector::TIB) ||
201  (isub == StripSubdetector::TID) ||
202  (isub == StripSubdetector::TOB) ||
203  (isub == StripSubdetector::TEC)) {
204  auto stripdet = dynamic_cast<StripGeomDetUnit const*>((*iu));
205  assert(stripdet != 0);
206  if(changes) { // Replace with ESWatcher
207  detectorUnits.insert(std::make_pair(detId, stripdet));
208  }
209  theDigiAlgo->initializeDetUnit(stripdet, iSetup);
210  }
211  }
212 }
edm::ESHandle< TrackerGeometry > pDD
const bool useConfFromDB
std::map< uint32_t, std::vector< int > > theDetIdList
std::map< std::string, size_t > crossingSimHitIndexOffset_
Offset to add to the index of each sim hit to account for which crossing it&#39;s in. ...
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
Definition: DetId.h:18
std::unique_ptr< SiStripDigitizerAlgorithm > theDigiAlgo
edm::ESHandle< MagneticField > pSetup
const std::string geometryType
string const
Definition: compareJSON.py:14
std::map< unsigned int, StripGeomDetUnit const * > detectorUnits
CLHEP::HepRandomEngine * SiStripDigitizer::randomEngine ( edm::StreamID const &  streamID)
private

Definition at line 286 of file SiStripDigitizer.cc.

References edm::RandomNumberGenerator::getEngine(), cmsHarvester::index, randomEngines_, and edm::StreamID::value().

Referenced by accumulate(), and finalizeEvent().

286  {
287  unsigned int index = streamID.value();
288  if(index >= randomEngines_.size()) {
289  randomEngines_.resize(index + 1, nullptr);
290  }
291  CLHEP::HepRandomEngine* ptr = randomEngines_[index];
292  if(!ptr) {
294  ptr = &rng->getEngine(streamID);
295  randomEngines_[index] = ptr;
296  }
297  return ptr;
298 }
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &) const =0
Use this engine in event methods.
std::vector< CLHEP::HepRandomEngine * > randomEngines_

Member Data Documentation

std::map<std::string,size_t> SiStripDigitizer::crossingSimHitIndexOffset_
private

Offset to add to the index of each sim hit to account for which crossing it's in.

I need to know what each sim hit index will be when the hits from all crossing frames are merged into one collection (assuming the MixingModule is configured to create the crossing frame for all sim hits). To do this I'll record how many hits were in each crossing, and then add that on to the index for a given hit in a given crossing. This assumes that the crossings are processed in the same order here as they are put into the crossing frame, which I'm pretty sure is true.
The key is the name of the sim hit collection.

Definition at line 83 of file SiStripDigitizer.h.

Referenced by accumulate(), and initializeEvent().

std::map<unsigned int, StripGeomDetUnit const *> SiStripDigitizer::detectorUnits
private

Definition at line 89 of file SiStripDigitizer.h.

Referenced by accumulateStripHits(), and initializeEvent().

const std::string SiStripDigitizer::gainLabel
private

Definition at line 64 of file SiStripDigitizer.h.

Referenced by finalizeEvent().

const std::string SiStripDigitizer::geometryType
private

Definition at line 71 of file SiStripDigitizer.h.

Referenced by initializeEvent().

const std::string SiStripDigitizer::hitsProducer
private

Definition at line 65 of file SiStripDigitizer.h.

Referenced by accumulate(), and SiStripDigitizer().

const bool SiStripDigitizer::makeDigiSimLinks_
private

Whether or not to create the association to sim truth collection. Set in configuration.

Definition at line 74 of file SiStripDigitizer.h.

Referenced by finalizeEvent().

edm::ESHandle<TrackerGeometry> SiStripDigitizer::pDD
private

Definition at line 87 of file SiStripDigitizer.h.

Referenced by finalizeEvent(), and initializeEvent().

const std::string SiStripDigitizer::PRDigi
private

Definition at line 70 of file SiStripDigitizer.h.

Referenced by finalizeEvent(), and SiStripDigitizer().

edm::ESHandle<MagneticField> SiStripDigitizer::pSetup
private

Definition at line 88 of file SiStripDigitizer.h.

Referenced by accumulateStripHits(), and initializeEvent().

std::vector<CLHEP::HepRandomEngine*> SiStripDigitizer::randomEngines_
private

Definition at line 90 of file SiStripDigitizer.h.

Referenced by randomEngine().

const std::string SiStripDigitizer::SCDigi
private

Definition at line 68 of file SiStripDigitizer.h.

Referenced by finalizeEvent(), and SiStripDigitizer().

std::map<uint32_t, std::vector<int> > SiStripDigitizer::theDetIdList
private

Definition at line 86 of file SiStripDigitizer.h.

Referenced by finalizeEvent(), and initializeEvent().

std::unique_ptr<SiStripDigitizerAlgorithm> SiStripDigitizer::theDigiAlgo
private
const vstring SiStripDigitizer::trackerContainers
private

Definition at line 66 of file SiStripDigitizer.h.

Referenced by accumulate(), and SiStripDigitizer().

const bool SiStripDigitizer::useConfFromDB
private

Definition at line 72 of file SiStripDigitizer.h.

Referenced by finalizeEvent(), and initializeEvent().

const std::string SiStripDigitizer::VRDigi
private

Definition at line 69 of file SiStripDigitizer.h.

Referenced by finalizeEvent(), and SiStripDigitizer().

const bool SiStripDigitizer::zeroSuppression
private

Definition at line 73 of file SiStripDigitizer.h.

Referenced by finalizeEvent().

const std::string SiStripDigitizer::ZSDigi
private

Definition at line 67 of file SiStripDigitizer.h.

Referenced by finalizeEvent(), and SiStripDigitizer().