CMS 3D CMS Logo

/afs/cern.ch/work/c/cnuttens/private/SiStripDev/DocumentationProduction/CMSSW_6_1_0/src/SimTracker/SiStripDigitizer/plugins/DigiSimLinkPileUpSignals.h

Go to the documentation of this file.
00001 #ifndef SimTracker_SiStripDigitizer_DigiSimLinkPileUpSignals_h
00002 #define SimTracker_SiStripDigitizer_DigiSimLinkPileUpSignals_h
00003 
00004 #include <map>
00005 #include <vector>
00006 #include "SimDataFormats/TrackingHit/interface/PSimHit.h"
00007 
00008 class SimHit;
00013 class DigiSimLinkPileUpSignals{ 
00014  public:
00015   // type used to describe the amplitude on a strip
00016   typedef float Amplitude;
00017   // associates to each strip a vector of pairs {simhit,amplitude}. 
00018   // That allows later to comput the fraction of the contribution of each simhit to the ADC value
00019   typedef std::map< int , std::vector < std::pair < const PSimHit*, Amplitude > >, std::less<int> >  HitToDigisMapType;
00020   // associates to each strip a vector of pairs {simhit,index_in_the_allhit_collection}
00021   // That allows to build the links properly
00022   typedef std::map< int , std::vector < std::pair < const PSimHit*, int > >, std::less<int> >  HitCounterToDigisMapType;
00023   
00024   DigiSimLinkPileUpSignals() { reset(); }
00025 
00026   virtual ~DigiSimLinkPileUpSignals() { }
00027   
00028   virtual void add(const std::vector<double>& locAmpl,
00029                    const size_t& firstChannelWithSignal, const size_t& lastChannelWithSignal,
00030                    const PSimHit* hit,const int& counter);
00031                    
00032   void reset(){ resetLink(); }
00033   
00034   const HitToDigisMapType& dumpLink() const { return theMapLink; }
00035   
00036   const HitCounterToDigisMapType& dumpCounterLink() const { return theCounterMapLink; }
00037   
00038  private:
00039   void resetLink();
00040   HitToDigisMapType theMapLink;
00041   HitCounterToDigisMapType theCounterMapLink;
00042 };
00043 #endif