CMS 3D CMS Logo

RPixDetDigitizer.cc
Go to the documentation of this file.
2 
4  CLHEP::HepRandomEngine &eng,
5  uint32_t det_id,
6  const PPSPixelTopology &ppt)
7  : det_id_(det_id) {
8  verbosity_ = params.getParameter<int>("RPixVerbosity");
9  theNoiseInElectrons = params.getParameter<double>("RPixEquivalentNoiseCharge");
10  thePixelThresholdInE = params.getParameter<double>("RPixDummyROCThreshold");
11  noNoise = params.getParameter<bool>("RPixNoNoise");
12 
13  links_persistence_ = params.getParameter<bool>("CTPPSPixelDigiSimHitRelationsPersistence");
14 
15  theRPixPileUpSignals = std::make_unique<RPixPileUpSignals>(params, det_id_);
16  theRPixDummyROCSimulator = std::make_unique<RPixDummyROCSimulator>(params, det_id_);
17  theRPixHitChargeConverter = std::make_unique<RPixHitChargeConverter>(params, eng, det_id_, ppt);
18 }
19 
21 
22 void RPixDetDigitizer::run(const std::vector<PSimHit> &input,
23  const std::vector<int> &input_links,
24  std::vector<CTPPSPixelDigi> &output_digi,
25  std::vector<std::vector<std::pair<int, double> > > &output_digi_links,
26  const CTPPSPixelGainCalibrations *pcalibrations,
28  if (verbosity_)
29  edm::LogInfo("PPS") << "RPixDetDigitizer " << det_id_ << " received input.size()=" << input.size();
30  theRPixPileUpSignals->reset();
31  bool links_persistence_checked = links_persistence_ && input_links.size() == input.size();
32  int input_size = input.size();
33  for (int i = 0; i < input_size; ++i) {
34  std::map<unsigned short, double> the_pixel_charge_map;
35  the_pixel_charge_map = theRPixHitChargeConverter->processHit(input[i], *pixelTopology);
36 
37  if (verbosity_)
38  edm::LogInfo("PPS") << "RPixDetDigitizer " << det_id_ << " returned hits=" << the_pixel_charge_map.size();
39  if (links_persistence_checked)
40  theRPixPileUpSignals->add(the_pixel_charge_map, input_links[i]);
41  else
42  theRPixPileUpSignals->add(the_pixel_charge_map, 0);
43  }
44  const std::map<unsigned short, double> &theSignal = theRPixPileUpSignals->dumpSignal();
45  std::map<unsigned short, std::vector<std::pair<int, double> > > &theSignalProvenance =
46  theRPixPileUpSignals->dumpLinks();
47  std::map<unsigned short, double> afterNoise;
48  afterNoise = theSignal;
49  theRPixDummyROCSimulator->ConvertChargeToHits(
50  afterNoise, theSignalProvenance, output_digi, output_digi_links, pcalibrations);
51 }
RPixDetDigitizer(const edm::ParameterSet &params, CLHEP::HepRandomEngine &eng, uint32_t det_id, const PPSPixelTopology &ppt)
static std::string const input
Definition: EdmProvDump.cc:50
std::unique_ptr< RPixHitChargeConverter > theRPixHitChargeConverter
std::unique_ptr< RPixDummyROCSimulator > theRPixDummyROCSimulator
Log< level::Info, false > LogInfo
void run(const std::vector< PSimHit > &input, const std::vector< int > &input_links, std::vector< CTPPSPixelDigi > &output_digi, std::vector< std::vector< std::pair< int, double > > > &output_digi_links, const CTPPSPixelGainCalibrations *pcalibration, const PPSPixelTopology *ppt)
std::unique_ptr< RPixPileUpSignals > theRPixPileUpSignals