CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
Pixel3DDigitizerAlgorithm Class Reference

#include <Pixel3DDigitizerAlgorithm.h>

Inheritance diagram for Pixel3DDigitizerAlgorithm:
PixelDigitizerAlgorithm Phase2TrackerDigitizerAlgorithm

Public Member Functions

std::vector< DigitizerUtility::EnergyDepositUnitdiffusion (const LocalPoint &pos, const float &ncarriers, const std::function< LocalVector(float, float)> &u_drift, const std::pair< float, float > pitches, const float &thickness) const
 
std::vector< DigitizerUtility::SignalPointdrift (const PSimHit &hit, const Phase2TrackerGeomDetUnit *pixdet, const GlobalVector &bfield, const std::vector< DigitizerUtility::EnergyDepositUnit > &ionization_points) const override
 
std::vector< DigitizerUtility::SignalPointdrift (const PSimHit &hit, const Phase2TrackerGeomDetUnit *pixdet, const GlobalVector &bfield, const std::vector< DigitizerUtility::EnergyDepositUnit > &ionization_points, bool diffusion_activated) const
 
void induce_signal (const PSimHit &hit, const size_t hitIndex, const uint32_t tofBin, const Phase2TrackerGeomDetUnit *pixdet, const std::vector< DigitizerUtility::SignalPoint > &collection_points) override
 
 Pixel3DDigitizerAlgorithm (const edm::ParameterSet &conf, edm::ConsumesCollector iC)
 
bool select_hit (const PSimHit &hit, double tCorr, double &sigScale) const override
 
 ~Pixel3DDigitizerAlgorithm () override
 
- Public Member Functions inherited from PixelDigitizerAlgorithm
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 ()
 

Private Member Functions

const bool is_inside_n_column_ (const LocalPoint &p, const float &sensor_thickness) const
 
const bool is_inside_ohmic_column_ (const LocalPoint &p, const std::pair< float, float > &pitch) const
 

Private Attributes

const edm::ESGetToken< SiPixelFedCablingMap, SiPixelFedCablingMapRcdfedCablingMapToken_
 
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordgeomToken_
 
const float np_column_gap_
 
const float np_column_radius_
 
const float ohm_column_radius_
 
edm::ESGetToken< SiPixelQuality, SiPixelQualityRcdsiPixelBadModuleToken_
 
edm::ESGetToken< SiPixelLorentzAngle, SiPixelLorentzAngleSimRcdsiPixelLorentzAngleToken_
 

Additional Inherited Members

- Public Attributes inherited from PixelDigitizerAlgorithm
bool apply_timewalk_
 
double even_column_interchannelCoupling_next_column_
 
double even_row_interchannelCoupling_next_row_
 
const edm::ESGetToken< SiPixelFedCablingMap, SiPixelFedCablingMapRcdfedCablingMapToken_
 
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_
 
- 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)
 
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 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 SiPixelFedCablingMapfedCablingMap_
 
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< 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 29 of file Pixel3DDigitizerAlgorithm.h.

Constructor & Destructor Documentation

◆ Pixel3DDigitizerAlgorithm()

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

Definition at line 27 of file Pixel3DDigitizerAlgorithm.cc.

References Phase2TrackerDigitizerAlgorithm::addPixelInefficiency_, Phase2TrackerDigitizerAlgorithm::pixelFlag_, Phase2TrackerDigitizerAlgorithm::theAdcFullScale_, Phase2TrackerDigitizerAlgorithm::theElectronPerADC_, Phase2TrackerDigitizerAlgorithm::theThresholdInE_Barrel_, Phase2TrackerDigitizerAlgorithm::theThresholdInE_Endcap_, and Phase2TrackerDigitizerAlgorithm::tMax_.

28  : PixelDigitizerAlgorithm(conf, iC),
30  (conf.getParameter<edm::ParameterSet>("Pixel3DDigitizerAlgorithm").getParameter<double>("NPColumnRadius")) *
31  1.0_um),
33  (conf.getParameter<edm::ParameterSet>("Pixel3DDigitizerAlgorithm").getParameter<double>("OhmicColumnRadius")) *
34  1.0_um),
36  (conf.getParameter<edm::ParameterSet>("Pixel3DDigitizerAlgorithm").getParameter<double>("NPColumnGap")) *
37  1.0_um) {
38  // XXX - NEEDED?
39  pixelFlag_ = true;
40 
41  edm::LogInfo("Pixel3DDigitizerAlgorithm")
42  << "Algorithm constructed \n"
43  << "Configuration parameters:\n"
44  << "\n*** Threshold"
45  << "\n Endcap = " << theThresholdInE_Endcap_ << " electrons"
46  << "\n Barrel = " << theThresholdInE_Barrel_ << " electrons"
47  << "\n*** Gain"
48  << "\n Electrons per ADC:" << theElectronPerADC_ << "\n ADC Full Scale: " << theAdcFullScale_
49  << "\n*** The delta cut-off is set to " << tMax_ << "\n*** Pixel-inefficiency: " << addPixelInefficiency_;
50 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
Log< level::Info, false > LogInfo
PixelDigitizerAlgorithm(const edm::ParameterSet &conf, edm::ConsumesCollector iC)

◆ ~Pixel3DDigitizerAlgorithm()

Pixel3DDigitizerAlgorithm::~Pixel3DDigitizerAlgorithm ( )
override

Definition at line 52 of file Pixel3DDigitizerAlgorithm.cc.

52 {}

Member Function Documentation

◆ diffusion()

std::vector< DigitizerUtility::EnergyDepositUnit > Pixel3DDigitizerAlgorithm::diffusion ( const LocalPoint pos,
const float &  ncarriers,
const std::function< LocalVector(float, float)> &  u_drift,
const std::pair< float, float >  pitches,
const float &  thickness 
) const

Definition at line 85 of file Pixel3DDigitizerAlgorithm.cc.

References funct::abs(), createTree::dd, mps_fire::i, createfilelist::int, LogDebug, hcaltb::N_SIGMA, mathSSE::sqrt(), and HcalDetIdTransform::transform().

Referenced by drift().

90  {
91  // FIXME -- DM : Note that with a 0.3 will be enough (if using current sigma formulae)
92  // With the current sigma, this value is dependent of the thickness,
93  // Note that this formulae is coming from planar sensors, a similar
94  // study with data will be needed to extract the sigma for 3D
95  const float max_migration_radius = 0.4_um;
96  // Need to know which axis is the relevant one
97  int displ_ind = -1;
98  float pitch = 0.0;
99 
100  // Check the group is near the edge of the pixel, so diffusion will
101  // be relevant in order to migrate between pixel cells
102  if (hpitches.first - std::abs(pos.x()) < max_migration_radius) {
103  displ_ind = 0;
104  pitch = hpitches.first;
105  } else if (hpitches.second - std::abs(pos.y()) < max_migration_radius) {
106  displ_ind = 1;
107  pitch = hpitches.second;
108  } else {
109  // Nothing to do, too far away
110  return std::vector<DigitizerUtility::EnergyDepositUnit>();
111  }
112 
113  // The new EnergyDeposits in the neighbour pixels
114  // (defined by +1 to the right (first axis) and +1 to the up (second axis)) <-- XXX
115  std::vector<DigitizerUtility::EnergyDepositUnit> migrated_charge;
116 
117  // FIXME -- DM
118  const float diffusion_step = 0.1_um;
119 
120  // The position while drifting
121  std::vector<float> pos_moving({pos.x(), pos.y(), pos.z()});
122  // The drifting: drift field and steps
123  std::function<std::vector<float>(int)> do_step =
124  [&pos_moving, &u_drift, diffusion_step](int i) -> std::vector<float> {
125  auto dd = u_drift(pos_moving[0], pos_moving[1]);
126  return std::vector<float>({i * diffusion_step * dd.x(), i * diffusion_step * dd.y(), i * diffusion_step * dd.z()});
127  };
128 
129  LogDebug("Pixel3DDigitizerAlgorithm::diffusion")
130  << "\nMax. radius from the pixel edge to migrate charge: " << max_migration_radius * 1.0_um_inv << " [um]"
131  << "\nMigration axis: " << displ_ind
132  << "\n(super-)Charge distance to the pixel edge: " << (pitch - pos_moving[displ_ind]) * 1.0_um_inv << " [um]";
133 
134  // How many sigmas (probably a configurable, to be decided not now)
135  const float N_SIGMA = 3.0;
136 
137  // Start the drift and check every step
138  // Some variables needed
139  float current_carriers = ncarriers;
140  std::vector<float> newpos({pos_moving[0], pos_moving[1], pos_moving[2]});
141  float distance_edge = 0.0_um;
142  // Current diffusion value
143  const float sigma = 0.4_um;
144  for (int i = 1;; ++i) {
145  std::transform(pos_moving.begin(), pos_moving.end(), do_step(i).begin(), pos_moving.begin(), std::plus<float>());
146  distance_edge = pitch - std::abs(pos_moving[displ_ind]);
147  // Get the amount of charge on the neighbor pixel: note the
148  // transformation to a Normal
149  float migrated_e = current_carriers * 0.5 * (1.0 - std::erf(distance_edge / (sigma * std::sqrt(2.0))));
150 
151  LogDebug("(super-)charge diffusion") << "step-" << i << ", Current carriers Ne= " << current_carriers << ","
152  << "r=(" << pos_moving[0] * 1.0_um_inv << ", " << pos_moving[1] * 1.0_um_inv
153  << ", " << pos_moving[2] * 1.0_um_inv << ") [um], "
154  << "Migrated charge: " << migrated_e;
155 
156  // Move the migrated charge
157  current_carriers -= migrated_e;
158 
159  // Either far away from the edge or almost half of the carriers already migrated
160  if (std::abs(distance_edge) >= max_migration_radius || current_carriers <= 0.5 * ncarriers) {
161  break;
162  }
163 
164  // Create the ionization point:
165  // First update the newpos vector: the new charge position at the neighbouring pixel
166  // is created in the same position as its "parent carriers"
167  // except the direction of migration
168  std::vector<float> newpos(pos_moving);
169  // Let's create the new charge carriers around 3 sigmas away
170  newpos[displ_ind] += std::copysign(N_SIGMA * sigma, newpos[displ_ind]);
171  migrated_charge.push_back(DigitizerUtility::EnergyDepositUnit(migrated_e, newpos[0], newpos[1], newpos[2]));
172  }
173  return migrated_charge;
174 }
string dd
Definition: createTree.py:154
T sqrt(T t)
Definition: SSEVec.h:19
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static const double N_SIGMA
#define LogDebug(id)
unsigned transform(const HcalDetId &id, unsigned transformCode)

◆ drift() [1/2]

std::vector< DigitizerUtility::SignalPoint > Pixel3DDigitizerAlgorithm::drift ( const PSimHit hit,
const Phase2TrackerGeomDetUnit pixdet,
const GlobalVector bfield,
const std::vector< DigitizerUtility::EnergyDepositUnit > &  ionization_points 
) const
overridevirtual

Reimplemented from Phase2TrackerDigitizerAlgorithm.

Definition at line 182 of file Pixel3DDigitizerAlgorithm.cc.

Referenced by drift().

186  {
187  return drift(hit, pixdet, bfield, ionization_points, true);
188 }
std::vector< DigitizerUtility::SignalPoint > drift(const PSimHit &hit, const Phase2TrackerGeomDetUnit *pixdet, const GlobalVector &bfield, const std::vector< DigitizerUtility::EnergyDepositUnit > &ionization_points) const override

◆ drift() [2/2]

std::vector< DigitizerUtility::SignalPoint > Pixel3DDigitizerAlgorithm::drift ( const PSimHit hit,
const Phase2TrackerGeomDetUnit pixdet,
const GlobalVector bfield,
const std::vector< DigitizerUtility::EnergyDepositUnit > &  ionization_points,
bool  diffusion_activated 
) const

Definition at line 189 of file Pixel3DDigitizerAlgorithm.cc.

References Surface::bounds(), funct::cos(), diffusion(), drift(), JetChargeProducer_cfi::exp, is_inside_n_column_(), is_inside_ohmic_column_(), Topology::localPosition(), LogDebug, CaloTowersParam_cfi::mc, PixelTopology::ncolumns(), B2GMonitoring_cff::nelectrons, np_column_radius_, PixelTopology::nrows(), PV3DBase< T, PVType, FrameType >::perp(), PixelTopology::pitch(), PixelTopology::pixel(), GloballyPositioned< T >::position(), Phase2TrackerDigitizerAlgorithm::pseudoRadDamage_, Phase2TrackerDigitizerAlgorithm::pseudoRadDamageRadius_, funct::sin(), GeomDet::specificSurface(), PixelGeomDetUnit::specificTopology(), mathSSE::sqrt(), GeomDet::surface(), theta(), Bounds::thickness(), Calorimetry_cff::thickness, x, PV3DBase< T, PVType, FrameType >::x(), y, PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

194  {
195  // -- Current reference system is placed in the center of the module
196  // -- The natural reference frame should be discribed taking advantatge of
197  // -- the cylindrical nature of the pixel geometry -->
198  // -- the new reference frame should be placed in the center of the n-column, and in the
199  // -- surface of the ROC using cylindrical coordinates
200 
201  // Get ROC pitch, half_pitch and sensor thickness to be used to create the
202  // proxy pixel cell reference frame
203  const auto pitch = pixdet->specificTopology().pitch();
204  const auto half_pitch = std::make_pair<float, float>(pitch.first * 0.5, pitch.second * 0.5);
205  const float thickness = pixdet->specificSurface().bounds().thickness();
206  const int nrows = pixdet->specificTopology().nrows();
207  const int ncolumns = pixdet->specificTopology().ncolumns();
208  const float pix_rounding = 0.99;
209 
210  // The maximum radial distance is going to be used to evaluate radiation damage XXX?
211  const float max_radial_distance =
212  std::sqrt(half_pitch.first * half_pitch.first + half_pitch.second * half_pitch.second);
213 
214  // All pixels are going to be translated to a proxy pixel cell (all pixels should behave
215  // equally no matter their position w.r.t. the module) and describe the movements there
216  // Define the center of the pixel local reference frame: the current cartesian local reference
217  // frame is centered at half_width_x,half_width_y,half_thickness
218  // XXX -- This info could be obtained at init/construction time?
219  LocalPoint center_proxy_cell(half_pitch.first, half_pitch.second, -0.5 * thickness);
220 
221  LogDebug("Pixel3DDigitizerAlgorithm::drift")
222  << "Pixel pitch:" << pitch.first * 1.0_um_inv << ", " << pitch.second * 1.0_um_inv << " [um]";
223 
224  // And the drift direction (assumed same for all the sensor)
225  // XXX call the function which will return a functional
226  std::function<LocalVector(float, float)> drift_direction = [](float x, float y) -> LocalVector {
227  const float theta = std::atan2(y, x);
228  return LocalVector(-std::cos(theta), -std::sin(theta), 0.0);
229  };
230  // The output
231  std::vector<DigitizerUtility::SignalPoint> collection_points;
232  //collection_points.resize(ionization_points.size());
233  collection_points.reserve(ionization_points.size());
234 
235  // Radiation damage limit of application
236  // (XXX: No sense for 3D, let this be until decided what algorithm to use)
237  const float RAD_DAMAGE = 0.001;
238 
239  for (const auto& super_charge : ionization_points) {
240  // Extract the pixel cell
241  auto current_pixel = pixdet->specificTopology().pixel(LocalPoint(super_charge.x(), super_charge.y()));
242  // `pixel` function does not check to be in the ROC bounds,
243  // so check it here and fix potential rounding problems.
244  // Careful, this is assuming a rounding problem (1 unit), more than 1 pixel
245  // away is probably showing some backward problem worth it to track.
246  // This is also correcting out of bounds migrated charge from diffusion.
247  // The charge will be moved to the edge of the row/column.
248  current_pixel.first = std::clamp(current_pixel.first, float(0.0), (nrows - 1) + pix_rounding);
249  current_pixel.second = std::clamp(current_pixel.second, float(0.0), (ncolumns - 1) + pix_rounding);
250 
251  const auto current_pixel_int = std::make_pair(std::floor(current_pixel.first), std::floor(current_pixel.second));
252 
253  // Convert to the 1x1 proxy pixel cell (pc), where all calculations are going to be
254  // performed. The pixel is scaled to the actual pitch
255  const auto relative_position_at_pc =
256  std::make_pair((current_pixel.first - current_pixel_int.first) * pitch.first,
257  (current_pixel.second - current_pixel_int.second) * pitch.second);
258 
259  // Changing the reference frame to the proxy pixel cell
260  LocalPoint position_at_pc(relative_position_at_pc.first - center_proxy_cell.x(),
261  relative_position_at_pc.second - center_proxy_cell.y(),
262  super_charge.z() - center_proxy_cell.z());
263 
264  LogDebug("Pixel3DDigitizerAlgorithm::drift")
265  << "(super-)Charge\nlocal position: (" << super_charge.x() * 1.0_um_inv << ", " << super_charge.y() * 1.0_um_inv
266  << ", " << super_charge.z() * 1.0_um_inv << ") [um]"
267  << "\nMeasurement Point (row,column) (" << current_pixel.first << ", " << current_pixel.second << ")"
268  << "\nProxy pixel-cell frame (centered at left-back corner): (" << relative_position_at_pc.first * 1.0_um_inv
269  << ", " << relative_position_at_pc.second * 1.0_um_inv << ") [um]"
270  << "\nProxy pixel-cell frame (centered at n-column): (" << position_at_pc.x() * 1.0_um_inv << ", "
271  << position_at_pc.y() * 1.0_um_inv << ") [um] "
272  << "\nNe=" << super_charge.energy() << " electrons";
273 
274  // Check if the point is inside any of the column --> no charge was actually created then
275  if (is_inside_n_column_(position_at_pc, thickness) || is_inside_ohmic_column_(position_at_pc, half_pitch)) {
276  LogDebug("Pixel3DDigitizerAlgorithm::drift") << "Remove charge, inside the n-column or p-column!!";
277  continue;
278  }
279 
280  float nelectrons = super_charge.energy();
281  // XXX -- Diffusion: using the center frame
282  if (diffusion_activated) {
283  auto migrated_charges = diffusion(position_at_pc, super_charge.energy(), drift_direction, half_pitch, thickness);
284  for (auto& mc : migrated_charges) {
285  // Remove the migrated charges
286  nelectrons -= mc.energy();
287  // and convert back to the pixel ref. system
288  // Low-left origin/pitch -> relative within the pixel (a)
289  // Adding the pixel
290  const float pixel_x = current_pixel_int.first + (mc.x() + center_proxy_cell.x()) / pitch.first;
291  const float pixel_y = current_pixel_int.second + (mc.y() + center_proxy_cell.y()) / pitch.second;
292  const auto lp = pixdet->specificTopology().localPosition(MeasurementPoint(pixel_x, pixel_y));
293  // Remember: the drift function will move the reference system to the top. We need to subtract
294  // (center_proxy_cell.z() is a constant negative value) what we previously added in order to
295  // avoid a double translation when calling the drift function below the drift function
296  // initially considers the reference system centered in the module at half thickness)
297  mc.migrate_position(LocalPoint(lp.x(), lp.y(), mc.z() + center_proxy_cell.z()));
298  }
299  if (!migrated_charges.empty()) {
300  LogDebug("Pixel3DDigitizerAlgorithm::drift") << "****************"
301  << "MIGRATING (super-)charges"
302  << "****************";
303  // Drift this charges on the other pixel
304  auto mig_colpoints = drift(hit, pixdet, bfield, migrated_charges, false);
305  collection_points.insert(std::end(collection_points), mig_colpoints.begin(), mig_colpoints.end());
306  LogDebug("Pixel3DDigitizerAlgorithm::drift") << "*****************"
307  << "DOME MIGRATION"
308  << "****************";
309  }
310  }
311 
312  // Perform the drift, and check a potential lost of carriers because
313  // they reach the pasivation region (-z < thickness/2)
314  // XXX: not doing nothing, the carriers reach the electrode surface,
315  const float drift_distance = position_at_pc.perp() - np_column_radius_;
316 
317  // Insert a charge loss due to Rad Damage here
318  // XXX: ??
319  float energyOnCollector = nelectrons;
320  // FIXME: is this correct? Not for 3D...
321 
322  if (pseudoRadDamage_ >= RAD_DAMAGE) {
323  const float module_radius = pixdet->surface().position().perp();
324  if (module_radius <= pseudoRadDamageRadius_) {
325  const float kValue = pseudoRadDamage_ / (module_radius * module_radius);
326  energyOnCollector = energyOnCollector * std::exp(-1.0 * kValue * drift_distance / max_radial_distance);
327  }
328  }
329  LogDebug("Pixel3DDigitizerAlgorithm::drift")
330  << "Drift distance = " << drift_distance * 1.0_um_inv << " [um], "
331  << "Initial electrons = " << super_charge.energy()
332  << " [electrons], Electrons after loss/diff= " << energyOnCollector << " [electrons] ";
333  // Load the Charge distribution parameters
334  // XXX -- probably makes no sense the SignalPoint anymore...
335  collection_points.push_back(DigitizerUtility::SignalPoint(
336  current_pixel_int.first, current_pixel_int.second, 0.0, 0.0, hit.tof(), energyOnCollector));
337  }
338 
339  return collection_points;
340 }
std::vector< DigitizerUtility::EnergyDepositUnit > diffusion(const LocalPoint &pos, const float &ncarriers, const std::function< LocalVector(float, float)> &u_drift, const std::pair< float, float > pitches, const float &thickness) const
Local3DVector LocalVector
Definition: LocalVector.h:12
T perp() const
Definition: PV3DBase.h:69
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
virtual std::pair< float, float > pixel(const LocalPoint &p) const =0
virtual LocalPoint localPosition(const MeasurementPoint &) const =0
virtual int ncolumns() const =0
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
virtual int nrows() const =0
virtual float thickness() const =0
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
T sqrt(T t)
Definition: SSEVec.h:19
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
const bool is_inside_n_column_(const LocalPoint &p, const float &sensor_thickness) const
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
const PositionType & position() const
const bool is_inside_ohmic_column_(const LocalPoint &p, const std::pair< float, float > &pitch) const
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
virtual std::pair< float, float > pitch() const =0
const Plane & specificSurface() const
Same as surface(), kept for backward compatibility.
Definition: GeomDet.h:40
Geom::Theta< T > theta() const
#define LogDebug(id)
std::vector< DigitizerUtility::SignalPoint > drift(const PSimHit &hit, const Phase2TrackerGeomDetUnit *pixdet, const GlobalVector &bfield, const std::vector< DigitizerUtility::EnergyDepositUnit > &ionization_points) const override
const Bounds & bounds() const
Definition: Surface.h:87

◆ induce_signal()

void Pixel3DDigitizerAlgorithm::induce_signal ( const PSimHit hit,
const size_t  hitIndex,
const uint32_t  tofBin,
const Phase2TrackerGeomDetUnit pixdet,
const std::vector< DigitizerUtility::SignalPoint > &  collection_points 
)
overridevirtual

Reimplemented from Phase2TrackerDigitizerAlgorithm.

Definition at line 346 of file Pixel3DDigitizerAlgorithm.cc.

References Phase2TrackerDigitizerAlgorithm::_signal, LaserClient_cfi::Amplitude, c_inv, GeomDet::geographicalId(), LogDebug, mag(), Phase2TrackerDigitizerAlgorithm::makeDigiSimLinks_, Phase2TrackerDigitizerAlgorithm::pixelFlag_, Phase2TrackerDigi::pixelToChannel(), pixelgpudetails::pixelToChannel(), PixelDigi::pixelToChannel(), DiDispStaMuonMonitor_cfi::pt, DetId::rawId(), GeomDet::surface(), and Surface::toGlobal().

350  {
351  // X - Rows, Left-Right
352  // Y - Columns, Down-Up
353  const uint32_t detId = pixdet->geographicalId().rawId();
354  // Accumulated signal at each channel of this detector
355  signal_map_type& the_signal = _signal[detId];
356 
357  // Choose the proper pixel-to-channel converter
358  std::function<int(int, int)> pixelToChannel =
360  : static_cast<std::function<int(int, int)> >(Phase2TrackerDigi::pixelToChannel);
361 
362  // Iterate over collection points on the collection plane
363  for (const auto& pt : collection_points) {
364  // Extract corresponding channel (position is already given in pixel indices)
365  const int channel = pixelToChannel(pt.position().x(), pt.position().y());
366 
367  float corr_time = hit.tof() - pixdet->surface().toGlobal(hit.localPosition()).mag() * c_inv;
368  if (makeDigiSimLinks_) {
369  the_signal[channel] +=
370  DigitizerUtility::Amplitude(pt.amplitude(), &hit, pt.amplitude(), corr_time, hitIndex, tofBin);
371  } else {
372  the_signal[channel] += DigitizerUtility::Amplitude(pt.amplitude(), nullptr, pt.amplitude());
373  }
374 
375  LogDebug("Pixel3DDigitizerAlgorithm::induce_signal")
376  << " Induce charge at row,col:" << pt.position() << " N_electrons:" << pt.amplitude() << " [Channel:" << channel
377  << "]\n [Accumulated signal in this channel:" << the_signal[channel].ampl() << "] "
378  << " Global index linked PSimHit:" << hitIndex;
379  }
380 }
static int pixelToChannel(int row, int col)
Definition: PixelDigi.h:75
static PackedDigiType pixelToChannel(unsigned int row, unsigned int col)
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
std::map< int, DigitizerUtility::Amplitude, std::less< int > > signal_map_type
constexpr double c_inv
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
constexpr uint32_t pixelToChannel(int row, int col)
#define LogDebug(id)

◆ is_inside_n_column_()

const bool Pixel3DDigitizerAlgorithm::is_inside_n_column_ ( const LocalPoint p,
const float &  sensor_thickness 
) const
private

Definition at line 62 of file Pixel3DDigitizerAlgorithm.cc.

References np_column_gap_, np_column_radius_, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by drift().

62  {
63  // The insensitive volume of the column: sensor thickness - column gap distance
64  return (p.perp() <= np_column_radius_ && p.z() <= (sensor_thickness - np_column_gap_));
65 }

◆ is_inside_ohmic_column_()

const bool Pixel3DDigitizerAlgorithm::is_inside_ohmic_column_ ( const LocalPoint p,
const std::pair< float, float > &  pitch 
) const
private

Definition at line 67 of file Pixel3DDigitizerAlgorithm.cc.

References ohm_column_radius_, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by drift().

68  {
69  // The four corners of the cell
70  return ((p - LocalVector(half_pitch.first, half_pitch.second, 0)).perp() <= ohm_column_radius_) ||
71  ((p - LocalVector(-half_pitch.first, half_pitch.second, 0)).perp() <= ohm_column_radius_) ||
72  ((p - LocalVector(half_pitch.first, -half_pitch.second, 0)).perp() <= ohm_column_radius_) ||
73  ((p - LocalVector(-half_pitch.first, -half_pitch.second, 0)).perp() <= ohm_column_radius_);
74 }
Local3DVector LocalVector
Definition: LocalVector.h:12

◆ select_hit()

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

Member Data Documentation

◆ fedCablingMapToken_

const edm::ESGetToken<SiPixelFedCablingMap, SiPixelFedCablingMapRcd> Pixel3DDigitizerAlgorithm::fedCablingMapToken_
private

Definition at line 70 of file Pixel3DDigitizerAlgorithm.h.

◆ geomToken_

const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> Pixel3DDigitizerAlgorithm::geomToken_
private

Definition at line 71 of file Pixel3DDigitizerAlgorithm.h.

◆ np_column_gap_

const float Pixel3DDigitizerAlgorithm::np_column_gap_
private

Definition at line 66 of file Pixel3DDigitizerAlgorithm.h.

Referenced by is_inside_n_column_().

◆ np_column_radius_

const float Pixel3DDigitizerAlgorithm::np_column_radius_
private

Definition at line 63 of file Pixel3DDigitizerAlgorithm.h.

Referenced by drift(), and is_inside_n_column_().

◆ ohm_column_radius_

const float Pixel3DDigitizerAlgorithm::ohm_column_radius_
private

Definition at line 64 of file Pixel3DDigitizerAlgorithm.h.

Referenced by is_inside_ohmic_column_().

◆ siPixelBadModuleToken_

edm::ESGetToken<SiPixelQuality, SiPixelQualityRcd> Pixel3DDigitizerAlgorithm::siPixelBadModuleToken_
private

Definition at line 68 of file Pixel3DDigitizerAlgorithm.h.

◆ siPixelLorentzAngleToken_

edm::ESGetToken<SiPixelLorentzAngle, SiPixelLorentzAngleSimRcd> Pixel3DDigitizerAlgorithm::siPixelLorentzAngleToken_
private

Definition at line 69 of file Pixel3DDigitizerAlgorithm.h.