CMS 3D CMS Logo

HGCDigitizer.h
Go to the documentation of this file.
1 #ifndef HGCalSimProducers_HGCDigitizer_h
2 #define HGCalSimProducers_HGCDigitizer_h
3 
7 
10 
18 
19 #include <vector>
20 #include <map>
21 #include <unordered_set>
22 #include <memory>
23 #include <tuple>
24 
25 class PCaloHit;
27 
29 {
30 public:
31 
34 
35  // index , det id, time
36  typedef std::tuple<int,uint32_t,float> HGCCaloHitTuple_t;
37  static bool orderByDetIdThenTime(const HGCCaloHitTuple_t &a, const HGCCaloHitTuple_t &b)
38  {
39  unsigned int detId_a(std::get<1>(a)), detId_b(std::get<1>(b));
40 
41  if(detId_a<detId_b) return true;
42  if(detId_a>detId_b) return false;
43 
44  double time_a(std::get<2>(a)), time_b(std::get<2>(b));
45  if(time_a<time_b) return true;
46 
47  return false;
48  }
49 
50 
54  void accumulate(edm::Event const& e, edm::EventSetup const& c, CLHEP::HepRandomEngine* hre);
55  void accumulate(PileUpEventPrincipal const& e, edm::EventSetup const& c, CLHEP::HepRandomEngine* hre);
56  template<typename GEOM>
57  void accumulate(edm::Handle<edm::PCaloHitContainer> const &hits, int bxCrossing,const GEOM *geom, CLHEP::HepRandomEngine* hre);
58 
62  void initializeEvent(edm::Event const& e, edm::EventSetup const& c);
63  void finalizeEvent(edm::Event& e, edm::EventSetup const& c, CLHEP::HepRandomEngine* hre);
64 
71 
75  void beginRun(const edm::EventSetup & es);
76  void endRun();
77 
78 private :
79 
80  //input/output names
82 
83  //digitization type (it's up to the specializations to decide it's meaning)
85 
86  //handle sim hits
89  std::unique_ptr<hgc::HGCSimHitDataAccumulator> simHitAccumulator_;
91 
92  //digitizers
93  std::unique_ptr<HGCEEDigitizer> theHGCEEDigitizer_;
94  std::unique_ptr<HGCHEbackDigitizer> theHGCHEbackDigitizer_;
95  std::unique_ptr<HGCHEfrontDigitizer> theHGCHEfrontDigitizer_;
96 
97  //geometries
98  std::unordered_set<DetId> validIds_;
101 
102  //subdetector id
104 
105  //misc switches
106  uint32_t verbosity_;
107 
108  //reference speed to evaluate time of arrival at the sensititive detector, assuming the center of CMS
109  float refSpeed_;
110 
111  //delay to apply after evaluating time of arrival at the sensitive detector
112  float tofDelay_;
113 
114  //average occupancies
115  std::array<double,3> averageOccupancies_;
116  uint32_t nEvents_;
117 
118  std::vector<float> cce_;
119 
120  std::map< uint32_t, std::vector< std::pair<float, float> > > hitRefs_bx0;
121 };
122 
123 
124 #endif
125 
126 
127 
uint32_t nEvents_
Definition: HGCDigitizer.h:116
std::vector< float > cce_
Definition: HGCDigitizer.h:118
void finalizeEvent(edm::Event &e, edm::EventSetup const &c, CLHEP::HepRandomEngine *hre)
ForwardSubdetector mySubDet_
Definition: HGCDigitizer.h:103
int digitizationType_
Definition: HGCDigitizer.h:84
std::string hitCollection_
Definition: HGCDigitizer.h:81
void resetSimHitDataAccumulator()
std::tuple< int, uint32_t, float > HGCCaloHitTuple_t
Definition: HGCDigitizer.h:36
void initializeEvent(edm::Event const &e, edm::EventSetup const &c)
actions at the start/end of event
ForwardSubdetector
const HGCalGeometry * gHGCal_
Definition: HGCDigitizer.h:99
bool producesEEDigis()
Definition: HGCDigitizer.h:67
std::string digiCollection_
Definition: HGCDigitizer.h:81
void beginRun(const edm::EventSetup &es)
actions at the start/end of run
std::unordered_set< DetId > validIds_
Definition: HGCDigitizer.h:98
bool producesHEfrontDigis()
Definition: HGCDigitizer.h:68
std::unique_ptr< HGCHEbackDigitizer > theHGCHEbackDigitizer_
Definition: HGCDigitizer.h:94
bool producesHEbackDigis()
Definition: HGCDigitizer.h:69
double b
Definition: hdecay.h:120
int maxSimHitsAccTime_
Definition: HGCDigitizer.h:87
double ev_per_eh_pair_
Definition: HGCDigitizer.h:88
std::unique_ptr< HGCHEfrontDigitizer > theHGCHEfrontDigitizer_
Definition: HGCDigitizer.h:95
std::unique_ptr< HGCEEDigitizer > theHGCEEDigitizer_
Definition: HGCDigitizer.h:93
void accumulate(edm::Event const &e, edm::EventSetup const &c, CLHEP::HepRandomEngine *hre)
handle SimHit accumulation
double a
Definition: hdecay.h:121
std::map< uint32_t, std::vector< std::pair< float, float > > > hitRefs_bx0
Definition: HGCDigitizer.h:120
HGCDigitizer(const edm::ParameterSet &ps, edm::ConsumesCollector &iC)
std::array< double, 3 > averageOccupancies_
Definition: HGCDigitizer.h:115
std::unique_ptr< hgc::HGCSimHitDataAccumulator > simHitAccumulator_
Definition: HGCDigitizer.h:89
static bool orderByDetIdThenTime(const HGCCaloHitTuple_t &a, const HGCCaloHitTuple_t &b)
Definition: HGCDigitizer.h:37
double bxTime_
Definition: HGCDigitizer.h:88
std::string digiCollection()
Definition: HGCDigitizer.h:70
const HcalGeometry * gHcal_
Definition: HGCDigitizer.h:100
uint32_t verbosity_
Definition: HGCDigitizer.h:106