Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:30:58

0001 #ifndef SimTracker_SiStripDigitizer_DigiSimLinkPileUpSignals_h
0002 #define SimTracker_SiStripDigitizer_DigiSimLinkPileUpSignals_h
0003 
0004 #include <map>
0005 #include <vector>
0006 #include "SimDataFormats/TrackingHit/interface/PSimHit.h"
0007 
0008 class SimHit;
0009 /**
0010  * Class which takes the responses from each SimHit and piles-up them, within a given module.
0011  * More precisely, it keeps for each strip the link to each individual measurement.
0012  */
0013 class DigiSimLinkPileUpSignals {
0014 public:
0015   // type used to describe the amplitude on a strip
0016   typedef float Amplitude;
0017   // associates to each strip a vector of pairs {simhit,amplitude}.
0018   // That allows later to comput the fraction of the contribution of each simhit to the ADC value
0019   typedef std::map<int, std::vector<std::pair<const PSimHit*, Amplitude> >, std::less<int> > HitToDigisMapType;
0020   // associates to each strip a vector of pairs {simhit,index_in_the_allhit_collection}
0021   // That allows to build the links properly
0022   typedef std::map<int, std::vector<std::pair<const PSimHit*, int> >, std::less<int> > HitCounterToDigisMapType;
0023 
0024   DigiSimLinkPileUpSignals() { reset(); }
0025 
0026   virtual ~DigiSimLinkPileUpSignals() {}
0027 
0028   virtual void add(const std::vector<float>& locAmpl,
0029                    const size_t& firstChannelWithSignal,
0030                    const size_t& lastChannelWithSignal,
0031                    const PSimHit* hit,
0032                    const int& counter);
0033 
0034   void reset() { resetLink(); }
0035 
0036   const HitToDigisMapType& dumpLink() const { return theMapLink; }
0037 
0038   const HitCounterToDigisMapType& dumpCounterLink() const { return theCounterMapLink; }
0039 
0040 private:
0041   void resetLink();
0042   HitToDigisMapType theMapLink;
0043   HitCounterToDigisMapType theCounterMapLink;
0044 };
0045 #endif