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 
26 
27 #include <unordered_map>
28 
29 // Forward declaration
30 namespace CLHEP {
31  class HepRandomEngine;
32 }
33 
34 namespace edm {
35  class Event;
36  class EventSetup;
37  class ParameterSet;
38  template<typename T> class Handle;
39  class ConsumesCollector;
40 }
41 
42 class MagneticField;
44 class PSimHit;
47 
48 namespace cms
49 {
51 
52  public:
53  typedef std::unordered_map<unsigned, TrackerGeometry::ModuleType> ModuleTypeCache;
54 
56  ~Phase2TrackerDigitizer() override;
57  void initializeEvent(edm::Event const& e, edm::EventSetup const& c) override;
58  void accumulate(edm::Event const& e, edm::EventSetup const& c) override;
59  void accumulate(PileUpEventPrincipal const& e, edm::EventSetup const& c, edm::StreamID const&) override;
60  void finalizeEvent(edm::Event& e, edm::EventSetup const& c) override;
61  virtual void beginJob() {}
62  void beginLuminosityBlock(edm::LuminosityBlock const& lumi, edm::EventSetup const& iSetup) override;
63 
64  template <class T>
65  void accumulate_local(T const& iEvent, edm::EventSetup const& iSetup);
66 
67  // For premixing
68  void loadAccumulator(const std::map<unsigned int, std::map<int, float> >& accumulator);
69  private:
70  using vstring = std::vector<std::string> ;
71 
72  // constants of different algorithm types
73  enum class AlgorithmType {
74  InnerPixel,
75  PixelinPS,
76  StripinPS,
77  TwoStrip,
78  Unknown
79  };
80  AlgorithmType getAlgoType(unsigned int idet);
81 
82  void accumulatePixelHits(edm::Handle<std::vector<PSimHit> >,
83  size_t globalSimHitIndex,
84  const unsigned int tofBin);
85  void addPixelCollection(edm::Event& iEvent, const edm::EventSetup& iSetup, const bool ot_analog);
86 
87  // Templated for premixing
88  template <typename DigiType>
89  void addOuterTrackerCollection(edm::Event& iEvent, const edm::EventSetup& iSetup);
90 
91 
92  bool first_;
93 
102  std::map<std::string,size_t> crossingSimHitIndexOffset_;
103  std::map<AlgorithmType, std::unique_ptr<Phase2TrackerDigitizerAlgorithm> > algomap_;
109  std::map<unsigned int, const Phase2TrackerGeomDetUnit*> detectorUnits_;
113  const bool premixStage1_;
114  const bool makeDigiSimLinks_;
115  // cache for detector types
116  ModuleTypeCache moduleTypeCache_;
117 
118  };
119 }
120 #endif
edm::ESWatcher< TrackerDigiGeometryRecord > theTkDigiGeomWatcher
std::unordered_map< unsigned, TrackerGeometry::ModuleType > ModuleTypeCache
std::map< unsigned int, const Phase2TrackerGeomDetUnit * > detectorUnits_
int iEvent
Definition: GenABIO.cc:224
edm::ESHandle< TrackerTopology > tTopoHand
edm::ESHandle< TrackerGeometry > pDD_
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. ...
Namespace of DDCMS conversion namespace.
edm::ESHandle< MagneticField > pSetup_
std::map< AlgorithmType, std::unique_ptr< Phase2TrackerDigitizerAlgorithm > > algomap_
HLT enums.
long double T
std::vector< std::string > vstring