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