FairRoot/PandaRoot
PndGemSensor.h
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- PndGemSensor header file -----
3 // ----- Created 12/02/2009 by R. Karabowicz -----
4 // -------------------------------------------------------------------------
5 
30 #ifndef PNDGEMSENSOR_H
31 #define PNDGEMSENSOR_H 1
32 
33 #include "TNamed.h"
34 #include "PndDetectorList.h"
35 
36 #include <map>
37 #include <list>
38 #include <set>
39 #include <vector>
40 
41 
42 class PndGemSensor : public TNamed
43 {
44 
45  public:
46 
48  PndGemSensor();
49 
50 
65  PndGemSensor(TString tempName, Int_t detId, Int_t iType,
68  Double_t innerRad, Double_t outerRad,
69  Double_t d,
70  Double_t stripAngle0, Double_t stripAngle1,
71  Double_t pitch0, Double_t pitch1);
72  PndGemSensor(TString tempName, Int_t stationNr, Int_t sectorNr, Int_t iType,
73  Double_t x0, Double_t y0, Double_t z0,
74  Double_t rotation,
75  Double_t innerRad, Double_t outerRad,
76  Double_t d,
77  Double_t stripAngle0, Double_t stripAngle1,
78  Double_t pitch0, Double_t pitch1);
79  PndGemSensor(const PndGemSensor &tempSensor);
80 
82  virtual ~PndGemSensor();
83 
84 
86  TString GetDetectorName() const { return fName.Data(); }
87  void SetDetectorId(Int_t stationNr, Int_t sensorNr) {
88  fDetectorId = kGEM << 27 | 0 << 21 | stationNr << 8 | sensorNr << 6; }
89  Int_t GetDetectorId() const {
90  return fDetectorId; }
91  Int_t GetSystemId() const {
92  return ( ( fDetectorId & ( 31<<27) ) >> 27); }
93  Int_t GetStationNr() const {
94  return ( ( fDetectorId & (8191<< 8) ) >> 8 ); }
95  Int_t GetSensorNr() const { // sensor number within station
96  return ( ( fDetectorId & ( 3<< 6) ) >> 6 ); }
97  Int_t GetType() const { return fType; }
98  Double_t GetX0() const { return fPosition[0]; }
99  Double_t GetY0() const { return fPosition[1]; }
100  Double_t GetZ0() const { return fPosition[2]; }
101  Double_t GetRotation() const { return fRotation; }
104  Double_t GetD() const { return fD; }
105  Double_t GetStripAngle(Int_t index) const { return fStripAngle[index]; }
106  Double_t GetPitch(Int_t index) const { return fPitch[index]; }
107  Double_t GetSigmaX() const { return fSigmaX; }
108  Double_t GetSigmaY() const { return fSigmaY; }
109  Double_t GetSigmaXY() const { return fSigmaXY; }
110  Int_t GetNChannels() const { return fNChannelsFront+fNChannelsBack; }
111  Int_t GetNChannelsFront() const { return fNChannelsFront; }
112  Int_t GetNChannelsBack () const { return fNChannelsBack; }
113 
114  Int_t GetSideChannels (Int_t si) const { if ( si==0 ) return fNChannelsFront; return fNChannelsBack;} // will return NChFront for si==0, and NChBack for anything else
115 
123  Int_t GetChannel(Double_t x, Double_t y, Int_t iSide);
124 
125  Int_t GetChannel2(Double_t x, Double_t y, Int_t iSide, Double_t& feeDist);
126  //Double_t GetChannel(Double_t x, Double_t y, Int_t iSide, Double_t& stripWidth);
127 
131  Bool_t Inside(Double_t radius);
132 
133 
140  //Bool_t ActivateChannels(Int_t ipt, Double_t x, Double_t y); // not implemented
141 
143  Double_t GetDistance(Int_t iSide, Double_t chan1, Double_t chan2);
144  Int_t GetDistance(Int_t iSide, Int_t chanMin, Int_t chanMax, Int_t chanTest);
145  Double_t GetDistance2(Int_t iSide, Double_t chan1, Double_t chan2);
146 
147  // returns the part of sensor in which chan is located.
148  // for most sensors it should return -1
149  // only for the sensors where the channel order is broken
150  Int_t GetSensorPart(Int_t iSide, Int_t chan);
151 
152  Double_t GetMeanChannel(Int_t iSide, Double_t chan1, Double_t weight1, Double_t chan2, Double_t weight2);
153 
154  Int_t GetNeighbours(Int_t iSide, Int_t iChan, Int_t& nChan1, Int_t& nChan2, Int_t& nChan3);
155 
164  //Int_t Intersect(Int_t iFStrip, Int_t iBStrip, std::vector<Double_t>& xCross, std::vector<Double_t>& yCross); // not implemented
165 
166  Int_t Intersect(Double_t iFStrip, Double_t iBStrip, Double_t& xCross, Double_t& yCross, Double_t& zCross);
167 
168  Int_t Intersect(Double_t iFStrip, Double_t iBStrip, Double_t& xCross, Double_t& yCross, Double_t& zCross,
169  Double_t& dr, Double_t& dp);
170 
171  Int_t Intersect(Double_t iFStrip, Double_t iBStrip, Double_t& xCross, Double_t& yCross, Double_t& zCross,
172  Double_t& dx, Double_t& dy, Double_t& dr, Double_t& dp);
173 
174  //Int_t IntersectClusters(Double_t fChan, Double_t bChan, Double_t& xCross, Double_t& yCross, Double_t& zCross); // not implemented
175 
183  //Int_t PointIndex(Int_t iFStrip, Int_t IBStrip); // not implemented
184 
185 
187  void Reset();
188 
189 
191  void Print();
192 
193 
194 
195  private:
196 
199  Int_t fDetectorId; // Unique detector ID
200  Int_t fType; // Sensor type
201  Double_t fPosition[3]; // Coordinates of the sensor centre [cm]
202  Double_t fRotation; // Rotation angle in global c.m. [rad]
203  Double_t fInnerRadius; // Inner radius of the sensor [cm]
204  Double_t fOuterRadius; // Outer radius of the sensor [cm]
205  Double_t fD; // thickness of the sensor [cm]
206  Double_t fStripAngle[2]; // Strips angle
207  Double_t fPitch[2]; // Strip readout pitch or pixel size in x/y
208 
212 
215  // Logically, this belongs to the HitFinder, but it is here
216  // for performance reasons: to be executed once per sensor, not for
217  // each MCPoint
218  Double_t fSigmaX; // RMS in x, global c.s. [cm]
219  Double_t fSigmaY; // RMS in y, global c.s. [cm]
220  Double_t fSigmaXY; // Covariance in global c.s. [cm**2]
221 
230  Int_t FrontStripNumber(Double_t x, Double_t y) const;
231 
232 
239  Int_t BackStripNumber(Double_t x, Double_t y) const;
240 
241 
250  Double_t& xint, Double_t& yint, Double_t& zint) const;
251 
252 
258  Bool_t IsInside(Double_t xint, Double_t yint) const;
259 
260 
261 
262 
264 
265 };
266 
267 
268 
269 
270 #endif
Double_t z0
Definition: checkhelixhit.C:62
Double_t x0
Definition: checkhelixhit.C:70
Double_t GetSigmaXY() const
Definition: PndGemSensor.h:109
double dy
TObjArray * d
Int_t Intersect(Double_t iFStrip, Double_t iBStrip, Double_t &xCross, Double_t &yCross, Double_t &zCross)
TString GetDetectorName() const
Definition: PndGemSensor.h:86
Double_t GetRotation() const
Definition: PndGemSensor.h:101
ClassDef(PndGemSensor, 1)
Double_t GetInnerRadius() const
Definition: PndGemSensor.h:102
TGeoRotation rotation
virtual ~PndGemSensor()
Int_t GetNChannelsBack() const
Definition: PndGemSensor.h:112
Double_t fOuterRadius
Definition: PndGemSensor.h:204
Double_t fPosition[3]
Definition: PndGemSensor.h:201
Int_t GetSideChannels(Int_t si) const
Definition: PndGemSensor.h:114
Double_t GetStripOrientation(Double_t x, Double_t y, Int_t iSide)
Int_t GetStationNr() const
Definition: PndGemSensor.h:93
Double_t fSigmaXY
Definition: PndGemSensor.h:220
void SetDetectorId(Int_t stationNr, Int_t sensorNr)
Definition: PndGemSensor.h:87
Double_t GetSigmaY() const
Definition: PndGemSensor.h:108
Int_t GetChannel(Double_t x, Double_t y, Int_t iSide)
Double_t fPitch[2]
Definition: PndGemSensor.h:207
Double_t
Double_t y0
Definition: checkhelixhit.C:71
Double_t GetDistance(Int_t iSide, Double_t chan1, Double_t chan2)
Double_t GetX0() const
Definition: PndGemSensor.h:98
Double_t fInnerRadius
Definition: PndGemSensor.h:203
Int_t GetChannel2(Double_t x, Double_t y, Int_t iSide, Double_t &feeDist)
Double_t z
Double_t fD
Definition: PndGemSensor.h:205
Double_t GetY0() const
Definition: PndGemSensor.h:99
Double_t fStripAngle[2]
Definition: PndGemSensor.h:206
Int_t BackStripNumber(Double_t x, Double_t y) const
double dx
Bool_t Inside(Double_t x, Double_t y)
Int_t GetNChannelsFront() const
Definition: PndGemSensor.h:111
Int_t GetSensorPart(Int_t iSide, Int_t chan)
Double_t GetD() const
Definition: PndGemSensor.h:104
Double_t fSigmaY
Definition: PndGemSensor.h:219
Double_t fSigmaX
Definition: PndGemSensor.h:218
Int_t fDetectorId
Definition: PndGemSensor.h:199
Double_t x
Int_t GetType() const
Definition: PndGemSensor.h:97
Int_t GetSystemId() const
Definition: PndGemSensor.h:91
Int_t GetSensorNr() const
Definition: PndGemSensor.h:95
Int_t fNChannelsBack
Definition: PndGemSensor.h:211
Double_t fRotation
Definition: PndGemSensor.h:202
Int_t FrontStripNumber(Double_t x, Double_t y) const
Bool_t IntCoord(Double_t x, Double_t y, Double_t z, Double_t &xint, Double_t &yint, Double_t &zint) const
Double_t GetDistance2(Int_t iSide, Double_t chan1, Double_t chan2)
Int_t GetNeighbours(Int_t iSide, Int_t iChan, Int_t &nChan1, Int_t &nChan2, Int_t &nChan3)
Int_t fNChannelsFront
Definition: PndGemSensor.h:210
Int_t GetDetectorId() const
Definition: PndGemSensor.h:89
Double_t GetZ0() const
Definition: PndGemSensor.h:100
Double_t GetOuterRadius() const
Definition: PndGemSensor.h:103
Int_t GetNChannels() const
Definition: PndGemSensor.h:110
Double_t GetPitch(Int_t index) const
Definition: PndGemSensor.h:106
Double_t GetSigmaX() const
Definition: PndGemSensor.h:107
Double_t y
Double_t GetMeanChannel(Int_t iSide, Double_t chan1, Double_t weight1, Double_t chan2, Double_t weight2)
Bool_t IsInside(Double_t xint, Double_t yint) const
Double_t GetStripAngle(Int_t index) const
Definition: PndGemSensor.h:105