CMS 3D CMS Logo

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

#include <CTPPSPixelSimTopology.h>

Inheritance diagram for CTPPSPixelSimTopology:
CTPPSPixelTopology

Classes

class  PixelInfo
 

Public Member Functions

 CTPPSPixelSimTopology ()
 
PixelInfo getPixelsInvolved (double x, double y, double sigma, double &hit_pos_x, double &hit_pos_y) const
 
void pixelRange (unsigned int arow, unsigned int acol, double &lower_x, double &higher_x, double &lower_y, double &higher_y) const
 
 ~CTPPSPixelSimTopology ()
 
- Public Member Functions inherited from CTPPSPixelTopology
double activeEdgeSigma () const
 
 CTPPSPixelTopology ()=default
 
double detDeadEdgeWidth () const
 
double detPitchSimX () const
 
double detPitchSimY () const
 
unsigned short detPixelNo () const
 
unsigned short detPixelSimXNo () const
 
unsigned short detPixelSimYNo () const
 
double detThickness () const
 
double detXWidth () const
 
double detYWidth () const
 
double physActiveEdgeDist () const
 
 ~CTPPSPixelTopology ()=default
 

Private Member Functions

double activeEdgeFactor (double x, double y) const
 
unsigned int col (double y) const
 
double distanceFromBottomActiveEdge (double x, double y) const
 
double distanceFromLeftActiveEdge (double x, double y) const
 
double distanceFromRightActiveEdge (double x, double y) const
 
double distanceFromTopActiveEdge (double x, double y) const
 
void index2RowCol (unsigned int &arow, unsigned int &acol, unsigned int index) const
 
unsigned int row (double x) const
 
void rowCol2Index (unsigned int arow, unsigned int acol, unsigned int &index) const
 

Private Attributes

double active_edge_x_
 
double active_edge_y_
 

Additional Inherited Members

- Static Public Member Functions inherited from CTPPSPixelTopology
static bool isPixelHit (float xLocalCoordinate, float yLocalCoordinate, bool is3x2=true)
 
- Public Attributes inherited from CTPPSPixelTopology
CTPPSPixelIndices indices_
 
- Static Public Attributes inherited from CTPPSPixelTopology
static constexpr double active_edge_sigma_ = 0.02
 
static constexpr double dead_edge_width_ = 200E-3
 
static constexpr unsigned short no_of_pixels_ = 160 * 156
 
static constexpr unsigned short no_of_pixels_simX_ = 160
 
static constexpr unsigned short no_of_pixels_simY_ = 156
 
static constexpr double phys_active_edge_dist_ = 0.150
 
static constexpr double pitch_simX_ = 100E-3
 
static constexpr double pitch_simY_ = 150E-3
 
static constexpr double simX_width_ = 16.6
 
static constexpr double simY_width_ = 24.4
 
static constexpr double thickness_ = 0.23
 

Detailed Description

Definition at line 7 of file CTPPSPixelSimTopology.h.

Constructor & Destructor Documentation

◆ CTPPSPixelSimTopology()

CTPPSPixelSimTopology::CTPPSPixelSimTopology ( )

◆ ~CTPPSPixelSimTopology()

CTPPSPixelSimTopology::~CTPPSPixelSimTopology ( )
inline

Definition at line 57 of file CTPPSPixelSimTopology.h.

57 {}

Member Function Documentation

◆ activeEdgeFactor()

double CTPPSPixelSimTopology::activeEdgeFactor ( double  x,
double  y 
) const
inlineprivate

Definition at line 133 of file CTPPSPixelSimTopology.h.

133  {
134  const double inv_sigma = 1. / active_edge_sigma_; // precaching
135  const double topEdgeFactor = std::erf(-distanceFromTopActiveEdge(x, y) * inv_sigma) * 0.5 + 0.5;
136  const double bottomEdgeFactor = std::erf(-distanceFromBottomActiveEdge(x, y) * inv_sigma) * 0.5 + 0.5;
137  const double rightEdgeFactor = std::erf(-distanceFromRightActiveEdge(x, y) * inv_sigma) * 0.5 + 0.5;
138  const double leftEdgeFactor = std::erf(-distanceFromLeftActiveEdge(x, y) * inv_sigma) * 0.5 + 0.5;
139 
140  const double aEF = topEdgeFactor * bottomEdgeFactor * rightEdgeFactor * leftEdgeFactor;
141 
142  if (aEF > 1.)
143  throw cms::Exception("CTPPSPixelSimTopology") << " active edge factor > 1";
144 
145  return aEF;
146  }

References CTPPSPixelTopology::active_edge_sigma_, distanceFromBottomActiveEdge(), distanceFromLeftActiveEdge(), distanceFromRightActiveEdge(), distanceFromTopActiveEdge(), Exception, x, and y.

Referenced by getPixelsInvolved().

◆ col()

unsigned int CTPPSPixelSimTopology::col ( double  y) const
inlineprivate

Definition at line 183 of file CTPPSPixelSimTopology.h.

183  {
184  // y in the G4 simulation system
185  unsigned int column;
186 
187  // columns (y segmentation)
188  // now y in the system centered in the bottom left corner of the sensor (sensor view, rocs behind)
189  y = y + simY_width_ / 2.;
190  if (y < 0. || y > simY_width_)
191  throw cms::Exception("CTPPSPixelSimTopology") << " out of reference frame";
192 
193  if (y <= (dead_edge_width_ + pitch_simY_))
194  column = 0;
195  else if (y <= (dead_edge_width_ + (ROCSizeInY - 1) * pitch_simY_))
196  column = int((y - dead_edge_width_ - pitch_simY_) / pitch_simY_) + 1;
197  else if (y <= (dead_edge_width_ + (ROCSizeInY + 1) * pitch_simY_))
198  column = ROCSizeInY - 1;
199  else if (y <= (dead_edge_width_ + (ROCSizeInY + 3) * pitch_simY_))
200  column = ROCSizeInY;
201  else if (y <= (dead_edge_width_ + (2 * ROCSizeInY + 1) * pitch_simY_))
202  column = int((y - dead_edge_width_ - pitch_simY_) / pitch_simY_) - 1;
203  else if (y <= (dead_edge_width_ + (2 * ROCSizeInY + 3) * pitch_simY_))
204  column = 2 * ROCSizeInY - 1;
205  else if (y <= (dead_edge_width_ + (2 * ROCSizeInY + 5) * pitch_simY_))
206  column = 2 * ROCSizeInY;
207  else if (y <= (dead_edge_width_ + (3 * ROCSizeInY + 3) * pitch_simY_))
208  column = int((y - dead_edge_width_ - pitch_simY_) / pitch_simY_) - 3;
209  else
210  column = (3 * ROCSizeInY - 1);
211 
212  return column;
213  }

References CTPPSPixelTopology::dead_edge_width_, Exception, createfilelist::int, CTPPSPixelTopology::pitch_simY_, CTPPSPixelTopology::simY_width_, and y.

Referenced by python.rootplot.root2matplotlib.Hist2D::colz(), and getPixelsInvolved().

◆ distanceFromBottomActiveEdge()

double CTPPSPixelSimTopology::distanceFromBottomActiveEdge ( double  x,
double  y 
) const
inlineprivate

Definition at line 149 of file CTPPSPixelSimTopology.h.

149 { return (-y - active_edge_y_); }

References active_edge_y_, and y.

Referenced by activeEdgeFactor().

◆ distanceFromLeftActiveEdge()

double CTPPSPixelSimTopology::distanceFromLeftActiveEdge ( double  x,
double  y 
) const
inlineprivate

Definition at line 151 of file CTPPSPixelSimTopology.h.

151 { return (-x - active_edge_x_); }

References active_edge_x_, and x.

Referenced by activeEdgeFactor().

◆ distanceFromRightActiveEdge()

double CTPPSPixelSimTopology::distanceFromRightActiveEdge ( double  x,
double  y 
) const
inlineprivate

Definition at line 150 of file CTPPSPixelSimTopology.h.

150 { return (x - active_edge_x_); }

References active_edge_x_, and x.

Referenced by activeEdgeFactor().

◆ distanceFromTopActiveEdge()

double CTPPSPixelSimTopology::distanceFromTopActiveEdge ( double  x,
double  y 
) const
inlineprivate

Definition at line 148 of file CTPPSPixelSimTopology.h.

148 { return (y - active_edge_y_); }

References active_edge_y_, and y.

Referenced by activeEdgeFactor().

◆ getPixelsInvolved()

CTPPSPixelSimTopology::PixelInfo CTPPSPixelSimTopology::getPixelsInvolved ( double  x,
double  y,
double  sigma,
double &  hit_pos_x,
double &  hit_pos_y 
) const

Definition at line 8 of file CTPPSPixelSimTopology.cc.

9  {
10  //hit position wrt the bottom left corner of the sensor (-8.3, -12.2) in sensor view, rocs behind
11  hit_pos_x = x + simX_width_ / 2.;
12  hit_pos_y = y + simY_width_ / 2.;
13  if (!(hit_pos_x * hit_pos_y > 0))
14  throw cms::Exception("CTPPSPixelSimTopology") << "out of reference frame";
15 
16  double hit_factor = activeEdgeFactor(x, y);
17 
18  unsigned int interested_row = row(x);
19  unsigned int interested_col = col(y);
20  double low_pixel_range_x, high_pixel_range_x, low_pixel_range_y, high_pixel_range_y;
21  pixelRange(
22  interested_row, interested_col, low_pixel_range_x, high_pixel_range_x, low_pixel_range_y, high_pixel_range_y);
23 
24  return CTPPSPixelSimTopology::PixelInfo(low_pixel_range_x,
25  high_pixel_range_x,
26  low_pixel_range_y,
27  high_pixel_range_y,
28  hit_factor,
29  interested_row,
30  interested_col);
31 }

References activeEdgeFactor(), col(), Exception, pixelRange(), row(), CTPPSPixelTopology::simX_width_, CTPPSPixelTopology::simY_width_, x, and y.

Referenced by RPixChargeShare::Share().

◆ index2RowCol()

void CTPPSPixelSimTopology::index2RowCol ( unsigned int &  arow,
unsigned int &  acol,
unsigned int  index 
) const
inlineprivate

Definition at line 219 of file CTPPSPixelSimTopology.h.

219  {
220  acol = index / no_of_pixels_simX_;
221  arow = index % no_of_pixels_simX_;
222  }

References CTPPSPixelTopology::no_of_pixels_simX_.

◆ pixelRange()

void CTPPSPixelSimTopology::pixelRange ( unsigned int  arow,
unsigned int  acol,
double &  lower_x,
double &  higher_x,
double &  lower_y,
double &  higher_y 
) const
inline

Definition at line 61 of file CTPPSPixelSimTopology.h.

66  {
67  // x and y in the system of Geant4 SIMULATION
68  arow = (2 * ROCSizeInX - 1) - arow;
69  if (arow > (2 * ROCSizeInX - 1) || acol > (3 * ROCSizeInY - 1))
70  throw cms::Exception("CTPPSPixelSimTopology") << "rows or columns exceeding limits";
71 
72  // rows (x segmentation)
73  if (arow == 0) {
74  lower_x = dead_edge_width_ - phys_active_edge_dist_; // 50 um
75  higher_x = dead_edge_width_ + pitch_simX_; // 300 um
76  } else if (arow <= (ROCSizeInX - 2)) {
77  lower_x = dead_edge_width_ + arow * pitch_simX_;
78  higher_x = dead_edge_width_ + (arow + 1) * pitch_simX_;
79  } else if (arow == (ROCSizeInX - 1)) {
80  lower_x = dead_edge_width_ + arow * pitch_simX_;
81  higher_x = dead_edge_width_ + (arow + 2) * pitch_simX_;
82  } else if (arow == ROCSizeInX) {
83  lower_x = dead_edge_width_ + (arow + 1) * pitch_simX_;
84  higher_x = dead_edge_width_ + (arow + 3) * pitch_simX_;
85  } else if (arow <= (2 * ROCSizeInX - 2)) {
86  lower_x = dead_edge_width_ + (arow + 2) * pitch_simX_;
87  higher_x = dead_edge_width_ + (arow + 3) * pitch_simX_;
88  } else if (arow == (2 * ROCSizeInX - 1)) {
89  lower_x = dead_edge_width_ + (arow + 2) * pitch_simX_;
90  higher_x = dead_edge_width_ + (arow + 3) * pitch_simX_ + phys_active_edge_dist_;
91  }
92 
93  // columns (y segmentation)
94  if (acol == 0) {
95  lower_y = dead_edge_width_ - phys_active_edge_dist_; // 50 um
96  higher_y = dead_edge_width_ + pitch_simY_; // 350 um
97  } else if (acol <= (ROCSizeInY - 2)) {
98  lower_y = dead_edge_width_ + acol * pitch_simY_;
99  higher_y = dead_edge_width_ + (acol + 1) * pitch_simY_;
100  } else if (acol == (ROCSizeInY - 1)) {
101  lower_y = dead_edge_width_ + acol * pitch_simY_;
102  higher_y = dead_edge_width_ + (acol + 2) * pitch_simY_;
103  } else if (acol == ROCSizeInY) {
104  lower_y = dead_edge_width_ + (acol + 1) * pitch_simY_;
105  higher_y = dead_edge_width_ + (acol + 3) * pitch_simY_;
106  } else if (acol <= (2 * ROCSizeInY - 2)) {
107  lower_y = dead_edge_width_ + (acol + 2) * pitch_simY_;
108  higher_y = dead_edge_width_ + (acol + 3) * pitch_simY_;
109  } else if (acol == (2 * ROCSizeInY - 1)) {
110  lower_y = dead_edge_width_ + (acol + 2) * pitch_simY_;
111  higher_y = dead_edge_width_ + (acol + 4) * pitch_simY_;
112  } else if (acol == (2 * ROCSizeInY)) {
113  lower_y = dead_edge_width_ + (acol + 3) * pitch_simY_;
114  higher_y = dead_edge_width_ + (acol + 5) * pitch_simY_;
115  } else if (acol <= (3 * ROCSizeInY - 2)) {
116  lower_y = dead_edge_width_ + (acol + 4) * pitch_simY_;
117  higher_y = dead_edge_width_ + (acol + 5) * pitch_simY_;
118  } else if (acol == (3 * ROCSizeInY - 1)) {
119  lower_y = dead_edge_width_ + (acol + 4) * pitch_simY_;
120  higher_y = dead_edge_width_ + (acol + 5) * pitch_simY_ + phys_active_edge_dist_;
121  }
122 
123  lower_x = lower_x - simX_width_ / 2.;
124  lower_y = lower_y - simY_width_ / 2.;
125  higher_x = higher_x - simX_width_ / 2.;
126  higher_y = higher_y - simY_width_ / 2.;
127  }

References CTPPSPixelTopology::dead_edge_width_, Exception, CTPPSPixelTopology::phys_active_edge_dist_, CTPPSPixelTopology::pitch_simX_, CTPPSPixelTopology::pitch_simY_, CTPPSPixelTopology::simX_width_, and CTPPSPixelTopology::simY_width_.

Referenced by PPSPixelDigiAnalyzer::analyze(), getPixelsInvolved(), and RPixChargeShare::Share().

◆ row()

unsigned int CTPPSPixelSimTopology::row ( double  x) const
inlineprivate

Definition at line 153 of file CTPPSPixelSimTopology.h.

153  {
154  // x in the G4 simulation system
155  x = x + simX_width_ / 2.;
156 
157  // now x in the system centered in the bottom left corner of the sensor (sensor view, rocs behind)
158  if (x < 0. || x > simX_width_)
159  throw cms::Exception("CTPPSPixelSimTopology") << "out of reference frame";
160 
161  // rows (x segmentation)
162  unsigned int arow;
163  if (x <= (dead_edge_width_ + pitch_simX_))
164  arow = 0;
165  else if (x <= (dead_edge_width_ + (ROCSizeInX - 1) * pitch_simX_))
166  arow = int((x - dead_edge_width_ - pitch_simX_) / pitch_simX_) + 1;
167  else if (x <= (dead_edge_width_ + (ROCSizeInX + 1) * pitch_simX_))
168  arow = (ROCSizeInX - 1);
169  else if (x <= (dead_edge_width_ + (ROCSizeInX + 3) * pitch_simX_))
170  arow = ROCSizeInX;
171  else if (x <= (dead_edge_width_ + (2 * ROCSizeInX + 2) * pitch_simX_))
172  arow = int((x - dead_edge_width_ - pitch_simX_) / pitch_simX_) - 1;
173  else
174  arow = (2 * ROCSizeInX - 1);
175 
176  arow = (2 * ROCSizeInX - 1) - arow;
177  if (arow > (2 * ROCSizeInX - 1))
178  throw cms::Exception("CTPPSPixelSimTopology") << "row number exceeding limit";
179 
180  return arow;
181  }

References CTPPSPixelTopology::dead_edge_width_, Exception, createfilelist::int, CTPPSPixelTopology::pitch_simX_, CTPPSPixelTopology::simX_width_, and x.

Referenced by getPixelsInvolved().

◆ rowCol2Index()

void CTPPSPixelSimTopology::rowCol2Index ( unsigned int  arow,
unsigned int  acol,
unsigned int &  index 
) const
inlineprivate

Definition at line 215 of file CTPPSPixelSimTopology.h.

215  {
216  index = acol * no_of_pixels_simX_ + arow;
217  }

References CTPPSPixelTopology::no_of_pixels_simX_.

Member Data Documentation

◆ active_edge_x_

double CTPPSPixelSimTopology::active_edge_x_
private

◆ active_edge_y_

double CTPPSPixelSimTopology::active_edge_y_
private
DDAxes::y
CTPPSPixelTopology::simX_width_
static constexpr double simX_width_
Definition: CTPPSPixelTopology.h:21
CTPPSPixelTopology::pitch_simY_
static constexpr double pitch_simY_
Definition: CTPPSPixelTopology.h:15
CTPPSPixelSimTopology::activeEdgeFactor
double activeEdgeFactor(double x, double y) const
Definition: CTPPSPixelSimTopology.h:133
CTPPSPixelTopology::simY_width_
static constexpr double simY_width_
Definition: CTPPSPixelTopology.h:22
CTPPSPixelSimTopology::active_edge_x_
double active_edge_x_
Definition: CTPPSPixelSimTopology.h:130
DDAxes::x
CTPPSPixelSimTopology::distanceFromTopActiveEdge
double distanceFromTopActiveEdge(double x, double y) const
Definition: CTPPSPixelSimTopology.h:148
CTPPSPixelSimTopology::distanceFromBottomActiveEdge
double distanceFromBottomActiveEdge(double x, double y) const
Definition: CTPPSPixelSimTopology.h:149
CTPPSPixelTopology::pitch_simX_
static constexpr double pitch_simX_
Definition: CTPPSPixelTopology.h:16
CTPPSPixelSimTopology::active_edge_y_
double active_edge_y_
Definition: CTPPSPixelSimTopology.h:131
createfilelist.int
int
Definition: createfilelist.py:10
CTPPSPixelSimTopology::distanceFromLeftActiveEdge
double distanceFromLeftActiveEdge(double x, double y) const
Definition: CTPPSPixelSimTopology.h:151
CTPPSPixelSimTopology::pixelRange
void pixelRange(unsigned int arow, unsigned int acol, double &lower_x, double &higher_x, double &lower_y, double &higher_y) const
Definition: CTPPSPixelSimTopology.h:61
CTPPSPixelSimTopology::PixelInfo
Definition: CTPPSPixelSimTopology.h:17
CTPPSPixelTopology::active_edge_sigma_
static constexpr double active_edge_sigma_
Definition: CTPPSPixelTopology.h:24
CTPPSPixelSimTopology::col
unsigned int col(double y) const
Definition: CTPPSPixelSimTopology.h:183
Exception
Definition: hltDiff.cc:246
CTPPSPixelTopology::phys_active_edge_dist_
static constexpr double phys_active_edge_dist_
Definition: CTPPSPixelTopology.h:25
CTPPSPixelSimTopology::row
unsigned int row(double x) const
Definition: CTPPSPixelSimTopology.h:153
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
CTPPSPixelTopology::dead_edge_width_
static constexpr double dead_edge_width_
Definition: CTPPSPixelTopology.h:23
cms::Exception
Definition: Exception.h:70
CTPPSPixelTopology::no_of_pixels_simX_
static constexpr unsigned short no_of_pixels_simX_
Definition: CTPPSPixelTopology.h:18
CTPPSPixelSimTopology::distanceFromRightActiveEdge
double distanceFromRightActiveEdge(double x, double y) const
Definition: CTPPSPixelSimTopology.h:150