1 #ifndef ALIFMDALIGNFAKER_H
2 #define ALIFMDALIGNFAKER_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
6 * Latest changes by Christian Holm Christensen <cholm@nbi.dk>
8 * See cxx source for full Copyright notice
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
16 //____________________________________________________________________
29 # include <TVector3.h>
35 * @class AliFMDAlignFaker
36 * @brief This task creates fake alignment.
38 * Which alignment, depends on the bit mask passed to the
39 * constructor, or added by `AddAlign'.
41 * The default is to write all alignment parameters to a local
42 * storage @c local://cdb which is a directory in the current
47 class AliFMDAlignFaker : public TTask
51 * What to make alignments for
54 /** MAke alignment for sensors */
56 /** Make alignment for half-rings */
60 /** All types of alignment */
61 kAll = (1<<kHalves|1<<kSensors)
65 @param mask Bit mask of what to make alignments for
66 @param geo File to read geometry from, if needed
67 @param loc Where to store the result
69 AliFMDAlignFaker(Int_t mask=kAll,
70 const char* geo="geometry.root",
75 virtual ~AliFMDAlignFaker() {}
77 * Add something to make alignment for
78 * @param w Bit of alignment mask
80 void AddAlign(EWhat w) { SETBIT(fMask, w); }
82 * Remove something to make alignment for
83 * @param w Bit of alignment mask
85 void RemoveAlign(EWhat w) { CLRBIT(fMask, w); }
87 * Set alignment select mask
88 * @param mask Bit mask
90 void SetAlign(Int_t mask) { fMask = mask; }
92 * Set the displacement (translation) of sensors. The displacement
93 * is selected random uniformly between the corresponding minimum
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)
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);
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)
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);
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
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);
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)
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);
142 * Set the output file name. Should be a valid CDB URL.
143 * @param file CDB URL
145 void SetOutput(const char* file) { SetTitle(file); }
147 * Set the file to read the geometry from.
148 * @param file File name
150 void SetGeometryFile(const char* file) { SetName(file); }
154 void SetComment(const Char_t* comment="dummy data") { fComment = comment; }
156 * Make the alignment objects.
157 * @param option Not used.
159 void Exec(Option_t* option="");
163 * @param toCdb Whether to store in CDB
164 * @param storage Storage element to use
166 * @return true on success
168 static Bool_t GetGeometry(Bool_t toCdb=kFALSE,
169 const TString& storage=TString());
174 * @param o Object to copy from
176 AliFMDAlignFaker(const AliFMDAlignFaker& o)
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),
193 * Assignment operator
196 * @return Reference to this
198 AliFMDAlignFaker& operator=(const AliFMDAlignFaker&) { return *this; }
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
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);
217 * @param path of a sensor
218 * @param id Volume id
220 Bool_t MakeAlignSensor(const TString& path, Int_t id);
223 * @param path of a sensor
224 * @param id Volume id
226 Bool_t MakeAlignHalf(const TString& path, Int_t id);
235 Long_t fMask; // What to write
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
247 TString fComment; // Comment on data
249 ClassDef(AliFMDAlignFaker,0)
253 //____________________________________________________________________