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::stream::EDProducerBase &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::stream::EDProducerBase mixMod,
edm::ConsumesCollector iC 
)
explicit

Definition at line 79 of file Phase2TrackerDigitizer.cc.

References AlCaHLTBitMon_QueryRunRegistry::string.

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

Definition at line 138 of file Phase2TrackerDigitizer.cc.

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

Member Function Documentation

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

Implements DigiAccumulatorMixMod.

Definition at line 185 of file Phase2TrackerDigitizer.cc.

References iEvent.

185  {
186  accumulate_local<edm::Event>(iEvent, iSetup);
187  }
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 190 of file Phase2TrackerDigitizer.cc.

References iEvent.

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

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

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

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

Referenced by accumulate_local().

143  {
144  if (hSimHits.isValid()) {
145  std::set<unsigned int> detIds;
146  std::vector<PSimHit> const& simHits = *hSimHits.product();
147  int indx = 0;
148  for (auto it = simHits.begin(), itEnd = simHits.end(); it != itEnd; ++it, ++globalSimHitIndex) {
149  unsigned int detId_raw = (*it).detUnitId();
150  if (detectorUnits_.find(detId_raw) == detectorUnits_.end()) continue;
151  if (detIds.insert(detId_raw).second) {
152  // The insert succeeded, so this detector element has not yet been processed.
153  AlgorithmType algotype = getAlgoType(detId_raw);
154  const Phase2TrackerGeomDetUnit* phase2det = detectorUnits_[detId_raw];
155  // access to magnetic field in global coordinates
156  GlobalVector bfield = pSetup_->inTesla(phase2det->surface().position());
157  LogDebug("PixelDigitizer") << "B-field(T) at " << phase2det->surface().position() << "(cm): "
158  << pSetup_->inTesla(phase2det->surface().position());
159  if (algomap_.find(algotype) != algomap_.end()) {
160  algomap_[algotype]->accumulateSimHits(it, itEnd, globalSimHitIndex, tofBin, phase2det, bfield);
161  } else
162  edm::LogInfo("Phase2TrackerDigitizer") << "Unsupported algorithm: ";
163  }
164  indx++;
165  }
166  }
167  }
#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 303 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().

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

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

97  {
99  if (!rng.isAvailable()) {
100  throw cms::Exception("Configuration")
101  << "Phase2TrackerDigitizer requires the RandomNumberGeneratorService\n"
102  "which is not present in the configuration file. You must add the service\n"
103  "in the configuration file or remove the modules that require it.";
104  }
105  rndEngine_ = &(rng->getEngine(lumi.index()));
106 
107  iSetup.get<IdealMagneticFieldRecord>().get(pSetup_);
108  iSetup.get<TrackerTopologyRcd>().get(tTopoHand);
109 
110  if (theTkDigiGeomWatcher.check(iSetup)) {
111  iSetup.get<TrackerDigiGeometryRecord>().get(geometryType_, pDD_);
112  //reset cache
114  detectorUnits_.clear();
115  for (auto const & det_u : pDD_->detUnits()) {
116  unsigned int detId_raw = det_u->geographicalId().rawId();
117  DetId detId = DetId(detId_raw);
118  if (DetId(detId).det() == DetId::Detector::Tracker) {
119  const Phase2TrackerGeomDetUnit* pixdet = dynamic_cast<const Phase2TrackerGeomDetUnit*>(det_u);
120  assert(pixdet);
121  detectorUnits_.insert(std::make_pair(detId_raw, pixdet));
122  }
123  }
124  }
125 
126  // one type of Digi and DigiSimLink suffices
127  // changes in future: InnerPixel -> Tracker
128  // creating algorithm objects and pushing them into the map
129  algomap_[AlgorithmType::InnerPixel] = std::unique_ptr<Phase2TrackerDigitizerAlgorithm>(new PixelDigitizerAlgorithm(iconfig_, (*rndEngine_)));
130  algomap_[AlgorithmType::PixelinPS] = std::unique_ptr<Phase2TrackerDigitizerAlgorithm>(new PSPDigitizerAlgorithm(iconfig_, (*rndEngine_)));
131  algomap_[AlgorithmType::StripinPS] = std::unique_ptr<Phase2TrackerDigitizerAlgorithm>(new PSSDigitizerAlgorithm(iconfig_, (*rndEngine_)));
132  algomap_[AlgorithmType::TwoStrip] = std::unique_ptr<Phase2TrackerDigitizerAlgorithm>(new SSDigitizerAlgorithm(iconfig_, (*rndEngine_)));
133  }
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 135 of file Phase2TrackerDigitizer.cc.

References algomap_.

135  {
136  algomap_.clear();
137  }
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 214 of file Phase2TrackerDigitizer.cc.

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

214  {
215  const bool isOuterTrackerReadoutAnalog = iconfig_.getParameter<bool>("isOTreadoutAnalog");
216  //Decide if we want analog readout for Outer Tracker.
217  addPixelCollection(iEvent, iSetup, isOuterTrackerReadoutAnalog);
218  if(!isOuterTrackerReadoutAnalog)
220  }
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 221 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().

221  {
222  DetId detId(detId_raw);
223 
225 
226  //get mType either from the geometry or from our cache (faster)
228  auto itr = moduleTypeCache_.find(detId_raw);
229  if( itr != moduleTypeCache_.end() ) {
230  mType = itr->second;
231  } else {
232  mType = pDD_->getDetectorType(detId);
233  moduleTypeCache_.emplace(detId_raw,mType);
234  }
235 
236  switch(mType){
237 
239  algotype = AlgorithmType::InnerPixel;
240  break;
242  algotype = AlgorithmType::InnerPixel;
243  break;
245  algotype = AlgorithmType::InnerPixel;
246  break;
248  algotype = AlgorithmType::InnerPixel;
249  break;
251  algotype = AlgorithmType::PixelinPS;
252  break;
254  algotype = AlgorithmType::StripinPS;
255  break;
257  algotype = AlgorithmType::TwoStrip;
258  break;
259  default:
260  edm::LogError("Phase2TrackerDigitizer")<<"ERROR - Wrong Detector Type, No Algorithm available ";
261  }
262 
263  return algotype;
264  }
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 170 of file Phase2TrackerDigitizer.cc.

References algomap_, crossingSimHitIndexOffset_, and first_.

170  {
171 
172  // Must initialize all the algorithms
173  for (auto const & el : algomap_) {
174  if (first_) el.second->init(iSetup);
175  el.second->initializeEvent();
176  }
177  first_ = false;
178  // Make sure that the first crossing processed starts indexing the sim hits from zero.
179  // This variable is used so that the sim hits from all crossing frames have sequential
180  // indices used to create the digi-sim link (if configured to do so) rather than starting
181  // from zero for each crossing.
183  }
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