]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDcalibDB.h
Change one info msg
[u/mrichter/AliRoot.git] / TRD / AliTRDcalibDB.h
1 #ifndef ALITRDCALIBDB_H
2 #define ALITRDCALIBDB_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 ///////////////////////////////////////////////////////////////////////////////
7 //                                                                           //
8 // Class providing the calibration parameters by accessing the CDB           //
9 //                                                                           //
10 ///////////////////////////////////////////////////////////////////////////////
11
12 /* $Id$ */
13
14 #ifndef ROOT_TObject
15 #include "TObject.h"
16 #endif
17
18 #ifndef ALITRDPIDUTIL_H
19 #include "AliTRDpidUtil.h"
20 #endif
21
22 #ifndef ALITRDPIDRESPONSE_H
23 #include "AliTRDPIDResponse.h"
24 #endif
25
26 class TString;
27
28 class AliCDBEntry;
29
30 class AliTRDrecoParam;
31 class AliTRDCalTrkAttach;
32 class AliTRDCalPID;
33 class AliTRDCalMonitoring;
34 class AliTRDCalROC;
35 class AliTRDCalDet;
36 class AliTRDCalSingleChamberStatus;
37 class AliTRDCalOnlineGainTableROC;
38
39 class AliTRDcalibDB : public TObject {
40
41  public:
42
43   enum { kNlayer  =   6
44        , kNstack  =   5
45        , kNsector =  18
46        , kNdet    = 540 };
47   
48   static AliTRDcalibDB               *Instance();
49   static void                         Terminate();
50
51   void                                SetRun(Long64_t run);
52   Long64_t                            GetRun() const { return fRun; }
53
54   Float_t                             GetNoise(Int_t det, Int_t col, Int_t row);
55         AliTRDCalROC                 *GetNoiseROC(Int_t det);
56   const AliTRDCalDet                 *GetNoiseDet();
57
58   Float_t                             GetVdrift(Int_t det, Int_t col, Int_t row);
59   Float_t                             GetVdriftAverage(Int_t det);
60         AliTRDCalROC                 *GetVdriftROC(Int_t det);
61   const AliTRDCalDet                 *GetVdriftDet();
62
63   Float_t                             GetT0(Int_t det, Int_t col, Int_t row);
64   Float_t                             GetT0Average(Int_t det);
65         AliTRDCalROC                 *GetT0ROC(Int_t det);
66   const AliTRDCalDet                 *GetT0Det();
67
68   Float_t                             GetGainFactor(Int_t det, Int_t col, Int_t row);
69   Float_t                             GetGainFactorAverage(Int_t det);
70   AliTRDCalROC                       *GetGainFactorROC(Int_t det);
71   const AliTRDCalDet                 *GetGainFactorDet();
72
73   Float_t                             GetOnlineGainFactor(Int_t det, Int_t col, Int_t row);
74   AliTRDCalOnlineGainTableROC        *GetOnlineGainTableROC(Int_t det);
75
76   AliTRDCalROC                       *GetPRFROC(Int_t det);
77   Float_t                             GetPRFWidth(Int_t det, Int_t col, Int_t row);
78
79   Float_t*                            GetSampledPRF() const { return fPRFsmp; };
80   Int_t                               GetPRFbin() const     { return fPRFbin; };
81   Float_t                             GetPRFlo() const      { return fPRFlo;  };
82   Float_t                             GetPRFhi() const      { return fPRFhi;  };
83
84   Int_t                               GetNumberOfTimeBinsDCS();
85   void                                GetFilterType(TString &filterType);
86   void                                GetGlobalConfiguration(TString &config);
87
88   Int_t                               GetOnlineGainTableID();
89
90   Bool_t                              HasOnlineFilterPedestal();
91   Bool_t                              HasOnlineFilterGain();
92   Bool_t                              HasOnlineTailCancellation();
93
94   Char_t                              GetPadStatus(Int_t det, Int_t col, Int_t row);
95   AliTRDCalSingleChamberStatus       *GetPadStatusROC(Int_t det);
96   AliTRDrecoParam*                    GetRecoParam(Int_t *eventtype);
97   AliTRDPIDResponse                  *GetPIDResponse(AliTRDPIDResponse::ETRDPIDMethod m);
98
99   Char_t                              GetChamberStatus(Int_t det);
100
101   Bool_t                              IsPadMasked(Int_t det, Int_t col, Int_t row);
102   Bool_t                              IsPadBridgedLeft(Int_t det, Int_t col, Int_t row);
103   Bool_t                              IsPadBridgedRight(Int_t det, Int_t col, Int_t row);
104   Bool_t                              IsPadNotConnected(Int_t det, Int_t col, Int_t row);
105   
106   Bool_t                              IsChamberInstalled(Int_t det);
107   Bool_t                              IsChamberMasked(Int_t det);
108   Bool_t                              IsHalfChamberMasked(Int_t det, Int_t side);
109
110   const AliTRDCalMonitoring          *GetMonitoringObject();
111   const AliTRDCalPID                 *GetPIDObject(AliTRDpidUtil::ETRDPIDMethod m);
112   const AliTRDCalTrkAttach           *GetAttachObject();
113
114   // Related functions, these depend on calibration data
115   Int_t                               PadResponse(Double_t signal, Double_t dist
116                                                 , Int_t layer, Double_t *pad) const;
117
118  protected:
119
120   // For caching see also implentation of GetCachedCDBObject in the .cxx file
121   enum { kIDVdriftPad = 0
122        , kIDVdriftChamber
123        , kIDT0Pad
124        , kIDT0Chamber
125        , kIDGainFactorPad
126        , kIDGainFactorChamber
127        , kIDOnlineGainFactor
128        , kIDNoiseChamber
129        , kIDNoisePad
130        , kIDPRFWidth
131        , kIDFEE
132        , kIDChamberPos
133        , kIDStackPos
134        , kIDSuperModulePos
135        , kIDPIDNN
136        , kIDPIDLQ
137        , kIDPIDLQ1D
138        , kIDRecoParam
139        , kIDMonitoringData
140        , kIDChamberStatus
141        , kIDPadStatus
142        , kIDDCS
143        , kIDAttach
144        , kCDBCacheSize };         // IDs of cached objects
145
146   const TObject *GetCachedCDBObject(Int_t id);
147   
148   void           Invalidate();
149   void           SamplePRF();
150   
151   AliCDBEntry   *GetCDBEntry(const Char_t *cdbPath);
152   const TObject *CacheCDBEntry(Int_t id, const Char_t *cdbPath);
153
154   static AliTRDcalibDB *fgInstance;                 //  Instance of this class (singleton implementation)
155   static Bool_t         fgTerminated;               //  Defines if this class has already been terminated
156
157   AliCDBEntry          *fCDBEntries[kCDBCacheSize]; //  Cache for CDB entries
158   TObject              *fCDBCache[kCDBCacheSize];   //  Cache for calibration objects.
159
160   Long64_t              fRun;                       //  Run Number
161
162   Float_t              *fPRFsmp;                    //! Sampled pad response
163   Int_t                 fPRFbin;                    //  Number of bins for the PRF
164   Float_t               fPRFlo;                     //  Lower boundary of the PRF
165   Float_t               fPRFhi;                     //  Higher boundary of the PRF
166   Float_t               fPRFwid;                    //  Bin width of the sampled PRF
167   Int_t                 fPRFpad;                    //  Distance to next pad in PRF
168
169   AliTRDPIDResponse    *fPIDResponse;               //  TRD PID Response function
170
171   Int_t                 fOnlineGainTableID;         //  ID for online gain table 
172   
173  private:
174
175   AliTRDcalibDB();                                  //  This is a singleton, constructor is private!  
176   AliTRDcalibDB(const AliTRDcalibDB &c);   
177   AliTRDcalibDB &operator=(const AliTRDcalibDB &c); 
178   virtual ~AliTRDcalibDB();
179
180   ClassDef(AliTRDcalibDB, 7)                        //  Provides central access to the CDB
181
182 };
183
184 #endif
185