Adding dummy PWG2 common module files
[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;
68751c2c 30//class AliCDBStorage;
c5bbaa2c 31
32class AliTPCcalibDB : public TObject
33{
34 public:
35 static AliTPCcalibDB* Instance();
36 AliTPCcalibDB();
37 virtual ~AliTPCcalibDB();
38 static void Terminate();
39 void SetRun(Long64_t run);
40 //
f5344549 41 AliTPCTransform* GetTransform() {return fTransform;}
3ac615eb 42 AliTPCExB* GetExB() {return fExB;}
f4d5fd21 43 void SetExBField(Float_t bz);
3ac615eb 44 static AliTPCExB* GetExB(Float_t bz,Bool_t bdelete);
54472e4f 45 AliTPCCalPad* GetPadGainFactor() {return fPadGainFactor;}
9f6e9f81 46 AliTPCCalPad* GetDedxGainFactor() {return fDedxGainFactor;}
54472e4f 47 AliTPCCalPad* GetPadTime0() {return fPadTime0;}
54472e4f 48 AliTPCCalPad* GetPadNoise() {return fPadNoise;}
49 AliTPCCalPad* GetPedestals() {return fPedestals;}
50 AliTPCSensorTempArray* GetTemperature() {return fTemperature;}
51 AliTPCParam* GetParameters(){return fParam;}
d6834f5f 52 AliTPCAltroMapping ** GetMapping(){ return fMapping;}
96305e49 53 AliTPCClusterParam *GetClusterParam(){ return fClusterParam;}
d6834f5f 54 //
da6c0bc9 55 //
56 static Float_t GetPressure(Int_t timeStamp, Int_t run, Int_t type=0);
7f7847fe 57 static Float_t GetValueGoofie(Int_t timeStamp, Int_t run, Int_t type);
64b48395 58 static Bool_t GetTemperatureFit(Int_t timeStamp, Int_t run, Int_t side,TVectorD& fit);
59 static Float_t GetTemperature(Int_t timeStamp, Int_t run, Int_t side);
da6c0bc9 60 static Double_t GetPTRelative(UInt_t timeSec, Int_t run, Int_t side);
61 AliDCSSensor * GetPressureSensor(Int_t run, Int_t type=0);
bf85fe4d 62 AliTPCSensorTempArray * GetTemperatureSensor(Int_t run);
63 AliDCSSensorArray * GetGoofieSensors(Int_t run);
da6c0bc9 64 AliTPCCalibVdrift * GetVdrift(Int_t run);
bf85fe4d 65 static Float_t GetGain(Int_t sector, Int_t row, Int_t pad);
66 //
86df2b3a 67 static void CreateObjectList(const Char_t *filename, TObjArray *calibObjects);
68 static void MakeTree(const char * fileName, TObjArray * array, const char * mapFileName = 0, AliTPCCalPad* outlierPad = 0, Float_t ltmFraction = 0.9);
3ac615eb 69 static void RegisterExB(Int_t index, Float_t bz, Bool_t bdelete);
c5bbaa2c 70 //
bf85fe4d 71 //
72 static void ProcessGoofie( AliDCSSensorArray* goofieArray, TVectorD & vecEntries, TVectorD & vecMedian, TVectorD &vecMean, TVectorD &vecRMS);
73 static void ProcessEnv(const char * runList);
74
75 //
c5bbaa2c 76protected:
77 void Update(); //update entries
78 AliCDBEntry* GetCDBEntry(const char* cdbPath);
bf85fe4d 79 void GetRunInformations(Int_t run); // JUST FOR CALIBRATION STUDIES
481f877b 80 Long64_t fRun; // current run number
f5344549 81 AliTPCTransform *fTransform; // object responsible for spacial corrections
418bbcaf 82 AliTPCExB *fExB; // ExB correction factor
68751c2c 83// AliCDBStorage* fLocator; // Storage locator retrieved from AliCDBManager
c5bbaa2c 84 //
85 // calibration parameters per pad
86 //
418bbcaf 87 AliTPCCalPad* fPadGainFactor; // Gain calibration entry
9f6e9f81 88 AliTPCCalPad* fDedxGainFactor; // Gain calibration entry - for dEdx
418bbcaf 89 AliTPCCalPad* fPadTime0; // Time0 calibration entry
418bbcaf 90 AliTPCCalPad* fPadNoise; // Noise calibration entry
91 AliTPCCalPad* fPedestals; // Pedestal calibration entry
92 AliTPCSensorTempArray* fTemperature; // Temperature calibration entry
d6834f5f 93 AliTPCAltroMapping **fMapping; // Altro mapping
8477f500 94 //
95 //
418bbcaf 96 AliTPCParam * fParam; // TPC parameters
96305e49 97 AliTPCClusterParam * fClusterParam; // TPC cluster error, shape and Q parameterization
c5bbaa2c 98 //
bf85fe4d 99 // Get the corssrun information
100 //
101 TObjArray fGRPArray; //! array of GRPs - per run
102 TObjArray fGoofieArray; //! array of GOOFIE values -per run
103 TObjArray fTemperatureArray; //! array of temperature sensors - per run
da6c0bc9 104 TObjArray fVdriftArray; //! array of v drift interfaces
bf85fe4d 105 TArrayI fRunList; //! run list - indicates try to get the run param
106 //
418bbcaf 107 static AliTPCcalibDB* fgInstance; // singleton control
108 static Bool_t fgTerminated; // termination control
3ac615eb 109 static TObjArray fgExBArray; // array of ExB corrections
c5bbaa2c 110 ClassDef(AliTPCcalibDB, 0)
e4dce695 111 private:
f4a89669 112 AliTPCcalibDB (const AliTPCcalibDB& );
113 AliTPCcalibDB& operator= (const AliTPCcalibDB& );
c5bbaa2c 114};
115
116
117#endif