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  virtual ~Phase2TrackerDigitizer();
57  virtual void initializeEvent(edm::Event const& e, edm::EventSetup const& c) override;
58  virtual void accumulate(edm::Event const& e, edm::EventSetup const& c) override;
59  virtual void accumulate(PileUpEventPrincipal const& e, edm::EventSetup const& c, edm::StreamID const&) override;
60  virtual void finalizeEvent(edm::Event& e, edm::EventSetup const& c) override;
61  virtual void beginJob() {}
62  virtual void beginLuminosityBlock(edm::LuminosityBlock const& lumi, edm::EventSetup const& iSetup) override;
63  virtual void endLuminosityBlock(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 
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  void addOuterTrackerCollection(edm::Event& iEvent, const edm::EventSetup& iSetup);
87 
88 
89  bool first_;
90 
99  std::map<std::string,size_t> crossingSimHitIndexOffset_;
100  std::map<AlgorithmType, std::unique_ptr<Phase2TrackerDigitizerAlgorithm> > algomap_;
106  std::map<unsigned int, const Phase2TrackerGeomDetUnit*> detectorUnits_;
107  CLHEP::HepRandomEngine* rndEngine_;
111 
112  // cache for detector types
113  ModuleTypeCache moduleTypeCache_;
114 
115  };
116 }
117 #endif
edm::ESWatcher< TrackerDigiGeometryRecord > theTkDigiGeomWatcher
const edm::ParameterSet & iconfig_
std::unordered_map< unsigned, TrackerGeometry::ModuleType > ModuleTypeCache
std::map< unsigned int, const Phase2TrackerGeomDetUnit * > detectorUnits_
int iEvent
Definition: GenABIO.cc:230
CLHEP::HepRandomEngine * rndEngine_
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. ...
edm::ESHandle< MagneticField > pSetup_
std::map< AlgorithmType, std::unique_ptr< Phase2TrackerDigitizerAlgorithm > > algomap_
HLT enums.
long double T
std::vector< std::string > vstring