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 
27 
28 // Forward declaration
29 namespace CLHEP {
30  class HepRandomEngine;
31 }
32 
33 namespace edm {
34  class Event;
35  class EventSetup;
36  class ParameterSet;
37  template <typename T>
38  class Handle;
39  class ConsumesCollector;
40 } // namespace edm
41 
42 class MagneticField;
44 class PSimHit;
47 
48 namespace cms {
50  public:
51  using ModuleTypeCache = std::unordered_map<uint32_t, TrackerGeometry::ModuleType>;
52 
53  explicit Phase2TrackerDigitizer(const edm::ParameterSet& iConfig,
56  ~Phase2TrackerDigitizer() override;
57 
58  void initializeEvent(edm::Event const& e, edm::EventSetup const& c) override;
59  void accumulate(edm::Event const& e, edm::EventSetup const& c) override;
60  void accumulate(PileUpEventPrincipal const& e, edm::EventSetup const& c, edm::StreamID const&) override;
61  void finalizeEvent(edm::Event& e, edm::EventSetup const& c) override;
62  virtual void beginJob() {}
63  void beginLuminosityBlock(edm::LuminosityBlock const& lumi, edm::EventSetup const& iSetup) override;
64 
65  template <class T>
66  void accumulate_local(T const& iEvent, edm::EventSetup const& iSetup);
67 
68  // For premixing
69  void loadAccumulator(const std::map<uint32_t, std::map<int, float> >& accumulator);
70 
71  private:
72  using vstring = std::vector<std::string>;
73 
74  // constants of different algorithm types
76  AlgorithmType getAlgoType(uint32_t idet);
77 
78  void accumulatePixelHits(edm::Handle<std::vector<PSimHit> >, size_t globalSimHitIndex, const uint32_t tofBin);
79  void addPixelCollection(edm::Event& iEvent, const edm::EventSetup& iSetup, const bool ot_analog);
80 
81  // Templated for premixing
82  template <typename DigiType>
84 
85  bool first_;
86 
95  std::map<std::string, size_t> crossingSimHitIndexOffset_;
96  std::map<AlgorithmType, std::unique_ptr<Phase2TrackerDigitizerAlgorithm> > algomap_;
102  std::map<uint32_t, const Phase2TrackerGeomDetUnit*> detectorUnits_;
106  const bool premixStage1_;
107  const bool makeDigiSimLinks_;
108  // cache for detector types
110  };
111 } // namespace cms
112 #endif
cms::Phase2TrackerDigitizer::vstring
std::vector< std::string > vstring
Definition: Phase2TrackerDigitizer.h:72
edm::StreamID
Definition: StreamID.h:30
cms::Phase2TrackerDigitizer::AlgorithmType::StripinPS
cms::Phase2TrackerDigitizer::first_
bool first_
Definition: Phase2TrackerDigitizer.h:85
cms::Phase2TrackerDigitizer::accumulatePixelHits
void accumulatePixelHits(edm::Handle< std::vector< PSimHit > >, size_t globalSimHitIndex, const uint32_t tofBin)
Definition: Phase2TrackerDigitizer.cc:122
cms::Phase2TrackerDigitizer::getAlgoType
AlgorithmType getAlgoType(uint32_t idet)
Definition: Phase2TrackerDigitizer.cc:228
TrackerGeometry.h
edm::ESWatcher< TrackerDigiGeometryRecord >
ESHandle.h
cms::Phase2TrackerDigitizer::AlgorithmType::PixelinPS
cms::Phase2TrackerDigitizer::isOuterTrackerReadoutAnalog_
const bool isOuterTrackerReadoutAnalog_
Definition: Phase2TrackerDigitizer.h:105
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
Handle
edm
HLT enums.
Definition: AlignableModifier.h:19
cms::Phase2TrackerDigitizer::beginJob
virtual void beginJob()
Definition: Phase2TrackerDigitizer.h:62
cms::Phase2TrackerDigitizer::tTopoHand_
edm::ESHandle< TrackerTopology > tTopoHand_
Definition: Phase2TrackerDigitizer.h:103
PileUpEventPrincipal
Definition: PileUpEventPrincipal.h:19
cms::Phase2TrackerDigitizer::moduleTypeCache_
ModuleTypeCache moduleTypeCache_
Definition: Phase2TrackerDigitizer.h:109
cms::Phase2TrackerDigitizer::finalizeEvent
void finalizeEvent(edm::Event &e, edm::EventSetup const &c) override
Definition: Phase2TrackerDigitizer.cc:218
edm::Handle
Definition: AssociativeIterator.h:50
ProducesCollector.h
TrackerTopology.h
cms::Phase2TrackerDigitizer::geometryType_
const std::string geometryType_
Definition: Phase2TrackerDigitizer.h:99
cms::Phase2TrackerDigitizer::initializeEvent
void initializeEvent(edm::Event const &e, edm::EventSetup const &c) override
Definition: Phase2TrackerDigitizer.cc:153
cms::Phase2TrackerDigitizer::AlgorithmType::Unknown
DigiAccumulatorMixMod.h
cms::Phase2TrackerDigitizer::accumulate_local
void accumulate_local(T const &iEvent, edm::EventSetup const &iSetup)
Definition: Phase2TrackerDigitizer.cc:187
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:15
edm::ESHandle< TrackerGeometry >
Event
cms::Phase2TrackerDigitizer::premixStage1_
const bool premixStage1_
Definition: Phase2TrackerDigitizer.h:106
DigiAccumulatorMixMod
Definition: DigiAccumulatorMixMod.h:41
cms::Phase2TrackerDigitizer::loadAccumulator
void loadAccumulator(const std::map< uint32_t, std::map< int, float > > &accumulator)
Definition: Phase2TrackerDigitizer.cc:210
CLHEP
Definition: CocoaGlobals.h:27
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
cms::Phase2TrackerDigitizer::makeDigiSimLinks_
const bool makeDigiSimLinks_
Definition: Phase2TrackerDigitizer.h:107
edm::ParameterSet
Definition: ParameterSet.h:36
cms::Phase2TrackerDigitizer::AlgorithmType::InnerPixel3D
ParameterSet
Definition: Functions.h:16
Phase2TrackerDigitizerAlgorithm
Definition: Phase2TrackerDigitizerAlgorithm.h:58
cms::Phase2TrackerDigitizer::detectorUnits_
std::map< uint32_t, const Phase2TrackerGeomDetUnit * > detectorUnits_
Definition: Phase2TrackerDigitizer.h:102
cms::Phase2TrackerDigitizer::pDD_
edm::ESHandle< TrackerGeometry > pDD_
Definition: Phase2TrackerDigitizer.h:100
iEvent
int iEvent
Definition: GenABIO.cc:224
cms::Phase2TrackerDigitizer::beginLuminosityBlock
void beginLuminosityBlock(edm::LuminosityBlock const &lumi, edm::EventSetup const &iSetup) override
Definition: Phase2TrackerDigitizer.cc:100
cms::Phase2TrackerDigitizer::pSetup_
edm::ESHandle< MagneticField > pSetup_
Definition: Phase2TrackerDigitizer.h:101
edm::EventSetup
Definition: EventSetup.h:57
cms::Phase2TrackerDigitizer::algomap_
std::map< AlgorithmType, std::unique_ptr< Phase2TrackerDigitizerAlgorithm > > algomap_
Definition: Phase2TrackerDigitizer.h:96
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
cms::Phase2TrackerDigitizer::ModuleTypeCache
std::unordered_map< uint32_t, TrackerGeometry::ModuleType > ModuleTypeCache
Definition: Phase2TrackerDigitizer.h:51
cms::Phase2TrackerDigitizer::hitsProducer_
const std::string hitsProducer_
Definition: Phase2TrackerDigitizer.h:97
cms::Phase2TrackerDigitizer::addOuterTrackerCollection
void addOuterTrackerCollection(edm::Event &iEvent, const edm::EventSetup &iSetup)
Definition: Phase2TrackerDigitizer.cc:344
mixOne_premix_on_sim_cfi.accumulator
accumulator
Definition: mixOne_premix_on_sim_cfi.py:167
cms::Phase2TrackerDigitizer::~Phase2TrackerDigitizer
~Phase2TrackerDigitizer() override
Definition: Phase2TrackerDigitizer.cc:121
edm::ProducesCollector
Definition: ProducesCollector.h:43
cms::Phase2TrackerDigitizer
Definition: Phase2TrackerDigitizer.h:49
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:274
T
long double T
Definition: Basic3DVectorLD.h:48
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:95
Phase2TrackerDigitizerFwd.h
cms::Phase2TrackerDigitizer::theTkDigiGeomWatcher_
edm::ESWatcher< TrackerDigiGeometryRecord > theTkDigiGeomWatcher_
Definition: Phase2TrackerDigitizer.h:104
cms::Phase2TrackerDigitizer::trackerContainers_
const vstring trackerContainers_
Definition: Phase2TrackerDigitizer.h:98
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:64
edm::Event
Definition: Event.h:73
MagneticField
Definition: MagneticField.h:19
lumi
Definition: LumiSectionData.h:20
cms::Phase2TrackerDigitizer::AlgorithmType
AlgorithmType
Definition: Phase2TrackerDigitizer.h:75
edm::ConsumesCollector
Definition: ConsumesCollector.h:39
cms::Phase2TrackerDigitizer::accumulate
void accumulate(edm::Event const &e, edm::EventSetup const &c) override
Definition: Phase2TrackerDigitizer.cc:176
cms
Namespace of DDCMS conversion namespace.
Definition: ProducerAnalyzer.cc:21
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
cms::Phase2TrackerDigitizer::AlgorithmType::InnerPixel