]>
Commit | Line | Data |
---|---|---|
20345ac5 | 1 | #ifndef ALIFMDALIGNFAKER_H |
2 | #define ALIFMDALIGNFAKER_H | |
3 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights | |
4 | * reserved. | |
5 | * | |
6 | * Latest changes by Christian Holm Christensen <cholm@nbi.dk> | |
7 | * | |
8 | * See cxx source for full Copyright notice | |
9 | */ | |
09b6c804 | 10 | /** |
11 | * @file AliFMDAlignFaker.h | |
12 | * @author Christian Holm Christensen <cholm@nbi.dk> | |
13 | * @date Sun Mar 26 18:26:39 2006 | |
14 | * @brief Make fake alignment | |
15 | */ | |
20345ac5 | 16 | //____________________________________________________________________ |
17 | // | |
02a27b50 | 18 | // Class |
19 | // to | |
20 | // make | |
21 | // fake | |
22 | // alignment | |
23 | // parameters | |
20345ac5 | 24 | // |
25 | #ifndef ROOT_TTask | |
26 | # include <TTask.h> | |
27 | #endif | |
28 | #ifndef ROOT_TVector3 | |
29 | # include <TVector3.h> | |
30 | #endif | |
31 | class TClonesArray; | |
32 | class TString; | |
33 | ||
09b6c804 | 34 | /** |
35 | * @class AliFMDAlignFaker | |
36 | * @brief This task creates fake alignment. | |
37 | * | |
38 | * Which alignment, depends on the bit mask passed to the | |
39 | * constructor, or added by `AddAlign'. | |
40 | * | |
41 | * The default is to write all alignment parameters to a local | |
42 | * storage @c local://cdb which is a directory in the current | |
43 | * directory. | |
44 | * | |
45 | * @ingroup FMD_util | |
46 | */ | |
20345ac5 | 47 | class AliFMDAlignFaker : public TTask |
48 | { | |
49 | public: | |
09b6c804 | 50 | /** |
51 | * What to make alignments for | |
52 | */ | |
20345ac5 | 53 | enum EWhat { |
9f662337 | 54 | /** MAke alignment for sensors */ |
20345ac5 | 55 | kSensors = 1, |
9f662337 | 56 | /** Make alignment for half-rings */ |
4183a24f | 57 | kHalves |
20345ac5 | 58 | }; |
59 | enum { | |
9f662337 | 60 | /** All types of alignment */ |
20345ac5 | 61 | kAll = (1<<kHalves|1<<kSensors) |
62 | }; | |
09b6c804 | 63 | /** |
64 | * Constructor | |
9f662337 | 65 | @param mask Bit mask of what to make alignments for |
66 | @param geo File to read geometry from, if needed | |
09b6c804 | 67 | @param loc Where to store the result |
68 | */ | |
20345ac5 | 69 | AliFMDAlignFaker(Int_t mask=kAll, |
70 | const char* geo="geometry.root", | |
9234535e | 71 | const char* loc=""); |
09b6c804 | 72 | /** |
73 | * Destructor | |
74 | */ | |
20345ac5 | 75 | virtual ~AliFMDAlignFaker() {} |
09b6c804 | 76 | /** |
77 | * Add something to make alignment for | |
78 | * @param w Bit of alignment mask | |
79 | */ | |
20345ac5 | 80 | void AddAlign(EWhat w) { SETBIT(fMask, w); } |
09b6c804 | 81 | /** |
82 | * Remove something to make alignment for | |
83 | * @param w Bit of alignment mask | |
84 | */ | |
1e8f773e | 85 | void RemoveAlign(EWhat w) { CLRBIT(fMask, w); } |
09b6c804 | 86 | /** |
87 | * Set alignment select mask | |
88 | * @param mask Bit mask | |
89 | */ | |
20345ac5 | 90 | void SetAlign(Int_t mask) { fMask = mask; } |
09b6c804 | 91 | /** |
92 | * Set the displacement (translation) of sensors. The displacement | |
93 | * is selected random uniformly between the corresponding minimum | |
94 | * and maximum. | |
95 | * @param x1 Minimum X displacement (in centimeters) | |
96 | * @param y1 Minimum Y displacement (in centimeters) | |
97 | * @param z1 Minimum Z displacement (in centimeters) | |
98 | * @param x2 Maximum X displacement (in centimeters) | |
99 | * @param y2 Maximum Y displacement (in centimeters) | |
100 | * @param z2 Maximum Z displacement (in centimeters) | |
101 | */ | |
20345ac5 | 102 | void SetSensorDisplacement(Double_t x1=0, Double_t y1=0, Double_t z1=0, |
103 | Double_t x2=.01, Double_t y2=.01, Double_t z2=0); | |
09b6c804 | 104 | /** |
105 | * Set the rotation of sensors. The displacement is selected | |
106 | * random uniformly between the corresponding minimum and maximum. | |
107 | * @param x1 Minimum X rotation (in degrees) | |
108 | * @param y1 Minimum Y rotation (in degrees) | |
109 | * @param z1 Minimum Z rotation (in degrees) | |
110 | * @param x2 Maximum X rotation (in degrees) | |
111 | * @param y2 Maximum Y rotation (in degrees) | |
112 | * @param z2 Maximum Z rotation (in degrees) | |
113 | */ | |
20345ac5 | 114 | void SetSensorRotation(Double_t x1=0, Double_t y1=0, Double_t z1=0, |
115 | Double_t x2=.5, Double_t y2=.5, Double_t z2=.5); | |
09b6c804 | 116 | /** |
117 | * Set the displacement (translation) of half-rings. The | |
118 | * displacement is selected random uniformly between the | |
119 | * corresponding minimum and maximum. | |
120 | * @param x1 Minimum X displacement | |
121 | * @param y1 Minimum Y displacement | |
122 | * @param z1 Minimum Z displacement | |
123 | * @param x2 Maximum X displacement | |
124 | * @param y2 Maximum Y displacement | |
125 | * @param z2 Maximum Z displacement | |
126 | */ | |
20345ac5 | 127 | void SetHalfDisplacement(Double_t x1=0, Double_t y1=0, Double_t z1=0, |
128 | Double_t x2=.05, Double_t y2=.05, Double_t z2=.05); | |
09b6c804 | 129 | /** |
130 | * Set the rotation of half-rings. The displacement is selected | |
131 | * random uniformly between the corresponding minimum and maximum. | |
132 | * @param x1 Minimum X rotation (in degrees) | |
133 | * @param y1 Minimum Y rotation (in degrees) | |
134 | * @param z1 Minimum Z rotation (in degrees) | |
135 | * @param x2 Maximum X rotation (in degrees) | |
136 | * @param y2 Maximum Y rotation (in degrees) | |
137 | * @param z2 Maximum Z rotation (in degrees) | |
138 | */ | |
20345ac5 | 139 | void SetHalfRotation(Double_t x1=0, Double_t y1=0, Double_t z1=0, |
140 | Double_t x2=0, Double_t y2=0, Double_t z2=0); | |
09b6c804 | 141 | /** |
142 | * Set the output file name. Should be a valid CDB URL. | |
143 | * @param file CDB URL | |
144 | */ | |
20345ac5 | 145 | void SetOutput(const char* file) { SetTitle(file); } |
09b6c804 | 146 | /** |
147 | * Set the file to read the geometry from. | |
148 | * @param file File name | |
149 | */ | |
20345ac5 | 150 | void SetGeometryFile(const char* file) { SetName(file); } |
09b6c804 | 151 | /** |
152 | * Set the comment | |
153 | */ | |
9234535e | 154 | void SetComment(const Char_t* comment="dummy data") { fComment = comment; } |
09b6c804 | 155 | /** |
156 | * Make the alignment objects. | |
157 | * @param option Not used. | |
158 | */ | |
20345ac5 | 159 | void Exec(Option_t* option=""); |
09b6c804 | 160 | /** |
161 | * Get the geometry | |
162 | * | |
163 | * @param toCdb Whether to store in CDB | |
164 | * @param storage Storage element to use | |
165 | * | |
166 | * @return true on success | |
167 | */ | |
d98fbfa5 | 168 | static Bool_t GetGeometry(Bool_t toCdb=kFALSE, |
169 | const TString& storage=TString()); | |
20345ac5 | 170 | protected: |
09b6c804 | 171 | /** |
172 | * Copy constructor | |
173 | * | |
174 | * @param o Object to copy from | |
175 | */ | |
b5ee4425 | 176 | AliFMDAlignFaker(const AliFMDAlignFaker& o) |
177 | : TTask(o), | |
178 | fMask(0), | |
179 | fSensorTransMin(0,0,0), | |
180 | fSensorTransMax(0,0,0), | |
181 | fSensorRotMin(0,0,0), | |
182 | fSensorRotMax(0,0,0), | |
183 | fHalfTransMin(0,0,0), | |
184 | fHalfTransMax(0,0,0), | |
185 | fHalfRotMin(0,0,0), | |
186 | fHalfRotMax(0,0,0), | |
187 | fRunMin(0), | |
188 | fRunMax(0), | |
189 | fArray(0), | |
190 | fComment("") | |
09b6c804 | 191 | {} |
192 | /** | |
193 | * Assignment operator | |
194 | * | |
195 | * | |
196 | * @return Reference to this | |
197 | */ | |
02a27b50 | 198 | AliFMDAlignFaker& operator=(const AliFMDAlignFaker&) { return *this; } |
199 | ||
09b6c804 | 200 | /** |
201 | * Make the alignment object for a path | |
202 | * @param path Node path. | |
203 | * @param volID Volume identifier | |
204 | * @param transX Translation in X | |
205 | * @param transY Translation in Y | |
206 | * @param transZ Translation in Z | |
207 | * @param rotX Rotation around X axis | |
208 | * @param rotY Rotation around Y axis | |
209 | * @param rotZ Rotation around Z axis | |
210 | * @return @c true on success | |
211 | */ | |
20345ac5 | 212 | Bool_t MakeAlign(const TString& path, Int_t volID, |
213 | Double_t transX, Double_t transY, Double_t transZ, | |
214 | Double_t rotX, Double_t rotY, Double_t rotZ); | |
09b6c804 | 215 | /** |
216 | * Align a sensor | |
217 | * @param path of a sensor | |
218 | * @param id Volume id | |
219 | */ | |
20345ac5 | 220 | Bool_t MakeAlignSensor(const TString& path, Int_t id); |
09b6c804 | 221 | /** |
222 | * Align a half-ring | |
223 | * @param path of a sensor | |
224 | * @param id Volume id | |
225 | */ | |
20345ac5 | 226 | Bool_t MakeAlignHalf(const TString& path, Int_t id); |
09b6c804 | 227 | /** |
228 | * Write to CDB | |
229 | */ | |
20345ac5 | 230 | void WriteToCDB(); |
09b6c804 | 231 | /** |
232 | * Write to file | |
233 | */ | |
20345ac5 | 234 | void WriteToFile(); |
20345ac5 | 235 | Long_t fMask; // What to write |
9f662337 | 236 | TVector3 fSensorTransMin; // Minimum translations of a sensor |
237 | TVector3 fSensorTransMax; // Maximum translations of a sensor | |
238 | TVector3 fSensorRotMin; // Minimum rotation of a sensor | |
239 | TVector3 fSensorRotMax; // Maximum rotation of a sensor | |
240 | TVector3 fHalfTransMin; // Minimum translations of a half-ring | |
241 | TVector3 fHalfTransMax; // Maximum translations of a half-ring | |
242 | TVector3 fHalfRotMin; // Minimum rotation of a half-ring | |
243 | TVector3 fHalfRotMax; // Maximum rotation of a half-ring | |
244 | Int_t fRunMin; // Run validity start | |
245 | Int_t fRunMax; // Run validity end | |
246 | TClonesArray* fArray; // Cache | |
9234535e | 247 | TString fComment; // Comment on data |
20345ac5 | 248 | |
249 | ClassDef(AliFMDAlignFaker,0) | |
250 | }; | |
251 | ||
252 | #endif | |
253 | //____________________________________________________________________ | |
254 | // | |
255 | // Local Variables: | |
256 | // mode: C++ | |
257 | // End: | |
258 | // | |
259 | // EOF | |
260 | // | |
261 |