1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 //_________________________________________________________________________
21 //*-- Author : D.Peressounko (RRC KI & SUBATECH)
22 //////////////////////////////////////////////////////////////////////////////
24 // --- ROOT system ---
26 // --- Standard library ---
28 // --- AliRoot header files ---
30 #include "AliPHOSCalibrManager.h"
31 #include "AliPHOSCalibrationDB.h"
32 ClassImp(AliPHOSCalibrationDB)
35 //____________________________________________________________________________
36 AliPHOSCalibrationDB::AliPHOSCalibrationDB():fPedestals(), fGains()
39 //____________________________________________________________________________
40 AliPHOSCalibrationDB::AliPHOSCalibrationDB(const char * database):
41 TNamed("AliPHOSCalibrationDB",database),fPedestals("Pedestals"),fGains("Gains"){
44 //____________________________________________________________________________
45 AliPHOSCalibrationDB::~AliPHOSCalibrationDB()
48 //____________________________________________________________________________
49 Float_t AliPHOSCalibrationDB::Calibrate(Int_t amp, Int_t absId)const
51 //if absID is known, return calibrated energy, else - zero
52 Float_t ret = (amp - fPedestals.Data(absId))*fGains.Data(absId);
56 return 0.0000001 ; //Should not be zero - to avoid FPE
59 //____________________________________________________________________________
60 void AliPHOSCalibrationDB::GetParameters(void){
61 //In this method we read calibration parameters using AliPHOSCalibrManager
62 //This manager should be configured to read from correct source.
64 AliPHOSCalibrManager * man = AliPHOSCalibrManager::GetInstance() ;
66 Error("GetParameters","AliPHOSCalibrManager not instanciated") ;
71 man->GetParameters(fPedestals) ;
72 man->GetParameters(fGains) ;
75 //____________________________________________________________________________
76 AliPHOSCalibrationDB& AliPHOSCalibrationDB::operator=(AliPHOSCalibrationDB const & cdb)
79 fPedestals=cdb.fPedestals ;