Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:30:35

0001 #ifndef Tracker_SiPileUpSignals_h
0002 #define Tracker_SiPileUpSignals_h
0003 
0004 #include <map>
0005 #include <vector>
0006 #include "SimDataFormats/TrackingHit/interface/PSimHit.h"
0007 #include "FWCore/Utilities/interface/Map.h"
0008 
0009 class SimHit;
0010 /**
0011  * Class which takes the responses from each SimHit and piles-up them, within a given module.
0012  * More precisely, it keeps for each strip the link to each individual measurement.
0013  */
0014 class SiPileUpSignals {
0015 public:
0016   // type used to describe the amplitude on a strip
0017   typedef float Amplitude;
0018   // associates to each strip a vector of amplitudes.
0019   // That allows later to comput the fraction of the contribution of each simhit to the ADC value
0020   typedef std::map<int, Amplitude> SignalMapType;
0021   typedef std::map<uint32_t, SignalMapType> signalMaps;
0022 
0023   SiPileUpSignals() { reset(); }
0024 
0025   virtual ~SiPileUpSignals() {}
0026 
0027   virtual void add(uint32_t detID,
0028                    const std::vector<float>& locAmpl,
0029                    const size_t& firstChannelWithSignal,
0030                    const size_t& lastChannelWithSignal);
0031 
0032   void reset() { resetSignals(); }
0033 
0034   const SignalMapType* getSignal(uint32_t detID) const {
0035     auto where = signal_.find(detID);
0036     if (where == signal_.end()) {
0037       return nullptr;
0038     }
0039     return &where->second;
0040   }
0041 
0042 private:
0043   void resetSignals();
0044   signalMaps signal_;
0045 };
0046 #endif