CMS 3D CMS Logo

Phase2TrackerDigitizer.h
Go to the documentation of this file.
1 #ifndef __SimTracker_SiPhase2Digitizer_Phase2TrackerDigitizer_h
2 #define __SimTracker_SiPhase2Digitizer_Phase2TrackerDigitizer_h
3 
4 //-------------------------------------------------------------
5 // class Phase2TrackerDigitizer
6 //
7 // Phase2TrackerDigitizer produces digis from SimHits
8 // The real algorithm is in Phase2TrackerDigitizerAlgorithm
9 //
10 // Author: Suchandra Dutta, Suvankar Roy Chowdhury, Subir Sarkar
11 //
12 //--------------------------------------------------------------
13 
14 #include <map>
15 #include <string>
16 #include <vector>
17 #include <unordered_map>
18 
29 
30 // Forward declaration
31 namespace CLHEP {
32  class HepRandomEngine;
33 }
34 
35 namespace edm {
36  class Event;
37  class EventSetup;
38  class ParameterSet;
39  template <typename T>
40  class Handle;
41  class ConsumesCollector;
42 } // namespace edm
43 
44 class MagneticField;
46 class PSimHit;
49 
50 namespace cms {
52  public:
53  using ModuleTypeCache = std::unordered_map<uint32_t, TrackerGeometry::ModuleType>;
54 
55  explicit Phase2TrackerDigitizer(const edm::ParameterSet& iConfig,
58  ~Phase2TrackerDigitizer() override;
59 
60  void initializeEvent(edm::Event const& e, edm::EventSetup const& c) override;
61  void accumulate(edm::Event const& e, edm::EventSetup const& c) override;
62  void accumulate(PileUpEventPrincipal const& e, edm::EventSetup const& c, edm::StreamID const&) override;
63  void finalizeEvent(edm::Event& e, edm::EventSetup const& c) override;
64  virtual void beginJob() {}
65 
66  template <class T>
67  void accumulate_local(T const& iEvent, edm::EventSetup const& iSetup);
68 
69  // For premixing
70  void loadAccumulator(const std::map<uint32_t, std::map<int, float> >& accumulator);
71 
72  private:
73  using vstring = std::vector<std::string>;
74 
75  // constants of different algorithm types
77  AlgorithmType getAlgoType(uint32_t idet);
78 
79  void accumulatePixelHits(edm::Handle<std::vector<PSimHit> >, size_t globalSimHitIndex, const uint32_t tofBin);
80  void addPixelCollection(edm::Event& iEvent, const edm::EventSetup& iSetup, const bool ot_analog);
81 
82  // Templated for premixing
83  template <typename DigiType>
85 
86  bool first_;
87 
96  std::map<std::string, size_t> crossingSimHitIndexOffset_;
97  std::map<AlgorithmType, std::unique_ptr<Phase2TrackerDigitizerAlgorithm> > algomap_;
103  const TrackerGeometry* pDD_ = nullptr;
104  const MagneticField* pSetup_ = nullptr;
105  std::map<uint32_t, const Phase2TrackerGeomDetUnit*> detectorUnits_;
106  const TrackerTopology* tTopo_ = nullptr;
109  const bool premixStage1_;
110  const bool makeDigiSimLinks_;
111  // cache for detector types
113  };
114 } // namespace cms
115 #endif
cms::Phase2TrackerDigitizer::vstring
std::vector< std::string > vstring
Definition: Phase2TrackerDigitizer.h:73
edm::StreamID
Definition: StreamID.h:30
cms::Phase2TrackerDigitizer::AlgorithmType::StripinPS
cms::Phase2TrackerDigitizer::first_
bool first_
Definition: Phase2TrackerDigitizer.h:86
cms::Phase2TrackerDigitizer::accumulatePixelHits
void accumulatePixelHits(edm::Handle< std::vector< PSimHit > >, size_t globalSimHitIndex, const uint32_t tofBin)
Definition: Phase2TrackerDigitizer.cc:101
cms::Phase2TrackerDigitizer::getAlgoType
AlgorithmType getAlgoType(uint32_t idet)
Definition: Phase2TrackerDigitizer.cc:226
TrackerGeometry.h
edm::ESWatcher< TrackerDigiGeometryRecord >
cms::Phase2TrackerDigitizer::AlgorithmType::PixelinPS
cms::Phase2TrackerDigitizer::isOuterTrackerReadoutAnalog_
const bool isOuterTrackerReadoutAnalog_
Definition: Phase2TrackerDigitizer.h:108
Handle
cms::Phase2TrackerDigitizer::pSetup_
const MagneticField * pSetup_
Definition: Phase2TrackerDigitizer.h:104
edm
HLT enums.
Definition: AlignableModifier.h:19
TrackerTopology
Definition: TrackerTopology.h:16
cms::Phase2TrackerDigitizer::beginJob
virtual void beginJob()
Definition: Phase2TrackerDigitizer.h:64
cms::Phase2TrackerDigitizer::tTopo_
const TrackerTopology * tTopo_
Definition: Phase2TrackerDigitizer.h:106
cms::Phase2TrackerDigitizer::tTopoToken_
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
Definition: Phase2TrackerDigitizer.h:102
PileUpEventPrincipal
Definition: PileUpEventPrincipal.h:19
cms::Phase2TrackerDigitizer::moduleTypeCache_
ModuleTypeCache moduleTypeCache_
Definition: Phase2TrackerDigitizer.h:112
cms::Phase2TrackerDigitizer::finalizeEvent
void finalizeEvent(edm::Event &e, edm::EventSetup const &c) override
Definition: Phase2TrackerDigitizer.cc:216
edm::Handle
Definition: AssociativeIterator.h:50
ProducesCollector.h
TrackerTopology.h
cms::Phase2TrackerDigitizer::initializeEvent
void initializeEvent(edm::Event const &e, edm::EventSetup const &c) override
Definition: Phase2TrackerDigitizer.cc:132
TrackerTopologyRcd.h
cms::Phase2TrackerDigitizer::AlgorithmType::Unknown
DigiAccumulatorMixMod.h
cms::Phase2TrackerDigitizer::accumulate_local
void accumulate_local(T const &iEvent, edm::EventSetup const &iSetup)
Definition: Phase2TrackerDigitizer.cc:185
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:16
IdealMagneticFieldRecord.h
Event
cms::Phase2TrackerDigitizer::premixStage1_
const bool premixStage1_
Definition: Phase2TrackerDigitizer.h:109
DigiAccumulatorMixMod
Definition: DigiAccumulatorMixMod.h:41
cms::Phase2TrackerDigitizer::loadAccumulator
void loadAccumulator(const std::map< uint32_t, std::map< int, float > > &accumulator)
Definition: Phase2TrackerDigitizer.cc:208
CLHEP
Definition: CocoaGlobals.h:27
cms::Phase2TrackerDigitizer::makeDigiSimLinks_
const bool makeDigiSimLinks_
Definition: Phase2TrackerDigitizer.h:110
TrackerDigiGeometryRecord.h
edm::ParameterSet
Definition: ParameterSet.h:47
cms::Phase2TrackerDigitizer::AlgorithmType::InnerPixel3D
ParameterSet
Definition: Functions.h:16
Phase2TrackerDigitizerAlgorithm
Definition: Phase2TrackerDigitizerAlgorithm.h:54
cms::Phase2TrackerDigitizer::detectorUnits_
std::map< uint32_t, const Phase2TrackerGeomDetUnit * > detectorUnits_
Definition: Phase2TrackerDigitizer.h:105
cms::Phase2TrackerDigitizer::pSetupToken_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > pSetupToken_
Definition: Phase2TrackerDigitizer.h:101
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup
Definition: EventSetup.h:58
cms::Phase2TrackerDigitizer::algomap_
std::map< AlgorithmType, std::unique_ptr< Phase2TrackerDigitizerAlgorithm > > algomap_
Definition: Phase2TrackerDigitizer.h:97
cms::Phase2TrackerDigitizer::ModuleTypeCache
std::unordered_map< uint32_t, TrackerGeometry::ModuleType > ModuleTypeCache
Definition: Phase2TrackerDigitizer.h:53
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord >
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
cms::Phase2TrackerDigitizer::hitsProducer_
const std::string hitsProducer_
Definition: Phase2TrackerDigitizer.h:98
cms::Phase2TrackerDigitizer::addOuterTrackerCollection
void addOuterTrackerCollection(edm::Event &iEvent, const edm::EventSetup &iSetup)
Definition: Phase2TrackerDigitizer.cc:340
mixOne_premix_on_sim_cfi.accumulator
accumulator
Definition: mixOne_premix_on_sim_cfi.py:167
cms::Phase2TrackerDigitizer::~Phase2TrackerDigitizer
~Phase2TrackerDigitizer() override
Definition: Phase2TrackerDigitizer.cc:100
edm::ProducesCollector
Definition: ProducesCollector.h:43
cms::Phase2TrackerDigitizer
Definition: Phase2TrackerDigitizer.h:51
DetId.h
cms::Phase2TrackerDigitizer::AlgorithmType::TwoStrip
ESWatcher.h
cms::Phase2TrackerDigitizer::addPixelCollection
void addPixelCollection(edm::Event &iEvent, const edm::EventSetup &iSetup, const bool ot_analog)
Definition: Phase2TrackerDigitizer.cc:272
T
long double T
Definition: Basic3DVectorLD.h:48
cms::Phase2TrackerDigitizer::pDD_
const TrackerGeometry * pDD_
Definition: Phase2TrackerDigitizer.h:103
cms::Phase2TrackerDigitizer::crossingSimHitIndexOffset_
std::map< std::string, size_t > crossingSimHitIndexOffset_
Offset to add to the index of each sim hit to account for which crossing it's in.
Definition: Phase2TrackerDigitizer.h:96
Phase2TrackerDigitizerFwd.h
cms::Phase2TrackerDigitizer::theTkDigiGeomWatcher_
edm::ESWatcher< TrackerDigiGeometryRecord > theTkDigiGeomWatcher_
Definition: Phase2TrackerDigitizer.h:107
cms::Phase2TrackerDigitizer::trackerContainers_
const vstring trackerContainers_
Definition: Phase2TrackerDigitizer.h:99
genParticles_cff.map
map
Definition: genParticles_cff.py:11
EventSetup
PSimHit
Definition: PSimHit.h:15
cms::Phase2TrackerDigitizer::Phase2TrackerDigitizer
Phase2TrackerDigitizer(const edm::ParameterSet &iConfig, edm::ProducesCollector, edm::ConsumesCollector &iC)
Definition: Phase2TrackerDigitizer.cc:62
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
edm::Event
Definition: Event.h:73
MagneticField
Definition: MagneticField.h:19
cms::Phase2TrackerDigitizer::pDDToken_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > pDDToken_
Definition: Phase2TrackerDigitizer.h:100
cms::Phase2TrackerDigitizer::AlgorithmType
AlgorithmType
Definition: Phase2TrackerDigitizer.h:76
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
cms::Phase2TrackerDigitizer::accumulate
void accumulate(edm::Event const &e, edm::EventSetup const &c) override
Definition: Phase2TrackerDigitizer.cc:174
cms
Namespace of DDCMS conversion namespace.
Definition: ProducerAnalyzer.cc:21
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
TrackerGeometry
Definition: TrackerGeometry.h:14
cms::Phase2TrackerDigitizer::AlgorithmType::InnerPixel