CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Member Functions | Public Attributes
PixelDigitizerAlgorithm Class Reference

#include <PixelDigitizerAlgorithm.h>

Inheritance diagram for PixelDigitizerAlgorithm:
Phase2TrackerDigitizerAlgorithm PixelBrickedDigitizerAlgorithm

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
 
 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
< SiPixelFedCablingMap,
SiPixelFedCablingMapRcd
fedCablingMapToken_
 
const edm::ESGetToken
< TrackerGeometry,
TrackerDigiGeometryRecord
geomToken_
 
double odd_column_interchannelCoupling_next_column_
 
double odd_row_interchannelCoupling_next_row_
 
edm::ESGetToken
< SiPixelQuality,
SiPixelQualityRcd
siPixelBadModuleToken_
 
edm::ESGetToken
< SiPixelLorentzAngle,
SiPixelLorentzAngleSimRcd
siPixelLorentzAngleToken_
 
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::Amplitude, 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::SignalPoint
drift (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 (const PSimHit &hit, const size_t hitIndex, const uint32_t tofBin, const Phase2TrackerGeomDetUnit *pixdet, const std::vector< DigitizerUtility::SignalPoint > &collection_points)
 
virtual void module_killing_conf (uint32_t detID)
 
virtual void module_killing_DB (const Phase2TrackerGeomDetUnit *pixdet)
 
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::EnergyDepositUnit
primary_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 SiPixelFedCablingMapfedCablingMap_
 
const std::unique_ptr
< SiG4UniversalFluctuation
fluctuate_
 
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
SiPhase2OuterTrackerLorentzAngle
siPhase2OTLorentzAngle_
 
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
< GaussianTailNoiseGenerator
theNoiser_
 
const int thePhase2ReadoutMode_
 
const float theReadoutNoise_
 
const std::unique_ptr
< SiPixelGainCalibrationOfflineSimService
theSiPixelGainCalibrationService_
 
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_
 

Detailed Description

Definition at line 12 of file PixelDigitizerAlgorithm.h.

Constructor & Destructor Documentation

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

Definition at line 34 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_.

36  conf.getParameter<ParameterSet>("PixelDigitizerAlgorithm"),
37  iC),
39  .getParameter<double>("Odd_row_interchannelCoupling_next_row")),
41  .getParameter<double>("Even_row_interchannelCoupling_next_row")),
43  conf.getParameter<ParameterSet>("PixelDigitizerAlgorithm")
44  .getParameter<double>("Odd_column_interchannelCoupling_next_column")),
46  conf.getParameter<ParameterSet>("PixelDigitizerAlgorithm")
47  .getParameter<double>("Even_column_interchannelCoupling_next_column")),
48  apply_timewalk_(conf.getParameter<ParameterSet>("PixelDigitizerAlgorithm").getParameter<bool>("ApplyTimewalk")),
50  conf.getParameter<ParameterSet>("PixelDigitizerAlgorithm").getParameter<edm::ParameterSet>("TimewalkModel")),
52  geomToken_(iC.esConsumes()) {
57  pixelFlag_ = true;
58  LogDebug("PixelDigitizerAlgorithm") << "Algorithm constructed "
59  << "Configuration parameters:"
60  << "Threshold/Gain = "
61  << "threshold in electron Endcap = " << theThresholdInE_Endcap_
62  << "threshold in electron Barrel = " << theThresholdInE_Barrel_ << " "
64  << " The delta cut-off is set to " << tMax_ << " pix-inefficiency "
66 }
const edm::ESGetToken< SiPixelFedCablingMap, SiPixelFedCablingMapRcd > fedCablingMapToken_
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)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ESGetToken< SiPixelLorentzAngle, SiPixelLorentzAngleSimRcd > siPixelLorentzAngleToken_
#define LogDebug(id)
PixelDigitizerAlgorithm::~PixelDigitizerAlgorithm ( )
override

Definition at line 67 of file PixelDigitizerAlgorithm.cc.

References LogDebug.

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

Member Function Documentation

void PixelDigitizerAlgorithm::add_cross_talk ( const Phase2TrackerGeomDetUnit pixdet)
overridevirtual

Reimplemented from Phase2TrackerDigitizerAlgorithm.

Definition at line 81 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(), cmsLHEtoEOSManager::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().

81  {
82  if (!pixelFlag_)
83  return;
84 
85  const Phase2TrackerTopology* topol = &pixdet->specificTopology();
86 
87  // cross-talk calculation valid for the case of 25x100 pixels
88  const float pitch_first = 0.0025;
89  const float pitch_second = 0.0100;
90 
91  // 0.5 um tolerance when comparing the pitch to accommodate the small changes in different TK geometrie (temporary fix)
92  const double pitch_tolerance(0.0005);
93 
94  if (std::abs(topol->pitch().first - pitch_first) > pitch_tolerance ||
95  std::abs(topol->pitch().second - pitch_second) > pitch_tolerance)
96  return;
97 
98  uint32_t detID = pixdet->geographicalId().rawId();
99  signal_map_type& theSignal = _signal[detID];
100  signal_map_type signalNew;
101 
102  int numRows = topol->nrows();
103  int numColumns = topol->ncolumns();
104 
105  for (auto& s : theSignal) {
106  float signalInElectrons = s.second.ampl(); // signal in electrons
107 
108  auto hitChan = PixelDigi::channelToPixel(s.first);
109 
110  float signalInElectrons_odd_row_Xtalk_next_row = signalInElectrons * odd_row_interchannelCoupling_next_row_;
111  float signalInElectrons_even_row_Xtalk_next_row = signalInElectrons * even_row_interchannelCoupling_next_row_;
112  float signalInElectrons_odd_column_Xtalk_next_column =
114  float signalInElectrons_even_column_Xtalk_next_column =
116 
117  // subtract the charge which will be shared
118  s.second.set(signalInElectrons - signalInElectrons_odd_row_Xtalk_next_row -
119  signalInElectrons_even_row_Xtalk_next_row - signalInElectrons_odd_column_Xtalk_next_column -
120  signalInElectrons_even_column_Xtalk_next_column);
121 
122  if (hitChan.first != 0) {
123  auto XtalkPrev = std::make_pair(hitChan.first - 1, hitChan.second);
124  int chanXtalkPrev = pixelFlag_ ? PixelDigi::pixelToChannel(XtalkPrev.first, XtalkPrev.second)
125  : Phase2TrackerDigi::pixelToChannel(XtalkPrev.first, XtalkPrev.second);
126  if (hitChan.first % 2 == 1)
127  signalNew.emplace(chanXtalkPrev,
128  DigitizerUtility::Amplitude(signalInElectrons_even_row_Xtalk_next_row, nullptr, -1.0));
129  else
130  signalNew.emplace(chanXtalkPrev,
131  DigitizerUtility::Amplitude(signalInElectrons_odd_row_Xtalk_next_row, nullptr, -1.0));
132  }
133  if (hitChan.first < numRows - 1) {
134  auto XtalkNext = std::make_pair(hitChan.first + 1, hitChan.second);
135  int chanXtalkNext = pixelFlag_ ? PixelDigi::pixelToChannel(XtalkNext.first, XtalkNext.second)
136  : Phase2TrackerDigi::pixelToChannel(XtalkNext.first, XtalkNext.second);
137  if (hitChan.first % 2 == 1)
138  signalNew.emplace(chanXtalkNext,
139  DigitizerUtility::Amplitude(signalInElectrons_odd_row_Xtalk_next_row, nullptr, -1.0));
140  else
141  signalNew.emplace(chanXtalkNext,
142  DigitizerUtility::Amplitude(signalInElectrons_even_row_Xtalk_next_row, nullptr, -1.0));
143  }
144 
145  if (hitChan.second != 0) {
146  auto XtalkPrev = std::make_pair(hitChan.first, hitChan.second - 1);
147  int chanXtalkPrev = pixelFlag_ ? PixelDigi::pixelToChannel(XtalkPrev.first, XtalkPrev.second)
148  : Phase2TrackerDigi::pixelToChannel(XtalkPrev.first, XtalkPrev.second);
149  if (hitChan.second % 2 == 1)
150  signalNew.emplace(chanXtalkPrev,
151  DigitizerUtility::Amplitude(signalInElectrons_even_column_Xtalk_next_column, nullptr, -1.0));
152  else
153  signalNew.emplace(chanXtalkPrev,
154  DigitizerUtility::Amplitude(signalInElectrons_odd_column_Xtalk_next_column, nullptr, -1.0));
155  }
156  if (hitChan.second < numColumns - 1) {
157  auto XtalkNext = std::make_pair(hitChan.first, hitChan.second + 1);
158  int chanXtalkNext = pixelFlag_ ? PixelDigi::pixelToChannel(XtalkNext.first, XtalkNext.second)
159  : Phase2TrackerDigi::pixelToChannel(XtalkNext.first, XtalkNext.second);
160  if (hitChan.second % 2 == 1)
161  signalNew.emplace(chanXtalkNext,
162  DigitizerUtility::Amplitude(signalInElectrons_odd_column_Xtalk_next_column, nullptr, -1.0));
163  else
164  signalNew.emplace(chanXtalkNext,
165  DigitizerUtility::Amplitude(signalInElectrons_even_column_Xtalk_next_column, nullptr, -1.0));
166  }
167  }
168  for (auto const& l : signalNew) {
169  int chan = l.first;
170  auto iter = theSignal.find(chan);
171  if (iter != theSignal.end()) {
172  iter->second += l.second.ampl();
173  } else {
174  theSignal.emplace(chan, DigitizerUtility::Amplitude(l.second.ampl(), nullptr, -1.0));
175  }
176  }
177 }
static std::pair< int, int > channelToPixel(int ch)
Definition: PixelDigi.h:69
virtual int ncolumns() const =0
tuple chan
lumi = TPaveText(lowX+0.38, lowY+0.061, lowX+0.45, lowY+0.161, &quot;NDC&quot;) lumi.SetBorderSize( 0 ) lumi...
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
virtual int nrows() const =0
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
std::map< int, DigitizerUtility::Amplitude, std::less< int > > signal_map_type
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)
void PixelDigitizerAlgorithm::init ( const edm::EventSetup es)
overridevirtual

Implements Phase2TrackerDigitizerAlgorithm.

Definition at line 19 of file PixelDigitizerAlgorithm.cc.

References edm::EventSetup::getData().

19  {
20  if (use_ineff_from_db_) // load gain calibration service fromdb...
21  theSiPixelGainCalibrationService_->setESObjects(es);
22 
25 
26  if (use_LorentzAngle_DB_) // Get Lorentz angle from DB record
28 
29  // gets the map and geometry from the DB (to kill ROCs)
31  geom_ = &es.getData(geomToken_);
32 }
const edm::ESGetToken< SiPixelFedCablingMap, SiPixelFedCablingMapRcd > fedCablingMapToken_
edm::ESGetToken< SiPixelQuality, SiPixelQualityRcd > siPixelBadModuleToken_
const SiPixelLorentzAngle * siPixelLorentzAngle_
bool getData(T &iHolder) const
Definition: EventSetup.h:128
const std::unique_ptr< SiPixelGainCalibrationOfflineSimService > theSiPixelGainCalibrationService_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
edm::ESGetToken< SiPixelLorentzAngle, SiPixelLorentzAngleSimRcd > siPixelLorentzAngleToken_
bool PixelDigitizerAlgorithm::isAboveThreshold ( const DigitizerUtility::SimHitInfo hitInfo,
float  charge,
float  thr 
) const
overridevirtual

Reimplemented from Phase2TrackerDigitizerAlgorithm.

Definition at line 231 of file PixelDigitizerAlgorithm.cc.

References apply_timewalk_, Phase2TrackerDigitizerAlgorithm::theTofLowerCut_, Phase2TrackerDigitizerAlgorithm::theTofUpperCut_, DigitizerUtility::SimHitInfo::time(), and timewalk_model_.

233  {
234  if (charge < thr)
235  return false;
236  if (apply_timewalk_ && hitInfo) {
237  float corrected_time = hitInfo->time();
238  double time = corrected_time + timewalk_model_(charge, thr);
239  return (time >= theTofLowerCut_ && time < theTofUpperCut_);
240  } else
241  return true;
242 }
const TimewalkModel timewalk_model_
bool PixelDigitizerAlgorithm::select_hit ( const PSimHit hit,
double  tCorr,
double &  sigScale 
) const
overridevirtual

Reimplemented from Phase2TrackerDigitizerAlgorithm.

Definition at line 71 of file PixelDigitizerAlgorithm.cc.

References Phase2TrackerDigitizerAlgorithm::theTofLowerCut_, Phase2TrackerDigitizerAlgorithm::theTofUpperCut_, and PSimHit::tof().

71  {
72  double time = hit.tof() - tCorr;
73  return (time >= theTofLowerCut_ && time < theTofUpperCut_);
74 }
float tof() const
deprecated name for timeOfFlight()
Definition: PSimHit.h:76

Member Data Documentation

bool PixelDigitizerAlgorithm::apply_timewalk_

Definition at line 61 of file PixelDigitizerAlgorithm.h.

Referenced by isAboveThreshold().

double PixelDigitizerAlgorithm::even_column_interchannelCoupling_next_column_

Definition at line 58 of file PixelDigitizerAlgorithm.h.

Referenced by add_cross_talk().

double PixelDigitizerAlgorithm::even_row_interchannelCoupling_next_row_
const edm::ESGetToken<SiPixelFedCablingMap, SiPixelFedCablingMapRcd> PixelDigitizerAlgorithm::fedCablingMapToken_

Definition at line 66 of file PixelDigitizerAlgorithm.h.

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

Definition at line 67 of file PixelDigitizerAlgorithm.h.

double PixelDigitizerAlgorithm::odd_column_interchannelCoupling_next_column_

Definition at line 57 of file PixelDigitizerAlgorithm.h.

Referenced by add_cross_talk().

double PixelDigitizerAlgorithm::odd_row_interchannelCoupling_next_row_

Definition at line 55 of file PixelDigitizerAlgorithm.h.

Referenced by add_cross_talk().

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

Definition at line 64 of file PixelDigitizerAlgorithm.h.

Referenced by PixelDigitizerAlgorithm().

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

Definition at line 65 of file PixelDigitizerAlgorithm.h.

Referenced by PixelDigitizerAlgorithm().

const TimewalkModel PixelDigitizerAlgorithm::timewalk_model_

Definition at line 62 of file PixelDigitizerAlgorithm.h.

Referenced by isAboveThreshold().