]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDgtuParam.h
Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[u/mrichter/AliRoot.git] / TRD / AliTRDgtuParam.h
1
2
3 #ifndef ALITRDGTUPARAM_H
4 #define ALITRDGTUPARAM_H
5 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
6  * See cxx source for full Copyright notice                               */
7
8 /* $Id: AliTRDgtuParam.h 27496 2008-07-22 08:35:45Z cblume $ */
9
10 // --------------------------------------------------------
11 //
12 // Singleton class to hold the parameters steering the GTU
13 // tracking
14 //
15 // --------------------------------------------------------
16
17 #include "TObject.h"
18
19 class AliTRDgeometry;
20
21 class AliTRDgtuParam : public TObject {
22  public:
23   virtual ~AliTRDgtuParam();
24
25   static AliTRDgtuParam *Instance(); // Singleton
26   static void Terminate();
27
28   static Int_t GetNLinks() { return fgkNLinks; }
29   static Int_t GetNLayers() { return fgkNLinks/2; }
30   static Int_t GetNZChannels() { return fgkNZChannels; }
31   static Int_t GetNRefLayers() { return fgkNRefLayers; }
32
33   static Float_t GetChamberThickness() { return 3.0; }
34
35   // ----- Bin widths (granularity) -----
36   static Float_t GetBinWidthY() { return fgkBinWidthY; }
37   static Float_t GetBinWidthdY() { return fgkBinWidthdY; }
38
39   // ----- Bit Widths (used for internal representation) -----
40   static Int_t GetBitWidthY() { return fgkBitWidthY; }
41   static Int_t GetBitWidthdY() { return fgkBitWidthdY; }
42   static Int_t GetBitWidthYProj() { return fgkBitWidthYProj; }
43   static Int_t GetBitExcessY() { return fgkBitExcessY; }
44   static Int_t GetBitExcessAlpha() { return fgkBitExcessAlpha; }
45   static Int_t GetBitExcessYProj() { return fgkBitExcessYProj; }
46
47   Float_t GetInnerPadLength(Int_t stack, Int_t layer) const {
48       return (stack == 2) ? 9. : fgkInnerPadLength[layer];
49   }
50   Float_t GetOuterPadLength(Int_t stack, Int_t layer) const {
51       return (stack == 2) ? 8. : fgkOuterPadLength[layer];
52   }
53   Float_t GetZrow(Int_t stack, Int_t layer, Int_t padrow) const {
54     Float_t zRowCorrected = fgkRow0Pos[layer][stack] - GetOuterPadLength(stack, layer) + GetInnerPadLength(stack, layer);
55     return zRowCorrected - (0.5 + padrow) * GetInnerPadLength(stack, layer);
56   }
57
58   AliTRDgeometry* GetGeo() const { return fGeo; }
59   Float_t GetVertexSize() const { return fVertexSize; }
60   Int_t GetCiAlpha(Int_t layer) const;
61   Int_t GetCiYProj(Int_t layer) const;
62   Int_t GetYt(Int_t stack, Int_t layer, Int_t zrow) const;
63   Int_t GetDeltaY() const { return fgDeltaY; }
64   Int_t GetDeltaAlpha() const { return fgDeltaAlpha; }
65   Int_t GetZSubchannel(Int_t stack, Int_t layer, Int_t zchannel, Int_t zpos) const;
66   static Int_t GetRefLayer(Int_t refLayerIdx);
67 //  Bool_t GetFitParams(TVectorD &rhs, Int_t k); // const
68   Bool_t GetIntersectionPoints(Int_t k, Float_t &x1, Float_t &x2); // const
69   static Int_t GetPt(Int_t layerMask, Int_t a, Float_t b, Float_t x1, Float_t x2, Float_t magField);
70
71   Bool_t IsInZChannel(Int_t stack, Int_t layer, Int_t zchannel, Int_t zpos) const;
72
73   void SetVertexSize(Float_t vertexsize) { fVertexSize = vertexsize; }
74
75   static void SetDeltaY(Int_t dy) { fgDeltaY = dy; }
76   static void SetDeltaAlpha(Int_t da) { fgDeltaAlpha = da; }
77
78   static void SetUseGTUconst(Bool_t b) { fgUseGTUconst = b; }
79   static Bool_t GetUseGTUconst() { return fgUseGTUconst; }
80
81   static void SetUseGTUmerge(Bool_t b) { fgUseGTUmerge = b; }
82   static Bool_t GetUseGTUmerge() { return fgUseGTUmerge; }
83
84   static void SetLimitNoTracklets(Bool_t b) { fgLimitNoTracklets = b; }
85   static Bool_t GetLimitNoTracklets() { return fgLimitNoTracklets; }
86
87   static void SetMaxNoTracklets(Int_t max) { fgMaxNoTracklets = max; }
88   static Int_t GetMaxNoTracklets() { return fgMaxNoTracklets; }
89
90   // z-channel map
91   Int_t GenerateZChannelMap(); // could have different modes (for beam-beam, cosmics, ...)
92   Bool_t DisplayZChannelMap(Int_t zchannel = -1, Int_t subch = 0) const;
93
94   // variables for pt-reconstruction (not used at the moment)
95   Bool_t GenerateRecoCoefficients(Int_t trackletMask);
96   Int_t   GetAki(Int_t k, Int_t i);
97   Float_t GetBki(Int_t k, Int_t i);
98   Float_t GetCki(Int_t k, Int_t i);
99 //  Float_t GetD(Int_t k) const;
100
101   // B-field
102   void SetMagField(Float_t field) { fMagField = field; }
103   Float_t GetMagField() const { return fMagField; }
104
105   static const Int_t fgkNZChannels = 3; // No. of z-channels
106   static const Int_t fgkNLinks = 12;    // No. of links
107   static const Int_t fgkFixLayer = 2;   // which layer is fixed for the generation of the z-channel map
108   static const Int_t fgkNRefLayers = 3;  // no. of reference layers
109
110   static const Float_t fgkBinWidthY; // bin width for y-position
111   static const Float_t fgkBinWidthdY; // bin width for deflection length
112
113   static const Int_t fgkBitWidthY; // bit width for y-position
114   static const Int_t fgkBitWidthdY; // bit width for deflection length
115   static const Int_t fgkBitWidthYProj; // bit width for projected y-position
116   static const Int_t fgkBitExcessY; // excess bits for y-position
117   static const Int_t fgkBitExcessAlpha; // excess bits for alpha
118   static const Int_t fgkBitExcessYProj; // excess bits for projected y-position
119
120   static const Int_t fgkPtInfinity; // infinite pt as obtained when a == 0
121
122  protected:
123   static       Int_t fgDeltaY;          // accepted deviation in y_proj, default: 9
124   static       Int_t fgDeltaAlpha;      // accepted deviation in alpha, default: 11
125
126   static       Int_t fgRefLayers[3];    // reference layers for track finding
127
128   static       Bool_t fgUseGTUconst;    // use constants as in the GTU for the calculations
129                                                // instead of geometry derived quantities
130   static       Bool_t fgUseGTUmerge;    // use merge algorithm exactly as in hardware
131   static       Bool_t fgLimitNoTracklets; // limit the number of tracklets per layer
132   static       Int_t  fgMaxNoTracklets;   // max number of tracklets per layer if limited
133   static const Bool_t fgZChannelMap[5][16][6][16]; // z-channel tables as in GTU
134   static const Float_t fgkRadius[6];    // layer radius as used in the GTU code
135   static const Float_t fgkThickness;    // drift length as used in the GTU code
136   static const Float_t fgkRow0Pos[6][5]; // geometry constant from GTU implementation
137   static const Float_t fgkInnerPadLength[6]; // geometry constant from GTU implementation
138   static const Float_t fgkOuterPadLength[6]; // geometry constant from GTU implementation
139   static const Float_t fgkAcoeff[32][6]; // geometry constant from GTU implementation
140   static const Int_t   fgkMaskID[64]; // geometry constant from GTU implementation
141
142   Float_t fVertexSize;          // assumed vertex size (z-dir.) for the z-channel map
143
144   Int_t fZChannelMap[5][16][6][16];               // must be changed
145   Int_t fZSubChannel[5][fgkNZChannels][6][16];    // must be changed
146
147   Int_t fCurrTrackletMask; // current tracklet mask for which the coefficients have been calculated
148   Float_t fAki[6]; // coefficients used for the fit, calculated for the current tracklet mask
149   Float_t fBki[6]; // coefficients used for the fit, calculated for the current tracklet mask
150   Float_t fCki[6]; // coefficients used for the fit, calculated for the current tracklet mask
151
152   Float_t fMagField;            // magnetic field in T
153
154   AliTRDgeometry *fGeo;         //! pointer to the TRD geometry
155
156   static AliTRDgtuParam *fgInstance; // instance pointer
157
158  private:
159   AliTRDgtuParam();                          // instance only via Instance()
160   AliTRDgtuParam(const AliTRDgtuParam &rhs); // not implemented
161   AliTRDgtuParam& operator=(const AliTRDgtuParam &rhs); // not implemented
162
163   ClassDef(AliTRDgtuParam, 1);
164 };
165
166 #endif