2 #include "gearimpl/FTDLayerLayoutImpl.h"
12 double zposition,
double zoffset,
double zsignpetal0,
15 double supportRinner,
double supportThickness,
16 double supportLengthMin,
double supportLengthMax,
18 double supportRadLength,
21 double sensitiveRinner,
double sensitiveThickness,
22 double sensitiveLengthMin,
double sensitiveLengthMax,
23 double sensitiveWidth,
24 double sensitiveRadLength )
28 lL.nPetals = nPetals ;
29 lL.nSensors = nSensors;
31 lL.sensorType = sensorType;
33 lL.petalOpenningAngle= petalOpAngle;
36 lL.zposition = zposition;
38 lL.zsign0 = zsignpetal0;
39 lL.rInner = supportRinner;
40 lL.lengthMin = supportLengthMin;
41 lL.lengthMax = supportLengthMax;
42 lL.thickness = supportThickness;
43 lL.width = supportWidth ;
44 lL.radLength = supportRadLength ;
46 sL.nPetals = nPetals ;
47 sL.nSensors = nSensors;
49 sL.sensorType = sensorType;
51 sL.petalOpenningAngle= petalOpAngle;
54 sL.zposition = zposition;
56 sL.zsign0 = zsignpetal0;
57 sL.rInner = sensitiveRinner;
58 sL.thickness = sensitiveThickness;
59 sL.lengthMin = sensitiveLengthMin;
60 sL.lengthMax = sensitiveLengthMax;
61 sL.width = sensitiveWidth ;
62 sL.radLength = sensitiveRadLength ;
64 _lVec.push_back( lL ) ;
65 _sVec.push_back( sL ) ;
76 int FTDLayerLayoutImpl::getEquivLayer(
const int & layerIndex)
const
87 correctedId = layerIndex;
92 std::cout <<
"The disk layer introduced is not in the right format. Use the description:\n " <<
93 "Z-Positives disks: 0,1,...,N-1\n " <<
94 "Z-negatives disks: 7,8,...,2N-1\n" << std::endl;
104 int layerId = getEquivLayer(layerIndex);
106 Layer petal = _lVec.at(layerId);
108 int offsetsign = petal.zsign0*(int)pow((
double)-1,(double)petalIndex);
110 double zpos = petal.zposition+offsetsign*petal.zoffset;
115 if( layerId != layerIndex )
120 return finalsign*zpos;
125 const int & sensorIndex)
const
128 int layerId = getEquivLayer(layerIndex);
131 int zdisksign = (int)(zsupport/fabs(zsupport));
132 int sign = -zdisksign;
134 if( ( _lVec.at(layerId).isDoubleSided )&&( sensorIndex > _lVec.at(layerId).nSensors/2 ) ){
140 if( sensorIndex > _lVec.at(layerId).nSensors || sensorIndex < 1 )
142 std::stringstream ss ;
143 ss <<
"FTDLayerLayoutImpl::getSensitiveZposition Error!!"
144 <<
" The Sensor Index \'" << sensorIndex
145 <<
"\' is out of range. There are only sensors from 1 to " << _lVec.at(layerId).nSensors <<
" !"
150 double petalthickness = _lVec.at(layerId).thickness;
151 double sensorthickness = _sVec.at(layerId).thickness;
152 double zpos = zsupport+sign*(petalthickness+sensorthickness)/2.0;
162 int layerId = getEquivLayer(layerIndex);
164 return _lVec.at(layerId).phi0+
165 (double)petalIndex*2.0*_lVec.at(layerId).petalOpenningAngle;
174 l = _lVec.at( layerIndex );
178 l = _sVec.at( layerIndex );
181 return l.rInner+l.width;
191 l = _lVec.at( layerIndex ) ;
194 l = _sVec.at( layerIndex ) ;
197 const double endphi = 0.0;
199 return endphi-2.0*l.phi0 ;
213 const double & phi,
const bool & sensitive )
const
217 l = _lVec.at( layerIndex ) ;
220 l = _sVec.at( layerIndex ) ;
223 double angularThickness ;
234 angularThickness = l.thickness*sqrt(1.0/(sin(theta)*sin(theta))+tan(phi)*tan(phi));
236 return angularThickness;
250 std::vector<vframe> FTDLayerLayoutImpl::getframe(
const Layer & l )
259 double sigma = atan( l.width/((l.lengthMax-l.lengthMin)/2.0) );
260 vframe e3(0.0,cos(sigma),sin(sigma));
262 std::vector<vframe> fr;
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.
Base exception class for GEAR - all other exceptions extend this.
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 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 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.
Abstract description of layers in a FTD detector.
Helper class for layer properties.
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 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)