]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONAlignmentTask.h
Include intermediate radii for Rcoh, include all partial builds
[u/mrichter/AliRoot.git] / MUON / AliMUONAlignmentTask.h
index 6c9bcc437c512bc5038cc345f709a3c817110c2c..4c9f631b02435e059952a3d34b1ce681bcaea500 100644 (file)
 #ifndef ALIMUONALIGNMENTTASK_H
 #define ALIMUONALIGNMENTTASK_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+* See cxx source for full Copyright notice                               */
 
-/// \ingroup ""
+// $Id$
+
+/// \ingroup calign
 /// \class AliMUONAlignmentTask
 /// \brief Task to align the muon spectrometer
 ///
-//  Author Javier Castillo, CEA/Saclay - Irfu/SPhN
+/// \author Javier Castillo, CEA/Saclay - Irfu/SPhN
+/// \author Hugo Pereira Da Costa, CEA/Saclay - Irfu/SPhN
 
-class TList;
-class TGraphErrors;
-class AliESDEvent;
-class AliMUONAlignment;
-class AliMUONGeoemetryTransformer;
+#include "AliAnalysisTaskSE.h"
+#include "AliMUONAlignment.h"
 
-#include "AliAnalysisTask.h"
+class TString;
+class TClonesArray;
+class AliMUONGeometryTransformer;
 
-class AliMUONAlignmentTask : public AliAnalysisTask {
- public:
-  //  AliMUONAlignmentTask(const char *name = "AliMUONAlignmentTask");
-  AliMUONAlignmentTask(const char *name = "AliMUONAlignmentTask", const char *geofilename = "geometry.root");
-  AliMUONAlignmentTask(const AliMUONAlignmentTask& obj);
-  AliMUONAlignmentTask& operator=(const AliMUONAlignmentTask& other); 
+class AliMUONAlignmentTask : public AliAnalysisTaskSE
+{
+
+  public:
+
+  /// constructor
+  AliMUONAlignmentTask( const char *name = "AliMUONAlignmentTask" );
+
+  /// destructor
   virtual ~AliMUONAlignmentTask();
-  
-  virtual void   LocalInit();
-  virtual void   ConnectInputData(Option_t *);
-  virtual void   CreateOutputObjects();
-  virtual void   Exec(Option_t *option);
-  virtual void   Terminate(const Option_t*);
-  
- private:
-  AliESDEvent *fESD;                      //!< ESD object
-
-  AliMUONAlignment *fAlign;               ///< The MUON alignment object
-    TString fGeoFilename;                 ///< Geometry file name
-  AliMUONGeometryTransformer *fTransform; ///< MUON geometry transformer
-    
-  Int_t fTrackTot;             ///< Number of track read 
-  Int_t fTrackOk;              ///< Number of track read 
-
-  Double_t fParameters[4*156]; ///< Array of alignment parameters
-  Double_t fErrors[4*156];     ///< Array of alignment parameters errors
-  Double_t fPulls[4*156];      ///< Array of alignment parameters pulls
-
-  TGraphErrors *fMSDEx ;   ///< Graph of translations along x
-  TGraphErrors *fMSDEy ;   ///< Graph of translations along y
-  TGraphErrors *fMSDEz ;   ///< Graph of translations along z
-  TGraphErrors *fMSDEp;    ///< Graph of rotation about z 
-
-  TList   *fList;          ///< list of graphs
-   
-  ClassDef(AliMUONAlignmentTask, 1); // example of analysis
+
+  /// get pointer to alignment class
+  AliMUONAlignment* alignment( void ) const
+  { return fAlign; }
+
+  virtual void LocalInit();
+
+  ///@name flags
+  //@{
+
+  /// perform alignment from alignment records is true. Use ESD tracks otherwise
+  void SetReadRecords( Bool_t value = kTRUE )
+  { fReadRecords = value; }
+
+  /// write alignment records to AOD if true
+  void SetWriteRecords( Bool_t value = kTRUE )
+  { fWriteRecords = value; }
+
+  /// perform alignment (from either tracks or records depending on fReadRecords)
+  void SetDoAlignment( Bool_t value )
+  { fDoAlignment = value; }
+
+  /// merge old and new Align CDBs into the new one.
+  void SetMergeAlignmentCDBs( Bool_t value )
+  { fMergeAlignmentCDBs = value; }
+
+  /// field on alignment
+  void SetBFieldOn( Bool_t value )
+  {
+    fForceBField = kTRUE;
+    fBFieldOn = value;
+  }
+
+  /// run range
+  void SetRunRange( Int_t runNumberMin, Int_t runNumberMax )
+  {
+    fRunNumberMin = runNumberMin;
+    fRunNumberMax = runNumberMax;
+  }
+
+  //@}
+
+  /// output data
+  virtual void UserCreateOutputObjects();
+
+  /// per-event method
+  virtual void UserExec( Option_t* );
+  virtual void NotifyRun();
+
+  /// termination cleanup
+  virtual void Terminate( const Option_t* )
+  {}
+
+  /// end of task execution
+  virtual void FinishTaskOutput();
+
+  /// Set default ocdb
+  void SetDefaultStorage( TString defaultOCDB )
+  { fDefaultStorage = defaultOCDB; }
+
+  /// Set old (misaligned) alignment path for ocdb
+  void SetOldAlignStorage( TString oldalignOCDB )
+  { fOldAlignStorage = oldalignOCDB; }
+
+  /// Set new (realigned) alignment path for ocdb
+  void SetNewAlignStorage( TString newalignOCDB )
+  { fNewAlignStorage = newalignOCDB; }
+
+  /// Flag to set OCDB once at first run notify
+  void SetLoadOCDBOnce( Bool_t loadOCDBOnce = kTRUE )
+  { fLoadOCDBOnce = loadOCDBOnce; }
+
+  protected:
+
+  /// store misalignment matrices from OCDB into geometry transformer
+  void SaveMisAlignmentData( AliMUONGeometryTransformer* ) const;
+
+  private:
+
+  /// copy constructor, not implemented
+  AliMUONAlignmentTask(const AliMUONAlignmentTask& obj);
+
+  /// asignment operator, not implemented
+  AliMUONAlignmentTask& operator=(const AliMUONAlignmentTask& other);
+
+  ///@name flags
+  //@{
+
+  /// perform alignment from alignment records is true. Use ESD tracks otherwise
+  Bool_t fReadRecords;
+
+  /// write alignment records to AOD if true
+  Bool_t fWriteRecords;
+
+  /// perform alignment (from either tracks or records depending on fReadRecords)
+  Bool_t fDoAlignment;
+
+  /// merge old and new Align CDBs into the new one.
+  Bool_t fMergeAlignmentCDBs;
+
+  /// true if magnetic field was forced to value, instead of reading from GRP
+  Bool_t fForceBField;
+
+  /// Flag for Magnetic field On/Off
+  Bool_t fBFieldOn;
+
+  //@}
+
+  /// The MUON alignment object
+  AliMUONAlignment *fAlign;
+
+  /// location of the default OCDB storage
+  TString fDefaultStorage;
+
+  /// location of the OCDB storage where to find old MUON/Align/Data (use the default one if empty)
+  TString fOldAlignStorage;
+
+  /// location of the OCDB storage where to put new MUON/Align/Data (use the default one if empty)
+  TString fNewAlignStorage;
+
+  /// geometry transformer used to recontruct the present data
+  AliMUONGeometryTransformer* fOldGeoTransformer;
+
+  /// new geometry transformer containing the new alignment to be applied
+  AliMUONGeometryTransformer* fNewGeoTransformer;
+
+  /// set to true if not willing to re-initialize OCDB at every new run
+  Bool_t fLoadOCDBOnce;
+
+  /// set to true when OCDB was loaded at least once
+  Bool_t fOCDBLoaded;
+
+  //! event number (internal counter)
+  Int_t fEvent;
+
+  /// Total number of track read
+  Int_t fTrackTot;
+
+  /// Number of tracks used for alignment
+  Int_t fTrackOk;
+
+  /// run range
+  Int_t fRunNumberMin;
+  Int_t fRunNumberMax;
+
+  /// Array of alignment parameters
+  Double_t fParameters[AliMUONAlignment::fNGlobal];
+
+  /// Array of alignment parameters errors
+  Double_t fErrors[AliMUONAlignment::fNGlobal];
+
+  /// Array of alignment parameters pulls
+  Double_t fPulls[AliMUONAlignment::fNGlobal];
+
+  /// list of track records
+  TClonesArray *fRecords;
+
+  /// number of records
+  Int_t fRecordCount;
+
+  ClassDef(AliMUONAlignmentTask, 3)
+
 };
 
 #endif
-