Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include "SimTracker/SiStripDigitizer/interface/SiPileUpSignals.h"
0002 #include "SimDataFormats/TrackingHit/interface/PSimHit.h"
0003 
0004 void SiPileUpSignals::resetSignals() { signal_.clear(); }
0005 
0006 void SiPileUpSignals::add(uint32_t detID,
0007                           const std::vector<float>& locAmpl,
0008                           const size_t& firstChannelWithSignal,
0009                           const size_t& lastChannelWithSignal) {
0010   SignalMapType& theSignal = signal_[detID];
0011   for (size_t iChannel = firstChannelWithSignal; iChannel < lastChannelWithSignal; ++iChannel) {
0012     if (locAmpl[iChannel] != 0.0) {
0013       if (theSignal.find(iChannel) == theSignal.end()) {
0014         theSignal.insert(std::make_pair(iChannel, locAmpl[iChannel]));
0015       } else {
0016         theSignal[iChannel] += locAmpl[iChannel];
0017       }
0018     }
0019   }
0020 }