]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONAlignmentTask.h
Added documentation about how to operate the Alignment task
[u/mrichter/AliRoot.git] / MUON / AliMUONAlignmentTask.h
1 #ifndef ALIMUONALIGNMENTTASK_H
2 #define ALIMUONALIGNMENTTASK_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice                               */
5
6 // $Id$
7
8 /// \ingroup calign
9 /// \class AliMUONAlignmentTask
10 /// \brief Task to align the muon spectrometer
11 ///
12 //  Author Javier Castillo, CEA/Saclay - Irfu/SPhN
13
14 #include "AliAnalysisTaskSE.h"
15 #include "AliMUONAlignment.h"
16
17 class TString;
18 class TClonesArray;
19 class AliMUONGeometryTransformer;
20
21 class AliMUONAlignmentTask : public AliAnalysisTaskSE
22 {
23
24   public:
25
26   /// constructor
27   AliMUONAlignmentTask( const char *name = "AliMUONAlignmentTask" );
28
29   /// destructor
30   virtual ~AliMUONAlignmentTask();
31
32   /// get pointer to alignment class
33   AliMUONAlignment* alignment( void ) const
34   { return fAlign; }
35
36   virtual void LocalInit();
37
38   ///@name flags
39   //@{
40
41   /// perform alignment from alignment records is true. Use ESD tracks otherwise
42   void SetReadRecords( Bool_t value = kTRUE )
43   { fReadRecords = value; }
44
45   /// write alignment records to AOD if true
46   void SetWriteRecords( Bool_t value = kTRUE )
47   { fWriteRecords = value; }
48
49   /// perform alignment (from either tracks or records depending on fReadRecords)
50   void SetDoAlignment( Bool_t value )
51   { fDoAlignment = value; }
52
53   /// merge old and new Align CDBs into the new one.
54   void SetMergeAlignmentCDBs( Bool_t value )
55   { fMergeAlignmentCDBs = value; }
56
57   /// field on alignment
58   void SetBFieldOn( Bool_t value )
59   {
60     fForceBField = kTRUE;
61     fBFieldOn = value;
62   }
63
64   /// run range
65   void SetRunRange( Int_t runNumberMin, Int_t runNumberMax )
66   {
67     fRunNumberMin = runNumberMin;
68     fRunNumberMax = runNumberMax;
69   }
70
71   /// use unbiased residuals
72   void SetUnbias(Bool_t value )
73   {
74     fUnbias = value;
75     if( fAlign ) fAlign->SetUnbias( value );
76   }
77
78   /// use unbiased residuals
79   Bool_t GetUnbias() const
80   { return fUnbias; }
81
82   //@}
83
84   /// output data
85   virtual void UserCreateOutputObjects();
86
87   /// per-event method
88   virtual void UserExec( Option_t* );
89   virtual void NotifyRun();
90
91   /// termination cleanup
92   virtual void Terminate( const Option_t* )
93   {}
94
95   /// end of task execution
96   virtual void FinishTaskOutput();
97
98   /// Set default ocdb
99   void SetDefaultStorage( TString defaultOCDB )
100   { fDefaultStorage = defaultOCDB; }
101
102   /// Set old (misaligned) alignment path for ocdb
103   void SetOldAlignStorage( TString oldalignOCDB )
104   { fOldAlignStorage = oldalignOCDB; }
105
106   /// Set new (realigned) alignment path for ocdb
107   void SetNewAlignStorage( TString newalignOCDB )
108   { fNewAlignStorage = newalignOCDB; }
109
110   /// Flag to set OCDB once at first run notify
111   void SetLoadOCDBOnce( Bool_t loadOCDBOnce = kTRUE )
112   { fLoadOCDBOnce = loadOCDBOnce; }
113
114   protected:
115
116   /// store misalignment matrices from OCDB into geometry transformer
117   void SaveMisAlignmentData( AliMUONGeometryTransformer* ) const;
118
119   private:
120
121   /// copy constructor, not implemented
122   AliMUONAlignmentTask(const AliMUONAlignmentTask& obj);
123
124   /// asignment operator, not implemented
125   AliMUONAlignmentTask& operator=(const AliMUONAlignmentTask& other);
126
127   ///@name flags
128   //@{
129
130   /// perform alignment from alignment records is true. Use ESD tracks otherwise
131   Bool_t fReadRecords;
132
133   /// write alignment records to AOD if true
134   Bool_t fWriteRecords;
135
136   /// perform alignment (from either tracks or records depending on fReadRecords)
137   Bool_t fDoAlignment;
138
139   /// merge old and new Align CDBs into the new one.
140   Bool_t fMergeAlignmentCDBs;
141
142   /// true if magnetic field was forced to value, instead of reading from GRP
143   Bool_t fForceBField;
144
145   /// Flag for Magnetic field On/Off
146   Bool_t fBFieldOn;
147
148   //! use unbiased residuals
149   Bool_t fUnbias;
150
151   //@}
152
153   /// The MUON alignment object
154   AliMUONAlignment *fAlign;
155
156   /// location of the default OCDB storage
157   TString fDefaultStorage;
158
159   /// location of the OCDB storage where to find old MUON/Align/Data (use the default one if empty)
160   TString fOldAlignStorage;
161
162   /// location of the OCDB storage where to put new MUON/Align/Data (use the default one if empty)
163   TString fNewAlignStorage;
164
165   /// geometry transformer used to recontruct the present data
166   AliMUONGeometryTransformer* fOldGeoTransformer;
167
168   /// new geometry transformer containing the new alignment to be applied
169   AliMUONGeometryTransformer* fNewGeoTransformer;
170
171   /// set to true if not willing to re-initialize OCDB at every new run
172   Bool_t fLoadOCDBOnce;
173
174   /// set to true when OCDB was loaded at least once
175   Bool_t fOCDBLoaded;
176
177   //! event number (internal counter)
178   Int_t fEvent;
179
180   /// Total number of track read
181   Int_t fTrackTot;
182
183   /// Number of tracks used for alignment
184   Int_t fTrackOk;
185
186   /// run range
187   Int_t fRunNumberMin;
188   Int_t fRunNumberMax;
189
190   /// Array of alignment parameters
191   Double_t fParameters[AliMUONAlignment::fNGlobal];
192
193   /// Array of alignment parameters errors
194   Double_t fErrors[AliMUONAlignment::fNGlobal];
195
196   /// Array of alignment parameters pulls
197   Double_t fPulls[AliMUONAlignment::fNGlobal];
198
199   /// list of track records
200   TClonesArray *fRecords;
201
202   /// number of records
203   Int_t fRecordCount;
204
205   ClassDef(AliMUONAlignmentTask, 3)
206
207 };
208
209 #endif