CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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, const size_t& lastChannelWithSignal);
30 
31  void reset(){ resetSignals(); }
32 
33  const SignalMapType* getSignal(uint32_t detID) const {
34  auto where = signal_.find(detID);
35  if(where == signal_.end()) {
36  return 0;
37  }
38  return &where->second;
39  }
40 
41  private:
42  void resetSignals();
44 };
45 #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
const SignalMapType * getSignal(uint32_t detID) const
std::map< int, Amplitude > SignalMapType
signalMaps signal_
virtual ~SiPileUpSignals()