CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Attributes | Static Private Attributes
RPixDummyROCSimulator Class Reference

#include <RPixDummyROCSimulator.h>

Public Member Functions

void ConvertChargeToHits (const std::map< unsigned short, double > &signals, std::map< unsigned short, std::vector< std::pair< int, double > > > &theSignalProvenance, std::vector< CTPPSPixelDigi > &output_digi, std::vector< std::vector< std::pair< int, double > > > &output_digi_links, const CTPPSPixelGainCalibrations *pcalibration)
 
 RPixDummyROCSimulator (const edm::ParameterSet &params, uint32_t det_id)
 

Private Types

typedef std::set< unsigned short > dead_pixel_set
 

Private Attributes

double dead_pixel_probability_
 
dead_pixel_set dead_pixels_
 
bool dead_pixels_simulation_on_
 
uint32_t det_id_
 
bool doSingleCalibration_
 
double electron_per_adc_
 
bool links_persistence_
 
unsigned short pixels_no_
 
double threshold_
 
int VcaltoElectronGain_
 
int VcaltoElectronOffset_
 
int verbosity_
 

Static Private Attributes

static constexpr double highRangeCal_ = 1800.
 
static constexpr double lowRangeCal_ = 260.
 
static constexpr int maxADC_ = 255
 

Detailed Description

Definition at line 14 of file RPixDummyROCSimulator.h.

Member Typedef Documentation

◆ dead_pixel_set

typedef std::set<unsigned short> RPixDummyROCSimulator::dead_pixel_set
private

Definition at line 25 of file RPixDummyROCSimulator.h.

Constructor & Destructor Documentation

◆ RPixDummyROCSimulator()

RPixDummyROCSimulator::RPixDummyROCSimulator ( const edm::ParameterSet params,
uint32_t  det_id 
)

Definition at line 7 of file RPixDummyROCSimulator.cc.

7  : det_id_(det_id) {
8  threshold_ = params.getParameter<double>("RPixDummyROCThreshold");
9  electron_per_adc_ = params.getParameter<double>("RPixDummyROCElectronPerADC");
10  VcaltoElectronGain_ = params.getParameter<int>("VCaltoElectronGain");
11  VcaltoElectronOffset_ = params.getParameter<int>("VCaltoElectronOffset");
12  doSingleCalibration_ = params.getParameter<bool>("doSingleCalibration");
13  dead_pixel_probability_ = params.getParameter<double>("RPixDeadPixelProbability");
14  dead_pixels_simulation_on_ = params.getParameter<bool>("RPixDeadPixelSimulationOn");
16  verbosity_ = params.getParameter<int>("RPixVerbosity");
17  links_persistence_ = params.getParameter<bool>("CTPPSPixelDigiSimHitRelationsPersistence");
18 }

References dead_pixel_probability_, dead_pixels_simulation_on_, CTPPSPixelTopology::detPixelNo(), doSingleCalibration_, electron_per_adc_, links_persistence_, CalibrationSummaryClient_cfi::params, pixels_no_, threshold_, VcaltoElectronGain_, VcaltoElectronOffset_, and verbosity_.

Member Function Documentation

◆ ConvertChargeToHits()

void RPixDummyROCSimulator::ConvertChargeToHits ( const std::map< unsigned short, double > &  signals,
std::map< unsigned short, std::vector< std::pair< int, double > > > &  theSignalProvenance,
std::vector< CTPPSPixelDigi > &  output_digi,
std::vector< std::vector< std::pair< int, double > > > &  output_digi_links,
const CTPPSPixelGainCalibrations pcalibration 
)

set maximum for 8 bits adc

Definition at line 20 of file RPixDummyROCSimulator.cc.

25  {
26  for (std::map<unsigned short, double>::const_iterator i = signals.begin(); i != signals.end(); ++i) {
27  //one threshold per hybrid
28  unsigned short pixel_no = i->first;
29  if (verbosity_)
30  edm::LogInfo("RPixDummyROCSimulator") << "Dummy ROC adc and threshold : " << i->second << ", " << threshold_;
31  if (i->second > threshold_ && (!dead_pixels_simulation_on_ || dead_pixels_.find(pixel_no) == dead_pixels_.end())) {
32  float gain = 0;
33  float pedestal = 0;
34  int adc = 0;
35  uint32_t col = pixel_no / 160;
36  uint32_t row = pixel_no % 160;
37 
38  const CTPPSPixelGainCalibration &DetCalibs = pcalibrations->getGainCalibration(det_id_);
39 
40  // Avoid exception due to col > 103 in case of 2x2 plane. To be removed
41  if (col >= DetCalibs.getNCols())
42  continue;
43 
45  adc = int(round(i->second / electron_per_adc_));
46  } else {
47  if (DetCalibs.getDetId() != 0) {
48  gain = DetCalibs.getGain(col, row) * highRangeCal_ / lowRangeCal_; // *highRangeCal/lowRangeCal
49  pedestal = DetCalibs.getPed(col, row);
50  adc = int(round((i->second - VcaltoElectronOffset_) / (gain * VcaltoElectronGain_) + pedestal));
51  }
52  }
54  if (adc >= maxADC_)
55  adc = maxADC_;
56  if (adc < 0)
57  adc = 0;
58  output_digi.push_back(CTPPSPixelDigi(row, col, adc));
59  if (links_persistence_) {
60  output_digi_links.push_back(theSignalProvenance[pixel_no]);
61  if (verbosity_) {
62  edm::LogInfo("RPixDummyROCSimulator") << "digi links size=" << theSignalProvenance[pixel_no].size();
63  for (unsigned int u = 0; u < theSignalProvenance[pixel_no].size(); ++u) {
64  edm::LogInfo("RPixDummyROCSimulator") << " digi: particle=" << theSignalProvenance[pixel_no][u].first
65  << " energy [electrons]=" << theSignalProvenance[pixel_no][u].second;
66  }
67  }
68  }
69  }
70  }
71 
72  if (verbosity_) {
73  for (unsigned int i = 0; i < output_digi.size(); ++i) {
74  edm::LogInfo("RPixDummyROCSimulator")
75  << "Dummy ROC Simulator " << det_id_ << " row= " //output_digi[i].GetDetId()<<" "
76  << output_digi[i].row() << " col= " << output_digi[i].column() << " adc= " << output_digi[i].adc();
77  }
78  }
79 }

References ecalMGPA::adc(), cuy::col, dead_pixels_, dead_pixels_simulation_on_, det_id_, doSingleCalibration_, electron_per_adc_, PedestalClient_cfi::gain, CTPPSPixelGainCalibration::getDetId(), CTPPSPixelGainCalibration::getGain(), CTPPSPixelGainCalibrations::getGainCalibration(), CTPPSPixelGainCalibration::getNCols(), CTPPSPixelGainCalibration::getPed(), highRangeCal_, mps_fire::i, createfilelist::int, links_persistence_, lowRangeCal_, maxADC_, EcalCondDBWriter_cfi::pedestal, threshold_, VcaltoElectronGain_, VcaltoElectronOffset_, and verbosity_.

Member Data Documentation

◆ dead_pixel_probability_

double RPixDummyROCSimulator::dead_pixel_probability_
private

Definition at line 31 of file RPixDummyROCSimulator.h.

Referenced by RPixDummyROCSimulator().

◆ dead_pixels_

dead_pixel_set RPixDummyROCSimulator::dead_pixels_
private

Definition at line 33 of file RPixDummyROCSimulator.h.

Referenced by ConvertChargeToHits().

◆ dead_pixels_simulation_on_

bool RPixDummyROCSimulator::dead_pixels_simulation_on_
private

Definition at line 32 of file RPixDummyROCSimulator.h.

Referenced by ConvertChargeToHits(), and RPixDummyROCSimulator().

◆ det_id_

uint32_t RPixDummyROCSimulator::det_id_
private

Definition at line 30 of file RPixDummyROCSimulator.h.

Referenced by ConvertChargeToHits().

◆ doSingleCalibration_

bool RPixDummyROCSimulator::doSingleCalibration_
private

Definition at line 40 of file RPixDummyROCSimulator.h.

Referenced by ConvertChargeToHits(), and RPixDummyROCSimulator().

◆ electron_per_adc_

double RPixDummyROCSimulator::electron_per_adc_
private

Definition at line 37 of file RPixDummyROCSimulator.h.

Referenced by ConvertChargeToHits(), and RPixDummyROCSimulator().

◆ highRangeCal_

constexpr double RPixDummyROCSimulator::highRangeCal_ = 1800.
staticconstexprprivate

Definition at line 26 of file RPixDummyROCSimulator.h.

Referenced by ConvertChargeToHits().

◆ links_persistence_

bool RPixDummyROCSimulator::links_persistence_
private

Definition at line 41 of file RPixDummyROCSimulator.h.

Referenced by ConvertChargeToHits(), and RPixDummyROCSimulator().

◆ lowRangeCal_

constexpr double RPixDummyROCSimulator::lowRangeCal_ = 260.
staticconstexprprivate

Definition at line 27 of file RPixDummyROCSimulator.h.

Referenced by ConvertChargeToHits().

◆ maxADC_

constexpr int RPixDummyROCSimulator::maxADC_ = 255
staticconstexprprivate

Definition at line 28 of file RPixDummyROCSimulator.h.

Referenced by ConvertChargeToHits().

◆ pixels_no_

unsigned short RPixDummyROCSimulator::pixels_no_
private

Definition at line 35 of file RPixDummyROCSimulator.h.

Referenced by RPixDummyROCSimulator().

◆ threshold_

double RPixDummyROCSimulator::threshold_
private

Definition at line 36 of file RPixDummyROCSimulator.h.

Referenced by ConvertChargeToHits(), and RPixDummyROCSimulator().

◆ VcaltoElectronGain_

int RPixDummyROCSimulator::VcaltoElectronGain_
private

Definition at line 38 of file RPixDummyROCSimulator.h.

Referenced by ConvertChargeToHits(), and RPixDummyROCSimulator().

◆ VcaltoElectronOffset_

int RPixDummyROCSimulator::VcaltoElectronOffset_
private

Definition at line 39 of file RPixDummyROCSimulator.h.

Referenced by ConvertChargeToHits(), and RPixDummyROCSimulator().

◆ verbosity_

int RPixDummyROCSimulator::verbosity_
private

Definition at line 34 of file RPixDummyROCSimulator.h.

Referenced by ConvertChargeToHits(), and RPixDummyROCSimulator().

ecalMGPA::adc
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
Definition: EcalMGPASample.h:11
mps_fire.i
i
Definition: mps_fire.py:355
CTPPSPixelGainCalibration::getNCols
uint32_t getNCols() const
Definition: CTPPSPixelGainCalibration.h:77
RPixDummyROCSimulator::dead_pixels_
dead_pixel_set dead_pixels_
Definition: RPixDummyROCSimulator.h:33
CTPPSPixelGainCalibration::getDetId
uint32_t getDetId() const
Definition: CTPPSPixelGainCalibration.h:76
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
cuy.col
col
Definition: cuy.py:1010
edm::LogInfo
Definition: MessageLogger.h:254
RPixDummyROCSimulator::highRangeCal_
static constexpr double highRangeCal_
Definition: RPixDummyROCSimulator.h:26
RPixDummyROCSimulator::VcaltoElectronOffset_
int VcaltoElectronOffset_
Definition: RPixDummyROCSimulator.h:39
CTPPSPixelTopology
Geometrical and topological information on RPix silicon detector. Uses coordinate a frame with origin...
Definition: CTPPSPixelTopology.h:10
RPixDummyROCSimulator::maxADC_
static constexpr int maxADC_
Definition: RPixDummyROCSimulator.h:28
CTPPSPixelGainCalibration
Definition: CTPPSPixelGainCalibration.h:27
CTPPSPixelGainCalibration::getGain
float getGain(const int &col, const int &row) const
Definition: CTPPSPixelGainCalibration.cc:136
RPixDummyROCSimulator::doSingleCalibration_
bool doSingleCalibration_
Definition: RPixDummyROCSimulator.h:40
RPixDummyROCSimulator::links_persistence_
bool links_persistence_
Definition: RPixDummyROCSimulator.h:41
RPixDummyROCSimulator::VcaltoElectronGain_
int VcaltoElectronGain_
Definition: RPixDummyROCSimulator.h:38
RPixDummyROCSimulator::det_id_
uint32_t det_id_
Definition: RPixDummyROCSimulator.h:30
RPixDummyROCSimulator::verbosity_
int verbosity_
Definition: RPixDummyROCSimulator.h:34
CTPPSPixelDigi
Definition: CTPPSPixelDigi.h:10
CTPPSPixelGainCalibration::getPed
float getPed(const int &col, const int &row) const
Definition: CTPPSPixelGainCalibration.cc:122
RPixDummyROCSimulator::electron_per_adc_
double electron_per_adc_
Definition: RPixDummyROCSimulator.h:37
createfilelist.int
int
Definition: createfilelist.py:10
EcalCondDBWriter_cfi.pedestal
pedestal
Definition: EcalCondDBWriter_cfi.py:49
RPixDummyROCSimulator::dead_pixels_simulation_on_
bool dead_pixels_simulation_on_
Definition: RPixDummyROCSimulator.h:32
RPixDummyROCSimulator::lowRangeCal_
static constexpr double lowRangeCal_
Definition: RPixDummyROCSimulator.h:27
RPixDummyROCSimulator::dead_pixel_probability_
double dead_pixel_probability_
Definition: RPixDummyROCSimulator.h:31
RPixDummyROCSimulator::threshold_
double threshold_
Definition: RPixDummyROCSimulator.h:36
PedestalClient_cfi.gain
gain
Definition: PedestalClient_cfi.py:37
CTPPSPixelTopology::detPixelNo
unsigned short detPixelNo() const
Definition: CTPPSPixelTopology.h:32
RPixDummyROCSimulator::pixels_no_
unsigned short pixels_no_
Definition: RPixDummyROCSimulator.h:35