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 */
9 /// \class AliMUONAlignmentTask
10 /// \brief Task to align the muon spectrometer
12 // Author Javier Castillo, CEA/Saclay - Irfu/SPhN
14 #include "AliAnalysisTaskSE.h"
15 #include "AliMUONAlignment.h"
19 class AliMUONGeometryTransformer;
21 class AliMUONAlignmentTask : public AliAnalysisTaskSE
27 AliMUONAlignmentTask( const char *name = "AliMUONAlignmentTask" );
30 virtual ~AliMUONAlignmentTask();
32 /// get pointer to alignment class
33 AliMUONAlignment* alignment( void ) const
36 virtual void LocalInit();
41 /// perform alignment from alignment records is true. Use ESD tracks otherwise
42 void SetReadRecords( Bool_t value = kTRUE )
43 { fReadRecords = value; }
45 /// write alignment records to AOD if true
46 void SetWriteRecords( Bool_t value = kTRUE )
47 { fWriteRecords = value; }
49 /// perform alignment (from either tracks or records depending on fReadRecords)
50 void SetDoAlignment( Bool_t value )
51 { fDoAlignment = value; }
53 /// merge old and new Align CDBs into the new one.
54 void SetMergeAlignmentCDBs( Bool_t value )
55 { fMergeAlignmentCDBs = value; }
57 /// field on alignment
58 void SetBFieldOn( Bool_t value )
65 void SetRunRange( Int_t runNumberMin, Int_t runNumberMax )
67 fRunNumberMin = runNumberMin;
68 fRunNumberMax = runNumberMax;
71 /// use unbiased residuals
72 void SetUnbias(Bool_t value )
75 if( fAlign ) fAlign->SetUnbias( value );
78 /// use unbiased residuals
79 Bool_t GetUnbias() const
85 virtual void UserCreateOutputObjects();
88 virtual void UserExec( Option_t* );
89 virtual void NotifyRun();
91 /// termination cleanup
92 virtual void Terminate( const Option_t* )
95 /// end of task execution
96 virtual void FinishTaskOutput();
99 void SetDefaultStorage( TString defaultOCDB )
100 { fDefaultStorage = defaultOCDB; }
102 /// Set old (misaligned) alignment path for ocdb
103 void SetOldAlignStorage( TString oldalignOCDB )
104 { fOldAlignStorage = oldalignOCDB; }
106 /// Set new (realigned) alignment path for ocdb
107 void SetNewAlignStorage( TString newalignOCDB )
108 { fNewAlignStorage = newalignOCDB; }
110 /// Flag to set OCDB once at first run notify
111 void SetLoadOCDBOnce( Bool_t loadOCDBOnce = kTRUE )
112 { fLoadOCDBOnce = loadOCDBOnce; }
116 /// store misalignment matrices from OCDB into geometry transformer
117 void SaveMisAlignmentData( AliMUONGeometryTransformer* ) const;
121 /// copy constructor, not implemented
122 AliMUONAlignmentTask(const AliMUONAlignmentTask& obj);
124 /// asignment operator, not implemented
125 AliMUONAlignmentTask& operator=(const AliMUONAlignmentTask& other);
130 /// perform alignment from alignment records is true. Use ESD tracks otherwise
133 /// write alignment records to AOD if true
134 Bool_t fWriteRecords;
136 /// perform alignment (from either tracks or records depending on fReadRecords)
139 /// merge old and new Align CDBs into the new one.
140 Bool_t fMergeAlignmentCDBs;
142 /// true if magnetic field was forced to value, instead of reading from GRP
145 /// Flag for Magnetic field On/Off
148 //! use unbiased residuals
153 /// The MUON alignment object
154 AliMUONAlignment *fAlign;
156 /// location of the default OCDB storage
157 TString fDefaultStorage;
159 /// location of the OCDB storage where to find old MUON/Align/Data (use the default one if empty)
160 TString fOldAlignStorage;
162 /// location of the OCDB storage where to put new MUON/Align/Data (use the default one if empty)
163 TString fNewAlignStorage;
165 /// geometry transformer used to recontruct the present data
166 AliMUONGeometryTransformer* fOldGeoTransformer;
168 /// new geometry transformer containing the new alignment to be applied
169 AliMUONGeometryTransformer* fNewGeoTransformer;
171 /// set to true if not willing to re-initialize OCDB at every new run
172 Bool_t fLoadOCDBOnce;
174 /// set to true when OCDB was loaded at least once
177 //! event number (internal counter)
180 /// Total number of track read
183 /// Number of tracks used for alignment
190 /// Array of alignment parameters
191 Double_t fParameters[AliMUONAlignment::fNGlobal];
193 /// Array of alignment parameters errors
194 Double_t fErrors[AliMUONAlignment::fNGlobal];
196 /// Array of alignment parameters pulls
197 Double_t fPulls[AliMUONAlignment::fNGlobal];
199 /// list of track records
200 TClonesArray *fRecords;
202 /// number of records
205 ClassDef(AliMUONAlignmentTask, 3)