CMS 3D CMS Logo

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

#include <PixelDigitizerAlgorithm.h>

Inheritance diagram for PixelDigitizerAlgorithm:
Phase2TrackerDigitizerAlgorithm

Public Member Functions

void accumulateSimHits (const std::vector< PSimHit >::const_iterator inputBegin, const std::vector< PSimHit >::const_iterator inputEnd, const size_t inputBeginGlobalIndex, const unsigned int tofBin, const Phase2TrackerGeomDetUnit *pixdet, const GlobalVector &bfield) override
 
void add_cross_talk (const Phase2TrackerGeomDetUnit *pixdet) override
 
void init (const edm::EventSetup &es) override
 
 PixelDigitizerAlgorithm (const edm::ParameterSet &conf)
 
 ~PixelDigitizerAlgorithm () override
 
- Public Member Functions inherited from Phase2TrackerDigitizerAlgorithm
virtual void digitize (const Phase2TrackerGeomDetUnit *pixdet, std::map< int, DigitizerUtility::DigiSimInfo > &digi_map, const TrackerTopology *tTopo)
 
virtual void initializeEvent (CLHEP::HepRandomEngine &eng)
 
void loadAccumulator (unsigned int detId, const std::map< int, float > &accumulator)
 
 Phase2TrackerDigitizerAlgorithm (const edm::ParameterSet &conf_common, const edm::ParameterSet &conf_specific)
 
virtual ~Phase2TrackerDigitizerAlgorithm ()
 

Public Attributes

const double even_column_interchannelCoupling_next_column
 
const double even_row_interchannelCoupling_next_row
 
const double odd_column_interchannelCoupling_next_column
 
const double odd_row_interchannelCoupling_next_row
 

Additional Inherited Members

- Protected Types inherited from Phase2TrackerDigitizerAlgorithm
using Frame = GloballyPositioned< double >
 
using Parameters = std::vector< edm::ParameterSet >
 
using signal_map_const_iterator = signal_map_type::const_iterator
 
using signal_map_iterator = signal_map_type::iterator
 
using signal_map_type = std::map< int, DigitizerUtility::Amplitude, std::less< int > >
 
using signalMaps = std::map< uint32_t, signal_map_type >
 
using simlink_map = std::map< unsigned int, std::vector< float >, std::less< unsigned int > >
 
- Protected Member Functions inherited from Phase2TrackerDigitizerAlgorithm
virtual void add_noise (const Phase2TrackerGeomDetUnit *pixdet)
 
virtual void add_noisy_cells (const Phase2TrackerGeomDetUnit *pixdet, float thePixelThreshold)
 
double calcQ (float x) const
 
int convertSignalToAdc (uint32_t detID, float signal_in_elec, float threshold)
 
void drift (const PSimHit &hit, const Phase2TrackerGeomDetUnit *pixdet, const GlobalVector &bfield, const std::vector< DigitizerUtility::EnergyDepositUnit > &ionization_points, std::vector< DigitizerUtility::SignalPoint > &collection_points) const
 
LocalVector DriftDirection (const Phase2TrackerGeomDetUnit *pixdet, const GlobalVector &bfield, const DetId &detId) const
 
void fluctuateEloss (int particleId, float momentum, float eloss, float length, int NumberOfSegments, std::vector< float > &elossVector) const
 
void induce_signal (const PSimHit &hit, const size_t hitIndex, const unsigned int tofBin, const Phase2TrackerGeomDetUnit *pixdet, const std::vector< DigitizerUtility::SignalPoint > &collection_points)
 
virtual void module_killing_conf (uint32_t detID)
 
virtual void module_killing_DB (uint32_t detID)
 
virtual void pixel_inefficiency (const SubdetEfficiencies &eff, const Phase2TrackerGeomDetUnit *pixdet, const TrackerTopology *tTopo)
 
virtual void pixel_inefficiency_db (uint32_t detID)
 
void primary_ionization (const PSimHit &hit, std::vector< DigitizerUtility::EnergyDepositUnit > &ionization_points) 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
 
std::vector< edm::ParameterSetbadPixels
 
const float ClusterWidth
 
const Parameters DeadModules
 
const std::unique_ptr< SiG4UniversalFluctuationfluctuate
 
const bool fluctuateCharge
 
std::unique_ptr< CLHEP::RandGaussQ > gaussDistribution_
 
edm::ESHandle< TrackerGeometrygeom_
 
const float GeVperElectron
 
const float interstripCoupling
 
const bool makeDigiSimLinks_
 
edm::ESHandle< SiPixelFedCablingMapmap_
 
bool pixelFlag
 
const double pseudoRadDamage
 
const double pseudoRadDamageRadius
 
CLHEP::HepRandomEngine * rengine_
 
const float Sigma0
 
const float SigmaCoeff
 
edm::ESHandle< SiPixelQualitySiPixelBadModule_
 
edm::ESHandle< 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< 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_
 

Detailed Description

Definition at line 9 of file PixelDigitizerAlgorithm.h.

Constructor & Destructor Documentation

PixelDigitizerAlgorithm::PixelDigitizerAlgorithm ( const edm::ParameterSet conf)

Definition at line 64 of file PixelDigitizerAlgorithm.cc.

References Phase2TrackerDigitizerAlgorithm::AddPixelInefficiency, Phase2TrackerDigitizerAlgorithm::pixelFlag, Phase2TrackerDigitizerAlgorithm::theAdcFullScale, Phase2TrackerDigitizerAlgorithm::theElectronPerADC, Phase2TrackerDigitizerAlgorithm::theThresholdInE_Barrel, Phase2TrackerDigitizerAlgorithm::theThresholdInE_Endcap, and Phase2TrackerDigitizerAlgorithm::tMax.

66  conf.getParameter<ParameterSet>("PixelDigitizerAlgorithm")),
67  odd_row_interchannelCoupling_next_row(conf.getParameter<ParameterSet>("PixelDigitizerAlgorithm")
68  .getParameter<double>("Odd_row_interchannelCoupling_next_row")),
70  .getParameter<double>("Even_row_interchannelCoupling_next_row")),
72  conf.getParameter<ParameterSet>("PixelDigitizerAlgorithm")
73  .getParameter<double>("Odd_column_interchannelCoupling_next_column")),
75  conf.getParameter<ParameterSet>("PixelDigitizerAlgorithm")
76  .getParameter<double>("Even_column_interchannelCoupling_next_column")) {
77  pixelFlag = true;
78  LogInfo("PixelDigitizerAlgorithm") << "Algorithm constructed "
79  << "Configuration parameters:"
80  << "Threshold/Gain = "
81  << "threshold in electron Endcap = " << theThresholdInE_Endcap
82  << "threshold in electron Barrel = " << theThresholdInE_Barrel << " "
83  << theElectronPerADC << " " << theAdcFullScale << " The delta cut-off is set to "
84  << tMax << " pix-inefficiency " << AddPixelInefficiency;
85 }
const double even_row_interchannelCoupling_next_row
T getParameter(std::string const &) const
const double odd_column_interchannelCoupling_next_column
const double even_column_interchannelCoupling_next_column
Phase2TrackerDigitizerAlgorithm(const edm::ParameterSet &conf_common, const edm::ParameterSet &conf_specific)
const double odd_row_interchannelCoupling_next_row
PixelDigitizerAlgorithm::~PixelDigitizerAlgorithm ( )
override

Definition at line 86 of file PixelDigitizerAlgorithm.cc.

References LogDebug.

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

Member Function Documentation

void PixelDigitizerAlgorithm::accumulateSimHits ( const std::vector< PSimHit >::const_iterator  inputBegin,
const std::vector< PSimHit >::const_iterator  inputEnd,
const size_t  inputBeginGlobalIndex,
const unsigned int  tofBin,
const Phase2TrackerGeomDetUnit pixdet,
const GlobalVector bfield 
)
overridevirtual

Implements Phase2TrackerDigitizerAlgorithm.

Definition at line 87 of file PixelDigitizerAlgorithm.cc.

References Phase2TrackerDigitizerAlgorithm::drift(), GeomDet::geographicalId(), Phase2TrackerDigitizerAlgorithm::induce_signal(), LogDebug, mag(), Phase2TrackerDigitizerAlgorithm::primary_ionization(), DetId::rawId(), GeomDet::surface(), Phase2TrackerDigitizerAlgorithm::theTofLowerCut, Phase2TrackerDigitizerAlgorithm::theTofUpperCut, and Surface::toGlobal().

92  {
93  // produce SignalPoint's for all SimHit's in detector
94  // Loop over hits
95  uint32_t detId = pixdet->geographicalId().rawId();
96  size_t simHitGlobalIndex = inputBeginGlobalIndex; // This needs to be stored to create the digi-sim link later
97  for (auto it = inputBegin; it != inputEnd; ++it, ++simHitGlobalIndex) {
98  // skip hits not in this detector.
99  if ((*it).detUnitId() != detId)
100  continue;
101 
102  LogDebug("PixelDigitizerAlgorithm") << (*it).particleType() << " " << (*it).pabs() << " " << (*it).energyLoss()
103  << " " << (*it).tof() << " " << (*it).trackId() << " " << (*it).processType()
104  << " " << (*it).detUnitId() << (*it).entryPoint() << " " << (*it).exitPoint();
105 
106  std::vector<DigitizerUtility::EnergyDepositUnit> ionization_points;
107  std::vector<DigitizerUtility::SignalPoint> collection_points;
108 
109  // fill collection_points for this SimHit, indpendent of topology
110  // Check the TOF cut
111  if (((*it).tof() - pixdet->surface().toGlobal((*it).localPosition()).mag() / 30.) >= theTofLowerCut &&
112  ((*it).tof() - pixdet->surface().toGlobal((*it).localPosition()).mag() / 30.) <= theTofUpperCut) {
113  primary_ionization(*it, ionization_points); // fills _ionization_points
114  // transforms _ionization_points to collection_points
115  drift(*it, pixdet, bfield, ionization_points, collection_points);
116 
117  // compute induced signal on readout elements and add to _signal
118  // *ihit needed only for SimHit<-->Digi link
119  induce_signal(*it, simHitGlobalIndex, tofBin, pixdet, collection_points);
120  }
121  }
122 }
void primary_ionization(const PSimHit &hit, std::vector< DigitizerUtility::EnergyDepositUnit > &ionization_points) const
#define LogDebug(id)
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:81
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
void drift(const PSimHit &hit, const Phase2TrackerGeomDetUnit *pixdet, const GlobalVector &bfield, const std::vector< DigitizerUtility::EnergyDepositUnit > &ionization_points, std::vector< DigitizerUtility::SignalPoint > &collection_points) const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
void induce_signal(const PSimHit &hit, const size_t hitIndex, const unsigned int tofBin, const Phase2TrackerGeomDetUnit *pixdet, const std::vector< DigitizerUtility::SignalPoint > &collection_points)
void PixelDigitizerAlgorithm::add_cross_talk ( const Phase2TrackerGeomDetUnit pixdet)
overridevirtual

Reimplemented from Phase2TrackerDigitizerAlgorithm.

Definition at line 128 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().

128  {
129  if (!pixelFlag)
130  return;
131 
132  const Phase2TrackerTopology* topol = &pixdet->specificTopology();
133 
134  // cross-talk calculation valid for the case of 25x100 pixels
135  const float pitch_first = 0.0025;
136  const float pitch_second = 0.0100;
137  // 0.5 um tolerance when comparing the pitch to accommodate the small changes in different TK geometrie (temporary fix)
138  const double pitch_tolerance(0.0005);
139 
140  if (abs(topol->pitch().first - pitch_first) > pitch_tolerance ||
141  abs(topol->pitch().second - pitch_second) > pitch_tolerance)
142  return;
143 
144  uint32_t detID = pixdet->geographicalId().rawId();
145  signal_map_type& theSignal = _signal[detID];
146  signal_map_type signalNew;
147  int numRows = topol->nrows();
148  int numColumns = topol->ncolumns();
149 
150  for (auto& s : theSignal) {
151  float signalInElectrons = s.second.ampl(); // signal in electrons
152 
153  auto hitChan = PixelDigi::channelToPixel(s.first);
154 
155  float signalInElectrons_odd_row_Xtalk_next_row = signalInElectrons * odd_row_interchannelCoupling_next_row;
156  float signalInElectrons_even_row_Xtalk_next_row = signalInElectrons * even_row_interchannelCoupling_next_row;
157  float signalInElectrons_odd_column_Xtalk_next_column =
159  float signalInElectrons_even_column_Xtalk_next_column =
161 
162  //subtract the charge which will be shared
163  s.second.set(signalInElectrons - signalInElectrons_odd_row_Xtalk_next_row -
164  signalInElectrons_even_row_Xtalk_next_row - signalInElectrons_odd_column_Xtalk_next_column -
165  signalInElectrons_even_column_Xtalk_next_column);
166 
167  if (hitChan.first != 0) {
168  auto XtalkPrev = std::make_pair(hitChan.first - 1, hitChan.second);
169  int chanXtalkPrev = (pixelFlag) ? PixelDigi::pixelToChannel(XtalkPrev.first, XtalkPrev.second)
170  : Phase2TrackerDigi::pixelToChannel(XtalkPrev.first, XtalkPrev.second);
171  if (hitChan.first % 2 == 1)
172  signalNew.emplace(chanXtalkPrev,
173  DigitizerUtility::Amplitude(signalInElectrons_even_row_Xtalk_next_row, nullptr, -1.0));
174  else
175  signalNew.emplace(chanXtalkPrev,
176  DigitizerUtility::Amplitude(signalInElectrons_odd_row_Xtalk_next_row, nullptr, -1.0));
177  }
178  if (hitChan.first < (numRows - 1)) {
179  auto XtalkNext = std::make_pair(hitChan.first + 1, hitChan.second);
180  int chanXtalkNext = (pixelFlag) ? PixelDigi::pixelToChannel(XtalkNext.first, XtalkNext.second)
181  : Phase2TrackerDigi::pixelToChannel(XtalkNext.first, XtalkNext.second);
182  if (hitChan.first % 2 == 1)
183  signalNew.emplace(chanXtalkNext,
184  DigitizerUtility::Amplitude(signalInElectrons_odd_row_Xtalk_next_row, nullptr, -1.0));
185  else
186  signalNew.emplace(chanXtalkNext,
187  DigitizerUtility::Amplitude(signalInElectrons_even_row_Xtalk_next_row, nullptr, -1.0));
188  }
189 
190  if (hitChan.second != 0) {
191  auto XtalkPrev = std::make_pair(hitChan.first, hitChan.second - 1);
192  int chanXtalkPrev = (pixelFlag) ? PixelDigi::pixelToChannel(XtalkPrev.first, XtalkPrev.second)
193  : Phase2TrackerDigi::pixelToChannel(XtalkPrev.first, XtalkPrev.second);
194  if (hitChan.second % 2 == 1)
195  signalNew.emplace(chanXtalkPrev,
196  DigitizerUtility::Amplitude(signalInElectrons_even_column_Xtalk_next_column, nullptr, -1.0));
197  else
198  signalNew.emplace(chanXtalkPrev,
199  DigitizerUtility::Amplitude(signalInElectrons_odd_column_Xtalk_next_column, nullptr, -1.0));
200  }
201  if (hitChan.second < (numColumns - 1)) {
202  auto XtalkNext = std::make_pair(hitChan.first, hitChan.second + 1);
203  int chanXtalkNext = (pixelFlag) ? PixelDigi::pixelToChannel(XtalkNext.first, XtalkNext.second)
204  : Phase2TrackerDigi::pixelToChannel(XtalkNext.first, XtalkNext.second);
205  if (hitChan.second % 2 == 1)
206  signalNew.emplace(chanXtalkNext,
207  DigitizerUtility::Amplitude(signalInElectrons_odd_column_Xtalk_next_column, nullptr, -1.0));
208  else
209  signalNew.emplace(chanXtalkNext,
210  DigitizerUtility::Amplitude(signalInElectrons_even_column_Xtalk_next_column, nullptr, -1.0));
211  }
212  }
213  for (auto const& l : signalNew) {
214  int chan = l.first;
215  auto iter = theSignal.find(chan);
216  if (iter != theSignal.end()) {
217  theSignal[chan] += l.second.ampl();
218  } else {
219  theSignal.emplace(chan, DigitizerUtility::Amplitude(l.second.ampl(), nullptr, -1.0));
220  }
221  }
222 }
const double even_row_interchannelCoupling_next_row
virtual int nrows() const =0
static std::pair< int, int > channelToPixel(int ch)
Definition: PixelDigi.h:65
const double odd_column_interchannelCoupling_next_column
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
const double even_column_interchannelCoupling_next_column
static int pixelToChannel(int row, int col)
Definition: PixelDigi.h:71
virtual std::pair< float, float > pitch() const =0
static PackedDigiType pixelToChannel(unsigned int row, unsigned int col)
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
const double odd_row_interchannelCoupling_next_row
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
chan
lumi = TPaveText(lowX+0.38, lowY+0.061, lowX+0.45, lowY+0.161, "NDC") lumi.SetBorderSize( 0 ) lumi...
virtual int ncolumns() const =0
void PixelDigitizerAlgorithm::init ( const edm::EventSetup es)
overridevirtual

Implements Phase2TrackerDigitizerAlgorithm.

Definition at line 49 of file PixelDigitizerAlgorithm.cc.

References edm::EventSetup::get().

49  {
50  if (use_ineff_from_db_) // load gain calibration service fromdb...
51  theSiPixelGainCalibrationService_->setESObjects(es);
52 
55 
56  if (use_LorentzAngle_DB_) // Get Lorentz angle from DB record
58 
59  // gets the map and geometry from the DB (to kill ROCs)
60  es.get<SiPixelFedCablingMapRcd>().get(map_);
62 }
edm::ESHandle< SiPixelFedCablingMap > map_
const std::unique_ptr< SiPixelGainCalibrationOfflineSimService > theSiPixelGainCalibrationService_
edm::ESHandle< SiPixelLorentzAngle > SiPixelLorentzAngle_
edm::ESHandle< TrackerGeometry > geom_
T get() const
Definition: EventSetup.h:73
edm::ESHandle< SiPixelQuality > SiPixelBadModule_

Member Data Documentation

const double PixelDigitizerAlgorithm::even_column_interchannelCoupling_next_column

Definition at line 30 of file PixelDigitizerAlgorithm.h.

Referenced by add_cross_talk().

const double PixelDigitizerAlgorithm::even_row_interchannelCoupling_next_row

Definition at line 28 of file PixelDigitizerAlgorithm.h.

Referenced by add_cross_talk().

const double PixelDigitizerAlgorithm::odd_column_interchannelCoupling_next_column

Definition at line 29 of file PixelDigitizerAlgorithm.h.

Referenced by add_cross_talk().

const double PixelDigitizerAlgorithm::odd_row_interchannelCoupling_next_row

Definition at line 27 of file PixelDigitizerAlgorithm.h.

Referenced by add_cross_talk().