CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Public Attributes
PixelDigitizerAlgorithm Class Reference

#include <PixelDigitizerAlgorithm.h>

Inheritance diagram for PixelDigitizerAlgorithm:
Phase2TrackerDigitizerAlgorithm Pixel3DDigitizerAlgorithm

Classes

class  TimewalkCurve
 
class  TimewalkModel
 

Public Member Functions

void add_cross_talk (const Phase2TrackerGeomDetUnit *pixdet) override
 
void init (const edm::EventSetup &es) override
 
bool isAboveThreshold (const digitizerUtility::SimHitInfo *hitInfo, float charge, float thr) const override
 
void module_killing_DB (const Phase2TrackerGeomDetUnit *pixdet) override
 
 PixelDigitizerAlgorithm (const edm::ParameterSet &conf, edm::ConsumesCollector iC)
 
bool select_hit (const PSimHit &hit, double tCorr, double &sigScale) const override
 
 ~PixelDigitizerAlgorithm () override
 
- Public Member Functions inherited from Phase2TrackerDigitizerAlgorithm
virtual void accumulateSimHits (const std::vector< PSimHit >::const_iterator inputBegin, const std::vector< PSimHit >::const_iterator inputEnd, const size_t inputBeginGlobalIndex, const uint32_t tofBin, const Phase2TrackerGeomDetUnit *pixdet, const GlobalVector &bfield)
 
virtual void digitize (const Phase2TrackerGeomDetUnit *pixdet, std::map< int, digitizerUtility::DigiSimInfo > &digi_map, const TrackerTopology *tTopo)
 
virtual void initializeEvent (CLHEP::HepRandomEngine &eng)
 
void loadAccumulator (uint32_t detId, const std::map< int, float > &accumulator)
 
 Phase2TrackerDigitizerAlgorithm (const edm::ParameterSet &conf_common, const edm::ParameterSet &conf_specific, edm::ConsumesCollector iC)
 
virtual ~Phase2TrackerDigitizerAlgorithm ()
 

Public Attributes

bool apply_timewalk_
 
double even_column_interchannelCoupling_next_column_
 
double even_row_interchannelCoupling_next_row_
 
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordgeomToken_
 
double odd_column_interchannelCoupling_next_column_
 
double odd_row_interchannelCoupling_next_row_
 
edm::ESGetToken< SiPixelQuality, SiPixelQualityRcdsiPixelBadModuleToken_
 
edm::ESGetToken< SiPixelLorentzAngle, SiPixelLorentzAngleSimRcdsiPixelLorentzAngleToken_
 
const TimewalkModel timewalk_model_
 

Additional Inherited Members

- Protected Types inherited from Phase2TrackerDigitizerAlgorithm
using Frame = GloballyPositioned< double >
 
using Parameters = std::vector< edm::ParameterSet >
 
using signal_map_type = std::map< int, digitizerUtility::Ph2Amplitude, std::less< int > >
 
using signalMaps = std::map< uint32_t, signal_map_type >
 
- Protected Member Functions inherited from Phase2TrackerDigitizerAlgorithm
virtual void add_noise (const Phase2TrackerGeomDetUnit *pixdet)
 
virtual void add_noisy_cells (const Phase2TrackerGeomDetUnit *pixdet, float thePixelThreshold)
 
float calcQ (float x)
 
int convertSignalToAdc (uint32_t detID, float signal_in_elec, float threshold)
 
virtual std::vector< digitizerUtility::SignalPointdrift (const PSimHit &hit, const Phase2TrackerGeomDetUnit *pixdet, const GlobalVector &bfield, const std::vector< digitizerUtility::EnergyDepositUnit > &ionization_points) const
 
LocalVector driftDirection (const Phase2TrackerGeomDetUnit *pixdet, const GlobalVector &bfield, const DetId &detId) const
 
virtual std::vector< float > fluctuateEloss (int particleId, float momentum, float eloss, float length, int NumberOfSegments) const
 
virtual void induce_signal (std::vector< PSimHit >::const_iterator inputBegin, const PSimHit &hit, const size_t hitIndex, const size_t firstHitIndex, const uint32_t tofBin, const Phase2TrackerGeomDetUnit *pixdet, const std::vector< digitizerUtility::SignalPoint > &collection_points)
 
virtual void module_killing_conf (uint32_t detID)
 
virtual void pixel_inefficiency (const SubdetEfficiencies &eff, const Phase2TrackerGeomDetUnit *pixdet, const TrackerTopology *tTopo)
 
virtual void pixel_inefficiency_db (uint32_t detID)
 
virtual std::vector< digitizerUtility::EnergyDepositUnitprimary_ionization (const PSimHit &hit) const
 
- Protected Attributes inherited from Phase2TrackerDigitizerAlgorithm
signalMaps _signal
 
const bool addNoise_
 
const bool addNoisyPixels_
 
const bool addPixelInefficiency_
 
const bool addThresholdSmearing_
 
const bool addXtalk_
 
const bool alpha2Order_
 
Parameters badPixels_
 
const float clusterWidth_
 
const Parameters deadModules_
 
const std::unique_ptr< SiG4UniversalFluctuationfluctuate_
 
const bool fluctuateCharge_
 
std::unique_ptr< CLHEP::RandGaussQ > gaussDistribution_
 
const TrackerGeometrygeom_
 
const float GeVperElectron_
 
const float interstripCoupling_
 
const bool makeDigiSimLinks_
 
bool pixelFlag_
 
const double pseudoRadDamage_
 
const double pseudoRadDamageRadius_
 
CLHEP::HepRandomEngine * rengine_
 
const float Sigma0_
 
const float SigmaCoeff_
 
const SiPhase2OuterTrackerLorentzAnglesiPhase2OTLorentzAngle_
 
const SiPixelQualitysiPixelBadModule_
 
const SiPixelLorentzAnglesiPixelLorentzAngle_
 
std::unique_ptr< CLHEP::RandGaussQ > smearedThreshold_Barrel_
 
std::unique_ptr< CLHEP::RandGaussQ > smearedThreshold_Endcap_
 
const SubdetEfficiencies subdetEfficiencies_
 
const float tanLorentzAnglePerTesla_Barrel_
 
const float tanLorentzAnglePerTesla_Endcap_
 
const int theAdcFullScale_
 
const float theElectronPerADC_
 
const double theHIPThresholdInE_Barrel_
 
const double theHIPThresholdInE_Endcap_
 
const float theNoiseInElectrons_
 
const std::unique_ptr< GaussianTailNoiseGeneratortheNoiser_
 
const int thePhase2ReadoutMode_
 
const float theReadoutNoise_
 
const std::unique_ptr< SiPixelChargeReweightingAlgorithmtheSiPixelChargeReweightingAlgorithm_
 
const std::unique_ptr< SiPixelGainCalibrationOfflineSimServicetheSiPixelGainCalibrationService_
 
const float theThresholdInE_Barrel_
 
const float theThresholdInE_Endcap_
 
const double theThresholdSmearing_Barrel_
 
const double theThresholdSmearing_Endcap_
 
const float theTofLowerCut_
 
const float theTofUpperCut_
 
const double tMax_
 
const bool use_deadmodule_DB_
 
const bool use_ineff_from_db_
 
const bool use_LorentzAngle_DB_
 
const bool use_module_killing_
 
const bool useChargeReweighting_
 

Detailed Description

Definition at line 11 of file PixelDigitizerAlgorithm.h.

Constructor & Destructor Documentation

◆ PixelDigitizerAlgorithm()

PixelDigitizerAlgorithm::PixelDigitizerAlgorithm ( const edm::ParameterSet conf,
edm::ConsumesCollector  iC 
)

Definition at line 40 of file PixelDigitizerAlgorithm.cc.

References Phase2TrackerDigitizerAlgorithm::addPixelInefficiency_, edm::ConsumesCollector::esConsumes(), LogDebug, Phase2TrackerDigitizerAlgorithm::pixelFlag_, siPixelBadModuleToken_, siPixelLorentzAngleToken_, Phase2TrackerDigitizerAlgorithm::theAdcFullScale_, Phase2TrackerDigitizerAlgorithm::theElectronPerADC_, Phase2TrackerDigitizerAlgorithm::theThresholdInE_Barrel_, Phase2TrackerDigitizerAlgorithm::theThresholdInE_Endcap_, Phase2TrackerDigitizerAlgorithm::tMax_, Phase2TrackerDigitizerAlgorithm::use_deadmodule_DB_, and Phase2TrackerDigitizerAlgorithm::use_LorentzAngle_DB_.

42  conf.getParameter<ParameterSet>("PixelDigitizerAlgorithm"),
43  iC),
45  .getParameter<double>("Odd_row_interchannelCoupling_next_row")),
47  .getParameter<double>("Even_row_interchannelCoupling_next_row")),
49  conf.getParameter<ParameterSet>("PixelDigitizerAlgorithm")
50  .getParameter<double>("Odd_column_interchannelCoupling_next_column")),
52  conf.getParameter<ParameterSet>("PixelDigitizerAlgorithm")
53  .getParameter<double>("Even_column_interchannelCoupling_next_column")),
54  apply_timewalk_(conf.getParameter<ParameterSet>("PixelDigitizerAlgorithm").getParameter<bool>("ApplyTimewalk")),
56  conf.getParameter<ParameterSet>("PixelDigitizerAlgorithm").getParameter<edm::ParameterSet>("TimewalkModel")),
57  geomToken_(iC.esConsumes()) {
62  pixelFlag_ = true;
63  LogDebug("PixelDigitizerAlgorithm") << "Algorithm constructed "
64  << "Configuration parameters:"
65  << "Threshold/Gain = "
66  << "threshold in electron Endcap = " << theThresholdInE_Endcap_
67  << "threshold in electron Barrel = " << theThresholdInE_Barrel_ << " "
69  << " The delta cut-off is set to " << tMax_ << " pix-inefficiency "
71 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::ESGetToken< SiPixelQuality, SiPixelQualityRcd > siPixelBadModuleToken_
const TimewalkModel timewalk_model_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
Phase2TrackerDigitizerAlgorithm(const edm::ParameterSet &conf_common, const edm::ParameterSet &conf_specific, edm::ConsumesCollector iC)
edm::ESGetToken< SiPixelLorentzAngle, SiPixelLorentzAngleSimRcd > siPixelLorentzAngleToken_
#define LogDebug(id)

◆ ~PixelDigitizerAlgorithm()

PixelDigitizerAlgorithm::~PixelDigitizerAlgorithm ( )
override

Definition at line 73 of file PixelDigitizerAlgorithm.cc.

References LogDebug.

73 { LogDebug("PixelDigitizerAlgorithm") << "Algorithm deleted"; }
#define LogDebug(id)

Member Function Documentation

◆ add_cross_talk()

void PixelDigitizerAlgorithm::add_cross_talk ( const Phase2TrackerGeomDetUnit pixdet)
overridevirtual

Reimplemented from Phase2TrackerDigitizerAlgorithm.

Definition at line 89 of file PixelDigitizerAlgorithm.cc.

References Phase2TrackerDigitizerAlgorithm::_signal, funct::abs(), officialStyle::chan, PixelDigi::channelToPixel(), even_column_interchannelCoupling_next_column_, even_row_interchannelCoupling_next_row_, GeomDet::geographicalId(), MainPageGenerator::l, PixelTopology::ncolumns(), PixelTopology::nrows(), odd_column_interchannelCoupling_next_column_, odd_row_interchannelCoupling_next_row_, PixelTopology::pitch(), Phase2TrackerDigitizerAlgorithm::pixelFlag_, Phase2TrackerDigi::pixelToChannel(), PixelDigi::pixelToChannel(), DetId::rawId(), alignCSCRings::s, and PixelGeomDetUnit::specificTopology().

89  {
90  if (!pixelFlag_)
91  return;
92 
93  const Phase2TrackerTopology* topol = &pixdet->specificTopology();
94 
95  // cross-talk calculation valid for the case of 25x100 pixels
96  const float pitch_first = 0.0025;
97  const float pitch_second = 0.0100;
98 
99  // 0.5 um tolerance when comparing the pitch to accommodate the small changes in different TK geometrie (temporary fix)
100  const double pitch_tolerance(0.0005);
101 
102  if (std::abs(topol->pitch().first - pitch_first) > pitch_tolerance ||
103  std::abs(topol->pitch().second - pitch_second) > pitch_tolerance)
104  return;
105 
106  uint32_t detID = pixdet->geographicalId().rawId();
107  signal_map_type& theSignal = _signal[detID];
108  signal_map_type signalNew;
109 
110  int numRows = topol->nrows();
111  int numColumns = topol->ncolumns();
112 
113  for (auto& s : theSignal) {
114  float signalInElectrons = s.second.ampl(); // signal in electrons
115 
116  auto hitChan = PixelDigi::channelToPixel(s.first);
117 
118  float signalInElectrons_odd_row_Xtalk_next_row = signalInElectrons * odd_row_interchannelCoupling_next_row_;
119  float signalInElectrons_even_row_Xtalk_next_row = signalInElectrons * even_row_interchannelCoupling_next_row_;
120  float signalInElectrons_odd_column_Xtalk_next_column =
122  float signalInElectrons_even_column_Xtalk_next_column =
124 
125  // subtract the charge which will be shared
126  s.second.set(signalInElectrons - signalInElectrons_odd_row_Xtalk_next_row -
127  signalInElectrons_even_row_Xtalk_next_row - signalInElectrons_odd_column_Xtalk_next_column -
128  signalInElectrons_even_column_Xtalk_next_column);
129 
130  if (hitChan.first != 0) {
131  auto XtalkPrev = std::make_pair(hitChan.first - 1, hitChan.second);
132  int chanXtalkPrev = pixelFlag_ ? PixelDigi::pixelToChannel(XtalkPrev.first, XtalkPrev.second)
133  : Phase2TrackerDigi::pixelToChannel(XtalkPrev.first, XtalkPrev.second);
134  if (hitChan.first % 2 == 1)
135  signalNew.emplace(chanXtalkPrev,
136  digitizerUtility::Ph2Amplitude(signalInElectrons_even_row_Xtalk_next_row, nullptr, -1.0));
137  else
138  signalNew.emplace(chanXtalkPrev,
139  digitizerUtility::Ph2Amplitude(signalInElectrons_odd_row_Xtalk_next_row, nullptr, -1.0));
140  }
141  if (hitChan.first < numRows - 1) {
142  auto XtalkNext = std::make_pair(hitChan.first + 1, hitChan.second);
143  int chanXtalkNext = pixelFlag_ ? PixelDigi::pixelToChannel(XtalkNext.first, XtalkNext.second)
144  : Phase2TrackerDigi::pixelToChannel(XtalkNext.first, XtalkNext.second);
145  if (hitChan.first % 2 == 1)
146  signalNew.emplace(chanXtalkNext,
147  digitizerUtility::Ph2Amplitude(signalInElectrons_odd_row_Xtalk_next_row, nullptr, -1.0));
148  else
149  signalNew.emplace(chanXtalkNext,
150  digitizerUtility::Ph2Amplitude(signalInElectrons_even_row_Xtalk_next_row, nullptr, -1.0));
151  }
152 
153  if (hitChan.second != 0) {
154  auto XtalkPrev = std::make_pair(hitChan.first, hitChan.second - 1);
155  int chanXtalkPrev = pixelFlag_ ? PixelDigi::pixelToChannel(XtalkPrev.first, XtalkPrev.second)
156  : Phase2TrackerDigi::pixelToChannel(XtalkPrev.first, XtalkPrev.second);
157  if (hitChan.second % 2 == 1)
158  signalNew.emplace(
159  chanXtalkPrev,
160  digitizerUtility::Ph2Amplitude(signalInElectrons_even_column_Xtalk_next_column, nullptr, -1.0));
161  else
162  signalNew.emplace(
163  chanXtalkPrev,
164  digitizerUtility::Ph2Amplitude(signalInElectrons_odd_column_Xtalk_next_column, nullptr, -1.0));
165  }
166  if (hitChan.second < numColumns - 1) {
167  auto XtalkNext = std::make_pair(hitChan.first, hitChan.second + 1);
168  int chanXtalkNext = pixelFlag_ ? PixelDigi::pixelToChannel(XtalkNext.first, XtalkNext.second)
169  : Phase2TrackerDigi::pixelToChannel(XtalkNext.first, XtalkNext.second);
170  if (hitChan.second % 2 == 1)
171  signalNew.emplace(
172  chanXtalkNext,
173  digitizerUtility::Ph2Amplitude(signalInElectrons_odd_column_Xtalk_next_column, nullptr, -1.0));
174  else
175  signalNew.emplace(
176  chanXtalkNext,
177  digitizerUtility::Ph2Amplitude(signalInElectrons_even_column_Xtalk_next_column, nullptr, -1.0));
178  }
179  }
180  for (auto const& l : signalNew) {
181  int chan = l.first;
182  auto iter = theSignal.find(chan);
183  if (iter != theSignal.end()) {
184  iter->second += l.second.ampl();
185  } else {
186  theSignal.emplace(chan, digitizerUtility::Ph2Amplitude(l.second.ampl(), nullptr, -1.0));
187  }
188  }
189 }
static std::pair< int, int > channelToPixel(int ch)
Definition: PixelDigi.h:69
virtual int ncolumns() const =0
virtual int nrows() const =0
std::map< int, digitizerUtility::Ph2Amplitude, std::less< int > > signal_map_type
static int pixelToChannel(int row, int col)
Definition: PixelDigi.h:75
U second(std::pair< T, U > const &p)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
chan
lumi = TPaveText(lowX+0.38, lowY+0.061, lowX+0.45, lowY+0.161, "NDC") lumi.SetBorderSize( 0 ) lumi...
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
virtual std::pair< float, float > pitch() const =0
constexpr uint32_t pixelToChannel(int row, int col)

◆ init()

void PixelDigitizerAlgorithm::init ( const edm::EventSetup es)
overridevirtual

Implements Phase2TrackerDigitizerAlgorithm.

Definition at line 24 of file PixelDigitizerAlgorithm.cc.

References edm::EventSetup::getData().

24  {
25  if (use_ineff_from_db_) // load gain calibration service fromdb...
26  theSiPixelGainCalibrationService_->setESObjects(es);
27 
30 
31  if (use_LorentzAngle_DB_) // Get Lorentz angle from DB record
33 
34  geom_ = &es.getData(geomToken_);
37  }
38 }
edm::ESGetToken< SiPixelQuality, SiPixelQualityRcd > siPixelBadModuleToken_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
const SiPixelLorentzAngle * siPixelLorentzAngle_
const std::unique_ptr< SiPixelChargeReweightingAlgorithm > theSiPixelChargeReweightingAlgorithm_
const std::unique_ptr< SiPixelGainCalibrationOfflineSimService > theSiPixelGainCalibrationService_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
edm::ESGetToken< SiPixelLorentzAngle, SiPixelLorentzAngleSimRcd > siPixelLorentzAngleToken_

◆ isAboveThreshold()

bool PixelDigitizerAlgorithm::isAboveThreshold ( const digitizerUtility::SimHitInfo hitInfo,
float  charge,
float  thr 
) const
overridevirtual

◆ module_killing_DB()

void PixelDigitizerAlgorithm::module_killing_DB ( const Phase2TrackerGeomDetUnit pixdet)
overridevirtual

Implements Phase2TrackerDigitizerAlgorithm.

Definition at line 258 of file PixelDigitizerAlgorithm.cc.

References Exception.

258  {
259  throw cms::Exception("PixelDigitizerAlgorithm") << "Trying to kill modules from the pixel digitizer."
260  << " This method is not yet implemented!";
261 }

◆ select_hit()

bool PixelDigitizerAlgorithm::select_hit ( const PSimHit hit,
double  tCorr,
double &  sigScale 
) const
overridevirtual

Reimplemented from Phase2TrackerDigitizerAlgorithm.

Definition at line 78 of file PixelDigitizerAlgorithm.cc.

References apply_timewalk_, Phase2TrackerDigitizerAlgorithm::theTofLowerCut_, and Phase2TrackerDigitizerAlgorithm::theTofUpperCut_.

78  {
79  // in case of signal-shape emulation do not apply [TofLower,TofUpper] selection
80  double toa = hit.tof() - tCorr;
81  return apply_timewalk_ || (toa >= theTofLowerCut_ && toa < theTofUpperCut_);
82 }

Member Data Documentation

◆ apply_timewalk_

bool PixelDigitizerAlgorithm::apply_timewalk_

Definition at line 61 of file PixelDigitizerAlgorithm.h.

Referenced by isAboveThreshold(), and select_hit().

◆ even_column_interchannelCoupling_next_column_

double PixelDigitizerAlgorithm::even_column_interchannelCoupling_next_column_

Definition at line 58 of file PixelDigitizerAlgorithm.h.

Referenced by add_cross_talk().

◆ even_row_interchannelCoupling_next_row_

double PixelDigitizerAlgorithm::even_row_interchannelCoupling_next_row_

Definition at line 56 of file PixelDigitizerAlgorithm.h.

Referenced by add_cross_talk().

◆ geomToken_

const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> PixelDigitizerAlgorithm::geomToken_

Definition at line 66 of file PixelDigitizerAlgorithm.h.

◆ odd_column_interchannelCoupling_next_column_

double PixelDigitizerAlgorithm::odd_column_interchannelCoupling_next_column_

Definition at line 57 of file PixelDigitizerAlgorithm.h.

Referenced by add_cross_talk().

◆ odd_row_interchannelCoupling_next_row_

double PixelDigitizerAlgorithm::odd_row_interchannelCoupling_next_row_

Definition at line 55 of file PixelDigitizerAlgorithm.h.

Referenced by add_cross_talk().

◆ siPixelBadModuleToken_

edm::ESGetToken<SiPixelQuality, SiPixelQualityRcd> PixelDigitizerAlgorithm::siPixelBadModuleToken_

Definition at line 64 of file PixelDigitizerAlgorithm.h.

Referenced by PixelDigitizerAlgorithm().

◆ siPixelLorentzAngleToken_

edm::ESGetToken<SiPixelLorentzAngle, SiPixelLorentzAngleSimRcd> PixelDigitizerAlgorithm::siPixelLorentzAngleToken_

Definition at line 65 of file PixelDigitizerAlgorithm.h.

Referenced by PixelDigitizerAlgorithm().

◆ timewalk_model_

const TimewalkModel PixelDigitizerAlgorithm::timewalk_model_

Definition at line 62 of file PixelDigitizerAlgorithm.h.

Referenced by isAboveThreshold().