]>
Commit | Line | Data |
---|---|---|
8d72d1c2 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
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 | **************************************************************************/ | |
15 | ||
16 | /* $Id$ */ | |
17 | ||
18 | #include <Riostream.h> | |
19 | ||
20 | #include "AliLog.h" | |
21 | #include "AliT0Parameters.h" | |
22 | #include "AliT0Calibrator.h" | |
23 | #include <TArrayI.h> | |
24 | #include <TGraph.h> | |
7d95281b | 25 | #include <TH1F.h> |
8d72d1c2 | 26 | |
27 | ClassImp(AliT0Calibrator) | |
28 | ||
29 | //____________________________________________________________________ | |
30 | AliT0Calibrator::AliT0Calibrator(): | |
31 | fChannelWidth(0), | |
32 | fWalk(0), | |
33 | fSlewingRec(0) | |
34 | { | |
35 | AliT0Parameters* param = AliT0Parameters::Instance(); | |
36 | param->Init(); | |
37 | ||
38 | fChannelWidth = param->GetChannelWidth() ; | |
39 | ||
40 | for (Int_t i=0; i<24; i++){ | |
41 | fTimeDelayCFD[i] = Int_t (param->GetTimeDelayCFD(i)); | |
42 | TGraph* gr = param ->GetSlewRec(i); | |
43 | fSlewingRec.AddAtAndExpand(gr,i) ; | |
44 | TGraph* fu = param ->GetWalk(i); | |
45 | fWalk.AddAtAndExpand(fu,i); | |
46 | } | |
47 | ||
48 | // | |
49 | } | |
50 | //_____________________________________________________________________________ | |
51 | ||
52 | AliT0Calibrator::AliT0Calibrator(const AliT0Calibrator &r): | |
53 | fChannelWidth(0), | |
54 | fWalk(0), | |
55 | fSlewingRec(0) | |
56 | ||
57 | { | |
58 | // | |
59 | // AliT0calibartor copy constructor | |
60 | // | |
61 | ||
62 | ((AliT0Calibrator &) r).Copy(*this); | |
63 | ||
64 | } | |
65 | ||
66 | //_____________________________________________________________________________ | |
67 | AliT0Calibrator &AliT0Calibrator::operator=(const AliT0Calibrator &r) | |
68 | { | |
69 | // | |
70 | // Assignment operator | |
71 | // | |
72 | ||
73 | if (this != &r) ((AliT0Calibrator &) r).Copy(*this); | |
74 | return *this; | |
75 | ||
76 | } | |
77 | ||
78 | ||
79 | ||
80 | //____________________________________________________________________ | |
81 | Int_t AliT0Calibrator::WalkCorrection(Int_t ipmt, Int_t qt, Int_t time) | |
82 | { | |
83 | //slewing correcion and equalizing channels | |
84 | ||
85 | Int_t timeEq=0, timeWalk=0; | |
86 | TGraph *fu1=(TGraph*) fWalk.At(ipmt); | |
87 | Float_t walk=fu1->Eval(Float_t(qt)); | |
88 | TH1F*hr=fu1->GetHistogram(); | |
89 | Float_t maxValue=hr->GetMaximum(50); | |
90 | timeWalk = time + Int_t(maxValue-walk)/fChannelWidth ; | |
91 | ||
92 | timeEq= timeWalk - (fTimeDelayCFD[ipmt]-fTimeDelayCFD[0]); | |
93 | AliDebug(2,Form(" timeWalk %i , qt %i timeEq %i \n ", | |
94 | timeWalk, qt, timeEq )); | |
95 | return timeEq; | |
96 | } | |
97 | ||
98 | ||
99 |