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 }
mps_fire.i
i
Definition: mps_fire.py:428
RPixDetDigitizer::verbosity_
int verbosity_
Definition: RPixDetDigitizer.h:58
input
static const std::string input
Definition: EdmProvDump.cc:48
RPixDetDigitizer::theRPixDummyROCSimulator
std::unique_ptr< RPixDummyROCSimulator > theRPixDummyROCSimulator
Definition: RPixDetDigitizer.h:50
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
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)
Definition: RPixDetDigitizer.cc:27
CTPPSPixelTopology
Geometrical and topological information on RPix silicon detector. Uses coordinate a frame with origin...
Definition: CTPPSPixelTopology.h:10
RPixDetDigitizer::theRPixPileUpSignals
std::unique_ptr< RPixPileUpSignals > theRPixPileUpSignals
Definition: RPixDetDigitizer.h:48
RPixDetDigitizer::links_persistence_
bool links_persistence_
Definition: RPixDetDigitizer.h:59
RPixDetDigitizer.h
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
CTPPSPixelTopology.h
RPixDetDigitizer::det_id_
uint32_t det_id_
Definition: RPixDetDigitizer.h:56
RPixDetDigitizer::noNoise
bool noNoise
Definition: RPixDetDigitizer.h:55
edm::ParameterSet
Definition: ParameterSet.h:47
CTPPSPixelGainCalibrations
Definition: CTPPSPixelGainCalibrations.h:8
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
edm::EventSetup
Definition: EventSetup.h:57
RPixDetDigitizer::theRPixHitChargeConverter
std::unique_ptr< RPixHitChargeConverter > theRPixHitChargeConverter
Definition: RPixDetDigitizer.h:49
RPixDetDigitizer::~RPixDetDigitizer
~RPixDetDigitizer()
Definition: RPixDetDigitizer.cc:25
CTPPSPixelTopology::detPixelNo
unsigned short detPixelNo() const
Definition: CTPPSPixelTopology.h:32
RPixDetDigitizer::thePixelThresholdInE
double thePixelThresholdInE
Definition: RPixDetDigitizer.h:54
ParameterSet.h
RPixDetDigitizer::numPixels
int numPixels
Definition: RPixDetDigitizer.h:52
RPixDetDigitizer::RPixDetDigitizer
RPixDetDigitizer(const edm::ParameterSet &params, CLHEP::HepRandomEngine &eng, uint32_t det_id, const edm::EventSetup &iSetup)
Definition: RPixDetDigitizer.cc:7
RPixDetDigitizer::theNoiseInElectrons
double theNoiseInElectrons
Definition: RPixDetDigitizer.h:53