CMS 3D CMS Logo

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

void accumulate (edm::Event const &e, edm::EventSetup const &c) override
 
void accumulate (PileUpEventPrincipal const &e, edm::EventSetup const &c, edm::StreamID const &) override
 
void finalizeEvent (edm::Event &e, edm::EventSetup const &c) override
 
PileupMixingContentgetEventPileupInfo () override
 
void initializeEvent (edm::Event const &e, edm::EventSetup const &c) override
 
 SiStripDigitizer (const edm::ParameterSet &conf, edm::ProducesCollector, edm::ConsumesCollector &iC)
 
void StorePileupInformation (std::vector< int > &numInteractionList, std::vector< int > &bunchCrossingList, std::vector< float > &TrueInteractionList, std::vector< edm::EventID > &eventInfoList, int bunchSpacing) override
 
 ~SiStripDigitizer () override
 
- 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)
 

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 double fracOfEventsToSimAPV_
 Whether or not to create the association to sim truth collection. Set in configuration. More...
 
const std::string gainLabel
 
const std::string geometryType
 
const std::string hitsProducer
 
const bool includeAPVSimulation_
 
const bool makeDigiSimLinks_
 
edm::ESHandle< TrackerGeometrypDD
 
std::unique_ptr< PileupMixingContentPileupInfo_
 
const std::string PRDigi
 
edm::ESHandle< MagneticFieldpSetup
 
CLHEP::HepRandomEngine * randomEngine_ = nullptr
 
const std::string SCDigi
 
std::vector< std::pair< int, std::bitset< 6 > > > theAffectedAPVvector
 
std::map< uint32_t, std::vector< int > > theDetIdList
 
std::unique_ptr< SiStripDigitizerAlgorithmtheDigiAlgo
 
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

◆ simhit_map

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

Definition at line 74 of file SiStripDigitizer.h.

◆ simhit_map_iterator

typedef simhit_map::iterator SiStripDigitizer::simhit_map_iterator
private

Definition at line 75 of file SiStripDigitizer.h.

◆ vstring

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

Definition at line 73 of file SiStripDigitizer.h.

Constructor & Destructor Documentation

◆ SiStripDigitizer()

SiStripDigitizer::SiStripDigitizer ( const edm::ParameterSet conf,
edm::ProducesCollector  producesCollector,
edm::ConsumesCollector iC 
)
explicit

Definition at line 59 of file SiStripDigitizer.cc.

62  : gainLabel(conf.getParameter<std::string>("Gain")),
63  hitsProducer(conf.getParameter<std::string>("hitsProducer")),
64  trackerContainers(conf.getParameter<std::vector<std::string>>("ROUList")),
65  ZSDigi(conf.getParameter<edm::ParameterSet>("DigiModeList").getParameter<std::string>("ZSDigi")),
66  SCDigi(conf.getParameter<edm::ParameterSet>("DigiModeList").getParameter<std::string>("SCDigi")),
67  VRDigi(conf.getParameter<edm::ParameterSet>("DigiModeList").getParameter<std::string>("VRDigi")),
68  PRDigi(conf.getParameter<edm::ParameterSet>("DigiModeList").getParameter<std::string>("PRDigi")),
69  geometryType(conf.getParameter<std::string>("GeometryType")),
70  useConfFromDB(conf.getParameter<bool>("TrackerConfigurationFromDB")),
71  zeroSuppression(conf.getParameter<bool>("ZeroSuppression")),
72  makeDigiSimLinks_(conf.getUntrackedParameter<bool>("makeDigiSimLinks", false)),
73  includeAPVSimulation_(conf.getParameter<bool>("includeAPVSimulation")),
74  fracOfEventsToSimAPV_(conf.getParameter<double>("fracOfEventsToSimAPV")) {
75  const std::string alias("simSiStripDigis");
76 
77  producesCollector.produces<edm::DetSetVector<SiStripDigi>>(ZSDigi).setBranchAlias(ZSDigi);
78  producesCollector.produces<edm::DetSetVector<SiStripRawDigi>>(SCDigi).setBranchAlias(alias + SCDigi);
79  producesCollector.produces<edm::DetSetVector<SiStripRawDigi>>(VRDigi).setBranchAlias(alias + VRDigi);
80  producesCollector.produces<edm::DetSetVector<SiStripRawDigi>>("StripAmplitudes")
81  .setBranchAlias(alias + "StripAmplitudes");
82  producesCollector.produces<edm::DetSetVector<SiStripRawDigi>>("StripAmplitudesPostAPV")
83  .setBranchAlias(alias + "StripAmplitudesPostAPV");
84  producesCollector.produces<edm::DetSetVector<SiStripRawDigi>>("StripAPVBaselines")
85  .setBranchAlias(alias + "StripAPVBaselines");
86  producesCollector.produces<edm::DetSetVector<SiStripRawDigi>>(PRDigi).setBranchAlias(alias + PRDigi);
87  producesCollector.produces<edm::DetSetVector<StripDigiSimLink>>().setBranchAlias(alias + "siStripDigiSimLink");
88  producesCollector.produces<bool>("SimulatedAPVDynamicGain").setBranchAlias(alias + "SimulatedAPVDynamicGain");
89  producesCollector.produces<std::vector<std::pair<int, std::bitset<6>>>>("AffectedAPVList")
90  .setBranchAlias(alias + "AffectedAPV");
91  for (auto const& trackerContainer : trackerContainers) {
92  edm::InputTag tag(hitsProducer, trackerContainer);
93  iC.consumes<std::vector<PSimHit>>(edm::InputTag(hitsProducer, trackerContainer));
94  }
96  if (!rng.isAvailable()) {
97  throw cms::Exception("Configuration")
98  << "SiStripDigitizer requires the RandomNumberGeneratorService\n"
99  "which is not present in the configuration file. You must add the service\n"
100  "in the configuration file or remove the modules that require it.";
101  }
102  theDigiAlgo = std::make_unique<SiStripDigitizerAlgorithm>(conf);
103 }

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

◆ ~SiStripDigitizer()

SiStripDigitizer::~SiStripDigitizer ( )
override

Definition at line 106 of file SiStripDigitizer.cc.

106 {}

Member Function Documentation

◆ accumulate() [1/2]

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

Implements DigiAccumulatorMixMod.

Definition at line 139 of file SiStripDigitizer.cc.

139  {
140  //Retrieve tracker topology from geometry
142  iSetup.get<TrackerTopologyRcd>().get(tTopoHand);
143  const TrackerTopology* tTopo = tTopoHand.product();
144 
145  // Step A: Get Inputs
146  for (auto const& trackerContainer : trackerContainers) {
148  edm::InputTag tag(hitsProducer, trackerContainer);
149  unsigned int tofBin = StripDigiSimLink::LowTof;
150  if (trackerContainer.find(std::string("HighTof")) != std::string::npos)
151  tofBin = StripDigiSimLink::HighTof;
152 
153  iEvent.getByLabel(tag, simHits);
154  accumulateStripHits(simHits, tTopo, crossingSimHitIndexOffset_[tag.encode()], tofBin);
155  // Now that the hits have been processed, I'll add the amount of hits in this crossing on to
156  // the global counter. Next time accumulateStripHits() is called it will count the sim hits
157  // as though they were on the end of this collection.
158  // Note that this is only used for creating digi-sim links (if configured to do so).
159  if (simHits.isValid())
160  crossingSimHitIndexOffset_[tag.encode()] += simHits->size();
161  }
162 }

References accumulateStripHits(), crossingSimHitIndexOffset_, edm::EventSetup::get(), get, StripDigiSimLink::HighTof, hitsProducer, iEvent, StripDigiSimLink::LowTof, edm::ESHandle< T >::product(), FastTrackerRecHitCombiner_cfi::simHits, AlCaHLTBitMon_QueryRunRegistry::string, GlobalPosition_Frontier_DevDB_cff::tag, and trackerContainers.

◆ accumulate() [2/2]

void SiStripDigitizer::accumulate ( PileUpEventPrincipal const &  e,
edm::EventSetup const &  c,
edm::StreamID const &  streamID 
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 164 of file SiStripDigitizer.cc.

166  {
168  iSetup.get<TrackerTopologyRcd>().get(tTopoHand);
169  const TrackerTopology* tTopo = tTopoHand.product();
170 
171  //Re-compute luminosity for accumulation for HIP effects
172  theDigiAlgo->calculateInstlumiScale(PileupInfo_.get());
173 
174  // Step A: Get Inputs
175  for (auto const& trackerContainer : trackerContainers) {
177  edm::InputTag tag(hitsProducer, trackerContainer);
178  unsigned int tofBin = StripDigiSimLink::LowTof;
179  if (trackerContainer.find(std::string("HighTof")) != std::string::npos)
180  tofBin = StripDigiSimLink::HighTof;
181 
182  iEvent.getByLabel(tag, simHits);
183  accumulateStripHits(simHits, tTopo, crossingSimHitIndexOffset_[tag.encode()], tofBin);
184  // Now that the hits have been processed, I'll add the amount of hits in this crossing on to
185  // the global counter. Next time accumulateStripHits() is called it will count the sim hits
186  // as though they were on the end of this collection.
187  // Note that this is only used for creating digi-sim links (if configured to do so).
188  if (simHits.isValid())
189  crossingSimHitIndexOffset_[tag.encode()] += simHits->size();
190  }
191 }

References accumulateStripHits(), crossingSimHitIndexOffset_, edm::EventSetup::get(), get, StripDigiSimLink::HighTof, hitsProducer, iEvent, StripDigiSimLink::LowTof, PileupInfo_, edm::ESHandle< T >::product(), FastTrackerRecHitCombiner_cfi::simHits, AlCaHLTBitMon_QueryRunRegistry::string, GlobalPosition_Frontier_DevDB_cff::tag, theDigiAlgo, and trackerContainers.

◆ accumulateStripHits()

void SiStripDigitizer::accumulateStripHits ( edm::Handle< std::vector< PSimHit >>  hSimHits,
const TrackerTopology tTopo,
size_t  globalSimHitIndex,
const unsigned int  tofBin 
)
private

Definition at line 108 of file SiStripDigitizer.cc.

111  {
112  // globalSimHitIndex is the index the sim hit will have when it is put in a collection
113  // of sim hits for all crossings. This is only used when creating digi-sim links if
114  // configured to do so.
115 
116  if (hSimHits.isValid()) {
117  std::set<unsigned int> detIds;
118  std::vector<PSimHit> const& simHits = *hSimHits.product();
119  for (std::vector<PSimHit>::const_iterator it = simHits.begin(), itEnd = simHits.end(); it != itEnd;
120  ++it, ++globalSimHitIndex) {
121  unsigned int detId = (*it).detUnitId();
122  if (detIds.insert(detId).second) {
123  // The insert succeeded, so this detector element has not yet been processed.
124  assert(detectorUnits[detId]);
125  if (detectorUnits[detId]->type().isTrackerStrip()) { // this test can be removed and replaced by stripdet!=0
126  auto stripdet = detectorUnits[detId];
127  //access to magnetic field in global coordinates
128  GlobalVector bfield = pSetup->inTesla(stripdet->surface().position());
129  LogDebug("Digitizer ") << "B-field(T) at " << stripdet->surface().position()
130  << "(cm): " << pSetup->inTesla(stripdet->surface().position());
131  theDigiAlgo->accumulateSimHits(it, itEnd, globalSimHitIndex, tofBin, stripdet, bfield, tTopo, randomEngine_);
132  }
133  }
134  } // end of loop over sim hits
135  }
136 }

References cms::cuda::assert(), detectorUnits, MagneticField::inTesla(), GeomDetEnumerators::isTrackerStrip(), LogDebug, pSetup, randomEngine_, FastTrackerRecHitCombiner_cfi::simHits, and theDigiAlgo.

Referenced by accumulate().

◆ finalizeEvent()

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

Implements DigiAccumulatorMixMod.

Definition at line 235 of file SiStripDigitizer.cc.

235  {
236  edm::ESHandle<SiStripGain> gainHandle;
237  edm::ESHandle<SiStripNoises> noiseHandle;
238  edm::ESHandle<SiStripThreshold> thresholdHandle;
239  edm::ESHandle<SiStripPedestals> pedestalHandle;
240  edm::ESHandle<SiStripApvSimulationParameters> apvSimulationParametersHandle;
241  iSetup.get<SiStripGainSimRcd>().get(gainLabel, gainHandle);
242  iSetup.get<SiStripNoisesRcd>().get(noiseHandle);
243  iSetup.get<SiStripThresholdRcd>().get(thresholdHandle);
244  iSetup.get<SiStripPedestalsRcd>().get(pedestalHandle);
245 
246  std::unique_ptr<bool> simulateAPVInThisEvent = std::make_unique<bool>(false);
247  if (includeAPVSimulation_) {
248  if (CLHEP::RandFlat::shoot(randomEngine_) < fracOfEventsToSimAPV_) {
249  *simulateAPVInThisEvent = true;
250  iSetup.get<SiStripApvSimulationParametersRcd>().get(apvSimulationParametersHandle);
251  }
252  }
253  std::vector<edm::DetSet<SiStripDigi>> theDigiVector;
254  std::vector<edm::DetSet<SiStripRawDigi>> theRawDigiVector;
255  std::unique_ptr<edm::DetSetVector<SiStripRawDigi>> theStripAmplitudeVector(new edm::DetSetVector<SiStripRawDigi>());
256  std::unique_ptr<edm::DetSetVector<SiStripRawDigi>> theStripAmplitudeVectorPostAPV(
258  std::unique_ptr<edm::DetSetVector<SiStripRawDigi>> theStripAPVBaselines(new edm::DetSetVector<SiStripRawDigi>());
259  std::unique_ptr<edm::DetSetVector<StripDigiSimLink>> pOutputDigiSimLink(new edm::DetSetVector<StripDigiSimLink>);
260 
262  iSetup.get<TrackerTopologyRcd>().get(tTopoHand);
263  const TrackerTopology* tTopo = tTopoHand.product();
264 
265  // Step B: LOOP on StripGeomDetUnit
266  theDigiVector.reserve(10000);
267  theDigiVector.clear();
268 
269  for (const auto& iu : pDD->detUnits()) {
270  if (useConfFromDB) {
271  //apply the cable map _before_ digitization: consider only the detis that are connected
272  if (theDetIdList.find(iu->geographicalId().rawId()) == theDetIdList.end())
273  continue;
274  }
275  auto sgd = dynamic_cast<StripGeomDetUnit const*>(iu);
276  if (sgd != nullptr) {
277  edm::DetSet<SiStripDigi> collectorZS(iu->geographicalId().rawId());
278  edm::DetSet<SiStripRawDigi> collectorRaw(iu->geographicalId().rawId());
279  edm::DetSet<SiStripRawDigi> collectorStripAmplitudes(iu->geographicalId().rawId());
280  edm::DetSet<SiStripRawDigi> collectorStripAmplitudesPostAPV(iu->geographicalId().rawId());
281  edm::DetSet<SiStripRawDigi> collectorStripAPVBaselines(iu->geographicalId().rawId());
282  edm::DetSet<StripDigiSimLink> collectorLink(iu->geographicalId().rawId());
283 
284  unsigned int detID = sgd->geographicalId().rawId();
285  DetId detId(detID);
286 
287  theDigiAlgo->digitize(collectorZS,
288  collectorRaw,
289  collectorStripAmplitudes,
290  collectorStripAmplitudesPostAPV,
291  collectorStripAPVBaselines,
292  collectorLink,
293  sgd,
294  gainHandle,
295  thresholdHandle,
296  noiseHandle,
297  pedestalHandle,
298  *simulateAPVInThisEvent,
299  apvSimulationParametersHandle,
302  tTopo);
303 
304  if (!collectorStripAmplitudes.data.empty())
305  theStripAmplitudeVector->insert(collectorStripAmplitudes);
306  if (!collectorStripAmplitudesPostAPV.data.empty())
307  theStripAmplitudeVectorPostAPV->insert(collectorStripAmplitudesPostAPV);
308  if (!collectorStripAPVBaselines.data.empty())
309  theStripAPVBaselines->insert(collectorStripAPVBaselines);
310 
311  if (zeroSuppression) {
312  if (!collectorZS.data.empty()) {
313  theDigiVector.push_back(collectorZS);
314  if (!collectorLink.data.empty())
315  pOutputDigiSimLink->insert(collectorLink);
316  }
317  } else {
318  if (!collectorRaw.data.empty()) {
319  theRawDigiVector.push_back(collectorRaw);
320  if (!collectorLink.data.empty())
321  pOutputDigiSimLink->insert(collectorLink);
322  }
323  }
324  }
325  }
326  if (zeroSuppression) {
327  // Step C: create output collection
328  std::unique_ptr<edm::DetSetVector<SiStripRawDigi>> output_virginraw(new edm::DetSetVector<SiStripRawDigi>());
329  std::unique_ptr<edm::DetSetVector<SiStripRawDigi>> output_scopemode(new edm::DetSetVector<SiStripRawDigi>());
330  std::unique_ptr<edm::DetSetVector<SiStripRawDigi>> output_processedraw(new edm::DetSetVector<SiStripRawDigi>());
331  std::unique_ptr<edm::DetSetVector<SiStripDigi>> output(new edm::DetSetVector<SiStripDigi>(theDigiVector));
332  std::unique_ptr<std::vector<std::pair<int, std::bitset<6>>>> AffectedAPVList(
333  new std::vector<std::pair<int, std::bitset<6>>>(theAffectedAPVvector));
334 
335  // Step D: write output to file
336  iEvent.put(std::move(output), ZSDigi);
337  iEvent.put(std::move(output_scopemode), SCDigi);
338  iEvent.put(std::move(output_virginraw), VRDigi);
339  iEvent.put(std::move(theStripAmplitudeVector), "StripAmplitudes");
340  iEvent.put(std::move(theStripAmplitudeVectorPostAPV), "StripAmplitudesPostAPV");
341  iEvent.put(std::move(theStripAPVBaselines), "StripAPVBaselines");
342  iEvent.put(std::move(output_processedraw), PRDigi);
343  iEvent.put(std::move(AffectedAPVList), "AffectedAPVList");
344  iEvent.put(std::move(simulateAPVInThisEvent), "SimulatedAPVDynamicGain");
345  if (makeDigiSimLinks_)
346  iEvent.put(
347  std::move(pOutputDigiSimLink)); // The previous EDProducer didn't name this collection so I won't either
348  } else {
349  // Step C: create output collection
350  std::unique_ptr<edm::DetSetVector<SiStripRawDigi>> output_virginraw(
351  new edm::DetSetVector<SiStripRawDigi>(theRawDigiVector));
352  std::unique_ptr<edm::DetSetVector<SiStripRawDigi>> output_scopemode(new edm::DetSetVector<SiStripRawDigi>());
353  std::unique_ptr<edm::DetSetVector<SiStripRawDigi>> output_processedraw(new edm::DetSetVector<SiStripRawDigi>());
354  std::unique_ptr<edm::DetSetVector<SiStripDigi>> output(new edm::DetSetVector<SiStripDigi>());
355 
356  // Step D: write output to file
357  iEvent.put(std::move(output), ZSDigi);
358  iEvent.put(std::move(output_scopemode), SCDigi);
359  iEvent.put(std::move(output_virginraw), VRDigi);
360  iEvent.put(std::move(theStripAmplitudeVector), "StripAmplitudes");
361  iEvent.put(std::move(theStripAmplitudeVectorPostAPV), "StripAmplitudesPostAPV");
362  iEvent.put(std::move(theStripAPVBaselines), "StripAPVBaselines");
363  iEvent.put(std::move(output_processedraw), PRDigi);
364  iEvent.put(std::move(simulateAPVInThisEvent), "SimulatedAPVDynamicGain");
365  if (makeDigiSimLinks_)
366  iEvent.put(
367  std::move(pOutputDigiSimLink)); // The previous EDProducer didn't name this collection so I won't either
368  }
369  randomEngine_ = nullptr; // to prevent access outside event
370 }

References TrackerGeometry::detUnits(), fracOfEventsToSimAPV_, gainLabel, edm::EventSetup::get(), get, iEvent, includeAPVSimulation_, makeDigiSimLinks_, eostools::move(), convertSQLitetoXML_cfg::output, pDD, PRDigi, edm::ESHandle< T >::product(), randomEngine_, SCDigi, theAffectedAPVvector, theDetIdList, theDigiAlgo, useConfFromDB, trackerHitRTTI::vector, VRDigi, zeroSuppression, and ZSDigi.

◆ getEventPileupInfo()

PileupMixingContent* SiStripDigitizer::getEventPileupInfo ( )
inlineoverridevirtual

Reimplemented from DigiAccumulatorMixMod.

Definition at line 65 of file SiStripDigitizer.h.

65 { return PileupInfo_.get(); }

References PileupInfo_.

◆ initializeEvent()

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

Implements DigiAccumulatorMixMod.

Definition at line 193 of file SiStripDigitizer.cc.

193  {
194  // Make sure that the first crossing processed starts indexing the sim hits from zero.
195  // This variable is used so that the sim hits from all crossing frames have sequential
196  // indices used to create the digi-sim link (if configured to do so) rather than starting
197  // from zero for each crossing.
199  theAffectedAPVvector.clear();
200  // Step A: Get Inputs
201 
202  if (useConfFromDB) {
204  iSetup.get<SiStripDetCablingRcd>().get(detCabling);
205  detCabling->addConnected(theDetIdList);
206  }
207 
208  // Cache random number engine
210  randomEngine_ = &rng->getEngine(iEvent.streamID());
211 
212  theDigiAlgo->initializeEvent(iSetup);
213 
215  iSetup.get<IdealMagneticFieldRecord>().get(pSetup);
216 
217  // FIX THIS! We only need to clear and (re)fill detectorUnits when the geometry type IOV changes. Use ESWatcher to determine this.
218  bool changes = true;
219  if (changes) { // Replace with ESWatcher
220  detectorUnits.clear();
221  }
222  for (const auto& iu : pDD->detUnits()) {
223  unsigned int detId = iu->geographicalId().rawId();
224  if (iu->type().isTrackerStrip()) {
225  auto stripdet = dynamic_cast<StripGeomDetUnit const*>(iu);
226  assert(stripdet != nullptr);
227  if (changes) { // Replace with ESWatcher
228  detectorUnits.insert(std::make_pair(detId, stripdet));
229  }
230  theDigiAlgo->initializeDetUnit(stripdet, iSetup);
231  }
232  }
233 }

References SiStripDetCabling::addConnected(), cms::cuda::assert(), crossingSimHitIndexOffset_, detectorUnits, TrackerGeometry::detUnits(), geometryType, edm::EventSetup::get(), get, edm::RandomNumberGenerator::getEngine(), iEvent, pDD, pSetup, randomEngine_, theAffectedAPVvector, theDetIdList, theDigiAlgo, and useConfFromDB.

◆ StorePileupInformation()

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

60  {
61  PileupInfo_ = std::make_unique<PileupMixingContent>(
62  numInteractionList, bunchCrossingList, TrueInteractionList, eventInfoList, bunchSpacing);
63  }

References genPUProtons_cfi::bunchCrossingList, HLTEgPhaseIITestSequence_cff::bunchSpacing, and PileupInfo_.

Member Data Documentation

◆ crossingSimHitIndexOffset_

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

Referenced by accumulate(), and initializeEvent().

◆ detectorUnits

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

Definition at line 106 of file SiStripDigitizer.h.

Referenced by accumulateStripHits(), and initializeEvent().

◆ fracOfEventsToSimAPV_

const double SiStripDigitizer::fracOfEventsToSimAPV_
private

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

Definition at line 89 of file SiStripDigitizer.h.

Referenced by finalizeEvent().

◆ gainLabel

const std::string SiStripDigitizer::gainLabel
private

Definition at line 77 of file SiStripDigitizer.h.

Referenced by finalizeEvent().

◆ geometryType

const std::string SiStripDigitizer::geometryType
private

Definition at line 84 of file SiStripDigitizer.h.

Referenced by initializeEvent().

◆ hitsProducer

const std::string SiStripDigitizer::hitsProducer
private

Definition at line 78 of file SiStripDigitizer.h.

Referenced by accumulate(), and SiStripDigitizer().

◆ includeAPVSimulation_

const bool SiStripDigitizer::includeAPVSimulation_
private

Definition at line 88 of file SiStripDigitizer.h.

Referenced by finalizeEvent().

◆ makeDigiSimLinks_

const bool SiStripDigitizer::makeDigiSimLinks_
private

Definition at line 87 of file SiStripDigitizer.h.

Referenced by finalizeEvent().

◆ pDD

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

Definition at line 104 of file SiStripDigitizer.h.

Referenced by finalizeEvent(), and initializeEvent().

◆ PileupInfo_

std::unique_ptr<PileupMixingContent> SiStripDigitizer::PileupInfo_
private

Definition at line 110 of file SiStripDigitizer.h.

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

◆ PRDigi

const std::string SiStripDigitizer::PRDigi
private

Definition at line 83 of file SiStripDigitizer.h.

Referenced by finalizeEvent(), and SiStripDigitizer().

◆ pSetup

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

Definition at line 105 of file SiStripDigitizer.h.

Referenced by accumulateStripHits(), and initializeEvent().

◆ randomEngine_

CLHEP::HepRandomEngine* SiStripDigitizer::randomEngine_ = nullptr
private

Definition at line 107 of file SiStripDigitizer.h.

Referenced by accumulateStripHits(), finalizeEvent(), and initializeEvent().

◆ SCDigi

const std::string SiStripDigitizer::SCDigi
private

Definition at line 81 of file SiStripDigitizer.h.

Referenced by finalizeEvent(), and SiStripDigitizer().

◆ theAffectedAPVvector

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

Definition at line 108 of file SiStripDigitizer.h.

Referenced by finalizeEvent(), and initializeEvent().

◆ theDetIdList

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

Definition at line 103 of file SiStripDigitizer.h.

Referenced by finalizeEvent(), and initializeEvent().

◆ theDigiAlgo

std::unique_ptr<SiStripDigitizerAlgorithm> SiStripDigitizer::theDigiAlgo
private

◆ trackerContainers

const vstring SiStripDigitizer::trackerContainers
private

Definition at line 79 of file SiStripDigitizer.h.

Referenced by accumulate(), and SiStripDigitizer().

◆ useConfFromDB

const bool SiStripDigitizer::useConfFromDB
private

Definition at line 85 of file SiStripDigitizer.h.

Referenced by finalizeEvent(), and initializeEvent().

◆ VRDigi

const std::string SiStripDigitizer::VRDigi
private

Definition at line 82 of file SiStripDigitizer.h.

Referenced by finalizeEvent(), and SiStripDigitizer().

◆ zeroSuppression

const bool SiStripDigitizer::zeroSuppression
private

Definition at line 86 of file SiStripDigitizer.h.

Referenced by finalizeEvent().

◆ ZSDigi

const std::string SiStripDigitizer::ZSDigi
private

Definition at line 80 of file SiStripDigitizer.h.

Referenced by finalizeEvent(), and SiStripDigitizer().

Vector3DBase
Definition: Vector3DBase.h:8
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
edm::DetSetVector< SiStripDigi >
edm::RandomNumberGenerator::getEngine
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
MagneticField::inTesla
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
SiStripDigitizer::PRDigi
const std::string PRDigi
Definition: SiStripDigitizer.h:83
SiStripDigitizer::geometryType
const std::string geometryType
Definition: SiStripDigitizer.h:84
edm::Handle::product
T const * product() const
Definition: Handle.h:70
edm::DetSet< SiStripDigi >
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:72
SiStripDigitizer::makeDigiSimLinks_
const bool makeDigiSimLinks_
Definition: SiStripDigitizer.h:87
TrackerTopology
Definition: TrackerTopology.h:16
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89281
SiStripDigitizer::crossingSimHitIndexOffset_
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.
Definition: SiStripDigitizer.h:100
cms::cuda::assert
assert(be >=bs)
FastTrackerRecHitCombiner_cfi.simHits
simHits
Definition: FastTrackerRecHitCombiner_cfi.py:5
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
SiStripApvSimulationParametersRcd
Definition: SiStripCondDataRecords.h:58
edm::Handle
Definition: AssociativeIterator.h:50
edm::Service::isAvailable
bool isAvailable() const
Definition: Service.h:40
SiStripPedestalsRcd
Definition: SiStripCondDataRecords.h:43
SiStripNoisesRcd
Definition: SiStripCondDataRecords.h:40
SiStripDigitizer::gainLabel
const std::string gainLabel
Definition: SiStripDigitizer.h:77
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
SiStripDigitizer::pSetup
edm::ESHandle< MagneticField > pSetup
Definition: SiStripDigitizer.h:105
DetId
Definition: DetId.h:17
SiStripDigitizer::pDD
edm::ESHandle< TrackerGeometry > pDD
Definition: SiStripDigitizer.h:104
SiStripDigitizer::ZSDigi
const std::string ZSDigi
Definition: SiStripDigitizer.h:80
SiStripDigitizer::theAffectedAPVvector
std::vector< std::pair< int, std::bitset< 6 > > > theAffectedAPVvector
Definition: SiStripDigitizer.h:108
HLTEgPhaseIITestSequence_cff.bunchSpacing
bunchSpacing
Definition: HLTEgPhaseIITestSequence_cff.py:1574
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
TrackerGeometry::detUnits
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
Definition: TrackerGeometry.h:61
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:15
edm::ESHandle< TrackerTopology >
SiStripDigitizer::theDigiAlgo
std::unique_ptr< SiStripDigitizerAlgorithm > theDigiAlgo
Definition: SiStripDigitizer.h:102
SiStripDigitizer::VRDigi
const std::string VRDigi
Definition: SiStripDigitizer.h:82
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
SiStripDetCablingRcd
Definition: SiStripDependentRecords.h:19
SiStripDigitizer::hitsProducer
const std::string hitsProducer
Definition: SiStripDigitizer.h:78
SiStripThresholdRcd
Definition: SiStripCondDataRecords.h:50
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
edm::ParameterSet
Definition: ParameterSet.h:47
SiStripDigitizer::fracOfEventsToSimAPV_
const double fracOfEventsToSimAPV_
Whether or not to create the association to sim truth collection. Set in configuration.
Definition: SiStripDigitizer.h:89
gainCalibHelper::gainCalibPI::type
type
Definition: SiPixelGainCalibHelper.h:40
edm::Service< edm::RandomNumberGenerator >
iEvent
int iEvent
Definition: GenABIO.cc:224
genPUProtons_cfi.bunchCrossingList
bunchCrossingList
Definition: genPUProtons_cfi.py:5
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
SiStripDigitizer::randomEngine_
CLHEP::HepRandomEngine * randomEngine_
Definition: SiStripDigitizer.h:107
SiStripDigitizer::useConfFromDB
const bool useConfFromDB
Definition: SiStripDigitizer.h:85
edm::ProducesCollector::produces
ProductRegistryHelper::BranchAliasSetterT< ProductType > produces()
Definition: ProducesCollector.h:52
SiStripDigitizer::trackerContainers
const vstring trackerContainers
Definition: SiStripDigitizer.h:79
get
#define get
SiStripDigitizer::PileupInfo_
std::unique_ptr< PileupMixingContent > PileupInfo_
Definition: SiStripDigitizer.h:110
SiStripDigitizer::SCDigi
const std::string SCDigi
Definition: SiStripDigitizer.h:81
eostools.move
def move(src, dest)
Definition: eostools.py:511
SiStripDigitizer::accumulateStripHits
void accumulateStripHits(edm::Handle< std::vector< PSimHit >>, const TrackerTopology *tTopo, size_t globalSimHitIndex, const unsigned int tofBin)
Definition: SiStripDigitizer.cc:108
SiStripOfflineCRack_cfg.alias
alias
Definition: SiStripOfflineCRack_cfg.py:128
Exception
Definition: hltDiff.cc:245
SiStripDigitizer::includeAPVSimulation_
const bool includeAPVSimulation_
Definition: SiStripDigitizer.h:88
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
SiStripGainSimRcd
Definition: SiStripDependentRecords.h:32
SiStripDigitizer::zeroSuppression
const bool zeroSuppression
Definition: SiStripDigitizer.h:86
TrackerTopologyRcd
Definition: TrackerTopologyRcd.h:10
SiStripDigitizer::detectorUnits
std::map< unsigned int, StripGeomDetUnit const * > detectorUnits
Definition: SiStripDigitizer.h:106
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
SiStripDetCabling::addConnected
void addConnected(std::map< uint32_t, std::vector< int >> &) const
Definition: SiStripDetCabling.cc:227
edm::InputTag
Definition: InputTag.h:15
GeomDetEnumerators::isTrackerStrip
bool isTrackerStrip(GeomDetEnumerators::SubDetector m)
Definition: GeomDetEnumerators.cc:64
SiStripDigitizer::theDetIdList
std::map< uint32_t, std::vector< int > > theDetIdList
Definition: SiStripDigitizer.h:103