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 endLuminosityBlock (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
 
 Phase2TrackerDigitizer (const edm::ParameterSet &iConfig, edm::ProducerBase &mixMod, 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 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)
 
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 edm::ParameterSeticonfig_
 
ModuleTypeCache moduleTypeCache_
 
edm::ESHandle< TrackerGeometrypDD_
 
edm::ESHandle< MagneticFieldpSetup_
 
CLHEP::HepRandomEngine * rndEngine_
 
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 53 of file Phase2TrackerDigitizer.h.

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

Definition at line 70 of file Phase2TrackerDigitizer.h.

Member Enumeration Documentation

Enumerator
InnerPixel 
PixelinPS 
StripinPS 
TwoStrip 
Unknown 

Definition at line 73 of file Phase2TrackerDigitizer.h.

73  {
74  InnerPixel,
75  PixelinPS,
76  StripinPS,
77  TwoStrip,
78  Unknown
79  };

Constructor & Destructor Documentation

cms::Phase2TrackerDigitizer::Phase2TrackerDigitizer ( const edm::ParameterSet iConfig,
edm::ProducerBase mixMod,
edm::ConsumesCollector iC 
)
explicit

Definition at line 80 of file Phase2TrackerDigitizer.cc.

References edm::ProductRegistryHelper::produces(), and AlCaHLTBitMon_QueryRunRegistry::string.

80  :
81  first_(true),
82  hitsProducer_(iConfig.getParameter<std::string>("hitsProducer")),
83  trackerContainers_(iConfig.getParameter<std::vector<std::string> >("ROUList")),
84  geometryType_(iConfig.getParameter<std::string>("GeometryType")),
85  iconfig_(iConfig)
86  {
87  //edm::LogInfo("Phase2TrackerDigitizer") << "Initialize Digitizer Algorithms";
88  const std::string alias1("simSiPixelDigis");
89  mixMod.produces<edm::DetSetVector<PixelDigi> >("Pixel").setBranchAlias(alias1);
90  mixMod.produces<edm::DetSetVector<PixelDigiSimLink> >("Pixel").setBranchAlias(alias1);
91 
92  const std::string alias2("simSiTrackerDigis");
93  mixMod.produces<edm::DetSetVector<Phase2TrackerDigi> >("Tracker").setBranchAlias(alias2);
94  mixMod.produces<edm::DetSetVector<PixelDigiSimLink> >("Tracker").setBranchAlias(alias2);
95 
96  }
BranchAliasSetterT< ProductType > produces()
declare what type of product will make and with which optional label
T getParameter(std::string const &) const
const edm::ParameterSet & iconfig_
cms::Phase2TrackerDigitizer::~Phase2TrackerDigitizer ( )
override

Definition at line 139 of file Phase2TrackerDigitizer.cc.

139  {
140  edm::LogInfo("Phase2TrackerDigitizer") << "Destroying the Digitizer";
141  }

Member Function Documentation

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

Implements DigiAccumulatorMixMod.

Definition at line 186 of file Phase2TrackerDigitizer.cc.

References iEvent.

186  {
187  accumulate_local<edm::Event>(iEvent, iSetup);
188  }
int iEvent
Definition: GenABIO.cc:230
void cms::Phase2TrackerDigitizer::accumulate ( PileUpEventPrincipal const &  e,
edm::EventSetup const &  c,
edm::StreamID const &   
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 191 of file Phase2TrackerDigitizer.cc.

References iEvent.

191  {
192  accumulate_local<PileUpEventPrincipal>(iEvent, iSetup);
193  }
int iEvent
Definition: GenABIO.cc:230
template<class T >
void cms::Phase2TrackerDigitizer::accumulate_local ( T const &  iEvent,
edm::EventSetup const &  iSetup 
)

Definition at line 196 of file Phase2TrackerDigitizer.cc.

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

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

Definition at line 143 of file Phase2TrackerDigitizer.cc.

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

Referenced by accumulate_local().

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

Definition at line 304 of file Phase2TrackerDigitizer.cc.

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

Referenced by finalizeEvent().

304  {
305  const TrackerTopology* tTopo = tTopoHand.product();
306  std::vector<edm::DetSet<Phase2TrackerDigi> > digiVector;
307  std::vector<edm::DetSet<PixelDigiSimLink> > digiLinkVector;
308  for (auto const & det_u : pDD_->detUnits()) {
309  DetId detId_raw = DetId(det_u->geographicalId().rawId());
310  AlgorithmType algotype = getAlgoType(detId_raw);
311 
312  if (algomap_.find(algotype) == algomap_.end() || algotype == AlgorithmType::InnerPixel) continue;
313 
314  std::map<int, DigitizerUtility::DigiSimInfo> digi_map;
315  algomap_[algotype]->digitize(dynamic_cast<const Phase2TrackerGeomDetUnit*>(det_u),
316  digi_map, tTopo);
317  edm::DetSet<Phase2TrackerDigi> collector(det_u->geographicalId().rawId());
318  edm::DetSet<PixelDigiSimLink> linkcollector(det_u->geographicalId().rawId());
319 
320  for (auto const & digi_p : digi_map) {
321  DigitizerUtility::DigiSimInfo info = digi_p.second;
322  std::pair<int,int> ip = Phase2TrackerDigi::channelToPixel(digi_p.first);
323  collector.data.emplace_back(ip.first, ip.second, info.ot_bit);
324  for (auto const & sim_p : info.simInfoList) {
325 
326  linkcollector.data.emplace_back(digi_p.first, sim_p.second->trackId(), sim_p.second->hitIndex(), sim_p.second->tofBin(), sim_p.second->eventId(), sim_p.first);
327  }
328  }
329 
330  if (!collector.data.empty()) digiVector.push_back(std::move(collector));
331  if (!linkcollector.data.empty()) digiLinkVector.push_back(std::move(linkcollector));
332  }
333 
334  // Step C: create collection with the cache vector of DetSet
335  std::unique_ptr<edm::DetSetVector<Phase2TrackerDigi> >
337  std::unique_ptr<edm::DetSetVector<PixelDigiSimLink> >
338  outputlink(new edm::DetSetVector<PixelDigiSimLink>(digiLinkVector));
339 
340  // Step D: write output to file
341  iEvent.put(std::move(output), "Tracker");
342  iEvent.put(std::move(outputlink), "Tracker");
343  }
static const TGPicture * info(bool iBackgroundIsBlack)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:136
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
edm::ESHandle< TrackerTopology > tTopoHand
edm::ESHandle< TrackerGeometry > pDD_
Definition: DetId.h:18
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:510
static std::pair< unsigned int, unsigned int > channelToPixel(unsigned int ch)
void cms::Phase2TrackerDigitizer::addPixelCollection ( edm::Event iEvent,
const edm::EventSetup iSetup,
const bool  ot_analog 
)
private

Definition at line 266 of file Phase2TrackerDigitizer.cc.

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

Referenced by finalizeEvent().

266  {
267  const TrackerTopology* tTopo = tTopoHand.product();
268  std::vector<edm::DetSet<PixelDigi> > digiVector;
269  std::vector<edm::DetSet<PixelDigiSimLink> > digiLinkVector;
270  for (auto const & det_u : pDD_->detUnits()) {
271  DetId detId_raw = DetId(det_u->geographicalId().rawId());
272  AlgorithmType algotype = getAlgoType(detId_raw);
273  if (algomap_.find(algotype) == algomap_.end()) continue;
274 
275  //Decide if we want analog readout for Outer Tracker.
276  if( !ot_analog && algotype != AlgorithmType::InnerPixel) continue;
277  std::map<int, DigitizerUtility::DigiSimInfo> digi_map;
278  algomap_[algotype]->digitize(dynamic_cast<const Phase2TrackerGeomDetUnit*>(det_u),
279  digi_map,tTopo);
280  edm::DetSet<PixelDigi> collector(det_u->geographicalId().rawId());
281  edm::DetSet<PixelDigiSimLink> linkcollector(det_u->geographicalId().rawId());
282  for (auto const & digi_p : digi_map) {
283  DigitizerUtility::DigiSimInfo info = digi_p.second;
284  std::pair<int,int> ip = PixelDigi::channelToPixel(digi_p.first);
285  collector.data.emplace_back(ip.first, ip.second, info.sig_tot);
286  for (auto const & sim_p : info.simInfoList) {
287  linkcollector.data.emplace_back(digi_p.first, sim_p.second->trackId(), sim_p.second->hitIndex(), sim_p.second->tofBin(), sim_p.second->eventId(), sim_p.first);
288  }
289  }
290  if (!collector.data.empty()) digiVector.push_back(std::move(collector));
291  if (!linkcollector.data.empty()) digiLinkVector.push_back(std::move(linkcollector));
292  }
293 
294  // Step C: create collection with the cache vector of DetSet
295  std::unique_ptr<edm::DetSetVector<PixelDigi> >
296  output(new edm::DetSetVector<PixelDigi>(digiVector));
297  std::unique_ptr<edm::DetSetVector<PixelDigiSimLink> >
298  outputlink(new edm::DetSetVector<PixelDigiSimLink>(digiLinkVector));
299 
300  // Step D: write output to file
301  iEvent.put(std::move(output), "Pixel");
302  iEvent.put(std::move(outputlink), "Pixel");
303  }
static const TGPicture * info(bool iBackgroundIsBlack)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:136
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
edm::ESHandle< TrackerTopology > tTopoHand
edm::ESHandle< TrackerGeometry > pDD_
Definition: DetId.h:18
AlgorithmType getAlgoType(unsigned int idet)
static std::pair< int, int > channelToPixel(int ch)
Definition: PixelDigi.h:62
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:510
virtual void cms::Phase2TrackerDigitizer::beginJob ( void  )
inlinevirtual

Definition at line 61 of file Phase2TrackerDigitizer.h.

References iEvent.

61 {}
void cms::Phase2TrackerDigitizer::beginLuminosityBlock ( edm::LuminosityBlock const &  lumi,
edm::EventSetup const &  iSetup 
)
overridevirtual

Reimplemented from DigiAccumulatorMixMod.

Definition at line 98 of file Phase2TrackerDigitizer.cc.

References algomap_, edm::ESWatcher< T >::check(), detectorUnits_, TrackerGeometry::detUnits(), Exception, geometryType_, edm::EventSetup::get(), edm::RandomNumberGenerator::getEngine(), iconfig_, edm::LuminosityBlock::index(), InnerPixel, edm::Service< T >::isAvailable(), moduleTypeCache_, pDD_, phase2TrackerDigitizer_cfi::PixelDigitizerAlgorithm, PixelinPS, pSetup_, phase2TrackerDigitizer_cfi::PSPDigitizerAlgorithm, phase2TrackerDigitizer_cfi::PSSDigitizerAlgorithm, rndEngine_, phase2TrackerDigitizer_cfi::SSDigitizerAlgorithm, StripinPS, theTkDigiGeomWatcher, align::Tracker, tTopoHand, and TwoStrip.

98  {
100  if (!rng.isAvailable()) {
101  throw cms::Exception("Configuration")
102  << "Phase2TrackerDigitizer requires the RandomNumberGeneratorService\n"
103  "which is not present in the configuration file. You must add the service\n"
104  "in the configuration file or remove the modules that require it.";
105  }
106  rndEngine_ = &(rng->getEngine(lumi.index()));
107 
108  iSetup.get<IdealMagneticFieldRecord>().get(pSetup_);
109  iSetup.get<TrackerTopologyRcd>().get(tTopoHand);
110 
111  if (theTkDigiGeomWatcher.check(iSetup)) {
112  iSetup.get<TrackerDigiGeometryRecord>().get(geometryType_, pDD_);
113  //reset cache
115  detectorUnits_.clear();
116  for (auto const & det_u : pDD_->detUnits()) {
117  unsigned int detId_raw = det_u->geographicalId().rawId();
118  DetId detId = DetId(detId_raw);
119  if (DetId(detId).det() == DetId::Detector::Tracker) {
120  const Phase2TrackerGeomDetUnit* pixdet = dynamic_cast<const Phase2TrackerGeomDetUnit*>(det_u);
121  assert(pixdet);
122  detectorUnits_.insert(std::make_pair(detId_raw, pixdet));
123  }
124  }
125  }
126 
127  // one type of Digi and DigiSimLink suffices
128  // changes in future: InnerPixel -> Tracker
129  // creating algorithm objects and pushing them into the map
130  algomap_[AlgorithmType::InnerPixel] = std::unique_ptr<Phase2TrackerDigitizerAlgorithm>(new PixelDigitizerAlgorithm(iconfig_, (*rndEngine_)));
131  algomap_[AlgorithmType::PixelinPS] = std::unique_ptr<Phase2TrackerDigitizerAlgorithm>(new PSPDigitizerAlgorithm(iconfig_, (*rndEngine_)));
132  algomap_[AlgorithmType::StripinPS] = std::unique_ptr<Phase2TrackerDigitizerAlgorithm>(new PSSDigitizerAlgorithm(iconfig_, (*rndEngine_)));
133  algomap_[AlgorithmType::TwoStrip] = std::unique_ptr<Phase2TrackerDigitizerAlgorithm>(new SSDigitizerAlgorithm(iconfig_, (*rndEngine_)));
134  }
edm::ESWatcher< TrackerDigiGeometryRecord > theTkDigiGeomWatcher
const edm::ParameterSet & iconfig_
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
std::unordered_map< unsigned, TrackerGeometry::ModuleType > ModuleTypeCache
std::map< unsigned int, const Phase2TrackerGeomDetUnit * > detectorUnits_
CLHEP::HepRandomEngine * rndEngine_
edm::ESHandle< TrackerTopology > tTopoHand
edm::ESHandle< TrackerGeometry > pDD_
bool isAvailable() const
Definition: Service.h:46
Definition: DetId.h:18
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
edm::ESHandle< MagneticField > pSetup_
std::map< AlgorithmType, std::unique_ptr< Phase2TrackerDigitizerAlgorithm > > algomap_
void cms::Phase2TrackerDigitizer::endLuminosityBlock ( edm::LuminosityBlock const &  lumi,
edm::EventSetup const &  iSetup 
)
overridevirtual

Reimplemented from DigiAccumulatorMixMod.

Definition at line 136 of file Phase2TrackerDigitizer.cc.

References algomap_.

136  {
137  algomap_.clear();
138  }
std::map< AlgorithmType, std::unique_ptr< Phase2TrackerDigitizerAlgorithm > > algomap_
void cms::Phase2TrackerDigitizer::finalizeEvent ( edm::Event e,
edm::EventSetup const &  c 
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 215 of file Phase2TrackerDigitizer.cc.

References addOuterTrackerCollection(), addPixelCollection(), edm::ParameterSet::getParameter(), and iconfig_.

215  {
216  const bool isOuterTrackerReadoutAnalog = iconfig_.getParameter<bool>("isOTreadoutAnalog");
217  //Decide if we want analog readout for Outer Tracker.
218  addPixelCollection(iEvent, iSetup, isOuterTrackerReadoutAnalog);
219  if(!isOuterTrackerReadoutAnalog)
221  }
T getParameter(std::string const &) const
const edm::ParameterSet & iconfig_
int iEvent
Definition: GenABIO.cc:230
void addOuterTrackerCollection(edm::Event &iEvent, const edm::EventSetup &iSetup)
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 222 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(), and addPixelCollection().

222  {
223  DetId detId(detId_raw);
224 
226 
227  //get mType either from the geometry or from our cache (faster)
229  auto itr = moduleTypeCache_.find(detId_raw);
230  if( itr != moduleTypeCache_.end() ) {
231  mType = itr->second;
232  } else {
233  mType = pDD_->getDetectorType(detId);
234  moduleTypeCache_.emplace(detId_raw,mType);
235  }
236 
237  switch(mType){
238 
240  algotype = AlgorithmType::InnerPixel;
241  break;
243  algotype = AlgorithmType::InnerPixel;
244  break;
246  algotype = AlgorithmType::InnerPixel;
247  break;
249  algotype = AlgorithmType::InnerPixel;
250  break;
252  algotype = AlgorithmType::PixelinPS;
253  break;
255  algotype = AlgorithmType::StripinPS;
256  break;
258  algotype = AlgorithmType::TwoStrip;
259  break;
260  default:
261  edm::LogError("Phase2TrackerDigitizer")<<"ERROR - Wrong Detector Type, No Algorithm available ";
262  }
263 
264  return algotype;
265  }
edm::ESHandle< TrackerGeometry > pDD_
ModuleType getDetectorType(DetId) const
Definition: DetId.h:18
void cms::Phase2TrackerDigitizer::initializeEvent ( edm::Event const &  e,
edm::EventSetup const &  c 
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 171 of file Phase2TrackerDigitizer.cc.

References algomap_, crossingSimHitIndexOffset_, and first_.

171  {
172 
173  // Must initialize all the algorithms
174  for (auto const & el : algomap_) {
175  if (first_) el.second->init(iSetup);
176  el.second->initializeEvent();
177  }
178  first_ = false;
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  }
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::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 99 of file Phase2TrackerDigitizer.h.

Referenced by accumulate_local(), and initializeEvent().

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

Definition at line 106 of file Phase2TrackerDigitizer.h.

Referenced by accumulatePixelHits(), and beginLuminosityBlock().

bool cms::Phase2TrackerDigitizer::first_
private

Definition at line 89 of file Phase2TrackerDigitizer.h.

Referenced by initializeEvent().

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

Definition at line 103 of file Phase2TrackerDigitizer.h.

Referenced by beginLuminosityBlock().

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

Definition at line 101 of file Phase2TrackerDigitizer.h.

Referenced by accumulate_local().

const edm::ParameterSet& cms::Phase2TrackerDigitizer::iconfig_
private

Definition at line 110 of file Phase2TrackerDigitizer.h.

Referenced by beginLuminosityBlock(), and finalizeEvent().

ModuleTypeCache cms::Phase2TrackerDigitizer::moduleTypeCache_
private

Definition at line 113 of file Phase2TrackerDigitizer.h.

Referenced by beginLuminosityBlock(), and getAlgoType().

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

Definition at line 105 of file Phase2TrackerDigitizer.h.

Referenced by accumulatePixelHits(), and beginLuminosityBlock().

CLHEP::HepRandomEngine* cms::Phase2TrackerDigitizer::rndEngine_
private

Definition at line 107 of file Phase2TrackerDigitizer.h.

Referenced by beginLuminosityBlock().

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

Definition at line 109 of file Phase2TrackerDigitizer.h.

Referenced by beginLuminosityBlock().

const vstring cms::Phase2TrackerDigitizer::trackerContainers_
private

Definition at line 102 of file Phase2TrackerDigitizer.h.

Referenced by accumulate_local().

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