Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:30:53

0001 
0002 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0003 #include "SimPPS/RPDigiProducer/plugins/RPPileUpSignals.h"
0004 #include <iostream>
0005 
0006 RPPileUpSignals::RPPileUpSignals(const edm::ParameterSet &params, RPDetId det_id) : det_id_(det_id) {
0007   links_persistence_ = params.getParameter<bool>("RPDigiSimHitRelationsPresistence");
0008   verbosity_ = params.getParameter<int>("RPVerbosity");
0009 }
0010 
0011 void RPPileUpSignals::reset() {
0012   the_strip_charge_piled_up_map_.clear();
0013   the_strip_charge_piled_up_map_links_.clear();
0014 }
0015 
0016 void RPPileUpSignals::add(const simromanpot::strip_charge_map &charge_induced, int PSimHitIndex) {
0017   for (simromanpot::strip_charge_map::const_iterator i = charge_induced.begin(); i != charge_induced.end(); ++i) {
0018     the_strip_charge_piled_up_map_[i->first] += i->second;
0019     if (links_persistence_ && i->second > 0) {
0020       the_strip_charge_piled_up_map_links_[i->first].push_back(std::pair<int, double>(PSimHitIndex, i->second));
0021       if (verbosity_) {
0022         edm::LogInfo("RPPileUpSignals") << "Det id=" << det_id_ << " strip=" << i->first << " charge=" << i->second
0023                                         << "\n";
0024       }
0025     }
0026   }
0027 }