CMS 3D CMS Logo

RPixDetDigitizer.cc
Go to the documentation of this file.
1 #include <vector>
2 #include <iostream>
6 
8  CLHEP::HepRandomEngine &eng,
9  uint32_t det_id,
10  const edm::EventSetup &iSetup)
11  : det_id_(det_id) {
12  verbosity_ = params.getParameter<int>("RPixVerbosity");
14  theNoiseInElectrons = params.getParameter<double>("RPixEquivalentNoiseCharge");
15  thePixelThresholdInE = params.getParameter<double>("RPixDummyROCThreshold");
16  noNoise = params.getParameter<bool>("RPixNoNoise");
17 
18  links_persistence_ = params.getParameter<bool>("CTPPSPixelDigiSimHitRelationsPersistence");
19 
20  theRPixPileUpSignals = std::make_unique<RPixPileUpSignals>(params, det_id_);
21  theRPixDummyROCSimulator = std::make_unique<RPixDummyROCSimulator>(params, det_id_);
22  theRPixHitChargeConverter = std::make_unique<RPixHitChargeConverter>(params, eng, det_id_);
23 }
24 
26 
27 void RPixDetDigitizer::run(const std::vector<PSimHit> &input,
28  const std::vector<int> &input_links,
29  std::vector<CTPPSPixelDigi> &output_digi,
30  std::vector<std::vector<std::pair<int, double> > > &output_digi_links,
31  const CTPPSPixelGainCalibrations *pcalibrations) {
32  if (verbosity_)
33  edm::LogInfo("RPixDetDigitizer") << det_id_ << " received input.size()=" << input.size();
34  theRPixPileUpSignals->reset();
35  bool links_persistence_checked = links_persistence_ && input_links.size() == input.size();
36  int input_size = input.size();
37  for (int i = 0; i < input_size; ++i) {
38  std::map<unsigned short, double> the_pixel_charge_map;
39  the_pixel_charge_map = theRPixHitChargeConverter->processHit(input[i]);
40 
41  if (verbosity_)
42  edm::LogInfo("RPixDetDigitizer") << det_id_ << " returned hits=" << the_pixel_charge_map.size();
43  if (links_persistence_checked)
44  theRPixPileUpSignals->add(the_pixel_charge_map, input_links[i]);
45  else
46  theRPixPileUpSignals->add(the_pixel_charge_map, 0);
47  }
48  const std::map<unsigned short, double> &theSignal = theRPixPileUpSignals->dumpSignal();
49  std::map<unsigned short, std::vector<std::pair<int, double> > > &theSignalProvenance =
50  theRPixPileUpSignals->dumpLinks();
51  std::map<unsigned short, double> afterNoise;
52  afterNoise = theSignal;
53  theRPixDummyROCSimulator->ConvertChargeToHits(
54  afterNoise, theSignalProvenance, output_digi, output_digi_links, pcalibrations);
55 }
T getParameter(std::string const &) const
RPixDetDigitizer(const edm::ParameterSet &params, CLHEP::HepRandomEngine &eng, uint32_t det_id, const edm::EventSetup &iSetup)
static std::string const input
Definition: EdmProvDump.cc:48
std::unique_ptr< RPixHitChargeConverter > theRPixHitChargeConverter
std::unique_ptr< RPixDummyROCSimulator > theRPixDummyROCSimulator
Geometrical and topological information on RPix silicon detector. Uses coordinate a frame with origin...
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)
unsigned short detPixelNo() const
std::unique_ptr< RPixPileUpSignals > theRPixPileUpSignals