CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HGCDigitizer.h
Go to the documentation of this file.
1 #ifndef HGCalSimProducers_HGCDigitizer_h
2 #define HGCalSimProducers_HGCDigitizer_h
3 
7 
10 
17 
18 #include <vector>
19 #include <map>
20 #include <memory>
21 #include <tuple>
22 
23 class PCaloHit;
25 
27 {
28 public:
29 
32 
33  typedef std::tuple<int,uint32_t,float> HGCCaloHitTuple_t;
35  {
36  unsigned int detId_a(std::get<1>(a)), detId_b(std::get<1>(b));
37 
38  if(detId_a<detId_b) return true;
39  if(detId_a>detId_b) return false;
40 
41  double time_a(std::get<2>(a)), time_b(std::get<2>(b));
42  if(time_a<time_b) return true;
43 
44  return false;
45  }
46 
47 
51  void accumulate(edm::Event const& e, edm::EventSetup const& c, CLHEP::HepRandomEngine* hre);
52  void accumulate(PileUpEventPrincipal const& e, edm::EventSetup const& c, CLHEP::HepRandomEngine* hre);
53  void accumulate(edm::Handle<edm::PCaloHitContainer> const &hits, int bxCrossing,const edm::ESHandle<HGCalGeometry> &geom, CLHEP::HepRandomEngine* hre);
54 
58  void initializeEvent(edm::Event const& e, edm::EventSetup const& c);
59  void finalizeEvent(edm::Event& e, edm::EventSetup const& c, CLHEP::HepRandomEngine* hre);
60 
67 
71  void beginRun(const edm::EventSetup & es);
72  void endRun();
73 
74 private :
75 
76  //used for initialization
78 
79  //input/output names
81 
82  //digitization type (it's up to the specializations to decide it's meaning)
84 
85  //handle sim hits
87  double bxTime_;
88  std::unique_ptr<hgc::HGCSimHitDataAccumulator> simHitAccumulator_;
90 
91  //digitizers
92  std::unique_ptr<HGCEEDigitizer> theHGCEEDigitizer_;
93  std::unique_ptr<HGCHEbackDigitizer> theHGCHEbackDigitizer_;
94  std::unique_ptr<HGCHEfrontDigitizer> theHGCHEfrontDigitizer_;
95 
96  //subdetector id
98 
99  //misc switches
101  uint32_t verbosity_;
102 
103  //reference speed to evaluate time of arrival at the sensititive detector, assuming the center of CMS
104  float refSpeed_;
105 
106  //delay to apply after evaluating time of arrival at the sensitive detector
107  float tofDelay_;
108 };
109 
110 
111 #endif
112 
113 
114 
void finalizeEvent(edm::Event &e, edm::EventSetup const &c, CLHEP::HepRandomEngine *hre)
Definition: HGCDigitizer.cc:66
ForwardSubdetector mySubDet_
Definition: HGCDigitizer.h:97
int digitizationType_
Definition: HGCDigitizer.h:83
std::string hitCollection_
Definition: HGCDigitizer.h:80
void resetSimHitDataAccumulator()
bool useAllChannels_
Definition: HGCDigitizer.h:100
bool checkValidDetIds_
Definition: HGCDigitizer.h:77
std::tuple< int, uint32_t, float > HGCCaloHitTuple_t
Definition: HGCDigitizer.h:33
void initializeEvent(edm::Event const &e, edm::EventSetup const &c)
actions at the start/end of event
Definition: HGCDigitizer.cc:60
ForwardSubdetector
bool producesEEDigis()
Definition: HGCDigitizer.h:63
std::string digiCollection_
Definition: HGCDigitizer.h:80
void beginRun(const edm::EventSetup &es)
actions at the start/end of run
bool producesHEfrontDigis()
Definition: HGCDigitizer.h:64
std::unique_ptr< HGCHEbackDigitizer > theHGCHEbackDigitizer_
Definition: HGCDigitizer.h:93
bool producesHEbackDigis()
Definition: HGCDigitizer.h:65
double b
Definition: hdecay.h:120
int maxSimHitsAccTime_
Definition: HGCDigitizer.h:86
std::unique_ptr< HGCHEfrontDigitizer > theHGCHEfrontDigitizer_
Definition: HGCDigitizer.h:94
std::unique_ptr< HGCEEDigitizer > theHGCEEDigitizer_
Definition: HGCDigitizer.h:92
void accumulate(edm::Event const &e, edm::EventSetup const &c, CLHEP::HepRandomEngine *hre)
handle SimHit accumulation
Definition: HGCDigitizer.cc:92
double a
Definition: hdecay.h:121
HGCDigitizer(const edm::ParameterSet &ps, edm::ConsumesCollector &iC)
Definition: HGCDigitizer.cc:24
std::unique_ptr< hgc::HGCSimHitDataAccumulator > simHitAccumulator_
Definition: HGCDigitizer.h:88
static bool orderByDetIdThenTime(const HGCCaloHitTuple_t &a, const HGCCaloHitTuple_t &b)
Definition: HGCDigitizer.h:34
double bxTime_
Definition: HGCDigitizer.h:87
std::string digiCollection()
Definition: HGCDigitizer.h:66
uint32_t verbosity_
Definition: HGCDigitizer.h:101