]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDcalibDB.h
Updated ideal geometry, including ACORDE
[u/mrichter/AliRoot.git] / TRD / AliTRDcalibDB.h
index fe986b707dbbf227058512ff88605f35ee53dafc..8ef6345c0986794982370657c1c008c91e90a2d1 100644 (file)
 
 /* $Id$ */
 
-#include <iostream>
 #include "TObject.h"
 
-#include "AliLog.h"
-#include "AliTRDgeometry.h"
+class AliCDBEntry;
 
-#include <AliCDBStorage.h>
-#include <AliCDBEntry.h>
+class AliTRDCalPID;
+class AliTRDCalMonitoring;
+class AliTRDCalROC;
+class AliTRDCalDet;
+class AliTRDCalSingleChamberStatus;
 
-class AliTRDCalPIDLQ;
+class AliTRDcalibDB : public TObject {
 
-class AliTRDcalibDB : public TObject
-{
-public:
-  enum { kNplan = 6, kNcham = 5, kNsect = 18, kNdet = 540 };
-  
-  static AliTRDcalibDB* Instance();
-  static void Terminate();
+ public:
 
-  void SetRun(Long64_t run);
-  
-  Bool_t GetChamberPos(Int_t det, Float_t* xyz);
-  Bool_t GetChamberPos(Int_t plane, Int_t chamber, Int_t sector, Float_t* xyz) { return GetChamberPos(AliTRDgeometry::GetDetector(plane, chamber, sector), xyz); }  
-  
-  Bool_t GetChamberRot(Int_t det, Float_t* xyz);
-  Bool_t GetChamberRot(Int_t plane, Int_t chamber, Int_t sector, Float_t* xyz) { return GetChamberRot(AliTRDgeometry::GetDetector(plane, chamber, sector), xyz); }  
-  
-  Bool_t GetStackPos(Int_t chamber, Int_t sector, Float_t* xyz);
-  Bool_t GetStackRot(Int_t chamber, Int_t sector, Float_t* xyz);
-   
-  Float_t GetVdrift(Int_t det, Int_t col, Int_t row);
-  Float_t GetVdrift(Int_t plane, Int_t chamber, Int_t sector, Int_t col, Int_t row) { return GetVdrift(AliTRDgeometry::GetDetector(plane, chamber, sector), col, row); }
-    
-  Float_t GetT0(Int_t det, Int_t col, Int_t row);
-  Float_t GetT0(Int_t plane, Int_t chamber, Int_t sector, Int_t col, Int_t row) { return GetT0(AliTRDgeometry::GetDetector(plane, chamber, sector), col, row); }
+  enum { kNplan =   6
+       , kNcham =   5
+       , kNsect =  18
+       , kNdet  = 540 };
   
-  Float_t GetGainFactor(Int_t det, Int_t col, Int_t row);
-  Float_t GetGainFactor(Int_t plane, Int_t chamber, Int_t sector, Int_t col, Int_t row) { return GetGainFactor(AliTRDgeometry::GetDetector(plane, chamber, sector), col, row); }
+  static AliTRDcalibDB               *Instance();
+  static void                         Terminate();
 
-  Float_t GetPRFWidth(Int_t det, Int_t col, Int_t row);
-  Float_t GetPRFWidth(Int_t plane, Int_t chamber, Int_t sector, Int_t col, Int_t row) { return GetPRFWidth(AliTRDgeometry::GetDetector(plane, chamber, sector), col, row); }
-  
-  Float_t GetSamplingFrequency(); 
-  Int_t GetNumberOfTimeBins();
-  
-  const AliTRDCalPIDLQ* GetPIDLQObject();
-  
-  //Related functions, these depend on calibration data
-  static Float_t GetOmegaTau(Float_t vdrift);
-  Int_t PadResponse(Double_t signal, Double_t dist, Int_t plane, Double_t *pad) const;
-  
-protected:
-  // for caching see also implentation of GetCachedCDBObject in the .cxx file
-  enum { kCDBCacheSize = 8 };   // Number of cached objects
-  enum { kIDVdrift = 0, kIDT0 = 1, kIDGainFactor = 2, kIDPRFWidth = 3, kIDGlobals = 4, 
-         kIDChamber = 5, kIDStack = 6, kIDPIDLQ = 7 };    // IDs of cached objects
+  void                                SetRun(Long64_t run);
+  Long64_t                            GetRun() const { return fRun; }
+
+  Float_t                             GetVdrift(Int_t det, Int_t col, Int_t row);
+  Float_t                             GetVdriftAverage(Int_t det);
+        AliTRDCalROC                 *GetVdriftROC(Int_t det);
+  const AliTRDCalDet                 *GetVdriftDet();
+
+  Float_t                             GetT0(Int_t det, Int_t col, Int_t row);
+  Float_t                             GetT0Average(Int_t det);
+        AliTRDCalROC                 *GetT0ROC(Int_t det);
+  const AliTRDCalDet                 *GetT0Det();
+
+  Float_t                             GetGainFactor(Int_t det, Int_t col, Int_t row);
+  Float_t                             GetGainFactorAverage(Int_t det);
+        AliTRDCalROC                 *GetGainFactorROC(Int_t det);
+  const AliTRDCalDet                 *GetGainFactorDet();
+
+        AliTRDCalROC                 *GetPRFROC(Int_t det);
+  Float_t                             GetPRFWidth(Int_t det, Int_t col, Int_t row);
+
+  Float_t*                            GetSampledPRF() { return fPRFsmp; };
+  Int_t                               GetPRFbin()     { return fPRFbin; };
+  Float_t                             GetPRFlo()      { return fPRFlo;  };
+  Float_t                             GetPRFhi()      { return fPRFhi;  };
+
+  Int_t                               GetNumberOfTimeBins();
+
+  Char_t                              GetPadStatus(Int_t det, Int_t col, Int_t row);
+        AliTRDCalSingleChamberStatus *GetPadStatusROC(Int_t det);
+
+  Char_t                              GetChamberStatus(Int_t det);
+
+  Bool_t                              IsPadMasked(Int_t det, Int_t col, Int_t row);
+  Bool_t                              IsPadBridgedLeft(Int_t det, Int_t col, Int_t row);
+  Bool_t                              IsPadBridgedRight(Int_t det, Int_t col, Int_t row);
+  Bool_t                              IsPadNotConnected(Int_t det, Int_t col, Int_t row);
   
-  const TObject* GetCachedCDBObject(Int_t id);
+  Bool_t                              IsChamberInstalled(Int_t det);
+  Bool_t                              IsChamberMasked(Int_t det);
+
+  const AliTRDCalMonitoring          *GetMonitoringObject();
+  const AliTRDCalPID                 *GetPIDObject(const Int_t method);
+
+  // Related functions, these depend on calibration data
+  static Float_t                      GetOmegaTau(Float_t vdrift, Float_t bz);
+         Int_t                        PadResponse(Double_t signal, Double_t dist
+                                                , Int_t plane, Double_t *pad) const;
   
-  void Invalidate();
-  void SamplePRF();
+ protected:
+
+  // For caching see also implentation of GetCachedCDBObject in the .cxx file
+  enum { kCDBCacheSize = 16 };   // Number of cached objects
+  enum { kIDVdriftPad = 0
+       , kIDVdriftChamber
+       , kIDT0Pad
+       , kIDT0Chamber
+       , kIDGainFactorPad
+       , kIDGainFactorChamber
+       , kIDPRFWidth
+       , kIDFEE
+       , kIDChamberPos
+       , kIDStackPos
+       , kIDSuperModulePos
+       , kIDPIDNN
+       , kIDPIDLQ
+       , kIDMonitoringData
+       , kIDChamberStatus
+       , kIDPadStatus };         // IDs of cached objects
+
+  const TObject *GetCachedCDBObject(Int_t id);
   
-  AliCDBEntry* GetCDBEntry(const char* cdbPath);
-  const TObject* CacheCDBEntry(Int_t id, const char* cdbPath);
-  const TObject* CacheMergeCDBEntry(Int_t id, const char* cdbPadPath, const char* cdbChamberPath);
+  void           Invalidate();
+  void           SamplePRF();
   
-  static AliTRDcalibDB* fgInstance;     // Instance of this class (singleton implementation)
-  static Bool_t fgTerminated;               // Defines if this class has already been terminated and therefore does not return instances in GetInstance anymore
+  AliCDBEntry   *GetCDBEntry(const Char_t *cdbPath);
+  const TObject *CacheCDBEntry(Int_t id, const Char_t *cdbPath);
 
-  AliCDBStorage* fLocator;                  // Storage locator retrieved from AliCDBManager
-  
-  AliCDBEntry* fCDBEntries[kCDBCacheSize];    // Cache for CDB entries 
-  TObject* fCDBCache[kCDBCacheSize];          // Cache for calibration objects.
-      
-  Long64_t fRun;
+  static AliTRDcalibDB *fgInstance;                 //  Instance of this class (singleton implementation)
+  static Bool_t         fgTerminated;               //  Defines if this class has already been terminated
+
+  AliCDBEntry          *fCDBEntries[kCDBCacheSize]; //  Cache for CDB entries
+  TObject              *fCDBCache[kCDBCacheSize];   //  Cache for calibration objects.
+
+  Long64_t              fRun;                       //  Run Number
   
-  struct 
-  {
-    Float_t             *fPRFsmp;                             //! Sampled pad response
-    Int_t                fPRFbin;                             //  Number of bins for the PRF
-    Float_t              fPRFlo;                              //  Lower boundary of the PRF
-    Float_t              fPRFhi;                              //  Higher boundary of the PRF
-    Float_t              fPRFwid;                             //  Bin width of the sampled PRF
-    Int_t                fPRFpad;                             //  Distance to next pad in PRF
-  } fPadResponse;
+  Float_t              *fPRFsmp;                    //! Sampled pad response
+  Int_t                 fPRFbin;                    //  Number of bins for the PRF
+  Float_t               fPRFlo;                     //  Lower boundary of the PRF
+  Float_t               fPRFhi;                     //  Higher boundary of the PRF
+  Float_t               fPRFwid;                    //  Bin width of the sampled PRF
+  Int_t                 fPRFpad;                    //  Distance to next pad in PRF
   
-private:
-  // this is a singleton, constructor is private!  
-  AliTRDcalibDB();
+ private:
+
+  AliTRDcalibDB();                                  //  This is a singleton, constructor is private!  
+  AliTRDcalibDB(const AliTRDcalibDB &c);   
+  AliTRDcalibDB &operator=(const AliTRDcalibDB &c); 
   virtual ~AliTRDcalibDB();
 
-  ClassDef(AliTRDcalibDB, 0)
+  ClassDef(AliTRDcalibDB,3)                         //  Provides central access to the CDB
+
 };
 
 #endif