CMS 3D CMS Logo

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

Go to the documentation of this file.
00001 #ifndef Tracker_SiPileUpSignals_h
00002 #define Tracker_SiPileUpSignals_h
00003 
00004 #include <map>
00005 #include <vector>
00006 #include "SimDataFormats/TrackingHit/interface/PSimHit.h"
00007 #include "FWCore/Utilities/interface/Map.h"
00008 
00009 class SimHit;
00014 class SiPileUpSignals{ 
00015  public:
00016   // type used to describe the amplitude on a strip
00017   typedef float Amplitude;
00018   // associates to each strip a vector of amplitudes. 
00019   // That allows later to comput the fraction of the contribution of each simhit to the ADC value
00020   typedef std::map<int, Amplitude>  SignalMapType;
00021   typedef std::map<uint32_t, SignalMapType>  signalMaps;
00022   
00023   SiPileUpSignals() { reset(); }
00024 
00025   virtual ~SiPileUpSignals() { }
00026   
00027   virtual void add(uint32_t detID,
00028                    const std::vector<double>& locAmpl,
00029                    const size_t& firstChannelWithSignal, const size_t& lastChannelWithSignal);
00030 
00031   void reset(){ resetSignals(); }
00032   
00033   const SignalMapType* getSignal(uint32_t detID) const {
00034     auto where = signal_.find(detID);
00035     if(where == signal_.end()) {
00036       return 0;
00037     }
00038     return &where->second;
00039   }
00040   
00041  private:
00042   void resetSignals();
00043   signalMaps signal_;
00044 };
00045 #endif