BmnRoot
Loading...
Searching...
No Matches
CbmStsSensor.h
Go to the documentation of this file.
1// -------------------------------------------------------------------------
2// ----- CbmStsSensor header file -----
3// ----- Created 01/07/2008 by R. Karabowicz -----
4// -------------------------------------------------------------------------
5
29#ifndef CBMSTSSENSOR_H
30#define CBMSTSSENSOR_H 1
31
32#include "TNamed.h"
33
34#include <map>
35#include <list>
36#include <set>
37#include <vector>
38
39#include "TGeoManager.h" //GP
40#include "TGeoNode.h"//GP
41#include "TGeoVolume.h"//GP
42
44
45
46class CbmStsSensor : public TNamed
47{
48
49 public:
50
53
54
68 CbmStsSensor(Int_t detId, Int_t iType, Double_t x0, Double_t y0,
69 Double_t rotation, Double_t lx, Double_t ly,
70 Double_t dx, Double_t dy, Double_t stereoF, Double_t stereoB);
71 CbmStsSensor(TString tempName, Int_t detId, Int_t iType, Double_t x0, Double_t y0, Double_t z0,
72 Double_t rotation, Double_t lx, Double_t ly,
73 Double_t d, Double_t dx, Double_t dy, Double_t stereoF, Double_t stereoB);
74
75
77 virtual ~CbmStsSensor();
78
80 TString GetDetectorName() const { return fName.Data(); }
81 Int_t GetDetectorId() const {
82 return fDetectorId; }
83 Int_t GetSystemId() const {
84 return ( fDetectorId & (15<<24) ) >> 24; }
85 Int_t GetStationNr() const {
86 return ( fDetectorId & (255<<16) ) >> 16; }
87 Int_t GetSectorNr() const { // sector number within station
88 return ( fDetectorId & (4095<<4) ) >> 4; }
89 /* Int_t GetSensorNr() const { // sensor number within sector
90 return ( fDetectorId & (32767<<1) ) >> 1; } */
91 Int_t GetSensorNr() const { // sensor number within sector
92 return ( fDetectorId & (7<<1) ) >> 1; }
93 Int_t GetType() const { return fType; }
94 Double_t GetX0() const { return fX0; }
95 Double_t GetY0() const { return fY0; }
96 Double_t GetZ0() const { return fZ0; }
97 Double_t GetRotation() const { return fRotation; }
98 Double_t GetLx() const { return fLx; }
99 Double_t GetLy() const { return fLy; }
100 Double_t GetD() const { return fD; }
101 Double_t GetDx() const { return fDx; }
102 Double_t GetDy() const { return fDy; }
103 Double_t GetStereoF() const { return fStereoF; }
104 Double_t GetStereoB() const { return fStereoB; }
105 Double_t GetSigmaX() const { return fSigmaX; }
106 Double_t GetSigmaY() const { return fSigmaY; }
107 Double_t GetSigmaXY() const { return fSigmaXY; }
108 Int_t GetNChannels() const { return fNChannelsFront + fNChannelsBack; }
109 Int_t GetNChannelsFront() const { return fNChannelsFront; }
110 Int_t GetNChannelsBack () const { return fNChannelsBack; }
111 Double_t GetBackStripShift() const { return fBackStripShift; }
112 Double_t GetFrontStripShift() const { return fFrontStripShift; }
113
121 Int_t GetChannel(Double_t x, Double_t y, Int_t iSide);
122
123 Float_t GetChannelPlus(Double_t x, Double_t y, Int_t iSide);
124
125 // Int_t GetFrontChannel(Double_t x, Double_t y, Double_t z);
126 // Int_t GetBackChannel (Double_t x, Double_t y, Double_t z);
127 Int_t GetFrontChannel(Double_t x, Double_t y, Double_t z, Double_t &dPitch); //AZ
128 Int_t GetBackChannel (Double_t x, Double_t y, Double_t z, Double_t &dPitch); //AZ
129
132 Bool_t Inside(Double_t x, Double_t y);
133
134
141 Bool_t ActivateChannels(Int_t ipt, Double_t x, Double_t y);
142
143
152 Int_t Intersect(Int_t iFStrip, Int_t iBStrip,
153 std::vector<Double_t>& xCross, std::vector<Double_t>& yCross);
154
155 Int_t Intersect(Int_t iFStrip, Int_t iBStrip, Double_t& xCross, Double_t& yCross, Double_t& zCross);
156
157 Int_t IntersectClusters(Double_t fChan, Double_t bChan, Double_t& xCross, Double_t& yCross, Double_t& zCross);
158
166 Int_t PointIndex(Int_t iFStrip, Int_t IBStrip);
167
168
170 void Reset();
171
172
174 void Print();
175
176
177
178 private:
179 TString GeoMaskSi[3][8];
180 TString GeoMaskGem[6][4];
181 TGeoVolume* TopVolume;
182 Double_t PIR = 3.1415926536 / 180.; // Ruf
183
186 //TString fName; // Station name
187 Int_t fDetectorId; // Unique detector ID
188 Int_t fType; // Sensor type
189 Double_t fX0, fY0, fZ0; // Coordinates of the sensor centre [cm]
190 Double_t fRotation; // Rotation angle in global c.m. [rad]
191 Double_t fLx, fLy; // Dimensions of the sensor [cm]
192 Double_t fDx; // Strip readout pitch or pixel size in x [cm]
193 Double_t fDy; // Pixel size in y [cm] for pixel sensor
194 Double_t fStereoF; // StereoF angle [rad] for strip sensor.
195 Double_t fStereoB; // StereoB angle [rad] for strip sensor.
196 Double_t fTanF,fTanB,fSinRot,fCosRot;
197
198 Double_t fD; // thickness of the sensor [cm]
199
201 Int_t fNChannelsFront;
202 Int_t fNChannelsBack;
203
204 Double_t fBackStripShift;
205 Double_t fFrontStripShift;
206
209 // Logically, this belongs to the HitFinder, but it is here
210 // for performance reasons: to be executed once per sensor, not for
211 // each MCPoint
212 Float_t fSigmaX; // RMS in x, global c.s. [cm]
213 Double_t fSigmaY; // RMS in y, global c.s. [cm]
214 Double_t fSigmaXY; // Covariance in global c.s. [cm**2]
215
216 Double_t fXSmearWidth;
217 Double_t fZSmearSlope;
218
219 Double_t fFrontLorentzShift;
220 Double_t fBackLorentzShift;
221
223 std::set<Int_t> fFrontActive;
224 std::set<Int_t> fBackActive;
225
226
229 std::map<std::pair<Int_t,Int_t>, Int_t > fTrueHits;
230
231
232
241 Int_t FrontStripNumber(Double_t x, Double_t y) const;
242
243
250 Int_t BackStripNumber(Double_t x, Double_t y) const;
251
252
260 Bool_t IntCoord(Double_t x, Double_t y,
261 Double_t& xint, Double_t& yint) const;
262 Bool_t IntCoord(Double_t x, Double_t y, Double_t z,
263 Double_t& xint, Double_t& yint, Double_t& zint) const;
264
265
271 Bool_t IsInside(Double_t xint, Double_t yint) const;
272
273
274
275
276 ClassDef(CbmStsSensor,1);
277
278};
279
280
281
282
283#endif
const Float_t d
Z-ccordinate of the first GEM-station.
Definition BmnMwpcHit.cxx:7
const Float_t z0
Definition BmnMwpcHit.cxx:6
Double_t GetZ0() const
Double_t GetStereoF() const
Double_t GetSigmaXY() const
Float_t GetChannelPlus(Double_t x, Double_t y, Int_t iSide)
Int_t GetSystemId() const
Double_t GetSigmaY() const
Double_t GetRotation() const
Int_t GetNChannelsFront() const
Double_t GetD() const
Int_t IntersectClusters(Double_t fChan, Double_t bChan, Double_t &xCross, Double_t &yCross, Double_t &zCross)
Double_t GetFrontStripShift() const
CbmStsSensor(Int_t detId, Int_t iType, Double_t x0, Double_t y0, Double_t rotation, Double_t lx, Double_t ly, Double_t dx, Double_t dy, Double_t stereoF, Double_t stereoB)
Int_t GetDetectorId() const
Double_t GetDy() const
Int_t GetType() const
Int_t Intersect(Int_t iFStrip, Int_t iBStrip, Double_t &xCross, Double_t &yCross, Double_t &zCross)
TString GetDetectorName() const
Double_t GetBackStripShift() const
Int_t GetNChannelsBack() const
Int_t Intersect(Int_t iFStrip, Int_t iBStrip, std::vector< Double_t > &xCross, std::vector< Double_t > &yCross)
Bool_t Inside(Double_t x, Double_t y)
Int_t GetFrontChannel(Double_t x, Double_t y, Double_t z, Double_t &dPitch)
Double_t GetDx() const
Int_t GetNChannels() const
Int_t GetBackChannel(Double_t x, Double_t y, Double_t z, Double_t &dPitch)
Bool_t ActivateChannels(Int_t ipt, Double_t x, Double_t y)
Double_t GetX0() const
Double_t GetLy() const
Int_t GetSectorNr() const
CbmStsSensor(TString tempName, Int_t detId, Int_t iType, Double_t x0, Double_t y0, Double_t z0, Double_t rotation, Double_t lx, Double_t ly, Double_t d, Double_t dx, Double_t dy, Double_t stereoF, Double_t stereoB)
Double_t GetSigmaX() const
Int_t GetStationNr() const
Int_t PointIndex(Int_t iFStrip, Int_t IBStrip)
Int_t GetChannel(Double_t x, Double_t y, Int_t iSide)
Double_t GetStereoB() const
Double_t GetY0() const
Int_t GetSensorNr() const
Double_t GetLx() const
virtual ~CbmStsSensor()