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, std::vector< edm::EventID > &eventList, int bunchSpace)
 
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, const unsigned int tofBin, 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 58 of file SiStripDigitizer.cc.

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

58  :
59  gainLabel(conf.getParameter<std::string>("Gain")),
60  hitsProducer(conf.getParameter<std::string>("hitsProducer")),
61  trackerContainers(conf.getParameter<std::vector<std::string> >("ROUList")),
62  ZSDigi(conf.getParameter<edm::ParameterSet>("DigiModeList").getParameter<std::string>("ZSDigi")),
63  SCDigi(conf.getParameter<edm::ParameterSet>("DigiModeList").getParameter<std::string>("SCDigi")),
64  VRDigi(conf.getParameter<edm::ParameterSet>("DigiModeList").getParameter<std::string>("VRDigi")),
65  PRDigi(conf.getParameter<edm::ParameterSet>("DigiModeList").getParameter<std::string>("PRDigi")),
66  geometryType(conf.getParameter<std::string>("GeometryType")),
67  useConfFromDB(conf.getParameter<bool>("TrackerConfigurationFromDB")),
68  zeroSuppression(conf.getParameter<bool>("ZeroSuppression")),
69  makeDigiSimLinks_(conf.getUntrackedParameter<bool>("makeDigiSimLinks", false))
70 {
71  const std::string alias("simSiStripDigis");
72 
73  mixMod.produces<edm::DetSetVector<SiStripDigi> >(ZSDigi).setBranchAlias(ZSDigi);
74  mixMod.produces<edm::DetSetVector<SiStripRawDigi> >(SCDigi).setBranchAlias(alias + SCDigi);
75  mixMod.produces<edm::DetSetVector<SiStripRawDigi> >(VRDigi).setBranchAlias(alias + VRDigi);
76  mixMod.produces<edm::DetSetVector<SiStripRawDigi> >(PRDigi).setBranchAlias(alias + PRDigi);
77  mixMod.produces<edm::DetSetVector<StripDigiSimLink> >().setBranchAlias(alias + "siStripDigiSimLink");
78  for(auto const& trackerContainer : trackerContainers) {
79  edm::InputTag tag(hitsProducer, trackerContainer);
80  iC.consumes<std::vector<PSimHit> >(edm::InputTag(hitsProducer, trackerContainer));
81  }
83  if ( ! rng.isAvailable()) {
84  throw cms::Exception("Configuration")
85  << "SiStripDigitizer requires the RandomNumberGeneratorService\n"
86  "which is not present in the configuration file. You must add the service\n"
87  "in the configuration file or remove the modules that require it.";
88  }
89  theDigiAlgo.reset(new SiStripDigitizerAlgorithm(conf));
90 }
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 93 of file SiStripDigitizer.cc.

93  {
94 }

Member Function Documentation

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

Implements DigiAccumulatorMixMod.

Definition at line 125 of file SiStripDigitizer.cc.

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

125  {
126  //Retrieve tracker topology from geometry
128  iSetup.get<IdealGeometryRecord>().get(tTopoHand);
129  const TrackerTopology *tTopo=tTopoHand.product();
130 
131  // Step A: Get Inputs
132  for(auto const& trackerContainer : trackerContainers) {
134  edm::InputTag tag(hitsProducer, trackerContainer);
135  unsigned int tofBin = StripDigiSimLink::LowTof;
136  if (trackerContainer.find(std::string("HighTof")) != std::string::npos) tofBin = StripDigiSimLink::HighTof;
137 
138  iEvent.getByLabel(tag, simHits);
139  accumulateStripHits(simHits,tTopo,crossingSimHitIndexOffset_[tag.encode()], tofBin, 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
void accumulateStripHits(edm::Handle< std::vector< PSimHit > >, const TrackerTopology *tTopo, size_t globalSimHitIndex, const unsigned int tofBin, CLHEP::HepRandomEngine *)
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:75
T const * product() const
Definition: ESHandle.h:86
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(), StripDigiSimLink::HighTof, hitsProducer, edm::HandleBase::isValid(), StripDigiSimLink::LowTof, edm::ESHandle< class >::product(), randomEngine(), trackerHits::simHits, AlCaHLTBitMon_QueryRunRegistry::string, 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  unsigned int tofBin = StripDigiSimLink::LowTof;
160  if (trackerContainer.find(std::string("HighTof")) != std::string::npos) tofBin = StripDigiSimLink::HighTof;
161 
162  iEvent.getByLabel(tag, simHits);
163  accumulateStripHits(simHits,tTopo,crossingSimHitIndexOffset_[tag.encode()], tofBin, randomEngine(streamID));
164  // Now that the hits have been processed, I'll add the amount of hits in this crossing on to
165  // the global counter. Next time accumulateStripHits() is called it will count the sim hits
166  // as though they were on the end of this collection.
167  // Note that this is only used for creating digi-sim links (if configured to do so).
168  if( simHits.isValid() ) crossingSimHitIndexOffset_[tag.encode()]+=simHits->size();
169  }
170  }
const vstring trackerContainers
void accumulateStripHits(edm::Handle< std::vector< PSimHit > >, const TrackerTopology *tTopo, size_t globalSimHitIndex, const unsigned int tofBin, CLHEP::HepRandomEngine *)
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:75
T const * product() const
Definition: ESHandle.h:86
tuple simHits
Definition: trackerHits.py:16
void SiStripDigitizer::accumulateStripHits ( edm::Handle< std::vector< PSimHit > >  hSimHits,
const TrackerTopology tTopo,
size_t  globalSimHitIndex,
const unsigned int  tofBin,
CLHEP::HepRandomEngine *  engine 
)
private

Definition at line 96 of file SiStripDigitizer.cc.

References assert(), detectorUnits, GeomDetEnumerators::isTrackerStrip(), LogDebug, pSetup, trackerHits::simHits, and theDigiAlgo.

Referenced by accumulate().

97  {
98  // globalSimHitIndex is the index the sim hit will have when it is put in a collection
99  // of sim hits for all crossings. This is only used when creating digi-sim links if
100  // configured to do so.
101 
102  if(hSimHits.isValid()) {
103  std::set<unsigned int> detIds;
104  std::vector<PSimHit> const& simHits = *hSimHits.product();
105  for(std::vector<PSimHit>::const_iterator it = simHits.begin(), itEnd = simHits.end(); it != itEnd; ++it, ++globalSimHitIndex ) {
106  unsigned int detId = (*it).detUnitId();
107  if(detIds.insert(detId).second) {
108  // The insert succeeded, so this detector element has not yet been processed.
109  assert(detectorUnits[detId]);
110  if(detectorUnits[detId]->type().isTrackerStrip()) { // this test can be removed and replaced by stripdet!=0
111  auto stripdet = detectorUnits[detId];
112  //access to magnetic field in global coordinates
113  GlobalVector bfield = pSetup->inTesla(stripdet->surface().position());
114  LogDebug ("Digitizer ") << "B-field(T) at " << stripdet->surface().position() << "(cm): "
115  << pSetup->inTesla(stripdet->surface().position());
116  theDigiAlgo->accumulateSimHits(it, itEnd, globalSimHitIndex, tofBin, stripdet, bfield, tTopo, engine);
117  }
118  }
119  } // end of loop over sim hits
120  }
121 }
#define LogDebug(id)
type
Definition: HCALResponse.h:21
assert(m_qm.get())
bool isTrackerStrip(const GeomDetEnumerators::SubDetector m)
bool isValid() const
Definition: HandleBase.h:75
std::unique_ptr< SiStripDigitizerAlgorithm > theDigiAlgo
T const * product() const
Definition: Handle.h:81
edm::ESHandle< MagneticField > pSetup
tuple simHits
Definition: trackerHits.py:16
std::map< unsigned int, StripGeomDetUnit const * > detectorUnits
void SiStripDigitizer::finalizeEvent ( edm::Event e,
edm::EventSetup const &  c 
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 211 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.

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

References assert(), compareJSON::const, crossingSimHitIndexOffset_, detectorUnits, geometryType, edm::EventSetup::get(), pDD, pSetup, theDetIdList, theDigiAlgo, and useConfFromDB.

173  {
174  // Make sure that the first crossing processed starts indexing the sim hits from zero.
175  // This variable is used so that the sim hits from all crossing frames have sequential
176  // indices used to create the digi-sim link (if configured to do so) rather than starting
177  // from zero for each crossing.
179 
180  // Step A: Get Inputs
181 
182  if(useConfFromDB){
184  iSetup.get<SiStripDetCablingRcd>().get(detCabling);
185  detCabling->addConnected(theDetIdList);
186  }
187 
188  theDigiAlgo->initializeEvent(iSetup);
189 
190  iSetup.get<TrackerDigiGeometryRecord>().get(geometryType,pDD);
191  iSetup.get<IdealMagneticFieldRecord>().get(pSetup);
192 
193  // FIX THIS! We only need to clear and (re)fill detectorUnits when the geometry type IOV changes. Use ESWatcher to determine this.
194  bool changes = true;
195  if(changes) { // Replace with ESWatcher
196  detectorUnits.clear();
197  }
198  for(TrackingGeometry::DetUnitContainer::const_iterator iu = pDD->detUnits().begin(); iu != pDD->detUnits().end(); ++iu) {
199  unsigned int detId = (*iu)->geographicalId().rawId();
200  if((*iu)->type().isTrackerStrip()) {
201  auto stripdet = dynamic_cast<StripGeomDetUnit const*>((*iu));
202  assert(stripdet != 0);
203  if(changes) { // Replace with ESWatcher
204  detectorUnits.insert(std::make_pair(detId, stripdet));
205  }
206  theDigiAlgo->initializeDetUnit(stripdet, iSetup);
207  }
208  }
209 }
edm::ESHandle< TrackerGeometry > pDD
assert(m_qm.get())
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. ...
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 283 of file SiStripDigitizer.cc.

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

Referenced by accumulate(), and finalizeEvent().

283  {
284  unsigned int index = streamID.value();
285  if(index >= randomEngines_.size()) {
286  randomEngines_.resize(index + 1, nullptr);
287  }
288  CLHEP::HepRandomEngine* ptr = randomEngines_[index];
289  if(!ptr) {
291  ptr = &rng->getEngine(streamID);
292  randomEngines_[index] = ptr;
293  }
294  return ptr;
295 }
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().