CMS 3D CMS Logo

SiPileUpSignals.h
Go to the documentation of this file.
1 #ifndef Tracker_SiPileUpSignals_h
2 #define Tracker_SiPileUpSignals_h
3 
4 #include <map>
5 #include <vector>
8 
9 class SimHit;
15 public:
16  // type used to describe the amplitude on a strip
17  typedef float Amplitude;
18  // associates to each strip a vector of amplitudes.
19  // That allows later to comput the fraction of the contribution of each simhit to the ADC value
20  typedef std::map<int, Amplitude> SignalMapType;
21  typedef std::map<uint32_t, SignalMapType> signalMaps;
22 
24 
25  virtual ~SiPileUpSignals() {}
26 
27  virtual void add(uint32_t detID,
28  const std::vector<float>& locAmpl,
29  const size_t& firstChannelWithSignal,
30  const size_t& lastChannelWithSignal);
31 
32  void reset() { resetSignals(); }
33 
34  const SignalMapType* getSignal(uint32_t detID) const {
35  auto where = signal_.find(detID);
36  if (where == signal_.end()) {
37  return nullptr;
38  }
39  return &where->second;
40  }
41 
42 private:
43  void resetSignals();
45 };
46 #endif
virtual void add(uint32_t detID, const std::vector< float > &locAmpl, const size_t &firstChannelWithSignal, const size_t &lastChannelWithSignal)
std::map< uint32_t, SignalMapType > signalMaps
std::map< int, Amplitude > SignalMapType
signalMaps signal_
virtual ~SiPileUpSignals()
const SignalMapType * getSignal(uint32_t detID) const