]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - TRD/AliTRDcalibDB.h
Fix of TOF problem, Calculation of dEdx and PID during propagation to TOF, Writing...
[u/mrichter/AliRoot.git] / TRD / AliTRDcalibDB.h
... / ...
CommitLineData
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#include "TObject.h"
15
16class AliCDBEntry;
17
18class AliTRDCalPID;
19class AliTRDCalMonitoring;
20class AliTRDCalROC;
21class AliTRDCalDet;
22class AliTRDCalSingleChamberStatus;
23
24class AliTRDcalibDB : public TObject {
25
26 public:
27
28 enum { kNplan = 6
29 , kNcham = 5
30 , kNsect = 18
31 , kNdet = 540 };
32
33 static AliTRDcalibDB *Instance();
34 static void Terminate();
35
36 void SetRun(Long64_t run);
37 Long64_t GetRun() const { return fRun; }
38
39 Float_t GetVdrift(Int_t det, Int_t col, Int_t row);
40 Float_t GetVdriftAverage(Int_t det);
41 AliTRDCalROC *GetVdriftROC(Int_t det);
42 const AliTRDCalDet *GetVdriftDet();
43
44 Float_t GetT0(Int_t det, Int_t col, Int_t row);
45 Float_t GetT0Average(Int_t det);
46 AliTRDCalROC *GetT0ROC(Int_t det);
47 const AliTRDCalDet *GetT0Det();
48
49 Float_t GetGainFactor(Int_t det, Int_t col, Int_t row);
50 Float_t GetGainFactorAverage(Int_t det);
51 AliTRDCalROC *GetGainFactorROC(Int_t det);
52 const AliTRDCalDet *GetGainFactorDet();
53
54 AliTRDCalROC *GetPRFROC(Int_t det);
55 Float_t GetPRFWidth(Int_t det, Int_t col, Int_t row);
56
57 Int_t GetNumberOfTimeBins();
58
59 Char_t GetPadStatus(Int_t det, Int_t col, Int_t row);
60 AliTRDCalSingleChamberStatus *GetPadStatusROC(Int_t det);
61
62 Char_t GetChamberStatus(Int_t det);
63
64 Bool_t IsPadMasked(Int_t det, Int_t col, Int_t row);
65 Bool_t IsPadBridgedLeft(Int_t det, Int_t col, Int_t row);
66 Bool_t IsPadBridgedRight(Int_t det, Int_t col, Int_t row);
67
68 Bool_t IsChamberInstalled(Int_t det);
69 Bool_t IsChamberMasked(Int_t det);
70
71 const AliTRDCalMonitoring *GetMonitoringObject();
72 const AliTRDCalPID *GetPIDObject(const Int_t method);
73
74 // Related functions, these depend on calibration data
75 static Float_t GetOmegaTau(Float_t vdrift, Float_t bz);
76 Int_t PadResponse(Double_t signal, Double_t dist
77 , Int_t plane, Double_t *pad) const;
78
79 protected:
80
81 // For caching see also implentation of GetCachedCDBObject in the .cxx file
82 enum { kCDBCacheSize = 16 }; // Number of cached objects
83 enum { kIDVdriftPad = 0
84 , kIDVdriftChamber
85 , kIDT0Pad
86 , kIDT0Chamber
87 , kIDGainFactorPad
88 , kIDGainFactorChamber
89 , kIDPRFWidth
90 , kIDFEE
91 , kIDChamberPos
92 , kIDStackPos
93 , kIDSuperModulePos
94 , kIDPIDNN
95 , kIDPIDLQ
96 , kIDMonitoringData
97 , kIDChamberStatus
98 , kIDPadStatus }; // IDs of cached objects
99
100 const TObject *GetCachedCDBObject(Int_t id);
101
102 void Invalidate();
103 void SamplePRF();
104
105 AliCDBEntry *GetCDBEntry(const Char_t *cdbPath);
106 const TObject *CacheCDBEntry(Int_t id, const Char_t *cdbPath);
107
108 static AliTRDcalibDB *fgInstance; // Instance of this class (singleton implementation)
109 static Bool_t fgTerminated; // Defines if this class has already been terminated
110
111 AliCDBEntry *fCDBEntries[kCDBCacheSize]; // Cache for CDB entries
112 TObject *fCDBCache[kCDBCacheSize]; // Cache for calibration objects.
113
114 Long64_t fRun; // Run Number
115
116 Float_t *fPRFsmp; //! Sampled pad response
117 Int_t fPRFbin; // Number of bins for the PRF
118 Float_t fPRFlo; // Lower boundary of the PRF
119 Float_t fPRFhi; // Higher boundary of the PRF
120 Float_t fPRFwid; // Bin width of the sampled PRF
121 Int_t fPRFpad; // Distance to next pad in PRF
122
123 private:
124
125 AliTRDcalibDB(); // This is a singleton, constructor is private!
126 AliTRDcalibDB(const AliTRDcalibDB &c);
127 AliTRDcalibDB &operator=(const AliTRDcalibDB &c);
128 virtual ~AliTRDcalibDB();
129
130 ClassDef(AliTRDcalibDB,3) // Provides central access to the CDB
131
132};
133
134#endif