CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
cms::SiPixelDigitizer Class Reference

#include <SiPixelDigitizer.h>

Inheritance diagram for cms::SiPixelDigitizer:
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
 
virtual void beginJob ()
 
void finalizeEvent (edm::Event &e, edm::EventSetup const &c) override
 
PileupMixingContentgetEventPileupInfo () override
 
void initializeEvent (edm::Event const &e, edm::EventSetup const &c) override
 
 SiPixelDigitizer (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
 
 ~SiPixelDigitizer () 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 ()
 
 DigiAccumulatorMixMod (DigiAccumulatorMixMod const &)=delete
 
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)
 
DigiAccumulatorMixMod const & operator= (DigiAccumulatorMixMod const &)=delete
 
virtual ~DigiAccumulatorMixMod ()
 

Private Types

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

Private Member Functions

void accumulatePixelHits (edm::Handle< std::vector< PSimHit > >, size_t globalSimHitIndex, const unsigned int tofBin, edm::EventSetup const &c)
 

Private Attributes

std::unique_ptr< SiPixelDigitizerAlgorithm_pixeldigialgo
 
bool applyLateReweighting_
 
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, PixelGeomDetUnit const * > detectorUnits
 
bool firstFinalizeEvent_
 
bool firstInitializeEvent_
 
const std::string hitsProducer
 
bool makeDigiSimLinks_
 
const int NumberOfEndcapDisks
 
const TrackerGeometrypDD = nullptr
 
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordpDDToken_
 
std::unique_ptr< PileupMixingContentPileupInfo_
 
const bool pilotBlades
 
const MagneticFieldpSetup = nullptr
 
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecordpSetupToken_
 
CLHEP::HepRandomEngine * randomEngine_ = nullptr
 
const bool store_SimHitEntryExitPoints_
 
const vstring trackerContainers
 
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtTopoToken_
 

Detailed Description

Definition at line 44 of file SiPixelDigitizer.h.

Member Typedef Documentation

◆ vstring

typedef std::vector<std::string> cms::SiPixelDigitizer::vstring
private

Definition at line 90 of file SiPixelDigitizer.h.

Constructor & Destructor Documentation

◆ SiPixelDigitizer()

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

Definition at line 82 of file SiPixelDigitizer.cc.

References _pixeldigialgo, SiStripOfflineCRack_cfg::alias, applyLateReweighting_, edm::ConsumesCollector::consumes(), Exception, hitsProducer, ProducerED_cfi::InputTag, edm::Service< T >::isAvailable(), NumberOfEndcapDisks, edm::ProducesCollector::produces(), store_SimHitEntryExitPoints_, AlCaHLTBitMon_QueryRunRegistry::string, makeGlobalPositionRcd_cfg::tag, and trackerContainers.

85  : firstInitializeEvent_(true),
86  firstFinalizeEvent_(true),
88  iConfig.exists("applyLateReweighting") ? iConfig.getParameter<bool>("applyLateReweighting") : false),
89  store_SimHitEntryExitPoints_(iConfig.exists("store_SimHitEntryExitPoints")
90  ? iConfig.getParameter<bool>("store_SimHitEntryExitPoints")
91  : false),
93  hitsProducer(iConfig.getParameter<std::string>("hitsProducer")),
94  trackerContainers(iConfig.getParameter<std::vector<std::string> >("RoutList")),
95  pilotBlades(iConfig.exists("enablePilotBlades") ? iConfig.getParameter<bool>("enablePilotBlades") : false),
96  NumberOfEndcapDisks(iConfig.exists("NumPixelEndcap") ? iConfig.getParameter<int>("NumPixelEndcap") : 2),
97  tTopoToken_(iC.esConsumes()),
98  pDDToken_(iC.esConsumes(edm::ESInputTag("", iConfig.getParameter<std::string>("PixGeometryType")))),
99  pSetupToken_(iC.esConsumes()) {
100  edm::LogInfo("PixelDigitizer ") << "Enter the Pixel Digitizer";
101 
102  edm::LogInfo("PixelDigitizer ") << " applyLateReweighting_ " << applyLateReweighting_;
103 
104  const std::string alias("simSiPixelDigis");
105 
106  producesCollector.produces<edm::DetSetVector<PixelDigi> >().setBranchAlias(alias);
107  producesCollector.produces<edm::DetSetVector<PixelDigiSimLink> >().setBranchAlias(alias + "siPixelDigiSimLink");
109  producesCollector.produces<edm::DetSetVector<PixelSimHitExtraInfo> >().setBranchAlias(alias +
110  "siPixelExtraSimHit");
111 
112  for (auto const& trackerContainer : trackerContainers) {
113  edm::InputTag tag(hitsProducer, trackerContainer);
114  iC.consumes<std::vector<PSimHit> >(edm::InputTag(hitsProducer, trackerContainer));
115  }
117  if (!rng.isAvailable()) {
118  throw cms::Exception("Configuration")
119  << "SiPixelDigitizer requires the RandomNumberGeneratorService\n"
120  "which is not present in the configuration file. You must add the service\n"
121  "in the configuration file or remove the modules that require it.";
122  }
123 
124  _pixeldigialgo = std::make_unique<SiPixelDigitizerAlgorithm>(iConfig, iC);
125  if (NumberOfEndcapDisks != 2)
126  producesCollector.produces<PixelFEDChannelCollection>();
127  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
ProductRegistryHelper::BranchAliasSetterT< ProductType > produces()
const std::string hitsProducer
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > pDDToken_
std::unique_ptr< SiPixelDigitizerAlgorithm > _pixeldigialgo
const bool store_SimHitEntryExitPoints_
Log< level::Info, false > LogInfo
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > pSetupToken_
const vstring trackerContainers
bool isAvailable() const
Definition: Service.h:40

◆ ~SiPixelDigitizer()

SiPixelDigitizer::~SiPixelDigitizer ( )
override

Definition at line 129 of file SiPixelDigitizer.cc.

129 { edm::LogInfo("PixelDigitizer ") << "Destruct the Pixel Digitizer"; }
Log< level::Info, false > LogInfo

Member Function Documentation

◆ accumulate() [1/2]

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

Implements DigiAccumulatorMixMod.

Definition at line 213 of file SiPixelDigitizer.cc.

References accumulatePixelHits(), crossingSimHitIndexOffset_, PixelDigiSimLink::HighTof, hitsProducer, mps_fire::i, iEvent, PixelDigiSimLink::LowTof, FastTrackerRecHitCombiner_cfi::simHits, AlCaHLTBitMon_QueryRunRegistry::string, makeGlobalPositionRcd_cfg::tag, and trackerContainers.

213  {
214  // Step A: Get Inputs
215  for (vstring::const_iterator i = trackerContainers.begin(), iEnd = trackerContainers.end(); i != iEnd; ++i) {
218 
219  iEvent.getByLabel(tag, simHits);
220  unsigned int tofBin = PixelDigiSimLink::LowTof;
221  if ((*i).find(std::string("HighTof")) != std::string::npos)
222  tofBin = PixelDigiSimLink::HighTof;
223  accumulatePixelHits(simHits, crossingSimHitIndexOffset_[tag.encode()], tofBin, iSetup);
224  // Now that the hits have been processed, I'll add the amount of hits in this crossing on to
225  // the global counter. Next time accumulateStripHits() is called it will count the sim hits
226  // as though they were on the end of this collection.
227  // Note that this is only used for creating digi-sim links (if configured to do so).
228  // std::cout << "index offset, current hit count = " << crossingSimHitIndexOffset_[tag.encode()] << ", " << simHits->size() << std::endl;
229  if (simHits.isValid())
230  crossingSimHitIndexOffset_[tag.encode()] += simHits->size();
231  }
232  }
const std::string hitsProducer
int iEvent
Definition: GenABIO.cc:224
void accumulatePixelHits(edm::Handle< std::vector< PSimHit > >, size_t globalSimHitIndex, const unsigned int tofBin, edm::EventSetup const &c)
const vstring trackerContainers
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. ...

◆ accumulate() [2/2]

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

Implements DigiAccumulatorMixMod.

Definition at line 234 of file SiPixelDigitizer.cc.

References accumulatePixelHits(), crossingSimHitIndexOffset_, PixelDigiSimLink::HighTof, hitsProducer, mps_fire::i, iEvent, PixelDigiSimLink::LowTof, FastTrackerRecHitCombiner_cfi::simHits, AlCaHLTBitMon_QueryRunRegistry::string, makeGlobalPositionRcd_cfg::tag, and trackerContainers.

236  {
237  // Step A: Get Inputs
238  for (vstring::const_iterator i = trackerContainers.begin(), iEnd = trackerContainers.end(); i != iEnd; ++i) {
241 
242  iEvent.getByLabel(tag, simHits);
243  unsigned int tofBin = PixelDigiSimLink::LowTof;
244  if ((*i).find(std::string("HighTof")) != std::string::npos)
245  tofBin = PixelDigiSimLink::HighTof;
246  accumulatePixelHits(simHits, crossingSimHitIndexOffset_[tag.encode()], tofBin, iSetup);
247  // Now that the hits have been processed, I'll add the amount of hits in this crossing on to
248  // the global counter. Next time accumulateStripHits() is called it will count the sim hits
249  // as though they were on the end of this collection.
250  // Note that this is only used for creating digi-sim links (if configured to do so).
251  // std::cout << "index offset, current hit count = " << crossingSimHitIndexOffset_[tag.encode()] << ", " << simHits->size() << std::endl;
252  if (simHits.isValid())
253  crossingSimHitIndexOffset_[tag.encode()] += simHits->size();
254  }
255  }
const std::string hitsProducer
int iEvent
Definition: GenABIO.cc:224
void accumulatePixelHits(edm::Handle< std::vector< PSimHit > >, size_t globalSimHitIndex, const unsigned int tofBin, edm::EventSetup const &c)
const vstring trackerContainers
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. ...

◆ accumulatePixelHits()

void SiPixelDigitizer::accumulatePixelHits ( edm::Handle< std::vector< PSimHit > >  hSimHits,
size_t  globalSimHitIndex,
const unsigned int  tofBin,
edm::EventSetup const &  c 
)
private

Definition at line 135 of file SiPixelDigitizer.cc.

References _pixeldigialgo, cms::cuda::assert(), detectorUnits, hcalRecHitTable_cff::detId, edm::EventSetup::getData(), MagneticField::inTesla(), GeomDetEnumerators::isTrackerPixel(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, LogDebug, pSetup, randomEngine_, FastTrackerRecHitCombiner_cfi::simHits, and tTopoToken_.

Referenced by accumulate().

138  {
139  if (hSimHits.isValid()) {
140  std::set<unsigned int> detIds;
141  std::vector<PSimHit> const& simHits = *hSimHits.product();
142  const TrackerTopology* tTopo = &iSetup.getData(tTopoToken_);
143  _pixeldigialgo->fillSimHitMaps(simHits, tofBin);
144  for (std::vector<PSimHit>::const_iterator it = simHits.begin(), itEnd = simHits.end(); it != itEnd;
145  ++it, ++globalSimHitIndex) {
146  unsigned int detId = (*it).detUnitId();
147  if (detIds.insert(detId).second) {
148  // The insert succeeded, so this detector element has not yet been processed.
150  if (detectorUnits[detId] &&
152  ->type()
153  .isTrackerPixel()) { // this test could be avoided and changed into a check of pixdet!=0
154  std::map<unsigned int, PixelGeomDetUnit const*>::iterator itDet = detectorUnits.find(detId);
155  if (itDet == detectorUnits.end())
156  continue;
157  auto pixdet = itDet->second;
158  assert(pixdet != nullptr);
159  //access to magnetic field in global coordinates
160  GlobalVector bfield = pSetup->inTesla(pixdet->surface().position());
161  LogDebug("PixelDigitizer ") << "B-field(T) at " << pixdet->surface().position()
162  << "(cm): " << pSetup->inTesla(pixdet->surface().position());
163  _pixeldigialgo->accumulateSimHits(
164  it, itEnd, globalSimHitIndex, tofBin, pixdet, bfield, tTopo, randomEngine_);
165  }
166  }
167  }
168  }
169  }
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
const MagneticField * pSetup
T const * product() const
Definition: Handle.h:70
assert(be >=bs)
std::map< unsigned int, PixelGeomDetUnit const * > detectorUnits
std::unique_ptr< SiPixelDigitizerAlgorithm > _pixeldigialgo
CLHEP::HepRandomEngine * randomEngine_
bool isValid() const
Definition: HandleBase.h:70
bool isTrackerPixel(GeomDetEnumerators::SubDetector m)
#define LogDebug(id)

◆ beginJob()

virtual void cms::SiPixelDigitizer::beginJob ( void  )
inlinevirtual

Definition at line 55 of file SiPixelDigitizer.h.

55 {}

◆ finalizeEvent()

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

Implements DigiAccumulatorMixMod.

Definition at line 258 of file SiPixelDigitizer.cc.

References _pixeldigialgo, applyLateReweighting_, edm::DetSet< T >::begin(), TrackerGeometry::detUnits(), edm::DetSet< T >::empty(), edm::DetSet< T >::end(), Exception, firstFinalizeEvent_, edm::EventSetup::getData(), iEvent, eostools::move(), convertSQLitetoXML_cfg::output, pDD, PileupInfo_, randomEngine_, store_SimHitEntryExitPoints_, and tTopoToken_.

258  {
259  const TrackerTopology* tTopo = &iSetup.getData(tTopoToken_);
260 
261  std::vector<edm::DetSet<PixelDigi> > theDigiVector;
262  std::vector<edm::DetSet<PixelDigiSimLink> > theDigiLinkVector;
263  std::vector<edm::DetSet<PixelSimHitExtraInfo> > theExtraSimHitInfoVector;
264 
265  if (firstFinalizeEvent_) {
266  _pixeldigialgo->init_DynIneffDB(iSetup);
267  firstFinalizeEvent_ = false;
268  }
269  _pixeldigialgo->calculateInstlumiFactor(PileupInfo_.get());
270 
271  if (_pixeldigialgo->killBadFEDChannels()) {
272  std::unique_ptr<PixelFEDChannelCollection> PixelFEDChannelCollection_ =
273  _pixeldigialgo->chooseScenario(PileupInfo_.get(), randomEngine_);
274  if (PixelFEDChannelCollection_ == nullptr) {
275  throw cms::Exception("NullPointerError") << "PixelFEDChannelCollection not set in chooseScenario function.\n";
276  }
277  iEvent.put(std::move(PixelFEDChannelCollection_));
278  }
279 
280  for (const auto& iu : pDD->detUnits()) {
281  if (iu->type().isTrackerPixel()) {
282  //
283 
284  edm::DetSet<PixelDigi> collector(iu->geographicalId().rawId());
285  edm::DetSet<PixelDigiSimLink> linkcollector(iu->geographicalId().rawId());
286  std::vector<PixelDigiAddTempInfo> tempcollector;
287  edm::DetSet<PixelSimHitExtraInfo> tempSHcollector(iu->geographicalId().rawId());
288 
289  _pixeldigialgo->digitize(dynamic_cast<const PixelGeomDetUnit*>(iu),
290  collector.data,
291  linkcollector.data,
292  tempcollector,
293  tTopo,
294  randomEngine_);
295 
296  // transformation of the tempcollector (October 15, 2021)
297  if (!tempcollector.empty()) {
298  std::vector<PixelDigiAddTempInfo>::const_iterator loopNewClass;
299  unsigned int channelPrevious2 = -1;
300  size_t hitFirstOne2 = -1;
301  for (loopNewClass = tempcollector.begin(); loopNewClass != tempcollector.end(); ++loopNewClass) {
302  // check if the new SimHit already exists in the class
303  // if yes : add only the Digi info to the existing entry
304  // if not : create a new entry
305  // PixelSimHitExtraInfo(
306  // size_t Hindex, Local3DPoint entryP , Local3DPoint exitP, uint32_t detID, std::vector<unsigned int> ch, std::vector<float> InitCharge)
307  // what about the duplicates : 2 SimHits associated to the same Digis ?
308  //
309  //
310 
311  bool checkTwoSimHits = false;
312  if (channelPrevious2 == loopNewClass->channel() && hitFirstOne2 != loopNewClass->hitIndex()) {
313  // case of one Digi associated to a second SimHit
314  checkTwoSimHits = true;
315  } else {
316  channelPrevious2 = loopNewClass->channel();
317  hitFirstOne2 = loopNewClass->hitIndex();
318  }
319 
320  bool checkInTheList = false;
321  if (!checkTwoSimHits) {
322  std::vector<PixelSimHitExtraInfo>::iterator loopTempSH;
323  for (loopTempSH = tempSHcollector.begin(); loopTempSH != tempSHcollector.end(); ++loopTempSH) {
324  if (loopNewClass->hitIndex() == loopTempSH->hitIndex()) {
325  checkInTheList = true;
326  loopTempSH->addDigiInfo(loopNewClass->channel());
327  }
328  }
329  if (!checkInTheList) {
330  PixelSimHitExtraInfo newSHEntry(loopNewClass->hitIndex(),
331  loopNewClass->entryPoint(),
332  loopNewClass->exitPoint(),
333  loopNewClass->channel());
334  tempSHcollector.push_back(newSHEntry);
335  }
336  }
337  }
338  }
339 
340  if (applyLateReweighting_) {
341  // if applyLateReweighting_ is true, the charge reweighting has to be applied on top of the digis
342  _pixeldigialgo->lateSignalReweight(
343  dynamic_cast<const PixelGeomDetUnit*>(iu), collector.data, tempSHcollector.data, tTopo, randomEngine_);
344  }
345 
346  if (!collector.data.empty()) {
347  theDigiVector.push_back(std::move(collector));
348  }
349  if (!linkcollector.data.empty()) {
350  theDigiLinkVector.push_back(std::move(linkcollector));
351  }
352  if (!tempSHcollector.data.empty()) {
353  theExtraSimHitInfoVector.push_back(std::move(tempSHcollector));
354  }
355  }
356  }
357  _pixeldigialgo->resetSimHitMaps();
358 
359  // Step C: create collection with the cache vector of DetSet
360  std::unique_ptr<edm::DetSetVector<PixelDigi> > output(new edm::DetSetVector<PixelDigi>(theDigiVector));
361  std::unique_ptr<edm::DetSetVector<PixelDigiSimLink> > outputlink(
362  new edm::DetSetVector<PixelDigiSimLink>(theDigiLinkVector));
363  std::unique_ptr<edm::DetSetVector<PixelSimHitExtraInfo> > outputExtraSim(
364  new edm::DetSetVector<PixelSimHitExtraInfo>(theExtraSimHitInfoVector));
365 
366  // Step D: write output to file
367  iEvent.put(std::move(output));
368  iEvent.put(std::move(outputlink));
370  iEvent.put(std::move(outputExtraSim));
371 
372  randomEngine_ = nullptr; // to prevent access outside event
373  }
iterator end()
Definition: DetSet.h:58
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
const TrackerGeometry * pDD
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
std::unique_ptr< PileupMixingContent > PileupInfo_
int iEvent
Definition: GenABIO.cc:224
std::unique_ptr< SiPixelDigitizerAlgorithm > _pixeldigialgo
const bool store_SimHitEntryExitPoints_
iterator begin()
Definition: DetSet.h:57
CLHEP::HepRandomEngine * randomEngine_
bool empty() const
Definition: DetSet.h:62
Definition: output.py:1
def move(src, dest)
Definition: eostools.py:511

◆ getEventPileupInfo()

PileupMixingContent* cms::SiPixelDigitizer::getEventPileupInfo ( )
inlineoverridevirtual

Reimplemented from DigiAccumulatorMixMod.

Definition at line 66 of file SiPixelDigitizer.h.

References PileupInfo_.

66 { return PileupInfo_.get(); }
std::unique_ptr< PileupMixingContent > PileupInfo_

◆ initializeEvent()

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

Implements DigiAccumulatorMixMod.

Definition at line 171 of file SiPixelDigitizer.cc.

References _pixeldigialgo, cms::cuda::assert(), crossingSimHitIndexOffset_, detectorUnits, hcalRecHitTable_cff::detId, TrackerGeometry::detUnits(), MillePedeFileConverter_cfg::e, firstInitializeEvent_, edm::EventSetup::getData(), edm::RandomNumberGenerator::getEngine(), TrackerTopology::layer(), NumberOfEndcapDisks, pDD, pDDToken_, pilotBlades, GeomDetEnumerators::PixelEndcap, pSetup, pSetupToken_, randomEngine_, and tTopoToken_.

171  {
172  if (firstInitializeEvent_) {
173  _pixeldigialgo->init(iSetup);
174  firstInitializeEvent_ = false;
175  }
176 
177  // Make sure that the first crossing processed starts indexing the sim hits from zero.
178  // This variable is used so that the sim hits from all crossing frames have sequential
179  // indices used to create the digi-sim link (if configured to do so) rather than starting
180  // from zero for each crossing.
182 
183  // Cache random number engine
185  randomEngine_ = &rng->getEngine(e.streamID());
186 
187  _pixeldigialgo->initializeEvent();
188  pDD = &iSetup.getData(pDDToken_);
189  pSetup = &iSetup.getData(pSetupToken_);
190  const TrackerTopology* tTopo = &iSetup.getData(tTopoToken_);
191 
192  // FIX THIS! We only need to clear and (re)fill this map when the geometry type IOV changes. Use ESWatcher to determine this.
193  if (true) { // Replace with ESWatcher
194  detectorUnits.clear();
195  for (const auto& iu : pDD->detUnits()) {
196  unsigned int detId = iu->geographicalId().rawId();
197  if (iu->type().isTrackerPixel()) {
198  auto pixdet = dynamic_cast<const PixelGeomDetUnit*>(iu);
199  assert(pixdet != nullptr);
200  if (iu->subDetector() ==
201  GeomDetEnumerators::SubDetector::PixelEndcap) { // true ONLY for the phase 0 pixel deetctor
202  unsigned int disk = tTopo->layer(detId); // using the generic layer method
203  //if using pilot blades, then allowing it for current detector only
204  if ((disk == 3) && ((!pilotBlades) && (NumberOfEndcapDisks == 2)))
205  continue;
206  }
207  detectorUnits.insert(std::make_pair(detId, pixdet));
208  }
209  }
210  }
211  }
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
const TrackerGeometry * pDD
const MagneticField * pSetup
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
assert(be >=bs)
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
unsigned int layer(const DetId &id) const
std::map< unsigned int, PixelGeomDetUnit const * > detectorUnits
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > pDDToken_
std::unique_ptr< SiPixelDigitizerAlgorithm > _pixeldigialgo
CLHEP::HepRandomEngine * randomEngine_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > pSetupToken_
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. ...

◆ StorePileupInformation()

void cms::SiPixelDigitizer::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 SiPixelDigitizer.h.

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

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

Member Data Documentation

◆ _pixeldigialgo

std::unique_ptr<SiPixelDigitizerAlgorithm> cms::SiPixelDigitizer::_pixeldigialgo
private

◆ applyLateReweighting_

bool cms::SiPixelDigitizer::applyLateReweighting_
private

Definition at line 76 of file SiPixelDigitizer.h.

Referenced by finalizeEvent(), and SiPixelDigitizer().

◆ crossingSimHitIndexOffset_

std::map<std::string, size_t> cms::SiPixelDigitizer::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 88 of file SiPixelDigitizer.h.

Referenced by accumulate(), and initializeEvent().

◆ detectorUnits

std::map<unsigned int, PixelGeomDetUnit const*> cms::SiPixelDigitizer::detectorUnits
private

Definition at line 95 of file SiPixelDigitizer.h.

Referenced by accumulatePixelHits(), and initializeEvent().

◆ firstFinalizeEvent_

bool cms::SiPixelDigitizer::firstFinalizeEvent_
private

Definition at line 75 of file SiPixelDigitizer.h.

Referenced by finalizeEvent().

◆ firstInitializeEvent_

bool cms::SiPixelDigitizer::firstInitializeEvent_
private

Definition at line 74 of file SiPixelDigitizer.h.

Referenced by initializeEvent().

◆ hitsProducer

const std::string cms::SiPixelDigitizer::hitsProducer
private

Definition at line 91 of file SiPixelDigitizer.h.

Referenced by accumulate(), and SiPixelDigitizer().

◆ makeDigiSimLinks_

bool cms::SiPixelDigitizer::makeDigiSimLinks_
private

Definition at line 78 of file SiPixelDigitizer.h.

◆ NumberOfEndcapDisks

const int cms::SiPixelDigitizer::NumberOfEndcapDisks
private

Definition at line 101 of file SiPixelDigitizer.h.

Referenced by initializeEvent(), and SiPixelDigitizer().

◆ pDD

const TrackerGeometry* cms::SiPixelDigitizer::pDD = nullptr
private

Definition at line 93 of file SiPixelDigitizer.h.

Referenced by finalizeEvent(), and initializeEvent().

◆ pDDToken_

const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> cms::SiPixelDigitizer::pDDToken_
private

Definition at line 104 of file SiPixelDigitizer.h.

Referenced by initializeEvent().

◆ PileupInfo_

std::unique_ptr<PileupMixingContent> cms::SiPixelDigitizer::PileupInfo_
private

Definition at line 98 of file SiPixelDigitizer.h.

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

◆ pilotBlades

const bool cms::SiPixelDigitizer::pilotBlades
private

Definition at line 100 of file SiPixelDigitizer.h.

Referenced by initializeEvent().

◆ pSetup

const MagneticField* cms::SiPixelDigitizer::pSetup = nullptr
private

Definition at line 94 of file SiPixelDigitizer.h.

Referenced by accumulatePixelHits(), and initializeEvent().

◆ pSetupToken_

const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> cms::SiPixelDigitizer::pSetupToken_
private

Definition at line 105 of file SiPixelDigitizer.h.

Referenced by initializeEvent().

◆ randomEngine_

CLHEP::HepRandomEngine* cms::SiPixelDigitizer::randomEngine_ = nullptr
private

Definition at line 96 of file SiPixelDigitizer.h.

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

◆ store_SimHitEntryExitPoints_

const bool cms::SiPixelDigitizer::store_SimHitEntryExitPoints_
private

Definition at line 77 of file SiPixelDigitizer.h.

Referenced by finalizeEvent(), and SiPixelDigitizer().

◆ trackerContainers

const vstring cms::SiPixelDigitizer::trackerContainers
private

Definition at line 92 of file SiPixelDigitizer.h.

Referenced by accumulate(), and SiPixelDigitizer().

◆ tTopoToken_

const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> cms::SiPixelDigitizer::tTopoToken_
private

Definition at line 103 of file SiPixelDigitizer.h.

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