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