Go to the documentation of this file.00001 #include "SiPileUpSignals.h"
00002 #include "SimDataFormats/TrackingHit/interface/PSimHit.h"
00003
00004 void SiPileUpSignals::resetSignals(){
00005 signal_.clear();
00006 }
00007
00008 void SiPileUpSignals::add(uint32_t detID, const std::vector<float>& locAmpl,
00009 const size_t& firstChannelWithSignal, const size_t& lastChannelWithSignal) {
00010 SignalMapType& theSignal = signal_[detID];
00011 for (size_t iChannel=firstChannelWithSignal; iChannel<lastChannelWithSignal; ++iChannel) {
00012 if(locAmpl[iChannel] != 0.0) {
00013 if(theSignal.find(iChannel) == theSignal.end()) {
00014 theSignal.insert(std::make_pair(iChannel, locAmpl[iChannel]));
00015 } else {
00016 theSignal[iChannel] += locAmpl[iChannel];
00017 }
00018 }
00019 }
00020 }