remove a number of histograms
[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();
23 AliITSMisAligner(const AliITSMisAligner &mAligner);
24 AliITSMisAligner &operator= (const AliITSMisAligner &mAligner);
25 ~AliITSMisAligner() {};
26
27 TClonesArray* MakeAlObjsArray();
28 AliCDBMetaData* GetCDBMetaData() const;
29
30 void SetSeed(Int_t seed) {fRnd.SetSeed(seed); return;}
31
32 void SetWholeITSPars(Double_t dx, Double_t dy, Double_t dz, Double_t dpsi, Double_t dtheta, Double_t dphi)
33 {
34 fWholeITS[0] = dx; fWholeITS[1] = dy; fWholeITS[2] = dz;
35 fWholeITS[3] = dpsi; fWholeITS[4] = dtheta; fWholeITS[5] = dphi;
36 }
37
38 void SetSPDSectorSigmas(Double_t dx, Double_t dy, Double_t dz, Double_t dpsi, Double_t dtheta, Double_t dphi)
39 {
40 fSPDSector[0] = dx; fSPDSector[1] = dy; fSPDSector[2] = dz;
41 fSPDSector[3] = dpsi; fSPDSector[4] = dtheta; fSPDSector[5] = dphi;
42 }
43
44 void SetSPDHSSigmas(Double_t dx, Double_t dy, Double_t dz, Double_t dpsi, Double_t dtheta, Double_t dphi)
45 {
46 fSPDHS[0] = dx; fSPDHS[1] = dy; fSPDHS[2] = dz;
47 fSPDHS[3] = dpsi; fSPDHS[4] = dtheta; fSPDHS[5] = dphi;
48 }
49
50 void SetSPDLadderSigmas(Double_t dx, Double_t dy, Double_t dz, Double_t dpsi, Double_t dtheta, Double_t dphi)
51 {
52 fSPDLadder[0] = dx; fSPDLadder[1] = dy; fSPDLadder[2] = dz;
53 fSPDLadder[3] = dpsi; fSPDLadder[4] = dtheta; fSPDLadder[5] = dphi;
54 }
55
56 void SetSPDHBSigmas(Double_t dx, Double_t dy, Double_t dz, Double_t dpsi, Double_t dtheta, Double_t dphi)
57 {
58 fSPDHB[0] = dx; fSPDHB[1] = dy; fSPDHB[2] = dz;
59 fSPDHB[3] = dpsi; fSPDHB[4] = dtheta; fSPDHB[5] = dphi;
60 }
61
62 void SetSPDBarrelSigmas(Double_t dx, Double_t dy, Double_t dz, Double_t dpsi, Double_t dtheta, Double_t dphi)
63 {
64 fSPDBarrel[0] = dx; fSPDBarrel[1] = dy; fSPDBarrel[2] = dz;
65 fSPDBarrel[3] = dpsi; fSPDBarrel[4] = dtheta; fSPDBarrel[5] = dphi;
66 }
67
68 void SetSDDLayerSigmas(Double_t dx, Double_t dy, Double_t dz, Double_t dpsi, Double_t dtheta, Double_t dphi)
69 {
70 fSDDLayer[0] = dx; fSDDLayer[1] = dy; fSDDLayer[2] = dz;
71 fSDDLayer[3] = dpsi; fSDDLayer[4] = dtheta; fSDDLayer[5] = dphi;
72 }
73
74 void SetSDDBarrelSigmas(Double_t dx, Double_t dy, Double_t dz, Double_t dpsi, Double_t dtheta, Double_t dphi)
75 {
76 fSDDBarrel[0] = dx; fSDDBarrel[1] = dy; fSDDBarrel[2] = dz;
77 fSDDBarrel[3] = dpsi; fSDDBarrel[4] = dtheta; fSDDBarrel[5] = dphi;
78 }
79
80 void SetSDDLadderSigmas(Double_t dx, Double_t dy, Double_t dz, Double_t dpsi, Double_t dtheta, Double_t dphi)
81 {
82 fSDDLadder[0] = dx; fSDDLadder[1] = dy; fSDDLadder[2] = dz;
83 fSDDLadder[3] = dpsi; fSDDLadder[4] = dtheta; fSDDLadder[5] = dphi;
84 }
85
86 void SetSDDModuleSigmas(Double_t dx, Double_t dy, Double_t dz, Double_t dpsi, Double_t dtheta, Double_t dphi)
87 {
88 fSDDModule[0] = dx; fSDDModule[1] = dy; fSDDModule[2] = dz;
89 fSDDModule[3] = dpsi; fSDDModule[4] = dtheta; fSDDModule[5] = dphi;
90 }
91
92 void SetSSDBarrelPars(Double_t dx, Double_t dy, Double_t dz, Double_t dpsi, Double_t dtheta, Double_t dphi)
93 {
94 fSSDBarrel[0] = dx; fSSDBarrel[1] = dy; fSSDBarrel[2] = dz;
95 fSSDBarrel[3] = dpsi; fSSDBarrel[4] = dtheta; fSSDBarrel[5] = dphi;
96 }
97
98 void SetSSDLadderSigmas(Double_t dx, Double_t dy, Double_t dz, Double_t dpsi, Double_t dtheta, Double_t dphi)
99 {
100 fSSDLadder[0] = dx; fSSDLadder[1] = dy; fSSDLadder[2] = dz;
101 fSSDLadder[3] = dpsi; fSSDLadder[4] = dtheta; fSSDLadder[5] = dphi;
102 }
103
104 void SetSSDModuleSigmas(Double_t dx, Double_t dy, Double_t dz, Double_t dpsi, Double_t dtheta, Double_t dphi)
105 {
106 fSSDModule[0] = dx; fSSDModule[1] = dy; fSSDModule[2] = dz;
107 fSSDModule[3] = dpsi; fSSDModule[4] = dtheta; fSSDModule[5] = dphi;
108 }
109
110 void SetSPDLadderShiftT(Double_t dx, Double_t dy, Double_t dz, Double_t dpsi, Double_t dtheta, Double_t dphi)
111 {
112 fSPDLadderShiftT[0] = dx; fSPDLadderShiftT[1] = dy; fSPDLadderShiftT[2] = dz;
113 fSPDLadderShiftT[3] = dpsi; fSPDLadderShiftT[4] = dtheta; fSPDLadderShiftT[5] = dphi;
114 }
115
116 void SetSPDLadderShiftB(Double_t dx, Double_t dy, Double_t dz, Double_t dpsi, Double_t dtheta, Double_t dphi)
117 {
118 fSPDLadderShiftB[0] = dx; fSPDLadderShiftB[1] = dy; fSPDLadderShiftB[2] = dz;
119 fSPDLadderShiftB[3] = dpsi; fSPDLadderShiftB[4] = dtheta; fSPDLadderShiftB[5] = dphi;
120 }
121
122 void SetSPDLadderShiftT(Double_t pars[6])
123 {
124 for(Int_t ii=0; ii<6; ii++)
125 fSPDLadderShiftT[ii] = pars[ii];
126 }
127
128 void SetSPDLadderShiftB(Double_t pars[6])
129 {
130 for(Int_t ii=0; ii<6; ii++)
131 fSPDLadderShiftB[ii] = pars[ii];
132 }
133
134 void SetWholeITSMisAlignment();
135 void SetSPDMisAlignment();
136 void SetSDDMisAlignment();
137 void SetSSDMisAlignment();
138
139 Double_t GetUnif(Double_t x1,Double_t x2) {return fRnd.Uniform(x1,x2);}
140
141 Bool_t AddAlignObj(char* name,Double_t dx,Double_t dy,Double_t dz,
142 Double_t dpsi,Double_t dtheta,Double_t dphi,
143 const char* distrib);
144
145 Bool_t AddAlignObj(Int_t lay,Double_t dx,Double_t dy,Double_t dz,
146 Double_t dpsi,Double_t dtheta,Double_t dphi,
147 Bool_t unif);
148
149 Bool_t AddAlignObj(Int_t lay,Int_t ladd,Double_t dx,Double_t dy,Double_t dz,
150 Double_t dpsi,Double_t dtheta,Double_t dphi,
151 Double_t xShift,Double_t yShift,Double_t zShift,
152 Double_t psiShift,Double_t thetaShift,Double_t phiShift,
153 Bool_t unif);
154
155 Bool_t AddSectorAlignObj(Int_t sectMin,Int_t sectMax,
156 Double_t dx,Double_t dy,Double_t dz,
157 Double_t dpsi,Double_t dtheta,Double_t dphi,
158 Double_t xShift,Double_t yShift,Double_t zShift,
159 Double_t psiShift,Double_t thetaShift,Double_t phiShift,
160 Bool_t unif);
161
162 void ShiftAlignObj(AliAlignObjParams &alObj,Double_t dx,Double_t dy,Double_t dz,Double_t dpsi,Double_t dtheta,Double_t dphi);
163 void SmearAlignObj(AliAlignObjParams &alObj,Double_t sx,Double_t sy,Double_t sz,Double_t spsi,Double_t stheta,Double_t sphi);
164
165 const char* GetSymbName(Int_t layer) const;
166 const char* GetSymbName(Int_t layer,Int_t ladd) const;
167 const char* GetSymbName(Int_t layer,Int_t ladd,Int_t mod) const;
168 const char* GetHalfStaveLadderSymbName(Int_t layer,Int_t ladd,Int_t halfStave) const;
169 static const char* GetParentSymName(const char* symname) ;
170 // const char* GetSistersSymName(const char* symname) const;
171 static Bool_t GetLayerAndLevel(const char* symname, Int_t &layer, Int_t &level);
172
173 static Int_t GetNLayers() {return kNLayers;}
174 static Int_t GetNLadders(Int_t lay) {return fgkNLadders[lay];}
175 static Int_t GetNDetectors(Int_t lay) {return fgkNDetectors[lay];}
176 static Int_t GetNSisters(const char* symname);
177 static Int_t GetNDaughters(const char* symname);
178
179 protected:
180 TRandom3 fRnd; // TRandom3 object
181 //TRandom fRnd; // TRandom object
182 Int_t fInd; // index of current AliAlignObjParams in fAlignObjArray
183 TClonesArray *fAlignObjArray; // array of AliAlignObjParams
184 TString fStrSPD; // name of SPD
185 TString fStrSDD; // name of SDD
186 TString fStrSSD; // name of SSD
187 TString fStrStave; // name of SPD stave
188 TString fStrHalfStave; // name of SPD half-stave
189 TString fStrLadder; // name of SPD ladder
190 TString fStrSector; // name of SPD sector
191 TString fStrSensor; // name of sensitive volume
192
193 private:
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
199 Double_t fWholeITS[6];
200 Double_t fSPDSector[6];
201 Double_t fSPDHB[6];
202 Double_t fSPDBarrel[6];
203 Double_t fSPDHS[6];
204 Double_t fSPDLadder[6];
205 Double_t fSDDLayer[6];
206 Double_t fSDDBarrel[6];
207 Double_t fSDDLadder[6];
208 Double_t fSDDModule[6];
209 Double_t fSSDBarrel[6];
210 Double_t fSSDLayer[6];
211 Double_t fSSDLadder[6];
212 Double_t fSSDModule[6];
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
217 Double_t fSDDLadderShift1[6];
218 Double_t fSDDLadderShift2[6];
edccc22d 219
220 // Choice between uniform (kTRUE) or gaussian (kFALSE) distribution in the smearing
221 Bool_t fUnifSPDSector, fUnifSPDHS, fUnifSDDLadder, fUnifSSDLadder, fUnifSPDLadder, fUnifSDDModule, fUnifSSDModule;
222
223 ClassDef(AliITSMisAligner,0) //ITS MisAligner
224};
225
226
227#endif