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,
27  const PPSPixelTopology *pixelTopology) {
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 }
mps_fire.i
i
Definition: mps_fire.py:428
RPixDetDigitizer::verbosity_
int verbosity_
Definition: RPixDetDigitizer.h:54
RPixDetDigitizer::run
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)
Definition: RPixDetDigitizer.cc:22
input
static const std::string input
Definition: EdmProvDump.cc:48
RPixDetDigitizer::theRPixDummyROCSimulator
std::unique_ptr< RPixDummyROCSimulator > theRPixDummyROCSimulator
Definition: RPixDetDigitizer.h:47
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
RPixDetDigitizer::theRPixPileUpSignals
std::unique_ptr< RPixPileUpSignals > theRPixPileUpSignals
Definition: RPixDetDigitizer.h:45
RPixDetDigitizer::links_persistence_
bool links_persistence_
Definition: RPixDetDigitizer.h:55
RPixDetDigitizer.h
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
RPixDetDigitizer::RPixDetDigitizer
RPixDetDigitizer(const edm::ParameterSet &params, CLHEP::HepRandomEngine &eng, uint32_t det_id, const PPSPixelTopology &ppt)
Definition: RPixDetDigitizer.cc:3
RPixDetDigitizer::det_id_
uint32_t det_id_
Definition: RPixDetDigitizer.h:52
RPixDetDigitizer::noNoise
bool noNoise
Definition: RPixDetDigitizer.h:51
edm::ParameterSet
Definition: ParameterSet.h:47
CTPPSPixelGainCalibrations
Definition: CTPPSPixelGainCalibrations.h:8
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
PPSPixelTopology
Definition: PPSPixelTopology.h:22
RPixDetDigitizer::theRPixHitChargeConverter
std::unique_ptr< RPixHitChargeConverter > theRPixHitChargeConverter
Definition: RPixDetDigitizer.h:46
RPixDetDigitizer::~RPixDetDigitizer
~RPixDetDigitizer()
Definition: RPixDetDigitizer.cc:20
RPixDetDigitizer::thePixelThresholdInE
double thePixelThresholdInE
Definition: RPixDetDigitizer.h:50
RPixDetDigitizer::theNoiseInElectrons
double theNoiseInElectrons
Definition: RPixDetDigitizer.h:49