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 PileupMixingContentgetEventPileupInfo () override
 
virtual void initializeEvent (edm::Event const &e, edm::EventSetup const &c) override
 
 SiStripDigitizer (const edm::ParameterSet &conf, edm::stream::EDProducerBase &mixMod, edm::ConsumesCollector &iC)
 
virtual void StorePileupInformation (std::vector< int > &numInteractionList, std::vector< int > &bunchCrossingList, std::vector< float > &TrueInteractionList, std::vector< edm::EventID > &eventInfoList, int bunchSpacing) override
 
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 void initializeBunchCrossing (edm::Event const &event, edm::EventSetup const &setup, int bunchCrossing)
 
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
 
PileupMixingContentPileupInfo_
 
const std::string PRDigi
 
edm::ESHandle< MagneticFieldpSetup
 
std::vector
< CLHEP::HepRandomEngine * > 
randomEngines_
 
const std::string SCDigi
 
std::vector< std::pair< int,
std::bitset< 6 > > > 
theAffectedAPVvector
 
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 46 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 72 of file SiStripDigitizer.h.

typedef simhit_map::iterator SiStripDigitizer::simhit_map_iterator
private

Definition at line 73 of file SiStripDigitizer.h.

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

Definition at line 71 of file SiStripDigitizer.h.

Constructor & Destructor Documentation

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

Definition at line 58 of file SiStripDigitizer.cc.

References HLT_FULL_cff::alias, edm::ConsumesCollector::consumes(), Exception, hitsProducer, HLT_FULL_cff::InputTag, edm::Service< T >::isAvailable(), PRDigi, rng, 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  mixMod.produces<std::vector<std::pair<int,std::bitset<6>>>>("AffectedAPVList").setBranchAlias(alias + "AffectedAPV");
79  for(auto const& trackerContainer : trackerContainers) {
80  edm::InputTag tag(hitsProducer, trackerContainer);
81  iC.consumes<std::vector<PSimHit> >(edm::InputTag(hitsProducer, trackerContainer));
82  }
84  if ( ! rng.isAvailable()) {
85  throw cms::Exception("Configuration")
86  << "SiStripDigitizer requires the RandomNumberGeneratorService\n"
87  "which is not present in the configuration file. You must add the service\n"
88  "in the configuration file or remove the modules that require it.";
89  }
90  theDigiAlgo.reset(new SiStripDigitizerAlgorithm(conf));
91 }
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
edm::Service< edm::RandomNumberGenerator > rng
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 94 of file SiStripDigitizer.cc.

94  {
95 }

Member Function Documentation

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

Implements DigiAccumulatorMixMod.

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

126  {
127  //Retrieve tracker topology from geometry
129  iSetup.get<TrackerTopologyRcd>().get(tTopoHand);
130  const TrackerTopology *tTopo=tTopoHand.product();
131 
132  // Step A: Get Inputs
133  for(auto const& trackerContainer : trackerContainers) {
135  edm::InputTag tag(hitsProducer, trackerContainer);
136  unsigned int tofBin = StripDigiSimLink::LowTof;
137  if (trackerContainer.find(std::string("HighTof")) != std::string::npos) tofBin = StripDigiSimLink::HighTof;
138 
139  iEvent.getByLabel(tag, simHits);
140  accumulateStripHits(simHits,tTopo,crossingSimHitIndexOffset_[tag.encode()], tofBin, randomEngine(iEvent.streamID()));
141  // Now that the hits have been processed, I'll add the amount of hits in this crossing on to
142  // the global counter. Next time accumulateStripHits() is called it will count the sim hits
143  // as though they were on the end of this collection.
144  // Note that this is only used for creating digi-sim links (if configured to do so).
145  if( simHits.isValid() ) crossingSimHitIndexOffset_[tag.encode()]+=simHits->size();
146  }
147  }
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 150 of file SiStripDigitizer.cc.

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

150  {
151 
153  iSetup.get<TrackerTopologyRcd>().get(tTopoHand);
154  const TrackerTopology *tTopo=tTopoHand.product();
155 
156  //Re-compute luminosity for accumulation for HIP effects
158  theDigiAlgo->calculateInstlumiScale(PileupInfo_);
159 
160  // Step A: Get Inputs
161  for(auto const& trackerContainer : trackerContainers) {
163  edm::InputTag tag(hitsProducer, trackerContainer);
164  unsigned int tofBin = StripDigiSimLink::LowTof;
165  if (trackerContainer.find(std::string("HighTof")) != std::string::npos) tofBin = StripDigiSimLink::HighTof;
166 
167  iEvent.getByLabel(tag, simHits);
168  accumulateStripHits(simHits,tTopo,crossingSimHitIndexOffset_[tag.encode()], tofBin, randomEngine(streamID));
169  // Now that the hits have been processed, I'll add the amount of hits in this crossing on to
170  // the global counter. Next time accumulateStripHits() is called it will count the sim hits
171  // as though they were on the end of this collection.
172  // Note that this is only used for creating digi-sim links (if configured to do so).
173  if( simHits.isValid() ) crossingSimHitIndexOffset_[tag.encode()]+=simHits->size();
174  }
175  }
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
PileupMixingContent * PileupInfo_
std::unique_ptr< SiStripDigitizerAlgorithm > theDigiAlgo
T const * product() const
Definition: ESHandle.h:86
tuple simHits
Definition: trackerHits.py:16
virtual PileupMixingContent * getEventPileupInfo() override
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 97 of file SiStripDigitizer.cc.

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

Referenced by accumulate().

98  {
99  // globalSimHitIndex is the index the sim hit will have when it is put in a collection
100  // of sim hits for all crossings. This is only used when creating digi-sim links if
101  // configured to do so.
102 
103  if(hSimHits.isValid()) {
104  std::set<unsigned int> detIds;
105  std::vector<PSimHit> const& simHits = *hSimHits.product();
106  for(std::vector<PSimHit>::const_iterator it = simHits.begin(), itEnd = simHits.end(); it != itEnd; ++it, ++globalSimHitIndex ) {
107  unsigned int detId = (*it).detUnitId();
108  if(detIds.insert(detId).second) {
109  // The insert succeeded, so this detector element has not yet been processed.
110  assert(detectorUnits[detId]);
111  if(detectorUnits[detId]->type().isTrackerStrip()) { // this test can be removed and replaced by stripdet!=0
112  auto stripdet = detectorUnits[detId];
113  //access to magnetic field in global coordinates
114  GlobalVector bfield = pSetup->inTesla(stripdet->surface().position());
115  LogDebug ("Digitizer ") << "B-field(T) at " << stripdet->surface().position() << "(cm): "
116  << pSetup->inTesla(stripdet->surface().position());
117  theDigiAlgo->accumulateSimHits(it, itEnd, globalSimHitIndex, tofBin, stripdet, bfield, tTopo, engine);
118  }
119  }
120  } // end of loop over sim hits
121  }
122 }
#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 216 of file SiStripDigitizer.cc.

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

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

Reimplemented from DigiAccumulatorMixMod.

Definition at line 64 of file SiStripDigitizer.h.

References PileupInfo_.

Referenced by accumulate().

64 { return PileupInfo_; }
PileupMixingContent * PileupInfo_
void SiStripDigitizer::initializeEvent ( edm::Event const &  e,
edm::EventSetup const &  c 
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 178 of file SiStripDigitizer.cc.

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

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

Definition at line 290 of file SiStripDigitizer.cc.

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

Referenced by accumulate(), and finalizeEvent().

290  {
291  unsigned int index = streamID.value();
292  if(index >= randomEngines_.size()) {
293  randomEngines_.resize(index + 1, nullptr);
294  }
295  CLHEP::HepRandomEngine* ptr = randomEngines_[index];
296  if(!ptr) {
298  ptr = &rng->getEngine(streamID);
299  randomEngines_[index] = ptr;
300  }
301  return ptr;
302 }
edm::Service< edm::RandomNumberGenerator > rng
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
std::vector< CLHEP::HepRandomEngine * > randomEngines_
virtual void SiStripDigitizer::StorePileupInformation ( std::vector< int > &  numInteractionList,
std::vector< int > &  bunchCrossingList,
std::vector< float > &  TrueInteractionList,
std::vector< edm::EventID > &  eventInfoList,
int  bunchSpacing 
)
inlineoverridevirtual

Reimplemented from DigiAccumulatorMixMod.

Definition at line 57 of file SiStripDigitizer.h.

References PileupInfo_.

60  {
61  PileupInfo_ = new PileupMixingContent(numInteractionList, bunchCrossingList, TrueInteractionList, eventInfoList, bunchSpacing);
62  }
PileupMixingContent * PileupInfo_

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 96 of file SiStripDigitizer.h.

Referenced by accumulate(), and initializeEvent().

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

Definition at line 102 of file SiStripDigitizer.h.

Referenced by accumulateStripHits(), and initializeEvent().

const std::string SiStripDigitizer::gainLabel
private

Definition at line 75 of file SiStripDigitizer.h.

Referenced by finalizeEvent().

const std::string SiStripDigitizer::geometryType
private

Definition at line 82 of file SiStripDigitizer.h.

Referenced by initializeEvent().

const std::string SiStripDigitizer::hitsProducer
private

Definition at line 76 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 85 of file SiStripDigitizer.h.

Referenced by finalizeEvent().

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

Definition at line 100 of file SiStripDigitizer.h.

Referenced by finalizeEvent(), and initializeEvent().

PileupMixingContent* SiStripDigitizer::PileupInfo_
private

Definition at line 106 of file SiStripDigitizer.h.

Referenced by accumulate(), getEventPileupInfo(), and StorePileupInformation().

const std::string SiStripDigitizer::PRDigi
private

Definition at line 81 of file SiStripDigitizer.h.

Referenced by finalizeEvent(), and SiStripDigitizer().

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

Definition at line 101 of file SiStripDigitizer.h.

Referenced by accumulateStripHits(), and initializeEvent().

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

Definition at line 103 of file SiStripDigitizer.h.

Referenced by randomEngine().

const std::string SiStripDigitizer::SCDigi
private

Definition at line 79 of file SiStripDigitizer.h.

Referenced by finalizeEvent(), and SiStripDigitizer().

std::vector<std::pair<int,std::bitset<6> > > SiStripDigitizer::theAffectedAPVvector
private

Definition at line 104 of file SiStripDigitizer.h.

Referenced by finalizeEvent(), and initializeEvent().

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

Definition at line 99 of file SiStripDigitizer.h.

Referenced by finalizeEvent(), and initializeEvent().

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

Definition at line 77 of file SiStripDigitizer.h.

Referenced by accumulate(), and SiStripDigitizer().

const bool SiStripDigitizer::useConfFromDB
private

Definition at line 83 of file SiStripDigitizer.h.

Referenced by finalizeEvent(), and initializeEvent().

const std::string SiStripDigitizer::VRDigi
private

Definition at line 80 of file SiStripDigitizer.h.

Referenced by finalizeEvent(), and SiStripDigitizer().

const bool SiStripDigitizer::zeroSuppression
private

Definition at line 84 of file SiStripDigitizer.h.

Referenced by finalizeEvent().

const std::string SiStripDigitizer::ZSDigi
private

Definition at line 78 of file SiStripDigitizer.h.

Referenced by finalizeEvent(), and SiStripDigitizer().