]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/AliTRDcalibDB.h
More Coverity stuff ..
[u/mrichter/AliRoot.git] / TRD / AliTRDcalibDB.h
CommitLineData
3551db50 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
4ba1d6ae 14#ifndef ROOT_TObject
3551db50 15#include "TObject.h"
4ba1d6ae 16#endif
17
0d83b3a5 18#ifndef ALITRDPIDUTIL_H
19#include "AliTRDpidUtil.h"
4ba1d6ae 20#endif
3551db50 21
2745a409 22class AliCDBEntry;
3551db50 23
0d83b3a5 24class AliTRDrecoParam;
720a0a16 25class AliTRDCalPID;
7754cd1f 26class AliTRDCalMonitoring;
56178ff4 27class AliTRDCalROC;
28class AliTRDCalDet;
0e09df31 29class AliTRDCalSingleChamberStatus;
e232d349 30class TString;
2745a409 31class AliTRDcalibDB : public TObject {
32
33 public:
34
053767a4 35 enum { kNlayer = 6
36 , kNstack = 5
37 , kNsector = 18
38 , kNdet = 540 };
6a739e92 39
0e09df31 40 static AliTRDcalibDB *Instance();
41 static void Terminate();
3551db50 42
0e09df31 43 void SetRun(Long64_t run);
44 Long64_t GetRun() const { return fRun; }
7754cd1f 45
df83a620 46 Float_t GetNoise(Int_t det, Int_t col, Int_t row);
47 AliTRDCalROC *GetNoiseROC(Int_t det);
48 const AliTRDCalDet *GetNoiseDet();
49
0e09df31 50 Float_t GetVdrift(Int_t det, Int_t col, Int_t row);
51 Float_t GetVdriftAverage(Int_t det);
52 AliTRDCalROC *GetVdriftROC(Int_t det);
53 const AliTRDCalDet *GetVdriftDet();
7754cd1f 54
0e09df31 55 Float_t GetT0(Int_t det, Int_t col, Int_t row);
56 Float_t GetT0Average(Int_t det);
57 AliTRDCalROC *GetT0ROC(Int_t det);
58 const AliTRDCalDet *GetT0Det();
7754cd1f 59
0e09df31 60 Float_t GetGainFactor(Int_t det, Int_t col, Int_t row);
61 Float_t GetGainFactorAverage(Int_t det);
4ba1d6ae 62 AliTRDCalROC *GetGainFactorROC(Int_t det);
0e09df31 63 const AliTRDCalDet *GetGainFactorDet();
3551db50 64
4ba1d6ae 65 AliTRDCalROC *GetPRFROC(Int_t det);
0e09df31 66 Float_t GetPRFWidth(Int_t det, Int_t col, Int_t row);
7754cd1f 67
be28462a 68 Float_t* GetSampledPRF() const { return fPRFsmp; };
69 Int_t GetPRFbin() const { return fPRFbin; };
70 Float_t GetPRFlo() const { return fPRFlo; };
71 Float_t GetPRFhi() const { return fPRFhi; };
fa7427d0 72
e232d349 73 Int_t GetNumberOfTimeBinsDCS();
74 void GetFilterType(TString &filterType);
af086c5e 75 void GetGlobalConfiguration(TString &config);
76 Bool_t HasOnlineFilterPedestal();
77 Bool_t HasOnlineFilterGain();
78 Bool_t HasOnlineTailCancellation();
7754cd1f 79
0e09df31 80 Char_t GetPadStatus(Int_t det, Int_t col, Int_t row);
4ba1d6ae 81 AliTRDCalSingleChamberStatus *GetPadStatusROC(Int_t det);
a7ac01d2 82 AliTRDrecoParam* GetRecoParam(Int_t *eventtype);
7754cd1f 83
0e09df31 84 Char_t GetChamberStatus(Int_t det);
85
86 Bool_t IsPadMasked(Int_t det, Int_t col, Int_t row);
87 Bool_t IsPadBridgedLeft(Int_t det, Int_t col, Int_t row);
88 Bool_t IsPadBridgedRight(Int_t det, Int_t col, Int_t row);
fa7427d0 89 Bool_t IsPadNotConnected(Int_t det, Int_t col, Int_t row);
3551db50 90
0e09df31 91 Bool_t IsChamberInstalled(Int_t det);
92 Bool_t IsChamberMasked(Int_t det);
7a6352a6 93 Bool_t IsHalfChamberMasked(Int_t det, Int_t side);
7754cd1f 94
0e09df31 95 const AliTRDCalMonitoring *GetMonitoringObject();
0d83b3a5 96 const AliTRDCalPID *GetPIDObject(AliTRDpidUtil::ETRDPIDMethod m);
7754cd1f 97
2745a409 98 // Related functions, these depend on calibration data
0e09df31 99 Int_t PadResponse(Double_t signal, Double_t dist
053767a4 100 , Int_t layer, Double_t *pad) const;
543691ea 101
2745a409 102 protected:
103
104 // For caching see also implentation of GetCachedCDBObject in the .cxx file
913950a4 105 enum { kCDBCacheSize = 20 }; // Number of cached objects
b43a3e17 106 enum { kIDVdriftPad = 0
107 , kIDVdriftChamber
108 , kIDT0Pad
109 , kIDT0Chamber
110 , kIDGainFactorPad
111 , kIDGainFactorChamber
df83a620 112 , kIDNoiseChamber
113 , kIDNoisePad
b43a3e17 114 , kIDPRFWidth
aa617684 115 , kIDFEE
b43a3e17 116 , kIDChamberPos
117 , kIDStackPos
118 , kIDSuperModulePos
44dbae42 119 , kIDPIDNN
b43a3e17 120 , kIDPIDLQ
a7ac01d2 121 , kIDRecoParam
b43a3e17 122 , kIDMonitoringData
123 , kIDChamberStatus
913950a4 124 , kIDPadStatus
125 , kIDDCS }; // IDs of cached objects
7754cd1f 126
56178ff4 127 const TObject *GetCachedCDBObject(Int_t id);
3551db50 128
2745a409 129 void Invalidate();
130 void SamplePRF();
6a739e92 131
b43a3e17 132 AliCDBEntry *GetCDBEntry(const Char_t *cdbPath);
133 const TObject *CacheCDBEntry(Int_t id, const Char_t *cdbPath);
7754cd1f 134
2745a409 135 static AliTRDcalibDB *fgInstance; // Instance of this class (singleton implementation)
136 static Bool_t fgTerminated; // Defines if this class has already been terminated
6d50f529 137
2745a409 138 AliCDBEntry *fCDBEntries[kCDBCacheSize]; // Cache for CDB entries
139 TObject *fCDBCache[kCDBCacheSize]; // Cache for calibration objects.
6a739e92 140
2745a409 141 Long64_t fRun; // Run Number
3551db50 142
6d50f529 143 Float_t *fPRFsmp; //! Sampled pad response
144 Int_t fPRFbin; // Number of bins for the PRF
145 Float_t fPRFlo; // Lower boundary of the PRF
146 Float_t fPRFhi; // Higher boundary of the PRF
147 Float_t fPRFwid; // Bin width of the sampled PRF
148 Int_t fPRFpad; // Distance to next pad in PRF
6a739e92 149
2745a409 150 private:
151
152 AliTRDcalibDB(); // This is a singleton, constructor is private!
153 AliTRDcalibDB(const AliTRDcalibDB &c);
154 AliTRDcalibDB &operator=(const AliTRDcalibDB &c);
3551db50 155 virtual ~AliTRDcalibDB();
156
a7ac01d2 157 ClassDef(AliTRDcalibDB, 4) // Provides central access to the CDB
2745a409 158
3551db50 159};
160
3551db50 161#endif
7a6352a6 162