BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
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
6/** CbmStsSensor.h
7 *@author V.Friese <v.friese@gsi.de>
8 *@since 28.08.06
9 *@version 1.0
10 **
11 ** This class describes the digitisation scheme for a sensor of the STS.
12 ** The sensor is rectangular with extensions fLx and fLy. The following
13 ** types are implemented:
14 ** 1 = pixel detector without charge sharing
15 ** 2 = double sides strip detector, all channels read out
16 ** 3 = double sided strip detector with double metal layer,
17 ** readout at the bottom corner
18 ** In case of strip detectors, the internal coordinate system sees
19 ** x across and y along the front side strips.
20 ** The origin of the internal sensor coordinate system is at the lower
21 ** left corner of the sensor, i.e. x runs from 0 to fLx,
22 ** and y from 0 to fLy.
23 ** For strip detectors, the readout pitch is the same on the front and
24 ** the back side, i.e. the strip pitch on the back side is smaller.
25 ** The sensor can be translated and rotated in the c.s. of the station.
26 **/
27
28#ifndef CBMSTSSENSOR_H
29#define CBMSTSSENSOR_H 1
30
31#include "TGeoManager.h" //GP
32#include "TGeoNode.h" //GP
33#include "TGeoVolume.h" //GP
34#include "TNamed.h"
35
36#include <list>
37#include <map>
38#include <set>
39#include <vector>
40
42
43class CbmStsSensor : public TNamed
44{
45
46 public:
47 /** Default constructor **/
49
50 /** Standard constructor
51 *@param detId Unique detector identifier
52 *@param iType Sensor type (1,2,3)
53 *@param x0 sensor centre x coordinate in global c.s [cm]
54 *@param y0 sensor centre y coordinate in global c.s [cm]
55 *@param rotation rotation in global c.s. [rad]
56 *@param lx sensor length in x [cm]
57 *@param ly sensor length in y [cm]
58 *@param dx Readout pitch (strip) or pixel width in x [cm]
59 *@param dy Pixel width in y [cm].
60 *@param stereoF StereoF angle [rad] (for double sided strip)
61 *@param stereoB StereoB angle [rad] (for double sided strip)
62 **/
64 Int_t iType,
65 Double_t x0,
66 Double_t y0,
67 Double_t rotation,
68 Double_t lx,
69 Double_t ly,
70 Double_t dx,
71 Double_t dy,
72 Double_t stereoF,
73 Double_t stereoB);
75 Int_t detId,
76 Int_t iType,
77 Double_t x0,
78 Double_t y0,
79 Double_t z0,
80 Double_t rotation,
81 Double_t lx,
82 Double_t ly,
83 Double_t d,
84 Double_t dx,
85 Double_t dy,
86 Double_t stereoF,
87 Double_t stereoB);
88
89 /** Destructor **/
90 virtual ~CbmStsSensor();
91
92 /** Accessors **/
93 TString GetDetectorName() const { return fName.Data(); }
94 Int_t GetDetectorId() const { return fDetectorId; }
95 Int_t GetSystemId() const { return (fDetectorId & (15 << 24)) >> 24; }
96 Int_t GetStationNr() const { return (fDetectorId & (255 << 16)) >> 16; }
98 { // sector number within station
99 return (fDetectorId & (4095 << 4)) >> 4;
100 }
101 /* Int_t GetSensorNr() const { // sensor number within sector
102 return ( fDetectorId & (32767<<1) ) >> 1; } */
104 { // sensor number within sector
105 return (fDetectorId & (7 << 1)) >> 1;
106 }
107 Int_t GetType() const { return fType; }
108 Double_t GetX0() const { return fX0; }
109 Double_t GetY0() const { return fY0; }
110 Double_t GetZ0() const { return fZ0; }
111 Double_t GetRotation() const { return fRotation; }
112 Double_t GetLx() const { return fLx; }
113 Double_t GetLy() const { return fLy; }
114 Double_t GetD() const { return fD; }
115 Double_t GetDx() const { return fDx; }
116 Double_t GetDy() const { return fDy; }
117 Double_t GetStereoF() const { return fStereoF; }
118 Double_t GetStereoB() const { return fStereoB; }
119 Double_t GetSigmaX() const { return fSigmaX; }
120 Double_t GetSigmaY() const { return fSigmaY; }
121 Double_t GetSigmaXY() const { return fSigmaXY; }
127
128 /** Calculate channel number for a coordinate pair.
129 *@param x x coordinate in global c.s. [cm]
130 *@param y y coordinate in global c.s. [cm]
131 *@param iSide 0 = front side, 1 = back side
132 *@value iChan channel number. -1 if point is outside sensor.
133 ** Will return the same for both sides in case of pixel sensor.
134 **/
136
138
139 // Int_t GetFrontChannel(Double_t x, Double_t y, Double_t z);
140 // Int_t GetBackChannel (Double_t x, Double_t y, Double_t z);
143
144 /** Test whether a coordinate pair (x,y) in global coordinates is
145 ** inside the sensor **/
147
148 /** Activate the channels corresponding to a MCPoint.
149 *@param ipt Index of MCPoint
150 *@param x x coordinate of point (global c.s.)
151 *@param y y coordinate of point (global c.s.)
152 *@value kTRUE if the point is inside the sensor, else kFALSE
153 **/
155
156 /** Calculates the coordinates of the intersections of front strip i
157 ** with back strip j in the global coordinate system
158 *@param iFStrip Front strip number
159 *@param iBStrip Back strip number
160 *@param xCross Vector of x coordinates of crossings [cm]
161 *@param yCross Vector of y coordinates of crossings [cm]
162 *@value Number of intersections
163 **/
164 Int_t Intersect(Int_t iFStrip, Int_t iBStrip, std::vector<Double_t>& xCross, std::vector<Double_t>& yCross);
165
166 Int_t Intersect(Int_t iFStrip, Int_t iBStrip, Double_t& xCross, Double_t& yCross, Double_t& zCross);
167
168 Int_t IntersectClusters(Double_t fChan, Double_t bChan, Double_t& xCross, Double_t& yCross, Double_t& zCross);
169
170 /** The index of the MCPoint that has caused a combination of
171 ** front and back strip to be fired. Returns -1 for combinations
172 ** of strips fired by different points (fake hits)
173 *@param iFStrip Front strip number
174 *@param iBStrip Back strip number
175 *@value Index of MCPoint
176 **/
177 Int_t PointIndex(Int_t iFStrip, Int_t iBStrip);
178
179 /** Clear the maps of fired strips **/
180 void Reset();
181
182 /** Screen output **/
183 void Print();
184
185 private:
186 TString GeoMaskSi[3][8];
187 TString GeoMaskGem[6][4];
189 Double_t PIR = 3.1415926536 / 180.; // Ruf
190
191 /** ------------- Data members --------------------------**/
192
193 // TString fName; // Station name
194 Int_t fDetectorId; // Unique detector ID
195 Int_t fType; // Sensor type
196 Double_t fX0, fY0, fZ0; // Coordinates of the sensor centre [cm]
197 Double_t fRotation; // Rotation angle in global c.m. [rad]
198 Double_t fLx, fLy; // Dimensions of the sensor [cm]
199 Double_t fDx; // Strip readout pitch or pixel size in x [cm]
200 Double_t fDy; // Pixel size in y [cm] for pixel sensor
201 Double_t fStereoF; // StereoF angle [rad] for strip sensor.
202 Double_t fStereoB; // StereoB angle [rad] for strip sensor.
204
205 Double_t fD; // thickness of the sensor [cm]
206
207 /** Number of channels in front and back plane **/
210
213
214 /** Errors of hit coordinates. For pixel sensor: size/sqrt(12),
215 ** for strip sensors RMS of overlap of front and back side strip **/
216 // Logically, this belongs to the HitFinder, but it is here
217 // for performance reasons: to be executed once per sensor, not for
218 // each MCPoint
219 Float_t fSigmaX; // RMS in x, global c.s. [cm]
220 Double_t fSigmaY; // RMS in y, global c.s. [cm]
221 Double_t fSigmaXY; // Covariance in global c.s. [cm**2]
222
225
228
229 /** STL sets containing the active channels **/
230 std::set<Int_t> fFrontActive; //!
231 std::set<Int_t> fBackActive; //!
232
233 /** STL map from the indizes of the fired strips to the
234 ** index of the MCPoint **/
235 std::map<std::pair<Int_t, Int_t>, Int_t> fTrueHits; //!
236
237 /** ------------- Private methods ------------------------**/
238
239 /** Strip number of a point in the front plane.
240 ** Returns -1 if the point is outside the sensor
241 *@param x x coordinate of point (global c.s.)
242 *@param y y coordinate of point (global c.s.)
243 *@value Number of strip hitted by the point
244 **/
246
247 /** Strip number of a point in the back plane.
248 ** Returns -1 if the point is outside the sensor
249 *@param x x coordinate of point (global c.s.)
250 *@param y y coordinate of point (global c.s.)
251 *@value Number of strip hitted by the point
252 **/
254
255 /** Calculate coordinates in internal coordinate system
256 *@param x x coordinate in global system
257 *@param y y coordinate in global system
258 *@param xint internal x coordinate (return)
259 *@param yint internal y coordinate (return)
260 *@value kTRUE if point is inside the sensor
261 **/
263 Bool_t IntCoord(Double_t x, Double_t y, Double_t z, Double_t& xint, Double_t& yint, Double_t& zint) const;
264
265 /** Check whether a point is inside the sensor
266 *@param xint x coordinate of point (internal system)
267 *@param yint y coordinate of point (internal system)
268 *@value kTRUE if inside sensor, else kFALSE
269 **/
270 Bool_t IsInside(Double_t xint, Double_t yint) const;
271
273};
274
275#endif
bool Bool_t
int Int_t
float Float_t
double Double_t
#define ClassDef(name, id)
CbmStsSensorDigiPar.h.
Double_t fBackLorentzShift
Double_t GetZ0() const
Double_t fStereoF
Double_t GetStereoF() const
Double_t GetSigmaXY() const
Float_t GetChannelPlus(Double_t x, Double_t y, Int_t iSide)
Int_t fNChannelsFront
Number of channels in front and back plane.
Double_t fSigmaXY
Int_t GetSystemId() const
Double_t GetSigmaY() const
Double_t GetRotation() const
Int_t GetNChannelsFront() const
Double_t GetD() const
Float_t fSigmaX
Errors of hit coordinates.
Int_t IntersectClusters(Double_t fChan, Double_t bChan, Double_t &xCross, Double_t &yCross, Double_t &zCross)
std::set< Int_t > fBackActive
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)
Standard constructor.
Int_t FrontStripNumber(Double_t x, Double_t y) const
----------— Private methods ---------------------—
Int_t GetDetectorId() const
Double_t GetDy() const
CbmStsSensor()
Default constructor.
Double_t fCosRot
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
Accessors.
Double_t GetBackStripShift() const
Double_t fFrontStripShift
Double_t fRotation
Double_t fSigmaY
TString GeoMaskSi[3][8]
Int_t GetNChannelsBack() const
Int_t Intersect(Int_t iFStrip, Int_t iBStrip, std::vector< Double_t > &xCross, std::vector< Double_t > &yCross)
Calculates the coordinates of the intersections of front strip i with back strip j in the global coor...
Bool_t Inside(Double_t x, Double_t y)
Test whether a coordinate pair (x,y) in global coordinates is inside the sensor.
Int_t GetFrontChannel(Double_t x, Double_t y, Double_t z, Double_t &dPitch)
TString GeoMaskGem[6][4]
TGeoVolume * TopVolume
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)
Activate the channels corresponding to a MCPoint.
Bool_t IntCoord(Double_t x, Double_t y, Double_t z, Double_t &xint, Double_t &yint, Double_t &zint) const
Double_t fBackStripShift
Int_t PointIndex(Int_t iFStrip, Int_t iBStrip)
The index of the MCPoint that has caused a combination of front and back strip to be fired.
Double_t fStereoB
Double_t GetX0() const
Double_t GetLy() const
std::set< Int_t > fFrontActive
STL sets containing the active channels.
Bool_t IsInside(Double_t xint, Double_t yint) const
Check whether a point is inside the sensor.
Int_t GetSectorNr() const
void Print()
Screen output.
void Reset()
Clear the maps of fired strips.
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 BackStripNumber(Double_t x, Double_t y) const
Strip number of a point in the back plane.
Int_t fNChannelsBack
Double_t fSinRot
Int_t fDetectorId
----------— Data members -----------------------—
Int_t GetStationNr() const
Double_t fZSmearSlope
Double_t fFrontLorentzShift
Int_t GetChannel(Double_t x, Double_t y, Int_t iSide)
Calculate channel number for a coordinate pair.
Bool_t IntCoord(Double_t x, Double_t y, Double_t &xint, Double_t &yint) const
Calculate coordinates in internal coordinate system.
Double_t fTanB
Double_t fXSmearWidth
Double_t GetStereoB() const
std::map< std::pair< Int_t, Int_t >, Int_t > fTrueHits
STL map from the indizes of the fired strips to the index of the MCPoint.
Double_t GetY0() const
Int_t GetSensorNr() const
Double_t GetLx() const
virtual ~CbmStsSensor()
Destructor.
Double_t fTanF
TString fName