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