CMS 3D CMS Logo

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

#include <Phase2TrackerDigitizer.h>

Inheritance diagram for cms::Phase2TrackerDigitizer:
DigiAccumulatorMixMod

Public Types

typedef std::unordered_map< unsigned, TrackerGeometry::ModuleTypeModuleTypeCache
 

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
 
template<class T >
void accumulate_local (T const &iEvent, edm::EventSetup const &iSetup)
 
virtual void beginJob ()
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &iSetup) override
 
void finalizeEvent (edm::Event &e, edm::EventSetup const &c) override
 
void initializeEvent (edm::Event const &e, edm::EventSetup const &c) override
 
void loadAccumulator (const std::map< unsigned int, std::map< int, float > > &accumulator)
 
 Phase2TrackerDigitizer (const edm::ParameterSet &iConfig, edm::ProducesCollector, edm::ConsumesCollector &iC)
 
 ~Phase2TrackerDigitizer () override
 
- Public Member Functions inherited from DigiAccumulatorMixMod
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

enum  AlgorithmType {
  AlgorithmType::InnerPixel, AlgorithmType::PixelinPS, AlgorithmType::StripinPS, AlgorithmType::TwoStrip,
  AlgorithmType::Unknown
}
 
using vstring = std::vector< std::string >
 

Private Member Functions

void accumulatePixelHits (edm::Handle< std::vector< PSimHit > >, size_t globalSimHitIndex, const unsigned int tofBin)
 
template<typename DigiType >
void addOuterTrackerCollection (edm::Event &iEvent, const edm::EventSetup &iSetup)
 
void addPixelCollection (edm::Event &iEvent, const edm::EventSetup &iSetup, const bool ot_analog)
 
AlgorithmType getAlgoType (unsigned int idet)
 

Private Attributes

std::map< AlgorithmType, std::unique_ptr< Phase2TrackerDigitizerAlgorithm > > algomap_
 
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, const Phase2TrackerGeomDetUnit * > detectorUnits_
 
bool first_
 
const std::string geometryType_
 
const std::string hitsProducer_
 
const bool isOuterTrackerReadoutAnalog
 
const bool makeDigiSimLinks_
 
ModuleTypeCache moduleTypeCache_
 
edm::ESHandle< TrackerGeometrypDD_
 
const bool premixStage1_
 
edm::ESHandle< MagneticFieldpSetup_
 
edm::ESWatcher< TrackerDigiGeometryRecordtheTkDigiGeomWatcher
 
const vstring trackerContainers_
 
edm::ESHandle< TrackerTopologytTopoHand
 

Detailed Description

Definition at line 50 of file Phase2TrackerDigitizer.h.

Member Typedef Documentation

Definition at line 52 of file Phase2TrackerDigitizer.h.

using cms::Phase2TrackerDigitizer::vstring = std::vector<std::string>
private

Definition at line 72 of file Phase2TrackerDigitizer.h.

Member Enumeration Documentation

Enumerator
InnerPixel 
PixelinPS 
StripinPS 
TwoStrip 
Unknown 

Definition at line 75 of file Phase2TrackerDigitizer.h.

75 { InnerPixel, PixelinPS, StripinPS, TwoStrip, Unknown };

Constructor & Destructor Documentation

cms::Phase2TrackerDigitizer::Phase2TrackerDigitizer ( const edm::ParameterSet iConfig,
edm::ProducesCollector  producesCollector,
edm::ConsumesCollector iC 
)
explicit

Definition at line 79 of file Phase2TrackerDigitizer.cc.

References algomap_, edm::ParameterSet::getParameter(), InnerPixel, makeDigiSimLinks_, PixelinPS, premixStage1_, edm::ProducesCollector::produces(), AlCaHLTBitMon_QueryRunRegistry::string, StripinPS, and TwoStrip.

82  : first_(true),
83  hitsProducer_(iConfig.getParameter<std::string>("hitsProducer")),
84  trackerContainers_(iConfig.getParameter<std::vector<std::string> >("ROUList")),
85  geometryType_(iConfig.getParameter<std::string>("GeometryType")),
86  isOuterTrackerReadoutAnalog(iConfig.getParameter<bool>("isOTreadoutAnalog")),
87  premixStage1_(iConfig.getParameter<bool>("premixStage1")),
89  iConfig.getParameter<edm::ParameterSet>("AlgorithmCommon").getUntrackedParameter<bool>("makeDigiSimLinks")) {
90  //edm::LogInfo("Phase2TrackerDigitizer") << "Initialize Digitizer Algorithms";
91  const std::string alias1("simSiPixelDigis");
92  producesCollector.produces<edm::DetSetVector<PixelDigi> >("Pixel").setBranchAlias(alias1);
93  if (makeDigiSimLinks_) {
94  producesCollector.produces<edm::DetSetVector<PixelDigiSimLink> >("Pixel").setBranchAlias(alias1);
95  }
96 
97  if (!iConfig.getParameter<bool>("isOTreadoutAnalog")) {
98  const std::string alias2("simSiTrackerDigis");
99  if (premixStage1_) {
100  // Premixing exploits the ADC field of PixelDigi to store the collected charge
101  // But we still want everything else to be treated like for Phase2TrackerDigi
102  producesCollector.produces<edm::DetSetVector<PixelDigi> >("Tracker").setBranchAlias(alias2);
103  } else {
104  producesCollector.produces<edm::DetSetVector<Phase2TrackerDigi> >("Tracker").setBranchAlias(alias2);
105  }
106  if (makeDigiSimLinks_) {
107  producesCollector.produces<edm::DetSetVector<PixelDigiSimLink> >("Tracker").setBranchAlias(alias2);
108  }
109  }
110  // creating algorithm objects and pushing them into the map
111  algomap_[AlgorithmType::InnerPixel] = std::make_unique<PixelDigitizerAlgorithm>(iConfig);
112  algomap_[AlgorithmType::PixelinPS] = std::make_unique<PSPDigitizerAlgorithm>(iConfig);
113  algomap_[AlgorithmType::StripinPS] = std::make_unique<PSSDigitizerAlgorithm>(iConfig);
114  algomap_[AlgorithmType::TwoStrip] = std::make_unique<SSDigitizerAlgorithm>(iConfig);
115  }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
ProductRegistryHelper::BranchAliasSetterT< ProductType > produces()
std::map< AlgorithmType, std::unique_ptr< Phase2TrackerDigitizerAlgorithm > > algomap_
cms::Phase2TrackerDigitizer::~Phase2TrackerDigitizer ( )
override

Definition at line 138 of file Phase2TrackerDigitizer.cc.

138 {}

Member Function Documentation

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

Implements DigiAccumulatorMixMod.

Definition at line 191 of file Phase2TrackerDigitizer.cc.

References iEvent.

191  {
192  accumulate_local<edm::Event>(iEvent, iSetup);
193  }
int iEvent
Definition: GenABIO.cc:224
void cms::Phase2TrackerDigitizer::accumulate ( PileUpEventPrincipal const &  e,
edm::EventSetup const &  c,
edm::StreamID const &   
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 195 of file Phase2TrackerDigitizer.cc.

References iEvent.

197  {
198  accumulate_local<PileUpEventPrincipal>(iEvent, iSetup);
199  }
int iEvent
Definition: GenABIO.cc:224
template<class T >
void cms::Phase2TrackerDigitizer::accumulate_local ( T const &  iEvent,
edm::EventSetup const &  iSetup 
)

Definition at line 202 of file Phase2TrackerDigitizer.cc.

References accumulatePixelHits(), crossingSimHitIndexOffset_, edm::InputTag::encode(), PixelDigiSimLink::HighTof, hitsProducer_, edm::HandleBase::isValid(), PixelDigiSimLink::LowTof, FastTrackerRecHitCombiner_cfi::simHits, AlCaHLTBitMon_QueryRunRegistry::string, GlobalPosition_Frontier_DevDB_cff::tag, trackerContainers_, and findQualityFiles::v.

202  {
203  for (auto const& v : trackerContainers_) {
206  iEvent.getByLabel(tag, simHits);
207 
208  //edm::EDGetTokenT< std::vector<PSimHit> > simHitToken_(consumes< std::vector<PSimHit>(tag));
209  //iEvent.getByToken(simHitToken_, simHits);
210 
211  unsigned int tofBin = PixelDigiSimLink::LowTof;
212  if (v.find(std::string("HighTof")) != std::string::npos)
213  tofBin = PixelDigiSimLink::HighTof;
214  accumulatePixelHits(simHits, crossingSimHitIndexOffset_[tag.encode()], tofBin);
215  // Now that the hits have been processed, I'll add the amount of hits in this crossing on to
216  // the global counter. Next time accumulateStripHits() is called it will count the sim hits
217  // as though they were on the end of this collection.
218  // Note that this is only used for creating digi-sim links (if configured to do so).
219  if (simHits.isValid())
220  crossingSimHitIndexOffset_[tag.encode()] += simHits->size();
221  }
222  }
void accumulatePixelHits(edm::Handle< std::vector< PSimHit > >, size_t globalSimHitIndex, const unsigned int tofBin)
int iEvent
Definition: GenABIO.cc:224
bool isValid() const
Definition: HandleBase.h:70
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. ...
void cms::Phase2TrackerDigitizer::accumulatePixelHits ( edm::Handle< std::vector< PSimHit > >  hSimHits,
size_t  globalSimHitIndex,
const unsigned int  tofBin 
)
private

Definition at line 139 of file Phase2TrackerDigitizer.cc.

References algomap_, detectorUnits_, getAlgoType(), MagneticField::inTesla(), LogDebug, GloballyPositioned< T >::position(), pSetup_, FastTrackerRecHitCombiner_cfi::simHits, and GeomDet::surface().

Referenced by accumulate_local().

141  {
142  if (hSimHits.isValid()) {
143  std::set<unsigned int> detIds;
144  std::vector<PSimHit> const& simHits = *hSimHits.product();
145  int indx = 0;
146  for (auto it = simHits.begin(), itEnd = simHits.end(); it != itEnd; ++it, ++globalSimHitIndex) {
147  unsigned int detId_raw = (*it).detUnitId();
148  if (detectorUnits_.find(detId_raw) == detectorUnits_.end())
149  continue;
150  if (detIds.insert(detId_raw).second) {
151  // The insert succeeded, so this detector element has not yet been processed.
152  AlgorithmType algotype = getAlgoType(detId_raw);
153  const Phase2TrackerGeomDetUnit* phase2det = detectorUnits_[detId_raw];
154  // access to magnetic field in global coordinates
155  GlobalVector bfield = pSetup_->inTesla(phase2det->surface().position());
156  LogDebug("PixelDigitizer") << "B-field(T) at " << phase2det->surface().position()
157  << "(cm): " << pSetup_->inTesla(phase2det->surface().position());
158  if (algomap_.find(algotype) != algomap_.end()) {
159  algomap_[algotype]->accumulateSimHits(it, itEnd, globalSimHitIndex, tofBin, phase2det, bfield);
160  } else
161  edm::LogInfo("Phase2TrackerDigitizer") << "Unsupported algorithm: ";
162  }
163  indx++;
164  }
165  }
166  }
#define LogDebug(id)
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
std::map< unsigned int, const Phase2TrackerGeomDetUnit * > detectorUnits_
bool isValid() const
Definition: HandleBase.h:70
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
T const * product() const
Definition: Handle.h:69
AlgorithmType getAlgoType(unsigned int idet)
edm::ESHandle< MagneticField > pSetup_
std::map< AlgorithmType, std::unique_ptr< Phase2TrackerDigitizerAlgorithm > > algomap_
const PositionType & position() const
template<typename DigiType >
void cms::Phase2TrackerDigitizer::addOuterTrackerCollection ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
private

Definition at line 355 of file Phase2TrackerDigitizer.cc.

References algomap_, DEFINE_DIGI_ACCUMULATOR, TrackerGeometry::detUnits(), getAlgoType(), info(), InnerPixel, makeDigiSimLinks_, eostools::move(), convertSQLitetoXML_cfg::output, pDD_, edm::ESHandle< T >::product(), edm::Event::put(), DigitizerUtility::DigiSimInfo::simInfoList, and tTopoHand.

355  {
356  const TrackerTopology* tTopo = tTopoHand.product();
357  std::vector<edm::DetSet<DigiType> > digiVector;
358  std::vector<edm::DetSet<PixelDigiSimLink> > digiLinkVector;
359  for (auto const& det_u : pDD_->detUnits()) {
360  DetId detId_raw = DetId(det_u->geographicalId().rawId());
361  AlgorithmType algotype = getAlgoType(detId_raw);
362 
363  if (algomap_.find(algotype) == algomap_.end() || algotype == AlgorithmType::InnerPixel)
364  continue;
365 
366  std::map<int, DigitizerUtility::DigiSimInfo> digi_map;
367  algomap_[algotype]->digitize(dynamic_cast<const Phase2TrackerGeomDetUnit*>(det_u), digi_map, tTopo);
368  edm::DetSet<DigiType> collector(det_u->geographicalId().rawId());
369  edm::DetSet<PixelDigiSimLink> linkcollector(det_u->geographicalId().rawId());
370 
371  for (auto const& digi_p : digi_map) {
372  DigitizerUtility::DigiSimInfo info = digi_p.second;
373  addToCollector(collector, digi_p.first, info);
374  for (auto const& sim_p : info.simInfoList) {
375  linkcollector.data.emplace_back(digi_p.first,
376  sim_p.second->trackId(),
377  sim_p.second->hitIndex(),
378  sim_p.second->tofBin(),
379  sim_p.second->eventId(),
380  sim_p.first);
381  }
382  }
383 
384  if (!collector.data.empty())
385  digiVector.push_back(std::move(collector));
386  if (!linkcollector.data.empty())
387  digiLinkVector.push_back(std::move(linkcollector));
388  }
389 
390  // Step C: create collection with the cache vector of DetSet
391  std::unique_ptr<edm::DetSetVector<DigiType> > output(new edm::DetSetVector<DigiType>(digiVector));
392  std::unique_ptr<edm::DetSetVector<PixelDigiSimLink> > outputlink(
393  new edm::DetSetVector<PixelDigiSimLink>(digiLinkVector));
394 
395  // Step D: write output to file
396  iEvent.put(std::move(output), "Tracker");
397  if (makeDigiSimLinks_) {
398  iEvent.put(std::move(outputlink), "Tracker");
399  }
400  }
static const TGPicture * info(bool iBackgroundIsBlack)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
edm::ESHandle< TrackerTopology > tTopoHand
edm::ESHandle< TrackerGeometry > pDD_
Definition: DetId.h:17
AlgorithmType getAlgoType(unsigned int idet)
std::map< AlgorithmType, std::unique_ptr< Phase2TrackerDigitizerAlgorithm > > algomap_
std::vector< std::pair< float, SimHitInfoForLinks * > > simInfoList
T const * product() const
Definition: ESHandle.h:86
def move(src, dest)
Definition: eostools.py:511
void cms::Phase2TrackerDigitizer::addPixelCollection ( edm::Event iEvent,
const edm::EventSetup iSetup,
const bool  ot_analog 
)
private

Definition at line 287 of file Phase2TrackerDigitizer.cc.

References algomap_, Phase2TrackerDigi::channelToPixel(), PixelDigi::channelToPixel(), edm::DetSet< T >::data, TrackerGeometry::detUnits(), getAlgoType(), info(), InnerPixel, makeDigiSimLinks_, eostools::move(), DigitizerUtility::DigiSimInfo::ot_bit, convertSQLitetoXML_cfg::output, pDD_, edm::ESHandle< T >::product(), edm::Event::put(), DigitizerUtility::DigiSimInfo::sig_tot, DigitizerUtility::DigiSimInfo::simInfoList, and tTopoHand.

Referenced by finalizeEvent().

289  {
290  const TrackerTopology* tTopo = tTopoHand.product();
291  std::vector<edm::DetSet<PixelDigi> > digiVector;
292  std::vector<edm::DetSet<PixelDigiSimLink> > digiLinkVector;
293  for (auto const& det_u : pDD_->detUnits()) {
294  DetId detId_raw = DetId(det_u->geographicalId().rawId());
295  AlgorithmType algotype = getAlgoType(detId_raw);
296  if (algomap_.find(algotype) == algomap_.end())
297  continue;
298 
299  //Decide if we want analog readout for Outer Tracker.
300  if (!ot_analog && algotype != AlgorithmType::InnerPixel)
301  continue;
302  std::map<int, DigitizerUtility::DigiSimInfo> digi_map;
303  algomap_[algotype]->digitize(dynamic_cast<const Phase2TrackerGeomDetUnit*>(det_u), digi_map, tTopo);
304  edm::DetSet<PixelDigi> collector(det_u->geographicalId().rawId());
305  edm::DetSet<PixelDigiSimLink> linkcollector(det_u->geographicalId().rawId());
306  for (auto const& digi_p : digi_map) {
307  DigitizerUtility::DigiSimInfo info = digi_p.second;
308  std::pair<int, int> ip = PixelDigi::channelToPixel(digi_p.first);
309  collector.data.emplace_back(ip.first, ip.second, info.sig_tot);
310  for (auto const& sim_p : info.simInfoList) {
311  linkcollector.data.emplace_back(digi_p.first,
312  sim_p.second->trackId(),
313  sim_p.second->hitIndex(),
314  sim_p.second->tofBin(),
315  sim_p.second->eventId(),
316  sim_p.first);
317  }
318  }
319  if (!collector.data.empty())
320  digiVector.push_back(std::move(collector));
321  if (!linkcollector.data.empty())
322  digiLinkVector.push_back(std::move(linkcollector));
323  }
324 
325  // Step C: create collection with the cache vector of DetSet
326  std::unique_ptr<edm::DetSetVector<PixelDigi> > output(new edm::DetSetVector<PixelDigi>(digiVector));
327  std::unique_ptr<edm::DetSetVector<PixelDigiSimLink> > outputlink(
328  new edm::DetSetVector<PixelDigiSimLink>(digiLinkVector));
329 
330  // Step D: write output to file
331  iEvent.put(std::move(output), "Pixel");
332  if (makeDigiSimLinks_) {
333  iEvent.put(std::move(outputlink), "Pixel");
334  }
335  }
static const TGPicture * info(bool iBackgroundIsBlack)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
static std::pair< int, int > channelToPixel(int ch)
Definition: PixelDigi.h:65
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
edm::ESHandle< TrackerTopology > tTopoHand
edm::ESHandle< TrackerGeometry > pDD_
Definition: DetId.h:17
AlgorithmType getAlgoType(unsigned int idet)
std::map< AlgorithmType, std::unique_ptr< Phase2TrackerDigitizerAlgorithm > > algomap_
std::vector< std::pair< float, SimHitInfoForLinks * > > simInfoList
T const * product() const
Definition: ESHandle.h:86
def move(src, dest)
Definition: eostools.py:511
virtual void cms::Phase2TrackerDigitizer::beginJob ( void  )
inlinevirtual
void cms::Phase2TrackerDigitizer::beginLuminosityBlock ( edm::LuminosityBlock const &  lumi,
edm::EventSetup const &  iSetup 
)
overridevirtual

Reimplemented from DigiAccumulatorMixMod.

Definition at line 117 of file Phase2TrackerDigitizer.cc.

References edm::ESWatcher< T >::check(), detectorUnits_, TrackerGeometry::detUnits(), geometryType_, edm::EventSetup::get(), moduleTypeCache_, pDD_, pSetup_, theTkDigiGeomWatcher, align::Tracker, and tTopoHand.

Referenced by PreMixingPhase2TrackerWorker::beginLuminosityBlock().

117  {
118  iSetup.get<IdealMagneticFieldRecord>().get(pSetup_);
119  iSetup.get<TrackerTopologyRcd>().get(tTopoHand);
120 
121  if (theTkDigiGeomWatcher.check(iSetup)) {
122  iSetup.get<TrackerDigiGeometryRecord>().get(geometryType_, pDD_);
123  //reset cache
125  detectorUnits_.clear();
126  for (auto const& det_u : pDD_->detUnits()) {
127  unsigned int detId_raw = det_u->geographicalId().rawId();
128  DetId detId = DetId(detId_raw);
129  if (DetId(detId).det() == DetId::Detector::Tracker) {
130  const Phase2TrackerGeomDetUnit* pixdet = dynamic_cast<const Phase2TrackerGeomDetUnit*>(det_u);
131  assert(pixdet);
132  detectorUnits_.insert(std::make_pair(detId_raw, pixdet));
133  }
134  }
135  }
136  }
edm::ESWatcher< TrackerDigiGeometryRecord > theTkDigiGeomWatcher
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
std::unordered_map< unsigned, TrackerGeometry::ModuleType > ModuleTypeCache
std::map< unsigned int, const Phase2TrackerGeomDetUnit * > detectorUnits_
edm::ESHandle< TrackerTopology > tTopoHand
edm::ESHandle< TrackerGeometry > pDD_
Definition: DetId.h:17
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:52
edm::ESHandle< MagneticField > pSetup_
void cms::Phase2TrackerDigitizer::finalizeEvent ( edm::Event e,
edm::EventSetup const &  c 
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 233 of file Phase2TrackerDigitizer.cc.

References addPixelCollection(), iEvent, isOuterTrackerReadoutAnalog, and premixStage1_.

Referenced by PreMixingPhase2TrackerWorker::put().

233  {
234  //Decide if we want analog readout for Outer Tracker.
237  if (premixStage1_) {
238  addOuterTrackerCollection<PixelDigi>(iEvent, iSetup);
239  } else {
240  addOuterTrackerCollection<Phase2TrackerDigi>(iEvent, iSetup);
241  }
242  }
243  }
int iEvent
Definition: GenABIO.cc:224
void addPixelCollection(edm::Event &iEvent, const edm::EventSetup &iSetup, const bool ot_analog)
Phase2TrackerDigitizer::AlgorithmType cms::Phase2TrackerDigitizer::getAlgoType ( unsigned int  idet)
private

Definition at line 244 of file Phase2TrackerDigitizer.cc.

References TrackerGeometry::getDetectorType(), InnerPixel, moduleTypeCache_, pDD_, TrackerGeometry::Ph1PXB, TrackerGeometry::Ph1PXF, TrackerGeometry::Ph2PSP, TrackerGeometry::Ph2PSS, TrackerGeometry::Ph2PXB, TrackerGeometry::Ph2PXF, TrackerGeometry::Ph2SS, PixelinPS, StripinPS, TwoStrip, TrackerGeometry::UNKNOWN, and Unknown.

Referenced by accumulatePixelHits(), addOuterTrackerCollection(), addPixelCollection(), and loadAccumulator().

244  {
245  DetId detId(detId_raw);
246 
248 
249  //get mType either from the geometry or from our cache (faster)
251  auto itr = moduleTypeCache_.find(detId_raw);
252  if (itr != moduleTypeCache_.end()) {
253  mType = itr->second;
254  } else {
255  mType = pDD_->getDetectorType(detId);
256  moduleTypeCache_.emplace(detId_raw, mType);
257  }
258 
259  switch (mType) {
261  algotype = AlgorithmType::InnerPixel;
262  break;
264  algotype = AlgorithmType::InnerPixel;
265  break;
267  algotype = AlgorithmType::InnerPixel;
268  break;
270  algotype = AlgorithmType::InnerPixel;
271  break;
273  algotype = AlgorithmType::PixelinPS;
274  break;
276  algotype = AlgorithmType::StripinPS;
277  break;
279  algotype = AlgorithmType::TwoStrip;
280  break;
281  default:
282  edm::LogError("Phase2TrackerDigitizer") << "ERROR - Wrong Detector Type, No Algorithm available ";
283  }
284 
285  return algotype;
286  }
edm::ESHandle< TrackerGeometry > pDD_
ModuleType getDetectorType(DetId) const
Definition: DetId.h:17
void cms::Phase2TrackerDigitizer::initializeEvent ( edm::Event const &  e,
edm::EventSetup const &  c 
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 168 of file Phase2TrackerDigitizer.cc.

References algomap_, crossingSimHitIndexOffset_, Exception, first_, edm::RandomNumberGenerator::getEngine(), edm::Service< T >::isAvailable(), and edm::Event::streamID().

Referenced by PreMixingPhase2TrackerWorker::initializeEvent().

168  {
170  if (!rng.isAvailable()) {
171  throw cms::Exception("Configuration")
172  << "Phase2TrackerDigitizer requires the RandomNumberGeneratorService\n"
173  "which is not present in the configuration file. You must add the service\n"
174  "in the configuration file or remove the modules that require it.";
175  }
176 
177  // Must initialize all the algorithms
178  for (auto const& el : algomap_) {
179  if (first_)
180  el.second->init(iSetup);
181 
182  el.second->initializeEvent(rng->getEngine(e.streamID()));
183  }
184  first_ = false;
185  // Make sure that the first crossing processed starts indexing the sim hits from zero.
186  // This variable is used so that the sim hits from all crossing frames have sequential
187  // indices used to create the digi-sim link (if configured to do so) rather than starting
188  // from zero for each crossing.
190  }
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
bool isAvailable() const
Definition: Service.h:40
std::map< AlgorithmType, std::unique_ptr< Phase2TrackerDigitizerAlgorithm > > algomap_
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. ...
void cms::Phase2TrackerDigitizer::loadAccumulator ( const std::map< unsigned int, std::map< int, float > > &  accumulator)

Definition at line 225 of file Phase2TrackerDigitizer.cc.

References mixOne_premix_on_sim_cfi::accumulator, ecalcalib_dqm_sourceclient-live_cfg::algo, algomap_, and getAlgoType().

Referenced by PreMixingPhase2TrackerWorker::put().

225  {
226  for (const auto& detMap : accumulator) {
227  AlgorithmType algoType = getAlgoType(detMap.first);
228  auto& algo = *(algomap_.at(algoType));
229  algo.loadAccumulator(detMap.first, detMap.second);
230  }
231  }
AlgorithmType getAlgoType(unsigned int idet)
std::map< AlgorithmType, std::unique_ptr< Phase2TrackerDigitizerAlgorithm > > algomap_

Member Data Documentation

std::map<AlgorithmType, std::unique_ptr<Phase2TrackerDigitizerAlgorithm> > cms::Phase2TrackerDigitizer::algomap_
private
std::map<std::string, size_t> cms::Phase2TrackerDigitizer::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 95 of file Phase2TrackerDigitizer.h.

Referenced by accumulate_local(), and initializeEvent().

std::map<unsigned int, const Phase2TrackerGeomDetUnit*> cms::Phase2TrackerDigitizer::detectorUnits_
private

Definition at line 102 of file Phase2TrackerDigitizer.h.

Referenced by accumulatePixelHits(), and beginLuminosityBlock().

bool cms::Phase2TrackerDigitizer::first_
private

Definition at line 85 of file Phase2TrackerDigitizer.h.

Referenced by initializeEvent().

const std::string cms::Phase2TrackerDigitizer::geometryType_
private

Definition at line 99 of file Phase2TrackerDigitizer.h.

Referenced by beginLuminosityBlock().

const std::string cms::Phase2TrackerDigitizer::hitsProducer_
private

Definition at line 97 of file Phase2TrackerDigitizer.h.

Referenced by accumulate_local().

const bool cms::Phase2TrackerDigitizer::isOuterTrackerReadoutAnalog
private

Definition at line 105 of file Phase2TrackerDigitizer.h.

Referenced by finalizeEvent().

const bool cms::Phase2TrackerDigitizer::makeDigiSimLinks_
private
ModuleTypeCache cms::Phase2TrackerDigitizer::moduleTypeCache_
private

Definition at line 109 of file Phase2TrackerDigitizer.h.

Referenced by beginLuminosityBlock(), and getAlgoType().

edm::ESHandle<TrackerGeometry> cms::Phase2TrackerDigitizer::pDD_
private
const bool cms::Phase2TrackerDigitizer::premixStage1_
private

Definition at line 106 of file Phase2TrackerDigitizer.h.

Referenced by finalizeEvent(), and Phase2TrackerDigitizer().

edm::ESHandle<MagneticField> cms::Phase2TrackerDigitizer::pSetup_
private

Definition at line 101 of file Phase2TrackerDigitizer.h.

Referenced by accumulatePixelHits(), and beginLuminosityBlock().

edm::ESWatcher<TrackerDigiGeometryRecord> cms::Phase2TrackerDigitizer::theTkDigiGeomWatcher
private

Definition at line 104 of file Phase2TrackerDigitizer.h.

Referenced by beginLuminosityBlock().

const vstring cms::Phase2TrackerDigitizer::trackerContainers_
private

Definition at line 98 of file Phase2TrackerDigitizer.h.

Referenced by accumulate_local().

edm::ESHandle<TrackerTopology> cms::Phase2TrackerDigitizer::tTopoHand
private