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 ()
 
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 ()
 

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

- Public Attributes inherited from CTPPSPixelTopology
CTPPSPixelIndices indices_
 
- Static Public Attributes inherited from CTPPSPixelTopology
static double active_edge_sigma_ = 0.02
 
static double dead_edge_width_ = 200E-3
 
static unsigned short no_of_pixels_ = 160*156
 
static unsigned short no_of_pixels_simX_ = 160
 
static unsigned short no_of_pixels_simY_ = 156
 
static double phys_active_edge_dist_ = 0.150
 
static double pitch_simX_ = 100E-3
 
static double pitch_simY_ = 150E-3
 
static double simX_width_ = 16.6
 
static double simY_width_ = 24.4
 
static double thickness_ = 0.23
 

Detailed Description

Definition at line 7 of file CTPPSPixelSimTopology.h.

Constructor & Destructor Documentation

CTPPSPixelSimTopology::CTPPSPixelSimTopology ( )
CTPPSPixelSimTopology::~CTPPSPixelSimTopology ( )
inline

Definition at line 51 of file CTPPSPixelSimTopology.h.

References getPixelsInvolved(), x, and y.

51 {}

Member Function Documentation

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

Definition at line 135 of file CTPPSPixelSimTopology.h.

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

Referenced by getPixelsInvolved().

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

Definition at line 179 of file CTPPSPixelSimTopology.h.

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

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

179  {
180  // y in the G4 simulation system
181  unsigned int column;
182 
183  // columns (y segmentation)
184  // now y in the system centered in the bottom left corner of the sensor (sensor view, rocs behind)
185  y = y + simY_width_/2.;
186  if ( y < 0. || y > simY_width_ )
187  throw cms::Exception("CTPPSPixelSimTopology")<< " out of reference frame";
188 
189  if ( y <= ( dead_edge_width_+ pitch_simY_ ) ) column = 0;
190  else if ( y <= ( dead_edge_width_+ 51*pitch_simY_ ) ) column = int( ( y-dead_edge_width_-pitch_simY_ )/pitch_simY_ )+1;
191  else if ( y <= ( dead_edge_width_+ 53*pitch_simY_ ) ) column = 51;
192  else if ( y <= ( dead_edge_width_+ 55*pitch_simY_ ) ) column = 52;
193  else if ( y <= ( dead_edge_width_+105*pitch_simY_ ) ) column = int( ( y-dead_edge_width_-pitch_simY_ )/pitch_simY_ )-1;
194  else if ( y <= ( dead_edge_width_+107*pitch_simY_ ) ) column = 103;
195  else if ( y <= ( dead_edge_width_+109*pitch_simY_ ) ) column = 104;
196  else if ( y <= ( dead_edge_width_+159*pitch_simY_ ) ) column = int( ( y-dead_edge_width_-pitch_simY_ )/pitch_simY_ )-3;
197  else column = 155;
198 
199  return column;
200  }
static double pitch_simY_
static double dead_edge_width_
static double simY_width_
double CTPPSPixelSimTopology::distanceFromBottomActiveEdge ( double  x,
double  y 
) const
inlineprivate

Definition at line 151 of file CTPPSPixelSimTopology.h.

Referenced by activeEdgeFactor().

151 { return ( -y-active_edge_y_ ); }
double CTPPSPixelSimTopology::distanceFromLeftActiveEdge ( double  x,
double  y 
) const
inlineprivate

Definition at line 153 of file CTPPSPixelSimTopology.h.

Referenced by activeEdgeFactor().

153 { return ( -x-active_edge_x_ ); }
double CTPPSPixelSimTopology::distanceFromRightActiveEdge ( double  x,
double  y 
) const
inlineprivate

Definition at line 152 of file CTPPSPixelSimTopology.h.

Referenced by activeEdgeFactor().

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

Definition at line 150 of file CTPPSPixelSimTopology.h.

Referenced by activeEdgeFactor().

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

Definition at line 10 of file CTPPSPixelSimTopology.cc.

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

Referenced by ~CTPPSPixelSimTopology().

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

Definition at line 206 of file CTPPSPixelSimTopology.h.

References CTPPSPixelTopology::no_of_pixels_simX_.

206  {
207  acol = index / no_of_pixels_simX_;
208  arow = index % no_of_pixels_simX_;
209  }
static unsigned short no_of_pixels_simX_
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 55 of file CTPPSPixelSimTopology.h.

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

Referenced by getPixelsInvolved(), and RPixClusterToHit::make_hit().

55  {
56  // x and y in the system of Geant4 SIMULATION
57  arow = 159 - arow;
58  if ( arow > 159 || acol > 155 )
59  throw cms::Exception("CTPPSPixelSimTopology")<< "rows or columns exceeding limits";
60 
61  // rows (x segmentation)
62  if ( arow == 0 ) {
63  lower_x = 0;
64  higher_x = 0.3;
65  }
66  else if ( arow <= 78 ) {
67  lower_x = 0.3 + ( arow-1 )*pitch_simX_;
68  higher_x = 0.3 + arow *pitch_simX_;
69  }
70  else if ( arow == 79 ) {
71  lower_x = 0.3 + ( arow-1 )*pitch_simX_;
72  higher_x = 0.3 + ( arow+1 )*pitch_simX_;
73  }
74  else if ( arow == 80 ) {
75  lower_x = 0.3 + arow *pitch_simX_;
76  higher_x = 0.3 + ( arow+2 )*pitch_simX_;
77  }
78  else if ( arow <= 158 ) {
79  lower_x = 0.3 + ( arow+1 )*pitch_simX_;
80  higher_x = 0.3 + ( arow+2 )*pitch_simX_;
81  }
82  else if ( arow == 159) {
83  lower_x = 0.3 + ( arow+1 )*pitch_simX_;
84  higher_x = 0.3 + ( arow+4 )*pitch_simX_;
85  }
86 
87  // columns (y segmentation)
88  if( acol == 0 ) {
89  lower_y = 0;
90  higher_y = 0.35;
91  }
92  else if ( acol <= 50 ) {
93  lower_y = 0.35 + ( acol-1 )*pitch_simY_;
94  higher_y = 0.35 + acol *pitch_simY_;
95  }
96  else if ( acol == 51 ) {
97  lower_y = 0.35 + ( acol-1 )*pitch_simY_;
98  higher_y = 0.35 + ( acol+1 )*pitch_simY_;
99  }
100  else if ( acol == 52 ) {
101  lower_y = 0.35 + acol *pitch_simY_;
102  higher_y = 0.35 + ( acol+2 )*pitch_simY_;
103  }
104  else if ( acol <= 102 ) {
105  lower_y = 0.35 + ( acol+1 )*pitch_simY_;
106  higher_y = 0.35 + ( acol+2 )*pitch_simY_;
107  }
108  else if ( acol == 103 ) {
109  lower_y = 0.35 + ( acol+1 )*pitch_simY_;
110  higher_y = 0.35 + ( acol+3 )*pitch_simY_;
111  }
112  else if ( acol == 104) {
113  lower_y = 0.35 + ( acol+2 )*pitch_simY_;
114  higher_y = 0.35 + ( acol+4 )*pitch_simY_;
115  }
116  else if ( acol <= 154 ) {
117  lower_y = 0.35 + ( acol+3 )*pitch_simY_;
118  higher_y = 0.35 + ( acol+4 )*pitch_simY_;
119  }
120  else if ( acol == 155 ) {
121  lower_y = 0.35 + ( acol+3 )*pitch_simY_;
122  higher_y = 0.35 + ( acol+4 )*pitch_simY_ + 0.2;
123  }
124 
125  lower_x = lower_x - simX_width_/2.;
126  lower_y = lower_y - simY_width_/2.;
127  higher_x = higher_x - simX_width_/2.;
128  higher_y = higher_y - simY_width_/2.;
129  }
static double pitch_simY_
static double simX_width_
static double simY_width_
static double pitch_simX_
unsigned int CTPPSPixelSimTopology::row ( double  x) const
inlineprivate

Definition at line 155 of file CTPPSPixelSimTopology.h.

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

Referenced by getPixelsInvolved().

155  {
156  // x in the G4 simulation system
157  x = x + simX_width_/2.;
158 
159  // now x in the system centered in the bottom left corner of the sensor (sensor view, rocs behind)
160  if ( x < 0. || x > simX_width_ )
161  throw cms::Exception("CTPPSPixelSimTopology")<< "out of reference frame";
162 
163  // rows (x segmentation)
164  unsigned int arow;
165  if ( x <= ( dead_edge_width_+ pitch_simX_ ) ) arow = 0;
166  else if ( x <= ( dead_edge_width_+ 79*pitch_simX_ ) ) arow = int( ( x-dead_edge_width_-pitch_simX_ )/pitch_simX_ )+1;
167  else if ( x <= ( dead_edge_width_+ 81*pitch_simX_ ) ) arow = 79;
168  else if ( x <= ( dead_edge_width_+ 83*pitch_simX_ ) ) arow = 80;
169  else if ( x <= ( dead_edge_width_+162*pitch_simX_ ) ) arow = int( ( x-dead_edge_width_-pitch_simX_ )/pitch_simX_ )-1;
170  else arow = 159;
171 
172  arow = 159-arow;
173  if ( arow>159 )
174  throw cms::Exception("CTPPSPixelSimTopology")<< "row number exceeding limit";
175 
176  return arow;
177  }
static double dead_edge_width_
static double simX_width_
static double pitch_simX_
void CTPPSPixelSimTopology::rowCol2Index ( unsigned int  arow,
unsigned int  acol,
unsigned int &  index 
) const
inlineprivate

Definition at line 202 of file CTPPSPixelSimTopology.h.

References CTPPSPixelTopology::no_of_pixels_simX_.

202  {
203  index = acol*no_of_pixels_simX_+arow;
204  }
static unsigned short no_of_pixels_simX_

Member Data Documentation

double CTPPSPixelSimTopology::active_edge_x_
private

Definition at line 132 of file CTPPSPixelSimTopology.h.

Referenced by CTPPSPixelSimTopology().

double CTPPSPixelSimTopology::active_edge_y_
private

Definition at line 133 of file CTPPSPixelSimTopology.h.

Referenced by CTPPSPixelSimTopology().