GEAR  1.9.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Friends Pages
FTDLayerLayoutImpl.h
1 // -*- C++ -*-
2 #ifndef GEAR_FTDLayerLayoutImpl_H
3 #define GEAR_FTDLayerLayoutImpl_H 1
4 
5 #include "gear/FTDLayerLayout.h"
6 #include <vector>
7 #include <math.h>
8 
9 namespace gear
10 {
20 // Helper class: Components x,y,z of a vector which defines
21 // a reference frame (its module is 1), why not
22 // usign Vector3D (CLHEP or GEAR)?... by the moment
23 class vframe // TO BE DEPRECATED...
24 {
25  public:
26  vframe(): x(0),y(0),z(0) { ; }
27  vframe(const double & xval, const double & yval, const double & zval):
28  x(xval),y(yval),z(zval) { ; }
29  ~vframe() { ; }
30 
31  double x{};
32  double y{};
33  double z{};
34 };
35 
37 {
38  friend class FTDParametersImpl ;
39 
40  public:
42  struct Layer
43  {
44  int nPetals {}; // Number of petals
45  int nSensors {}; // Number of sensors per petal
46  bool isDoubleSided{}; // if Petals have sensors on front AND back
47  int sensorType {}; // The sensor type of the disk: pixel or strips
48  // For future changes: could be extended the types
49  // to Double Side Micro Strips, for instance...
50  double petalOpenningAngle {}; // Angle defining the half-width of a petal
51  double phi0 {}; // azimuthal angle of the first petal (paralel to Y-axis,
52  // and in the Y-positive direction)
53  double alpha{}; // Angle of the rotation of the petal in
54  // its own plane (turbine-blade design)
55  double zposition{}; // Z-position of the centroid of the layer (disk).
56  double zoffset{}; // z-distance from the zposition to the centroid
57  // of a petal (staggered design)
58  double zsign0{}; // Sign of the zoffset of the first petal --> FIXME: int
59  double rInner{}; // Distance from Z-axis to the closest point of a petal (or sensitive)
60  double thickness {}; // thickness (petal or sensor)
61  double lengthMin {}; // smaller length of a trapezoid (petal or sensor)
62  double lengthMax {}; // biggest length of a trapezoid (petal or sensor)
63  double width {}; // y-distance (between the lengthMin line
64  // and the lengthMax line) for petal or sensor
65  double radLength {}; // Radiation length (petal or sensor)
66  } ;
67 
68 
69  typedef std::vector<Layer> LayerVec ;
70 
71  // Destructor.
72  virtual ~FTDLayerLayoutImpl() { /* nop */; }
73 
75  virtual int getNLayers() const { return _lVec.size() ; }
76 
79  virtual int getNPetals(int layerIndex) const { return _lVec.at( getEquivLayer(layerIndex) ).nPetals ; }
80 
94  virtual int getNSensors(int layerIndex) const { return _lVec.at( getEquivLayer(layerIndex) ).nSensors; }
95 
98  virtual bool isDoubleSided(int layerIndex) const { return _lVec.at( getEquivLayer(layerIndex) ).isDoubleSided; }
99 
105  virtual int getSensorType(int layerIndex) const { return _lVec.at(getEquivLayer(layerIndex)).sensorType; }
106 
110  virtual double getPhiHalfDistance(int layerIndex) const
111  { return _lVec.at( getEquivLayer(layerIndex) ).petalOpenningAngle ; }
112 
115  virtual double getPhi0(const int & layerIndex) const { return _lVec.at(getEquivLayer(layerIndex)).phi0 ; }
116 
119  virtual double getAlpha(int layerIndex) const { return _lVec.at( getEquivLayer(layerIndex) ).alpha ; }
120 
123  //FIXME: TO BE DEPRECATED OR PRIVATE? All the positions having to
124  // return this class is relative to the petals or
125  // sensors. to be checked
126  virtual double getZposition(const int & layerIndex) const
127  { return _lVec.at(getEquivLayer(layerIndex)).zposition ; }
128 
134  //FIXME: TO BE DEPRECATED OR PRIVATE?
135  virtual double getZoffset(const int & layerIndex) const
136  { return _lVec.at(getEquivLayer(layerIndex)).zoffset ; }
137 
140  virtual double getZoffsetSign0(const int & layerIndex) const
141  { return _lVec.at(getEquivLayer(layerIndex)).zsign0 ; }
142 
149  virtual double getSupportZposition(const int & layerIndex, const int & petalIndex) const;
150 
153  virtual double getSupportRinner(int layerIndex) const
154  { return _lVec.at( getEquivLayer(layerIndex) ).rInner ; }
155 
159  virtual double getSupportRadLength(int layerIndex) const
160  { return _lVec.at( getEquivLayer(layerIndex) ).radLength ; }
161 
165  virtual double getSupportThickness(int layerIndex) const
166  { return _lVec.at( getEquivLayer(layerIndex) ).thickness ; }
167 
171  // FIXME: Change Length <--> Width (I think is the usual notation)
172  virtual double getSupportLengthMin(int layerIndex) const { return _lVec.at( getEquivLayer(layerIndex) ).lengthMin ; }
173 
177  // FIXME: Change Length <--> Width (I think is the usual notation)
178  virtual double getSupportLengthMax(int layerIndex) const { return _lVec.at( getEquivLayer(layerIndex) ).lengthMax ; }
179 
183  // FIXME: Change Length <--> Width (I think is the usual notation)
184  virtual double getSupportWidth(int layerIndex) const { return _lVec.at( getEquivLayer(layerIndex) ).width ; }
185 
186 
199  virtual double getSensitiveZposition(const int & layerIndex, const int & petalIndex,
200  const int & sensorIndex) const;
201 
204  virtual double getSensitiveRinner(int layerIndex) const
205  { return _sVec.at( getEquivLayer(layerIndex) ).rInner ; }
206 
210  virtual double getSensitiveRadLength(int layerIndex) const { return _sVec.at( getEquivLayer(layerIndex) ).radLength ; }
211 
214  virtual double getSensitiveThickness(int layerIndex) const { return _sVec.at( getEquivLayer(layerIndex) ).thickness ; }
215 
219  virtual double getSensitiveLengthMin(int layerIndex) const { return _sVec.at( getEquivLayer(layerIndex) ).lengthMin ; }
220 
224  // FIXME: Change Length <--> Width (I think is the usual notation)
225  virtual double getSensitiveLengthMax(int layerIndex) const { return _sVec.at( getEquivLayer(layerIndex) ).lengthMax ; }
226 
229  // FIXME: Change Length <--> Width (I think is the usual notation)
230  virtual double getSensitiveWidth(int layerIndex) const { return _sVec.at( getEquivLayer(layerIndex) ).width ; }
231 
232 
235  virtual void addLayer(int nPetals, int nSensors, bool isDoubleSided ,int sensorType, double petalOpAngle, double phi0, double alpha,
236  // common for support and sensitive
237  double zposition, double zoffset, double zsign0,
238  // support
239  //double supportZposlayer,
240  double supportRinner, double supportThickness,
241  double supportLengthMin, double supportLengthMax,
242  double supportWidth,
243  double supportRadLength,
244  // sensitive
245  //double sensitiveZposlayer,
246  double sensitiveRinner, double sensitiveThickness,
247  double sensitiveLengthMin, double sensitiveLengthMax,
248  double sensitiveWidth,
249  double sensitiveRadLength ) ;
250 
251 
257  virtual double getPhiPetalCd(const int & layerIndex, const int & petalIndex) const;
258 
260  // FIXME: To be checked if necessary
261  virtual double getMaxRadius(const int & layerIndex,const bool & sensitive=false ) const ;
262 
265  // FIXME: To be checked if necessary
266  virtual double getStartPhi(const int & layerIndex, const int & petalInd,const bool &sensitive=false ) const ;
267 
270  // FIXME: To be checked if necessary
271  virtual double getEndPhi(const int & layerIndex,const int & petalInd, const bool & sensitive=false ) const ;
272 
278  // FIXME: To be checked if necessary
279  virtual double getThicknessForAngle(const int & layerIndex, const double & tetha,
280  const double & phi, const bool & sensitive=false ) const ;
281 
282 
283  protected:
284  // Support
285  LayerVec _lVec {};
286  // Sensitive
287  LayerVec _sVec {};
288 
289 
290  // Reference frame of the petal (left side ).
291  // The frame is defined in the way of that all the points inside the
292  // trapezoid are defined positives.
293  std::vector<vframe> _eL{}; //FIXME: TO BE DEPRECATED
294  std::vector<vframe> _eS{}; //FIXME: TO BE DEPRECATED
295 
296  private:
297  // Internal function to convert the raw layerIndex (which goes from 0 to 2N-1,
298  // being N=total number of positive disk, to the identifier which corresponds
299  // with the z-positive disks symmetric to it.
300  // The positives disks have defined the raw index as 0,N-1
301  // The negatives disks have defined the raw index as N,2N-1
302  // So, the returned index will be the same for positives disks
303  // and the correspondent value between 0,N-1 for the negative ones.
304  int getEquivLayer(const int & layerIndex) const;
305 
306  // Extraction of the left side reference frame
307  std::vector<vframe> getframe( const Layer & layer ); //FIXME: TO BE DEPRECATED
308 
309 }; // class
310 } // namespace gear
311 #endif /* ifndef GEAR_FTDLAYERLAYOUT_H */
virtual double getSensitiveThickness(int layerIndex) const
The thickness in mm of the sensitive area in supports in layer layerIndex.
virtual double getThicknessForAngle(const int &layerIndex, const double &tetha, const double &phi, const bool &sensitive=false) const
returns thickness as viewed under the incidence angles phi and theta in layer layerIndex.
virtual int getNLayers() const
The total number of layers (z-positives and z-negatives disks).
virtual double getPhiPetalCd(const int &layerIndex, const int &petalIndex) const
Azimuthal angle of the petal petalIndex Centroid at layer layerIndex.
virtual double getSupportWidth(int layerIndex) const
The width in mm for supports in layer layerIndex - layer indexing starting at 0 from the layer closes...
virtual double getSupportRadLength(int layerIndex) const
The radiation length in the support structure supports of layer layerIndex - layer indexing starts at...
virtual double getSupportRinner(int layerIndex) const
The R-min of the petals in the XY-plane in mm for supports.
virtual int getSensorType(int layerIndex) const
The sensor type of the disk: pixel or micro-strip The return value corresponds to the following value...
virtual double getSensitiveRinner(int layerIndex) const
The R-min of the support in the XY-plane in mm for sensors.
virtual double getSupportThickness(int layerIndex) const
The thickness in mm of the supports in layerIndex - layer indexing starting at 0 for the layer closes...
virtual int getNSensors(int layerIndex) const
The number of sensors per petal on a specific layer - Sensor indexing is defined as follows: (illustr...
virtual double getSensitiveRadLength(int layerIndex) const
The radiation length in sensitive volumes in layer layerIndex - layer indexing starts at 0 for the la...
Abstract description of layers in a FTD detector.
virtual double getZposition(const int &layerIndex) const
The z-position of the centroid of the disk structure.
virtual double getMaxRadius(const int &layerIndex, const bool &sensitive=false) const
returns maximum radius for a given layer
virtual double getSupportZposition(const int &layerIndex, const int &petalIndex) const
The position of the support in z direction in mm for the petalIndex petal in layer layerIndex - layer...
virtual double getZoffsetSign0(const int &layerIndex) const
The z-offset sign for the first petal (petalId=0)
virtual double getPhiHalfDistance(int layerIndex) const
Angular half-width of the petals of a layer.
virtual double getSupportLengthMax(int layerIndex) const
The length (x-direction) in mm for the largest edge of the supports in layerIndex - layer indexing st...
virtual double getPhi0(const int &layerIndex) const
Angular distance (XY plane) of a first petal (whose index is 0)
virtual double getAlpha(int layerIndex) const
Angle of rotation in the own plane of a petal.
Geometry properties of a FTD detector needed for reconstruction code.
virtual double getSensitiveLengthMin(int layerIndex) const
Same as getSupportLengthMin() except for the sensitive part of the support.
virtual double getEndPhi(const int &layerIndex, const int &petalInd, const bool &sensitive=false) const
returns ending phi for first petal in layer layerIndex (on side facing IP)
virtual int getNPetals(int layerIndex) const
The number of petals in the layer layerIndex - layer indexing starts at 0 for the layer closest to IP...
virtual double getSensitiveZposition(const int &layerIndex, const int &petalIndex, const int &sensorIndex) const
The position of the sensitive in z direction in mm for sensor sensorIndex of the petal support petalI...
virtual bool isDoubleSided(int layerIndex) const
Whether the petals on a layer have sensors in front and back.
virtual double getSensitiveLengthMax(int layerIndex) const
Same as getSupportLengthMax() except for the sensitive part of the support.
Abstract description of layers in a FTD detector.
Helper class for layer properties.
virtual double getSensitiveWidth(int layerIndex) const
The width of the sensitive area in supports in layer layerIndex in mm.
virtual void addLayer(int nPetals, int nSensors, bool isDoubleSided, int sensorType, double petalOpAngle, double phi0, double alpha, double zposition, double zoffset, double zsign0, double supportRinner, double supportThickness, double supportLengthMin, double supportLengthMax, double supportWidth, double supportRadLength, double sensitiveRinner, double sensitiveThickness, double sensitiveLengthMin, double sensitiveLengthMax, double sensitiveWidth, double sensitiveRadLength)
Add a new layer at the given position.
virtual double getZoffset(const int &layerIndex) const
The z-offset of the support structure in a staggered the setup - the z position of the even numbered ...
virtual double getSupportLengthMin(int layerIndex) const
The length (x-direction) in mm for the smallest edge of the supports in layerIndex - layer indexing s...
virtual double getStartPhi(const int &layerIndex, const int &petalInd, const bool &sensitive=false) const
returns starting phi for first petal in layer layerIndex (on side facing IP)