2 /**************************************************************************
3 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * Author: The ALICE Off-line Project. *
6 * Contributors are mentioned in the code where appropriate. *
8 * Permission to use, copy, modify and distribute this software and its *
9 * documentation strictly for non-commercial purposes is hereby granted *
10 * without fee, provided that the above copyright notice appears in all *
11 * copies and that both the copyright notice and this permission notice *
12 * appear in the supporting documentation. The authors make no claims *
13 * about the suitability of this software for any purpose. It is *
14 * provided "as is" without express or implied warranty. *
15 **************************************************************************/
18 /***********************************************************************
19 * this class doing calibration during reconstruction
21 * - equalizing channels
22 * - applying walk corrections
24 * Alla.Maevskaya@cern.ch
26 **********************************************************************/
28 //#include <Riostream.h>
31 #include "AliT0Parameters.h"
32 #include "AliT0Calibrator.h"
33 #include "AliT0Reconstructor.h"
34 #include "AliT0RecoParam.h"
35 #include "AliCDBEntry.h"
36 #include "AliCDBManager.h"
41 #include <Riostream.h>
43 ClassImp(AliT0Calibrator)
45 //____________________________________________________________________
46 AliT0Calibrator::AliT0Calibrator():TNamed(),
53 printf(" AliT0Calibrator ::: AliT0RecoParam GetEq() %i\n", fEqualized);
54 AliT0Parameters* param = AliT0Parameters::Instance();
56 //slewing correcion and equalizing channels
58 fChannelWidth = param->GetChannelWidth() ;
60 for (Int_t i=0; i<24; i++){
62 fTimeDelayCFD[i] = Int_t (param->GetTimeDelayCFD(i));
63 TGraph* fu = param ->GetWalk(i);
64 // fWalk.AddAtAndExpand(fu,i);
65 //TGraph* fu = param ->GetAmpLEDRec(i);
66 fWalk.AddAtAndExpand(fu,i);
70 //_____________________________________________________________________________
72 AliT0Calibrator::AliT0Calibrator(const AliT0Calibrator &r): TNamed(),
79 // AliT0calibartor copy constructor
82 ((AliT0Calibrator &) r).Copy(*this);
86 //_____________________________________________________________________________
87 AliT0Calibrator &AliT0Calibrator::operator=(const AliT0Calibrator &r)
90 // Assignment operator
93 if (this != &r) ((AliT0Calibrator &) r).Copy(*this);
99 //____________________________________________________________________
101 Int_t AliT0Calibrator::WalkCorrection(Int_t refAmp, Int_t ipmt, Int_t qt, Int_t time)
105 // referemce amplitude for walk correction now read from RecoParam
108 Int_t timeEq=0, timeWalk=0;
109 TGraph *fu1=(TGraph*) fWalk.At(ipmt);
110 if(fu1 && fu1->GetN()>0) {
111 walk = Int_t(fu1->Eval(Double_t(qt)));
115 timeEq= time - fTimeDelayCFD[ipmt]-walk;
117 timeEq = time - walk - refAmp;
119 // printf(" ipmt %i time before %i timeWalk %i , walk %i qt %i fTimeDelayCFD[ipmt] %i timeEq %i \n ",
120 // ipmt, time,timeWalk, walk, qt,fTimeDelayCFD[ipmt], timeEq );
121 AliDebug(2,Form(" fEqualized %i ipmt %i refAmp %i time before %i timeWalk %i , walk %i qt %i timeEq %i, diff %i \n ",
122 fEqualized, ipmt, refAmp, time,timeWalk, walk, qt, timeEq , fTimeDelayCFD[ipmt]));