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