All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
SiStripGeomFTD.h
Go to the documentation of this file.
1 #ifndef SISTRIPGEOMFTD_H
2 #define SISTRIPGEOMFTD_H 1
3 
4 #include<vector>
5 #include<string>
6 
7 // Include CLHEP header files
8 // Include CLHEP header files
9 
10 #include "SiStripGeom.h"
11 
12 // Include Gear header files
13 #include "gear/FTDParameters.h"
14 #include "gear/FTDLayerLayout.h"
15 
16 // Include LCIO stuff
17 #include "EVENT/SimTrackerHit.h"
18 #include "UTIL/BitField64.h"
19 
20 //class gear::FTDParameters;
21 //class gear::FTDLayerLayout;
22 /**
23 \addtogroup SiStripDigi SiStripDigi
24 @{
25 */
26 namespace sistrip
27 {
28 
29 //! Gear geometry class - holds all geometry information about silicon strip
30 //! sensors. The data are taken directly from Gear xml file and values are
31 //! saved in the system of units defined in PhysicalConstants.h. The local
32 //! reference system is defined as follows: X-axis is perpendicular to the
33 //! beam axis and to the ladder (sensor) plane; Y-axis lies in a ladder
34 //! (sensor) plane and is also perpendicular to the beam axis; Z-axis is
35 //! parallel to the beam axis(for zero theta); (0,0,0) point is positioned
36 //! such as X, Y, Z coordinates are always positive. Strips are considered
37 //! to be either perpendicular to the beam axis or parallel with the beam
38 //! axis (SSDs) or both (DSSDs).
39 //!
40 //! @author Z. Drasal, Charles University Prague
41 //!
42 //! Thu Jul 14 (J. Duarte Campderros)
43 //! Converted to abstract class used by the builder to construct the
44 //! different subdetectors which going to use silicon strips (FTD,SIT,..)
45 
47 
49 {
50  public:
51 
52  //!Constructor
53  SiStripGeomFTD(const std::string &, const double & pitchFront,
54  const double & pitchRear);
55  //!Destructor
56  virtual ~SiStripGeomFTD();
57 
58  //!Method initializing class - reads Gear parameters from XML file
59  virtual void initGearParams();
60 
61  //! Returns the input cellID0 where the field sensor is put to 0
62  virtual int cellID0withSensor0(const int & cellID0) const;
63 
64  //!Method to extract codification ID,
65  //std::map<std::string,short int> cellIDDecProv(EVENT::SimTrackerHit * & simHit);
66  virtual std::map<std::string,int> decodeCellID(const UTIL::BitField64 & cellID) const;
67  virtual std::map<std::string,int> decodeCellID(const int & cellID) const;
68 
69  //!Method to extract strip and strip type (cellID1)
70  virtual std::pair<StripType,int> decodeStripID(const int & encodedStripID) const;
71  virtual std::pair<StripType,int> decodeStripID(const UTIL::BitField64 & cellEnc) const;
72 
73  //!Stores the cellID0 and cellID1 of the LCIO object to the file
74  virtual void updateCanonicalCellID(const int & cellID, const int & stripType,
75  const int & stripID, UTIL::BitField64 * bf);
76 
77 
78  // TRANSFORMATION METHODS - GLOBAL REF. SYSTEM
79  //!Transform given point from global ref. system to local ref. system (sensor)
80  virtual CLHEP::Hep3Vector transformPointToLocal(short int layerID,
81  short int ladderID, short int sensorID, const CLHEP::Hep3Vector & point);
82 
83  //!Transform given vector from global ref. system to local ref. system (sensor)
84  virtual CLHEP::Hep3Vector transformVecToLocal(short int layerID,
85  short int ladderID, short int sensorID,
86  const CLHEP::Hep3Vector & vec);
87 
88  //!Transform given matrix from global ref. system to local ref. system (sensor)
89  virtual CLHEP::HepMatrix transformMatxToLocal(short int layerID,
90  short int ladderID, const CLHEP::HepMatrix & matrix);
91 
92 
93  // TRANSFORMATION METHODS - LOCAL REF. SYSTEM
94  //!Transform given point from local ref. system (sensor) to global ref. system
95  virtual CLHEP::Hep3Vector transformPointToGlobal(short int layerID,
96  short int ladderID, short int sensorID, const CLHEP::Hep3Vector & point);
97 
98  //!Transform given vector from local ref. system (sensor) to global ref. system
99  virtual CLHEP::Hep3Vector transformVecToGlobal(short int layerID,
100  short int ladderID, short int sensorID,
101  const CLHEP::Hep3Vector & vec);
102 
103  //!Transform given diagonal matrix from local ref. system (sensor) to global ref. system
104  virtual CLHEP::HepMatrix transformMatxToGlobal(short int layerID,
105  short int ladderID, const CLHEP::HepMatrix & matrix);
106 
107 
108  // OTHER METHODS - GLOBAL REF. SYSTEM
109  //!Get info whether the given point is inside of Si sensor
110  virtual bool isPointInsideSensor (short int layerID,
111  short int ladderID, short int sensorID, const CLHEP::Hep3Vector & point) const;
112 
113 
114  // OTHER METHODS - LOCAL REF. SYSTEM
115  //! Get info whether the given point is out of Si sensor (parameters: layerID,
116  //! space point in local ref. system)
117  virtual bool isPointOutOfSensor(short int layerID, const CLHEP::Hep3Vector & point) const;
118 
119  //! Get sensor pitch for strips in the local ref. system.
120  //! Currently it means the faced to IP sensors of the petals.
121  virtual double getSensorPitch(const int & diskID, const int & sensorID,
122  const double & posZ) const;
123 
124  //! Get Y-centered position in the local ref. system for the stripID
125  virtual double getStripPosY(const int & diskID, const int & sensorID,
126  const int & stripID, const double & posZ) const;
127 
128  //! Get number of strips per sensor
129  virtual int getSensorNStrips(const int & diskID, const int & sensorID) const;
130 
131  //! Transforming a given point to the local ref. frame of a petal
132  //! which is rotated around its center an angle stAngle
133  virtual CLHEP::Hep3Vector transformPointToRotatedLocal(const int & diskID,
134  const int & sensorID, const CLHEP::Hep3Vector & point) const;
135 
136  //! Transforming a given point from the reference system rotated around
137  //! the center of a petal to its local ref. frame (inverse of
138  //! transformPointToRotatedLocal)
139  virtual CLHEP::Hep3Vector transformPointFromRotatedLocal(const int & diskID,
140  const int & sensorID, const CLHEP::Hep3Vector & point) const;
141 
142  //! Get director vector of a strip (inside the local Ref. system)
143  //! The vector is defined to describe the strip from z_local=0
144  virtual CLHEP::Hep3Vector getStripUnitVector(const int & diskID,
145  const int & sensorID, const int & stripID) const;
146 
147  //! Get the point which crosses two strips
148  virtual CLHEP::Hep3Vector getCrossLinePoint(const int & diskID,
149  const int & sensorID,
150  const int & stripIDFront, const int & stripIDRear) const;
151 
152  // OTHER METHODS - IDENTIFYING
153  //! Get strip ID (in Phi), points are given in local ref. system; strips are
154  //! considered to be perpendicular to beam axis. It is perpedicular to the
155  //! RPhi LRF and paralel to the z-axis of the LRF. Recall that the number
156  //! of strips in the RPhi LRF plane is dependent of Z (in LRF) due to
157  //! the trapezoid shape of the sensors.
158  //! That sensor are the faced to IP on each petal (in the current design)
159  virtual int getStripID(const int & diskID, const int & sensorID,
160  const double & posRPhi, const double & posZ ) const;
161 
162  //!Method impossed by consistent with the mother class.
163  //!The FTD sensors are all perpendicular to the beam axis
164  virtual double getLadderTheta(short int diskID) const { return M_PI/2.0;}
165 
166 
167  // PRINT METHODS
168  //!Method printing general Gear parameters
169  virtual void printGearParams() const;
170 
171  //!Method printing sensor Gear parameters
172  virtual void printSensorParams(short int layerID) const;
173 
174  private:
175  gear::FTDParameters * _ftdParams;
176  gear::FTDLayerLayout * _ftdLayer;
177 
178  // Pitch of the front and rear sensor in the middle of
179  // the sensor. FIXME: These data member are initialized by
180  // the processors (Digi and Cluster) and could introduced
181  // an inconsistency between differents values...
182  double _pitchFront;
183  double _pitchRear;
184  //FIXME PROVISIONAL?
185  double getLadderOffsetX(const short int & layerID) const;
186  //! Get the stereo angle of the strips
187  double getStereoAngle(const int & diskID,const int & sensorID) const;
188 
189  std::vector<double> _layerOuterRadius;
190  std::vector<double> _layerPetalOpAngle;
191  std::vector<double> _ladderZOffsetSign0;
192 
193 }; // Class
194 
195 } // Namespace
196 
197 /** @} */
198 
199 #endif // SISTRIPGEOMFTD_H
virtual ~SiStripGeomFTD()
Destructor.
virtual bool isPointOutOfSensor(short int layerID, const CLHEP::Hep3Vector &point) const
Get info whether the given point is out of Si sensor (parameters: layerID, space point in local ref...
gear::FTDLayerLayout * _ftdLayer
virtual int cellID0withSensor0(const int &cellID0) const
Returns the input cellID0 where the field sensor is put to 0.
double getLadderOffsetX(const short int &layerID) const
virtual double getLadderTheta(short int diskID) const
Method impossed by consistent with the mother class.
Gear geometry class - holds all geometry information about silicon strip sensors. ...
Definition: SiStripGeom.h:59
LayerTypeFTD
Gear geometry class - holds all geometry information about silicon strip sensors. ...
virtual CLHEP::Hep3Vector transformPointToGlobal(short int layerID, short int ladderID, short int sensorID, const CLHEP::Hep3Vector &point)
Transform given point from local ref. system (sensor) to global ref. system.
virtual CLHEP::Hep3Vector getCrossLinePoint(const int &diskID, const int &sensorID, const int &stripIDFront, const int &stripIDRear) const
Get the point which crosses two strips.
virtual double getSensorPitch(const int &diskID, const int &sensorID, const double &posZ) const
Get sensor pitch for strips in the local ref.
virtual CLHEP::Hep3Vector transformVecToGlobal(short int layerID, short int ladderID, short int sensorID, const CLHEP::Hep3Vector &vec)
Transform given vector from local ref. system (sensor) to global ref. system.
virtual CLHEP::HepMatrix transformMatxToGlobal(short int layerID, short int ladderID, const CLHEP::HepMatrix &matrix)
Transform given diagonal matrix from local ref. system (sensor) to global ref. system.
virtual std::pair< StripType, int > decodeStripID(const int &encodedStripID) const
Method to extract strip and strip type (cellID1)
double getStereoAngle(const int &diskID, const int &sensorID) const
Get the stereo angle of the strips.
virtual bool isPointInsideSensor(short int layerID, short int ladderID, short int sensorID, const CLHEP::Hep3Vector &point) const
Get info whether the given point is inside of Si sensor.
virtual CLHEP::Hep3Vector transformVecToLocal(short int layerID, short int ladderID, short int sensorID, const CLHEP::Hep3Vector &vec)
Transform given vector from global ref. system to local ref. system (sensor)
std::vector< double > _ladderZOffsetSign0
virtual CLHEP::HepMatrix transformMatxToLocal(short int layerID, short int ladderID, const CLHEP::HepMatrix &matrix)
Transform given matrix from global ref. system to local ref. system (sensor)
virtual CLHEP::Hep3Vector transformPointToRotatedLocal(const int &diskID, const int &sensorID, const CLHEP::Hep3Vector &point) const
Transforming a given point to the local ref.
virtual double getStripPosY(const int &diskID, const int &sensorID, const int &stripID, const double &posZ) const
Get Y-centered position in the local ref. system for the stripID.
SiStripGeomFTD(const std::string &, const double &pitchFront, const double &pitchRear)
Constructor.
virtual void updateCanonicalCellID(const int &cellID, const int &stripType, const int &stripID, UTIL::BitField64 *bf)
Stores the cellID0 and cellID1 of the LCIO object to the file.
virtual void printGearParams() const
Method printing general Gear parameters.
virtual std::map< std::string, int > decodeCellID(const UTIL::BitField64 &cellID) const
Method to extract codification ID,.
virtual int getStripID(const int &diskID, const int &sensorID, const double &posRPhi, const double &posZ) const
Get strip ID (in Phi), points are given in local ref.
virtual CLHEP::Hep3Vector transformPointFromRotatedLocal(const int &diskID, const int &sensorID, const CLHEP::Hep3Vector &point) const
Transforming a given point from the reference system rotated around the center of a petal to its loca...
std::vector< double > _layerPetalOpAngle
gear::FTDParameters * _ftdParams
virtual void printSensorParams(short int layerID) const
Method printing sensor Gear parameters.
virtual int getSensorNStrips(const int &diskID, const int &sensorID) const
Get number of strips per sensor.
virtual void initGearParams()
Method initializing class - reads Gear parameters from XML file.
virtual CLHEP::Hep3Vector getStripUnitVector(const int &diskID, const int &sensorID, const int &stripID) const
Get director vector of a strip (inside the local Ref.
virtual CLHEP::Hep3Vector transformPointToLocal(short int layerID, short int ladderID, short int sensorID, const CLHEP::Hep3Vector &point)
Transform given point from global ref. system to local ref. system (sensor)
std::vector< double > _layerOuterRadius