New classes for beam test analysis
[u/mrichter/AliRoot.git] / PHOS / AliPHOSCalibrationDB.h
CommitLineData
f74edaba 1#ifndef ALIPHOSCALIBRATIONDB_H
2#define ALIPHOSCALIBRATIONDB_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id$ */
7
8//_________________________________________________________________________
9//
10//*-- Author: D.Peressounko (RRC KI & SUBATECH)
11
12
13// --- ROOT system ---
14#include "TNamed.h"
15#include "TArrayF.h"
16#include "TString.h"
17
18// --- Standard library ---
19
20// --- AliRoot header files ---
21class AliPHOSConTableDB ;
22
23class AliPHOSCalibrationDB:public TNamed {
24
25public:
26 AliPHOSCalibrationDB() ; // ctor
27 AliPHOSCalibrationDB(const char* filename ,const char * database = "Primordial") ;
28 virtual ~AliPHOSCalibrationDB() ; // dtor
29
30 //Main method: calibrates if gains are known, otherwise - returns 0
31 Float_t Calibrate(Int_t amp, Int_t absId)const ;
32
33 //Read gains of pedestals from ascii file
34 void ReadCalibrationParameters(const char * filename = "gains.dat",Option_t* opt = "gains") ;
35
36 //Sets the same parameters for all channels
37 void SetAll(Float_t pedestal = 0, Float_t slope = 0.01) ;
38
39 //To know correspondance when reads list of gains from ascii file
40 void SetConTableDB(AliPHOSConTableDB * ctdb){fctdb = ctdb; }
41
42 //Set parameters for particlular channel
43 void SetParameters(Int_t AbsId, Float_t pedestal = 0, Float_t slope = 0.01)
44 {if(fPedestals){fPedestals->AddAt(pedestal,AbsId-1) ; fSlopes->AddAt(slope,AbsId-1) ;} }
45
46 //To be replaced in real DB when updating will really be necessary
47 void Update(Int_t event,Int_t run){}
48
49 AliPHOSCalibrationDB & operator = (const AliPHOSCalibrationDB & ) ;
50private:
51 Int_t fCurentRun ; //!
52 Int_t fNChannels ;
53 TString fFileName ;
54 TArrayF * fPedestals ;
55 TArrayF * fSlopes ;
56 AliPHOSConTableDB * fctdb ; //!
57
58 ClassDef(AliPHOSCalibrationDB,1) // description
59
60};
61
62#endif // AliPHOSCALIBRATIONDB_H