]> git.uio.no Git - u/mrichter/AliRoot.git/blame - FMD/AliFMDAlignFaker.h
Default constructor creates CDB storage with centrally set run number (Yu.Kharlov)
[u/mrichter/AliRoot.git] / FMD / AliFMDAlignFaker.h
CommitLineData
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 */
c2fc1258 10/** @file AliFMDAlignFaker.h
11 @author Christian Holm Christensen <cholm@nbi.dk>
12 @date Sun Mar 26 18:26:39 2006
13 @brief Make fake alignment
14*/
20345ac5 15//____________________________________________________________________
16//
17// Class to make fake alignration parameters
18//
19#ifndef ROOT_TTask
20# include <TTask.h>
21#endif
22#ifndef ROOT_TVector3
23# include <TVector3.h>
24#endif
25class TClonesArray;
26class TString;
27
9f662337 28/** @class AliFMDAlignFaker
c2fc1258 29 @brief This task creates fake alignment.
30 Which alignment, depends on the bit mask passed to the
31 constructor, or added by `AddAlign'.
9f662337 32
33 The default is to write all alignment parameters to a local
34 storage @c local://cdb which is a directory in the current
35 directory.
36 @ingroup FMD_util
37*/
20345ac5 38class AliFMDAlignFaker : public TTask
39{
40public:
9f662337 41 /** What to make alignments for */
20345ac5 42 enum EWhat {
9f662337 43 /** MAke alignment for sensors */
20345ac5 44 kSensors = 1,
9f662337 45 /** Make alignment for half-rings */
4183a24f 46 kHalves
20345ac5 47 };
48 enum {
9f662337 49 /** All types of alignment */
20345ac5 50 kAll = (1<<kHalves|1<<kSensors)
51 };
9f662337 52 /** Constructor
53 @param mask Bit mask of what to make alignments for
54 @param geo File to read geometry from, if needed
55 @param loc Where to store the result */
20345ac5 56 AliFMDAlignFaker(Int_t mask=kAll,
57 const char* geo="geometry.root",
58 const char* loc="local://cdb");
9f662337 59 /** Destructor */
20345ac5 60 virtual ~AliFMDAlignFaker() {}
9f662337 61 /** Add something to make alignment for
62 @param w Bit of alignment mask */
20345ac5 63 void AddAlign(EWhat w) { SETBIT(fMask, w); }
9f662337 64 /** Remove something to make alignment for
65 @param w Bit of alignment mask */
1e8f773e 66 void RemoveAlign(EWhat w) { CLRBIT(fMask, w); }
9f662337 67 /** Set alignment select mask
68 @param mask Bit mask */
20345ac5 69 void SetAlign(Int_t mask) { fMask = mask; }
9f662337 70 /** Set the displacement (translation) of sensors. The displacement
71 is selected random uniformly between the corresponding minimum
72 and maximum.
73 @param x1 Minimum X displacement (in centimeters)
74 @param y1 Minimum Y displacement (in centimeters)
75 @param z1 Minimum Z displacement (in centimeters)
76 @param x2 Maximum X displacement (in centimeters)
77 @param y2 Maximum Y displacement (in centimeters)
78 @param z2 Maximum Z displacement (in centimeters) */
20345ac5 79 void SetSensorDisplacement(Double_t x1=0, Double_t y1=0, Double_t z1=0,
80 Double_t x2=.01, Double_t y2=.01, Double_t z2=0);
9f662337 81 /** Set the rotation of sensors. The displacement is selected
82 random uniformly between the corresponding minimum and maximum.
83 @param x1 Minimum X rotation (in degrees)
84 @param y1 Minimum Y rotation (in degrees)
85 @param z1 Minimum Z rotation (in degrees)
86 @param x2 Maximum X rotation (in degrees)
87 @param y2 Maximum Y rotation (in degrees)
88 @param z2 Maximum Z rotation (in degrees) */
20345ac5 89 void SetSensorRotation(Double_t x1=0, Double_t y1=0, Double_t z1=0,
90 Double_t x2=.5, Double_t y2=.5, Double_t z2=.5);
9f662337 91 /** Set the displacement (translation) of half-rings. The
92 displacement is selected random uniformly between the
93 corresponding minimum and maximum.
94 @param x1 Minimum X displacement
95 @param y1 Minimum Y displacement
96 @param z1 Minimum Z displacement
97 @param x2 Maximum X displacement
98 @param y2 Maximum Y displacement
99 @param z2 Maximum Z displacement */
20345ac5 100 void SetHalfDisplacement(Double_t x1=0, Double_t y1=0, Double_t z1=0,
101 Double_t x2=.05, Double_t y2=.05, Double_t z2=.05);
9f662337 102 /** Set the rotation of half-rings. The displacement is selected
103 random uniformly between the corresponding minimum and maximum.
104 @param x1 Minimum X rotation (in degrees)
105 @param y1 Minimum Y rotation (in degrees)
106 @param z1 Minimum Z rotation (in degrees)
107 @param x2 Maximum X rotation (in degrees)
108 @param y2 Maximum Y rotation (in degrees)
109 @param z2 Maximum Z rotation (in degrees) */
20345ac5 110 void SetHalfRotation(Double_t x1=0, Double_t y1=0, Double_t z1=0,
111 Double_t x2=0, Double_t y2=0, Double_t z2=0);
9f662337 112 /** Set the output file name. Should be a valid CDB URL.
113 @param file CDB URL */
20345ac5 114 void SetOutput(const char* file) { SetTitle(file); }
9f662337 115 /** Set the file to read the geometry from.
116 @param file File name */
20345ac5 117 void SetGeometryFile(const char* file) { SetName(file); }
9f662337 118 /** Make the alignment objects.
119 @param option Not used. */
20345ac5 120 void Exec(Option_t* option="");
121protected:
9f662337 122 /** Make the alignment object for a path
123 @param path Node path.
124 @param volID Volume identifier
125 @param transX Translation in X
126 @param transY Translation in Y
127 @param transZ Translation in Z
128 @param rotX Rotation around X axis
129 @param rotY Rotation around Y axis
130 @param rotZ Rotation around Z axis
131 @return @c true on success */
20345ac5 132 Bool_t MakeAlign(const TString& path, Int_t volID,
133 Double_t transX, Double_t transY, Double_t transZ,
134 Double_t rotX, Double_t rotY, Double_t rotZ);
9f662337 135 /** Align a sensor
136 @param path of a sensor
137 @param id Volume id */
20345ac5 138 Bool_t MakeAlignSensor(const TString& path, Int_t id);
9f662337 139 /** Align a half-ring
140 @param path of a sensor
141 @param id Volume id */
20345ac5 142 Bool_t MakeAlignHalf(const TString& path, Int_t id);
9f662337 143 /** Write to CDB */
20345ac5 144 void WriteToCDB();
9f662337 145 /** Write to file */
20345ac5 146 void WriteToFile();
147
148 Long_t fMask; // What to write
9f662337 149 TVector3 fSensorTransMin; // Minimum translations of a sensor
150 TVector3 fSensorTransMax; // Maximum translations of a sensor
151 TVector3 fSensorRotMin; // Minimum rotation of a sensor
152 TVector3 fSensorRotMax; // Maximum rotation of a sensor
153 TVector3 fHalfTransMin; // Minimum translations of a half-ring
154 TVector3 fHalfTransMax; // Maximum translations of a half-ring
155 TVector3 fHalfRotMin; // Minimum rotation of a half-ring
156 TVector3 fHalfRotMax; // Maximum rotation of a half-ring
157 Int_t fRunMin; // Run validity start
158 Int_t fRunMax; // Run validity end
159 TClonesArray* fArray; // Cache
20345ac5 160
161 ClassDef(AliFMDAlignFaker,0)
162};
163
164#endif
165//____________________________________________________________________
166//
167// Local Variables:
168// mode: C++
169// End:
170//
171// EOF
172//
173