Hotfix for online display GUI application (Matevz)
[u/mrichter/AliRoot.git] / TPC / AliTPCcalibDB.h
CommitLineData
c5bbaa2c 1#ifndef ALITPCCALIBDB_H
2#define ALITPCCALIBDB_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
418bbcaf 13class AliTPCTransform;
14class AliTPCExB;
c5bbaa2c 15#include "TObject.h"
bf85fe4d 16#include "TObjArray.h"
17#include "TArrayI.h"
18#include "TVectorD.h"
5312f439 19#include "TGraph.h"
20#include "AliTPCCalPad.h"
21#include "TString.h"
bf85fe4d 22
54472e4f 23class AliTPCSensorTempArray;
e7e39fb5 24class AliDCSSensorArray;
c5bbaa2c 25class AliCDBEntry;
8477f500 26class AliTPCParam;
d6834f5f 27class AliTPCAltroMapping;
96305e49 28class AliTPCClusterParam;
bf85fe4d 29class AliDCSSensor;
30class AliDCSSensorArray;
da6c0bc9 31class AliTPCCalibVdrift;
8de77f00 32class AliGRPObject;
0231c65f 33class TMap;
68751c2c 34//class AliCDBStorage;
c5bbaa2c 35
36class AliTPCcalibDB : public TObject
37{
38 public:
39 static AliTPCcalibDB* Instance();
40 AliTPCcalibDB();
41 virtual ~AliTPCcalibDB();
42 static void Terminate();
43 void SetRun(Long64_t run);
5e1215d4 44 void Update(); //update entries
45 void UpdateRunInformations(Int_t run, Bool_t force=kFALSE);
46 //
5312f439 47 Long64_t GetRun() const {return fRun;}
5e1215d4 48 //
49 //
c5bbaa2c 50 //
f5344549 51 AliTPCTransform* GetTransform() {return fTransform;}
3ac615eb 52 AliTPCExB* GetExB() {return fExB;}
f4d5fd21 53 void SetExBField(Float_t bz);
3ac615eb 54 static AliTPCExB* GetExB(Float_t bz,Bool_t bdelete);
54472e4f 55 AliTPCCalPad* GetPadGainFactor() {return fPadGainFactor;}
9f6e9f81 56 AliTPCCalPad* GetDedxGainFactor() {return fDedxGainFactor;}
54472e4f 57 AliTPCCalPad* GetPadTime0() {return fPadTime0;}
54472e4f 58 AliTPCCalPad* GetPadNoise() {return fPadNoise;}
59 AliTPCCalPad* GetPedestals() {return fPedestals;}
5312f439 60 //ALTRO config data
61 TObjArray* GetAltroConfigData() const {return fALTROConfigData;}
62 AliTPCCalPad* GetALTROAcqStart() const {return fALTROConfigData?static_cast<AliTPCCalPad*>(fALTROConfigData->FindObject("AcqStart")):0;}
63 AliTPCCalPad* GetALTROZsThr() const {return fALTROConfigData?static_cast<AliTPCCalPad*>(fALTROConfigData->FindObject("ZsThr")):0;}
64 AliTPCCalPad* GetALTROFPED() const {return fALTROConfigData?static_cast<AliTPCCalPad*>(fALTROConfigData->FindObject("FPED")):0;}
65 AliTPCCalPad* GetALTROAcqStop() const {return fALTROConfigData?static_cast<AliTPCCalPad*>(fALTROConfigData->FindObject("AcqStop")):0;}
66 AliTPCCalPad* GetALTROMasked() const {return fALTROConfigData?static_cast<AliTPCCalPad*>(fALTROConfigData->FindObject("Masked")):0;}
67 //Pulser data
68 TObjArray* GetPulserData() const {return fPulserData;}
69 AliTPCCalPad* GetPulserTmean() const {return fPulserData?static_cast<AliTPCCalPad*>(fPulserData->FindObject("PulserTmean")):0;}
70 AliTPCCalPad* GetPulserTrms() const {return fPulserData?static_cast<AliTPCCalPad*>(fPulserData->FindObject("PulserTrms")):0;}
71 AliTPCCalPad* GetPulserQmean() const {return fPulserData?static_cast<AliTPCCalPad*>(fPulserData->FindObject("PulserQmean")):0;}
72//CE data
73 TObjArray* GetCEData() const {return fCEData;}
74 AliTPCCalPad* GetCETmean() const {return fCEData?static_cast<AliTPCCalPad*>(fCEData->FindObject("CETmean")):0;}
75 AliTPCCalPad* GetCETrms() const {return fCEData?static_cast<AliTPCCalPad*>(fCEData->FindObject("CETrms")):0;}
76 AliTPCCalPad* GetCEQmean() const {return fCEData?static_cast<AliTPCCalPad*>(fCEData->FindObject("CEQmean")):0;}
77 TObjArray* GetCErocTtime() const {return fCEData?static_cast<TObjArray*>(fCEData->FindObject("rocTtime")):0;}
78 TObjArray* GetCErocQtime() const {return fCEData?static_cast<TObjArray*>(fCEData->FindObject("rocQtime")):0;}
79 TGraph* GetCErocTgraph(const Int_t roc)const {return GetCErocTtime()?static_cast<TGraph*>(GetCErocTtime()->At(roc)):0;}
80 TGraph* GetCErocQgraph(const Int_t roc)const {return GetCErocQtime()?static_cast<TGraph*>(GetCErocQtime()->At(roc)):0;}
892226be 81 static Float_t GetCEdriftTime(Int_t run, Int_t sector, Double_t timeStamp=-1., Int_t *entries=0);
82 static Float_t GetCEchargeTime(Int_t run, Int_t sector, Double_t timeStamp=-1., Int_t *entries=0);
5312f439 83//
54472e4f 84 AliTPCSensorTempArray* GetTemperature() {return fTemperature;}
85 AliTPCParam* GetParameters(){return fParam;}
d6834f5f 86 AliTPCAltroMapping ** GetMapping(){ return fMapping;}
96305e49 87 AliTPCClusterParam *GetClusterParam(){ return fClusterParam;}
3af3fbc4 88 TObjArray *GetTimeGainSplines(){ return fTimeGainSplines;}
d6834f5f 89 //
5312f439 90 //GRP information
8de77f00 91 static AliGRPObject * GetGRP(Int_t run);
0231c65f 92 static TMap * GetGRPMap(Int_t run);
da6c0bc9 93 static Float_t GetPressure(Int_t timeStamp, Int_t run, Int_t type=0);
5312f439 94 static Float_t GetL3Current(Int_t run, Int_t statType=0);
95 static Float_t GetBz(Int_t run);
96 static Char_t GetL3Polarity(Int_t run);
97 static TString GetRunType(Int_t run);
98 //
7fff7612 99 static Float_t GetDCSSensorValue(AliDCSSensorArray *arr, Int_t timeStamp, const char * sensorName, Int_t sigDigits=-1);
100 static Float_t GetDCSSensorMeanValue(AliDCSSensorArray *arr, const char * sensorName, Int_t sigDigits=-1);
5312f439 101 //Voltage information
7fff7612 102 static Float_t GetChamberHighVoltage(Int_t run, Int_t sector, Int_t timeStamp=-1, Int_t sigDigits=0);
103 static Float_t GetSkirtVoltage(Int_t run, Int_t sector, Int_t timeStamp=-1, Int_t sigDigits=0);
104 static Float_t GetCoverVoltage(Int_t run, Int_t sector, Int_t timeStamp=-1, Int_t sigDigits=0);
105 static Float_t GetGGoffsetVoltage(Int_t run, Int_t sector, Int_t timeStamp=-1, Int_t sigDigits=0);
106 static Float_t GetGGnegVoltage(Int_t run, Int_t sector, Int_t timeStamp=-1, Int_t sigDigits=0);
107 static Float_t GetGGposVoltage(Int_t run, Int_t sector, Int_t timeStamp=-1, Int_t sigDigits=0);
5312f439 108 //Goofie Values
7f7847fe 109 static Float_t GetValueGoofie(Int_t timeStamp, Int_t run, Int_t type);
5312f439 110 //
64b48395 111 static Bool_t GetTemperatureFit(Int_t timeStamp, Int_t run, Int_t side,TVectorD& fit);
112 static Float_t GetTemperature(Int_t timeStamp, Int_t run, Int_t side);
da6c0bc9 113 static Double_t GetPTRelative(UInt_t timeSec, Int_t run, Int_t side);
114 AliDCSSensor * GetPressureSensor(Int_t run, Int_t type=0);
e2914767 115 //AliDCSSensor * GetVoltageSensor(Int_t run, Int_t type=0);
bf85fe4d 116 AliTPCSensorTempArray * GetTemperatureSensor(Int_t run);
117 AliDCSSensorArray * GetGoofieSensors(Int_t run);
e2914767 118 AliDCSSensorArray * GetVoltageSensors(Int_t run);
da6c0bc9 119 AliTPCCalibVdrift * GetVdrift(Int_t run);
a2c3785e 120 TObjArray * GetTimeGainSplinesRun(Int_t run);
bf85fe4d 121 static Float_t GetGain(Int_t sector, Int_t row, Int_t pad);
122 //
86df2b3a 123 static void CreateObjectList(const Char_t *filename, TObjArray *calibObjects);
124 static void MakeTree(const char * fileName, TObjArray * array, const char * mapFileName = 0, AliTPCCalPad* outlierPad = 0, Float_t ltmFraction = 0.9);
3ac615eb 125 static void RegisterExB(Int_t index, Float_t bz, Bool_t bdelete);
c5bbaa2c 126 //
bf85fe4d 127 //
bf85fe4d 128
e2914767 129 AliGRPObject * MakeGRPObjectFromMap(TMap *map);
5312f439 130 //Create a tree suited for diplaying with the AliTPCCalibViewerGUI
131 static Bool_t CreateGUITree(Int_t run, const char* filename="");
bf85fe4d 132 //
c5bbaa2c 133protected:
e2914767 134
c5bbaa2c 135 AliCDBEntry* GetCDBEntry(const char* cdbPath);
481f877b 136 Long64_t fRun; // current run number
f5344549 137 AliTPCTransform *fTransform; // object responsible for spacial corrections
418bbcaf 138 AliTPCExB *fExB; // ExB correction factor
68751c2c 139// AliCDBStorage* fLocator; // Storage locator retrieved from AliCDBManager
c5bbaa2c 140 //
141 // calibration parameters per pad
142 //
418bbcaf 143 AliTPCCalPad* fPadGainFactor; // Gain calibration entry
9f6e9f81 144 AliTPCCalPad* fDedxGainFactor; // Gain calibration entry - for dEdx
418bbcaf 145 AliTPCCalPad* fPadTime0; // Time0 calibration entry
418bbcaf 146 AliTPCCalPad* fPadNoise; // Noise calibration entry
147 AliTPCCalPad* fPedestals; // Pedestal calibration entry
5312f439 148 TObjArray *fALTROConfigData; // ALTRO configuration data
149 TObjArray *fPulserData; // Calibration Pulser data
150 TObjArray *fCEData; // CE data
151 //
418bbcaf 152 AliTPCSensorTempArray* fTemperature; // Temperature calibration entry
d6834f5f 153 AliTPCAltroMapping **fMapping; // Altro mapping
8477f500 154 //
155 //
418bbcaf 156 AliTPCParam * fParam; // TPC parameters
96305e49 157 AliTPCClusterParam * fClusterParam; // TPC cluster error, shape and Q parameterization
3af3fbc4 158 TObjArray * fTimeGainSplines; // Array of AliSplineFits: at 0 MIP position in time ; at 1 Fermi Plateau from cosmics
c5bbaa2c 159 //
bf85fe4d 160 // Get the corssrun information
161 //
a2c3785e 162 TObjArray fTimeGainSplinesArray; //! array Array of AliSplineFits: at 0 MIP position in time ; at 1 Fermi Plateau from cosmics
163 TObjArray fGRPArray; //! array of GRPs - per run
164 TObjArray fGRPMaps; //! array of GRPs maps - per run - old data
165 TObjArray fGoofieArray; //! array of GOOFIE values -per run
166 TObjArray fVoltageArray; //! array of Chamber HV values -per run
167 TObjArray fTemperatureArray; //! array of temperature sensors - per run
168 TObjArray fVdriftArray; //! array of v drift interfaces
5e1215d4 169 TObjArray fDriftCorrectionArray; //! array of drift correction
170
a2c3785e 171 TArrayI fRunList; //! run list - indicates try to get the run param
bf85fe4d 172 //
418bbcaf 173 static AliTPCcalibDB* fgInstance; // singleton control
174 static Bool_t fgTerminated; // termination control
3ac615eb 175 static TObjArray fgExBArray; // array of ExB corrections
c5bbaa2c 176 ClassDef(AliTPCcalibDB, 0)
e4dce695 177 private:
f4a89669 178 AliTPCcalibDB (const AliTPCcalibDB& );
179 AliTPCcalibDB& operator= (const AliTPCcalibDB& );
c5bbaa2c 180};
181
182
183#endif