Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include "SimPPS/PPSPixelDigiProducer/interface/RPixPileUpSignals.h"
0002 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0003 
0004 RPixPileUpSignals::RPixPileUpSignals(const edm::ParameterSet &params, uint32_t det_id) : det_id_(det_id) {
0005   links_persistence_ = params.getParameter<bool>("CTPPSPixelDigiSimHitRelationsPersistence");
0006   verbosity_ = params.getParameter<int>("RPixVerbosity");
0007 }
0008 
0009 void RPixPileUpSignals::reset() {
0010   the_pixel_charge_piled_up_map_.clear();
0011   the_pixel_charge_piled_up_map_links_.clear();
0012 }
0013 
0014 void RPixPileUpSignals::add(const std::map<unsigned short, double> &charge_induced, int PSimHitIndex) {
0015   for (std::map<unsigned short, double>::const_iterator i = charge_induced.begin(); i != charge_induced.end(); ++i) {
0016     the_pixel_charge_piled_up_map_[i->first] += i->second;
0017     if (links_persistence_ && i->second > 0) {
0018       the_pixel_charge_piled_up_map_links_[i->first].push_back(std::pair<int, double>(PSimHitIndex, i->second));
0019       if (verbosity_) {
0020         edm::LogInfo("RPixPileUpSignals") << "Det id=" << det_id_ << " pixel=" << i->first << " charge=" << i->second;
0021       }
0022     }
0023   }
0024 }