update for the NUA
[u/mrichter/AliRoot.git] / ITS / AliITSMisAligner.h
CommitLineData
edccc22d 1#ifndef ALIITSMISALIGNER_H
2#define ALIITSMISALIGNER_H
3
4// Class building the alignment objects for ITS (SPD, SDD, SSD)
5// It derives from AliMisAligner, thus providing the methods
6// MakeAlObjsArray (builds and returns the array of alignment objects)
7// and GetCDBMetaData (returns the metadata for the OCDB entry)
8//
9
10/* $Id$ */
11
12#include <TString.h>
13#include "AliMisAligner.h"
14#include <TRandom3.h>
15
16class TClonesArray;
17class AliAlignObjParams;
18
19//-------------------------------------------------------------------------
20class AliITSMisAligner : public AliMisAligner{
21 public:
22 AliITSMisAligner();
edccc22d 23 ~AliITSMisAligner() {};
24
25 TClonesArray* MakeAlObjsArray();
26 AliCDBMetaData* GetCDBMetaData() const;
27
28 void SetSeed(Int_t seed) {fRnd.SetSeed(seed); return;}
29
30 void SetWholeITSPars(Double_t dx, Double_t dy, Double_t dz, Double_t dpsi, Double_t dtheta, Double_t dphi)
31 {
32 fWholeITS[0] = dx; fWholeITS[1] = dy; fWholeITS[2] = dz;
33 fWholeITS[3] = dpsi; fWholeITS[4] = dtheta; fWholeITS[5] = dphi;
34 }
35
36 void SetSPDSectorSigmas(Double_t dx, Double_t dy, Double_t dz, Double_t dpsi, Double_t dtheta, Double_t dphi)
37 {
38 fSPDSector[0] = dx; fSPDSector[1] = dy; fSPDSector[2] = dz;
39 fSPDSector[3] = dpsi; fSPDSector[4] = dtheta; fSPDSector[5] = dphi;
40 }
41
42 void SetSPDHSSigmas(Double_t dx, Double_t dy, Double_t dz, Double_t dpsi, Double_t dtheta, Double_t dphi)
43 {
44 fSPDHS[0] = dx; fSPDHS[1] = dy; fSPDHS[2] = dz;
45 fSPDHS[3] = dpsi; fSPDHS[4] = dtheta; fSPDHS[5] = dphi;
46 }
47
48 void SetSPDLadderSigmas(Double_t dx, Double_t dy, Double_t dz, Double_t dpsi, Double_t dtheta, Double_t dphi)
49 {
50 fSPDLadder[0] = dx; fSPDLadder[1] = dy; fSPDLadder[2] = dz;
51 fSPDLadder[3] = dpsi; fSPDLadder[4] = dtheta; fSPDLadder[5] = dphi;
52 }
53
54 void SetSPDHBSigmas(Double_t dx, Double_t dy, Double_t dz, Double_t dpsi, Double_t dtheta, Double_t dphi)
55 {
56 fSPDHB[0] = dx; fSPDHB[1] = dy; fSPDHB[2] = dz;
57 fSPDHB[3] = dpsi; fSPDHB[4] = dtheta; fSPDHB[5] = dphi;
58 }
59
60 void SetSPDBarrelSigmas(Double_t dx, Double_t dy, Double_t dz, Double_t dpsi, Double_t dtheta, Double_t dphi)
61 {
62 fSPDBarrel[0] = dx; fSPDBarrel[1] = dy; fSPDBarrel[2] = dz;
63 fSPDBarrel[3] = dpsi; fSPDBarrel[4] = dtheta; fSPDBarrel[5] = dphi;
64 }
65
66 void SetSDDLayerSigmas(Double_t dx, Double_t dy, Double_t dz, Double_t dpsi, Double_t dtheta, Double_t dphi)
67 {
68 fSDDLayer[0] = dx; fSDDLayer[1] = dy; fSDDLayer[2] = dz;
69 fSDDLayer[3] = dpsi; fSDDLayer[4] = dtheta; fSDDLayer[5] = dphi;
70 }
71
72 void SetSDDBarrelSigmas(Double_t dx, Double_t dy, Double_t dz, Double_t dpsi, Double_t dtheta, Double_t dphi)
73 {
74 fSDDBarrel[0] = dx; fSDDBarrel[1] = dy; fSDDBarrel[2] = dz;
75 fSDDBarrel[3] = dpsi; fSDDBarrel[4] = dtheta; fSDDBarrel[5] = dphi;
76 }
77
78 void SetSDDLadderSigmas(Double_t dx, Double_t dy, Double_t dz, Double_t dpsi, Double_t dtheta, Double_t dphi)
79 {
80 fSDDLadder[0] = dx; fSDDLadder[1] = dy; fSDDLadder[2] = dz;
81 fSDDLadder[3] = dpsi; fSDDLadder[4] = dtheta; fSDDLadder[5] = dphi;
82 }
83
84 void SetSDDModuleSigmas(Double_t dx, Double_t dy, Double_t dz, Double_t dpsi, Double_t dtheta, Double_t dphi)
85 {
86 fSDDModule[0] = dx; fSDDModule[1] = dy; fSDDModule[2] = dz;
87 fSDDModule[3] = dpsi; fSDDModule[4] = dtheta; fSDDModule[5] = dphi;
88 }
89
90 void SetSSDBarrelPars(Double_t dx, Double_t dy, Double_t dz, Double_t dpsi, Double_t dtheta, Double_t dphi)
91 {
92 fSSDBarrel[0] = dx; fSSDBarrel[1] = dy; fSSDBarrel[2] = dz;
93 fSSDBarrel[3] = dpsi; fSSDBarrel[4] = dtheta; fSSDBarrel[5] = dphi;
94 }
95
96 void SetSSDLadderSigmas(Double_t dx, Double_t dy, Double_t dz, Double_t dpsi, Double_t dtheta, Double_t dphi)
97 {
98 fSSDLadder[0] = dx; fSSDLadder[1] = dy; fSSDLadder[2] = dz;
99 fSSDLadder[3] = dpsi; fSSDLadder[4] = dtheta; fSSDLadder[5] = dphi;
100 }
101
102 void SetSSDModuleSigmas(Double_t dx, Double_t dy, Double_t dz, Double_t dpsi, Double_t dtheta, Double_t dphi)
103 {
104 fSSDModule[0] = dx; fSSDModule[1] = dy; fSSDModule[2] = dz;
105 fSSDModule[3] = dpsi; fSSDModule[4] = dtheta; fSSDModule[5] = dphi;
106 }
107
108 void SetSPDLadderShiftT(Double_t dx, Double_t dy, Double_t dz, Double_t dpsi, Double_t dtheta, Double_t dphi)
109 {
110 fSPDLadderShiftT[0] = dx; fSPDLadderShiftT[1] = dy; fSPDLadderShiftT[2] = dz;
111 fSPDLadderShiftT[3] = dpsi; fSPDLadderShiftT[4] = dtheta; fSPDLadderShiftT[5] = dphi;
112 }
113
114 void SetSPDLadderShiftB(Double_t dx, Double_t dy, Double_t dz, Double_t dpsi, Double_t dtheta, Double_t dphi)
115 {
116 fSPDLadderShiftB[0] = dx; fSPDLadderShiftB[1] = dy; fSPDLadderShiftB[2] = dz;
117 fSPDLadderShiftB[3] = dpsi; fSPDLadderShiftB[4] = dtheta; fSPDLadderShiftB[5] = dphi;
118 }
119
120 void SetSPDLadderShiftT(Double_t pars[6])
121 {
122 for(Int_t ii=0; ii<6; ii++)
123 fSPDLadderShiftT[ii] = pars[ii];
124 }
125
126 void SetSPDLadderShiftB(Double_t pars[6])
127 {
128 for(Int_t ii=0; ii<6; ii++)
129 fSPDLadderShiftB[ii] = pars[ii];
130 }
131
132 void SetWholeITSMisAlignment();
133 void SetSPDMisAlignment();
134 void SetSDDMisAlignment();
135 void SetSSDMisAlignment();
136
137 Double_t GetUnif(Double_t x1,Double_t x2) {return fRnd.Uniform(x1,x2);}
138
139 Bool_t AddAlignObj(char* name,Double_t dx,Double_t dy,Double_t dz,
140 Double_t dpsi,Double_t dtheta,Double_t dphi,
141 const char* distrib);
142
143 Bool_t AddAlignObj(Int_t lay,Double_t dx,Double_t dy,Double_t dz,
144 Double_t dpsi,Double_t dtheta,Double_t dphi,
145 Bool_t unif);
146
147 Bool_t AddAlignObj(Int_t lay,Int_t ladd,Double_t dx,Double_t dy,Double_t dz,
148 Double_t dpsi,Double_t dtheta,Double_t dphi,
149 Double_t xShift,Double_t yShift,Double_t zShift,
150 Double_t psiShift,Double_t thetaShift,Double_t phiShift,
151 Bool_t unif);
152
153 Bool_t AddSectorAlignObj(Int_t sectMin,Int_t sectMax,
154 Double_t dx,Double_t dy,Double_t dz,
155 Double_t dpsi,Double_t dtheta,Double_t dphi,
156 Double_t xShift,Double_t yShift,Double_t zShift,
157 Double_t psiShift,Double_t thetaShift,Double_t phiShift,
158 Bool_t unif);
159
160 void ShiftAlignObj(AliAlignObjParams &alObj,Double_t dx,Double_t dy,Double_t dz,Double_t dpsi,Double_t dtheta,Double_t dphi);
161 void SmearAlignObj(AliAlignObjParams &alObj,Double_t sx,Double_t sy,Double_t sz,Double_t spsi,Double_t stheta,Double_t sphi);
162
163 const char* GetSymbName(Int_t layer) const;
164 const char* GetSymbName(Int_t layer,Int_t ladd) const;
165 const char* GetSymbName(Int_t layer,Int_t ladd,Int_t mod) const;
166 const char* GetHalfStaveLadderSymbName(Int_t layer,Int_t ladd,Int_t halfStave) const;
167 static const char* GetParentSymName(const char* symname) ;
168 // const char* GetSistersSymName(const char* symname) const;
169 static Bool_t GetLayerAndLevel(const char* symname, Int_t &layer, Int_t &level);
170
171 static Int_t GetNLayers() {return kNLayers;}
172 static Int_t GetNLadders(Int_t lay) {return fgkNLadders[lay];}
173 static Int_t GetNDetectors(Int_t lay) {return fgkNDetectors[lay];}
174 static Int_t GetNSisters(const char* symname);
175 static Int_t GetNDaughters(const char* symname);
176
177 protected:
178 TRandom3 fRnd; // TRandom3 object
179 //TRandom fRnd; // TRandom object
180 Int_t fInd; // index of current AliAlignObjParams in fAlignObjArray
181 TClonesArray *fAlignObjArray; // array of AliAlignObjParams
182 TString fStrSPD; // name of SPD
183 TString fStrSDD; // name of SDD
184 TString fStrSSD; // name of SSD
185 TString fStrStave; // name of SPD stave
186 TString fStrHalfStave; // name of SPD half-stave
187 TString fStrLadder; // name of SPD ladder
188 TString fStrSector; // name of SPD sector
189 TString fStrSensor; // name of sensitive volume
190
191 private:
c98634db 192 AliITSMisAligner(const AliITSMisAligner &mAligner);
193 AliITSMisAligner &operator= (const AliITSMisAligner &mAligner);
edccc22d 194 enum {kNLayers = 6}; // The number of layers.
195 static const Int_t fgkNLadders[kNLayers]; // Array of the number of ladders/layer(layer)
196 static const Int_t fgkNDetectors[kNLayers];// Array of the number of detector/ladder(layer)
197
198 // Parameters setting the misalignment at all SPD/SDD/SSD levels
5c6a2470 199 Double_t fWholeITS[6]; // parameters for the whole TIS
200 Double_t fSPDSector[6]; // sectors
201 Double_t fSPDHB[6]; // SPD half barrel
202 Double_t fSPDBarrel[6]; // SPD barrel
203 Double_t fSPDHS[6]; // SPD half stave
204 Double_t fSPDLadder[6]; // SPD ladder
205 Double_t fSDDLayer[6]; // SPD layer
206 Double_t fSDDBarrel[6]; // SDD barrel
207 Double_t fSDDLadder[6]; // SDD ladder
208 Double_t fSDDModule[6]; // SDD module
209 Double_t fSSDBarrel[6]; // SSD barrel
210 Double_t fSSDLayer[6]; // SSD layer
211 Double_t fSSDLadder[6]; // SSD ladder
212 Double_t fSSDModule[6]; // SSD module
edccc22d 213
214 // Parameters setting common shifts (used for "full" misalignment)
215 Double_t fSPDLadderShiftT[6]; // for top half-barrel ladders
216 Double_t fSPDLadderShiftB[6]; // for bottom half-barrel ladders
5c6a2470 217 Double_t fSDDLadderShift1[6]; // for ladder first SDD layer
218 Double_t fSDDLadderShift2[6]; // for ladder second SDD layer
edccc22d 219
220 // Choice between uniform (kTRUE) or gaussian (kFALSE) distribution in the smearing
416d7e17 221 Bool_t fUnifSPDSector; // kTRUE if uniform smearing SPD sector
222 Bool_t fUnifSPDHS; // kTRUE if uniform smearing SPD HS
223 Bool_t fUnifSDDLadder; // kTRUE if uniform smearing SDD ladder
224 Bool_t fUnifSSDLadder; // kTRUE if uniform smearing SSD ladder
225 Bool_t fUnifSPDLadder; // kTRUE if uniform smearing SPD ladder
226 Bool_t fUnifSDDModule; // kTRUE if uniform smearing SDD module
227 Bool_t fUnifSSDModule; // kTRUE if uniform smearing SSD module
edccc22d 228
229 ClassDef(AliITSMisAligner,0) //ITS MisAligner
230};
231
232
233#endif