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
13 /// \author Hugo Pereira Da Costa, CEA/Saclay - Irfu/SPhN
15 #include "AliAnalysisTaskSE.h"
16 #include "AliMUONAlignment.h"
20 class AliMUONGeometryTransformer;
22 class AliMUONAlignmentTask : public AliAnalysisTaskSE
28 AliMUONAlignmentTask( const char *name = "AliMUONAlignmentTask" );
31 virtual ~AliMUONAlignmentTask();
33 /// get pointer to alignment class
34 AliMUONAlignment* alignment( void ) const
37 virtual void LocalInit();
42 /// perform alignment from alignment records is true. Use ESD tracks otherwise
43 void SetReadRecords( Bool_t value = kTRUE )
44 { fReadRecords = value; }
46 /// write alignment records to AOD if true
47 void SetWriteRecords( Bool_t value = kTRUE )
48 { fWriteRecords = value; }
50 /// perform alignment (from either tracks or records depending on fReadRecords)
51 void SetDoAlignment( Bool_t value )
52 { fDoAlignment = value; }
54 /// merge old and new Align CDBs into the new one.
55 void SetMergeAlignmentCDBs( Bool_t value )
56 { fMergeAlignmentCDBs = value; }
58 /// field on alignment
59 void SetBFieldOn( Bool_t value )
66 void SetRunRange( Int_t runNumberMin, Int_t runNumberMax )
68 fRunNumberMin = runNumberMin;
69 fRunNumberMax = runNumberMax;
75 virtual void UserCreateOutputObjects();
78 virtual void UserExec( Option_t* );
79 virtual void NotifyRun();
81 /// termination cleanup
82 virtual void Terminate( const Option_t* )
85 /// end of task execution
86 virtual void FinishTaskOutput();
89 void SetDefaultStorage( TString defaultOCDB )
90 { fDefaultStorage = defaultOCDB; }
92 /// Set old (misaligned) alignment path for ocdb
93 void SetOldAlignStorage( TString oldalignOCDB )
94 { fOldAlignStorage = oldalignOCDB; }
96 /// Set new (realigned) alignment path for ocdb
97 void SetNewAlignStorage( TString newalignOCDB )
98 { fNewAlignStorage = newalignOCDB; }
100 /// Flag to set OCDB once at first run notify
101 void SetLoadOCDBOnce( Bool_t loadOCDBOnce = kTRUE )
102 { fLoadOCDBOnce = loadOCDBOnce; }
106 /// store misalignment matrices from OCDB into geometry transformer
107 void SaveMisAlignmentData( AliMUONGeometryTransformer* ) const;
111 /// copy constructor, not implemented
112 AliMUONAlignmentTask(const AliMUONAlignmentTask& obj);
114 /// asignment operator, not implemented
115 AliMUONAlignmentTask& operator=(const AliMUONAlignmentTask& other);
120 /// perform alignment from alignment records is true. Use ESD tracks otherwise
123 /// write alignment records to AOD if true
124 Bool_t fWriteRecords;
126 /// perform alignment (from either tracks or records depending on fReadRecords)
129 /// merge old and new Align CDBs into the new one.
130 Bool_t fMergeAlignmentCDBs;
132 /// true if magnetic field was forced to value, instead of reading from GRP
135 /// Flag for Magnetic field On/Off
140 /// The MUON alignment object
141 AliMUONAlignment *fAlign;
143 /// location of the default OCDB storage
144 TString fDefaultStorage;
146 /// location of the OCDB storage where to find old MUON/Align/Data (use the default one if empty)
147 TString fOldAlignStorage;
149 /// location of the OCDB storage where to put new MUON/Align/Data (use the default one if empty)
150 TString fNewAlignStorage;
152 /// geometry transformer used to recontruct the present data
153 AliMUONGeometryTransformer* fOldGeoTransformer;
155 /// new geometry transformer containing the new alignment to be applied
156 AliMUONGeometryTransformer* fNewGeoTransformer;
158 /// set to true if not willing to re-initialize OCDB at every new run
159 Bool_t fLoadOCDBOnce;
161 /// set to true when OCDB was loaded at least once
164 //! event number (internal counter)
167 /// Total number of track read
170 /// Number of tracks used for alignment
177 /// Array of alignment parameters
178 Double_t fParameters[AliMUONAlignment::fNGlobal];
180 /// Array of alignment parameters errors
181 Double_t fErrors[AliMUONAlignment::fNGlobal];
183 /// Array of alignment parameters pulls
184 Double_t fPulls[AliMUONAlignment::fNGlobal];
186 /// list of track records
187 TClonesArray *fRecords;
189 /// number of records
192 ClassDef(AliMUONAlignmentTask, 3)