reco i trigger parameters for T0
[u/mrichter/AliRoot.git] / T0 / AliT0Calibrator.cxx
CommitLineData
446d6ec4 1
8d72d1c2 2/**************************************************************************
3 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * *
5 * Author: The ALICE Off-line Project. *
6 * Contributors are mentioned in the code where appropriate. *
7 * *
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 **************************************************************************/
16
17/* $Id$ */
94249139 18/***********************************************************************
19 * this class doing calibration during reconstruction
20 * 2 steps:
21 * - equalizing channels
22 * - applying walk corrections
23 *
24 * Alla.Maevskaya@cern.ch
25 *
26 **********************************************************************/
27
28//#include <Riostream.h>
8d72d1c2 29
30#include "AliLog.h"
31#include "AliT0Parameters.h"
32#include "AliT0Calibrator.h"
8d72d1c2 33#include <TGraph.h>
7d95281b 34#include <TH1F.h>
2e6a5ee0 35#include <TMath.h>
b09247a2 36#include <Riostream.h>
8d72d1c2 37
38ClassImp(AliT0Calibrator)
39
40//____________________________________________________________________
9e1b06a2 41 AliT0Calibrator::AliT0Calibrator():TNamed(),
2e6a5ee0 42 fChannelWidth(0),
43 fWalk(0)
44
8d72d1c2 45{
94249139 46 //constructor
47
2e6a5ee0 48 AliT0Parameters* param = AliT0Parameters::Instance();
49 param->Init();
8d72d1c2 50
51 fChannelWidth = param->GetChannelWidth() ;
8d72d1c2 52 for (Int_t i=0; i<24; i++){
2e6a5ee0 53 fMaxValue[i]=0;
8d72d1c2 54 fTimeDelayCFD[i] = Int_t (param->GetTimeDelayCFD(i));
d0bcd1fb 55
446d6ec4 56 TGraph* fu = param ->GetWalk(i);
d0bcd1fb 57 // TGraph* fu = param ->GetAmpLEDRec(i);
58 fWalk.AddAtAndExpand(fu,i);
8d72d1c2 59 }
60
8d72d1c2 61}
62//_____________________________________________________________________________
63
9e1b06a2 64AliT0Calibrator::AliT0Calibrator(const AliT0Calibrator &r): TNamed(),
8d72d1c2 65 fChannelWidth(0),
74adb36a 66 fWalk(0)
8d72d1c2 67
68{
69 //
70 // AliT0calibartor copy constructor
71 //
72
73 ((AliT0Calibrator &) r).Copy(*this);
74
75}
76
77//_____________________________________________________________________________
78AliT0Calibrator &AliT0Calibrator::operator=(const AliT0Calibrator &r)
79{
80 //
81 // Assignment operator
82 //
83
84 if (this != &r) ((AliT0Calibrator &) r).Copy(*this);
85 return *this;
86
87}
88
89
8d72d1c2 90//____________________________________________________________________
29a60970 91Int_t AliT0Calibrator::WalkCorrection(Int_t ipmt, Int_t qt, Int_t time)
8d72d1c2 92{
93 //slewing correcion and equalizing channels
94
2e6a5ee0 95 Int_t walk=0;
96
97 Int_t timeEq=0, timeWalk=0;
d0bcd1fb 98 TGraph *fu1=(TGraph*) fWalk.At(ipmt);
99 if(fu1 && fu1->GetN()>0)
2e6a5ee0 100 walk=Int_t(fu1->Eval(Double_t(qt)));
d0bcd1fb 101
102 timeWalk = time + walk ;
103 timeEq= timeWalk - fTimeDelayCFD[ipmt];
104 AliDebug(10,Form(" ipmt %i time before %i timeWalk %i , walk %i qt %i timeEq %i \n ",
105 ipmt, time,timeWalk, walk, qt, timeEq ));
106
8d72d1c2 107 return timeEq;
108}
109
110
111