Adding high voltage to the tree
[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"
19
c5bbaa2c 20class AliTPCCalPad;
54472e4f 21class AliTPCSensorTempArray;
e7e39fb5 22class AliDCSSensorArray;
c5bbaa2c 23class AliCDBEntry;
8477f500 24class AliTPCParam;
d6834f5f 25class AliTPCAltroMapping;
96305e49 26class AliTPCClusterParam;
bf85fe4d 27class AliDCSSensor;
28class AliDCSSensorArray;
da6c0bc9 29class AliTPCCalibVdrift;
8de77f00 30class AliGRPObject;
0231c65f 31class TMap;
68751c2c 32//class AliCDBStorage;
c5bbaa2c 33
34class AliTPCcalibDB : public TObject
35{
36 public:
37 static AliTPCcalibDB* Instance();
38 AliTPCcalibDB();
39 virtual ~AliTPCcalibDB();
40 static void Terminate();
41 void SetRun(Long64_t run);
5e1215d4 42 void Update(); //update entries
43 void UpdateRunInformations(Int_t run, Bool_t force=kFALSE);
44 //
45 //
46 //
c5bbaa2c 47 //
f5344549 48 AliTPCTransform* GetTransform() {return fTransform;}
3ac615eb 49 AliTPCExB* GetExB() {return fExB;}
f4d5fd21 50 void SetExBField(Float_t bz);
3ac615eb 51 static AliTPCExB* GetExB(Float_t bz,Bool_t bdelete);
54472e4f 52 AliTPCCalPad* GetPadGainFactor() {return fPadGainFactor;}
9f6e9f81 53 AliTPCCalPad* GetDedxGainFactor() {return fDedxGainFactor;}
54472e4f 54 AliTPCCalPad* GetPadTime0() {return fPadTime0;}
54472e4f 55 AliTPCCalPad* GetPadNoise() {return fPadNoise;}
56 AliTPCCalPad* GetPedestals() {return fPedestals;}
57 AliTPCSensorTempArray* GetTemperature() {return fTemperature;}
58 AliTPCParam* GetParameters(){return fParam;}
d6834f5f 59 AliTPCAltroMapping ** GetMapping(){ return fMapping;}
96305e49 60 AliTPCClusterParam *GetClusterParam(){ return fClusterParam;}
3af3fbc4 61 TObjArray *GetTimeGainSplines(){ return fTimeGainSplines;}
d6834f5f 62 //
da6c0bc9 63 //
8de77f00 64 static AliGRPObject * GetGRP(Int_t run);
0231c65f 65 static TMap * GetGRPMap(Int_t run);
da6c0bc9 66 static Float_t GetPressure(Int_t timeStamp, Int_t run, Int_t type=0);
e2914767 67 static Float_t GetChamberHighVoltage(Int_t timeStamp, Int_t run, Int_t sector);
7f7847fe 68 static Float_t GetValueGoofie(Int_t timeStamp, Int_t run, Int_t type);
64b48395 69 static Bool_t GetTemperatureFit(Int_t timeStamp, Int_t run, Int_t side,TVectorD& fit);
70 static Float_t GetTemperature(Int_t timeStamp, Int_t run, Int_t side);
da6c0bc9 71 static Double_t GetPTRelative(UInt_t timeSec, Int_t run, Int_t side);
72 AliDCSSensor * GetPressureSensor(Int_t run, Int_t type=0);
e2914767 73 //AliDCSSensor * GetVoltageSensor(Int_t run, Int_t type=0);
bf85fe4d 74 AliTPCSensorTempArray * GetTemperatureSensor(Int_t run);
75 AliDCSSensorArray * GetGoofieSensors(Int_t run);
e2914767 76 AliDCSSensorArray * GetVoltageSensors(Int_t run);
da6c0bc9 77 AliTPCCalibVdrift * GetVdrift(Int_t run);
a2c3785e 78 TObjArray * GetTimeGainSplinesRun(Int_t run);
bf85fe4d 79 static Float_t GetGain(Int_t sector, Int_t row, Int_t pad);
80 //
86df2b3a 81 static void CreateObjectList(const Char_t *filename, TObjArray *calibObjects);
82 static void MakeTree(const char * fileName, TObjArray * array, const char * mapFileName = 0, AliTPCCalPad* outlierPad = 0, Float_t ltmFraction = 0.9);
3ac615eb 83 static void RegisterExB(Int_t index, Float_t bz, Bool_t bdelete);
c5bbaa2c 84 //
bf85fe4d 85 //
86 static void ProcessGoofie( AliDCSSensorArray* goofieArray, TVectorD & vecEntries, TVectorD & vecMedian, TVectorD &vecMean, TVectorD &vecRMS);
87 static void ProcessEnv(const char * runList);
88
e2914767 89 AliGRPObject * MakeGRPObjectFromMap(TMap *map);
bf85fe4d 90 //
c5bbaa2c 91protected:
e2914767 92
c5bbaa2c 93 AliCDBEntry* GetCDBEntry(const char* cdbPath);
481f877b 94 Long64_t fRun; // current run number
f5344549 95 AliTPCTransform *fTransform; // object responsible for spacial corrections
418bbcaf 96 AliTPCExB *fExB; // ExB correction factor
68751c2c 97// AliCDBStorage* fLocator; // Storage locator retrieved from AliCDBManager
c5bbaa2c 98 //
99 // calibration parameters per pad
100 //
418bbcaf 101 AliTPCCalPad* fPadGainFactor; // Gain calibration entry
9f6e9f81 102 AliTPCCalPad* fDedxGainFactor; // Gain calibration entry - for dEdx
418bbcaf 103 AliTPCCalPad* fPadTime0; // Time0 calibration entry
418bbcaf 104 AliTPCCalPad* fPadNoise; // Noise calibration entry
105 AliTPCCalPad* fPedestals; // Pedestal calibration entry
106 AliTPCSensorTempArray* fTemperature; // Temperature calibration entry
d6834f5f 107 AliTPCAltroMapping **fMapping; // Altro mapping
8477f500 108 //
109 //
418bbcaf 110 AliTPCParam * fParam; // TPC parameters
96305e49 111 AliTPCClusterParam * fClusterParam; // TPC cluster error, shape and Q parameterization
3af3fbc4 112 TObjArray * fTimeGainSplines; // Array of AliSplineFits: at 0 MIP position in time ; at 1 Fermi Plateau from cosmics
c5bbaa2c 113 //
bf85fe4d 114 // Get the corssrun information
115 //
a2c3785e 116 TObjArray fTimeGainSplinesArray; //! array Array of AliSplineFits: at 0 MIP position in time ; at 1 Fermi Plateau from cosmics
117 TObjArray fGRPArray; //! array of GRPs - per run
118 TObjArray fGRPMaps; //! array of GRPs maps - per run - old data
119 TObjArray fGoofieArray; //! array of GOOFIE values -per run
120 TObjArray fVoltageArray; //! array of Chamber HV values -per run
121 TObjArray fTemperatureArray; //! array of temperature sensors - per run
122 TObjArray fVdriftArray; //! array of v drift interfaces
5e1215d4 123 TObjArray fDriftCorrectionArray; //! array of drift correction
124
a2c3785e 125 TArrayI fRunList; //! run list - indicates try to get the run param
bf85fe4d 126 //
418bbcaf 127 static AliTPCcalibDB* fgInstance; // singleton control
128 static Bool_t fgTerminated; // termination control
3ac615eb 129 static TObjArray fgExBArray; // array of ExB corrections
c5bbaa2c 130 ClassDef(AliTPCcalibDB, 0)
e4dce695 131 private:
f4a89669 132 AliTPCcalibDB (const AliTPCcalibDB& );
133 AliTPCcalibDB& operator= (const AliTPCcalibDB& );
c5bbaa2c 134};
135
136
137#endif