removal of effective c++ warnings (C.Zampolli)+ use of additional calib parameters...
[u/mrichter/AliRoot.git] / TOF / AliTOFcalibESD.cxx
CommitLineData
6dc9348d 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
762446e0 16/*
17$Log$
0e46b9ae 18Revision 1.4 2006/04/05 08:35:38 hristov
19Coding conventions (S.Arcelli, C.Zampolli)
20
340693af 21Revision 1.3 2006/03/28 14:57:13 arcelli
22updates to handle new V5 geometry & some re-arrangements
23
d4ad0d6b 24Revision 1.2 2006/02/13 17:22:26 arcelli
25just Fixing Log info
26
762446e0 27Revision 1.1 2006/02/13 16:10:48 arcelli
28Add classes for TOF Calibration (C.Zampolli)
29
6dc9348d 30author: Chiara Zampolli, zampolli@bo.infn.it
762446e0 31*/
6dc9348d 32
33///////////////////////////////////////////////////////////////////////////////
34// //
35// class for TOF calibration //
36// //
37///////////////////////////////////////////////////////////////////////////////
38
39#include "AliTOFcalibESD.h"
6dc9348d 40
0e46b9ae 41class AliPID;
6dc9348d 42
43ClassImp(AliTOFcalibESD)
44
45//________________________________________________________________
46AliTOFcalibESD::AliTOFcalibESD():
340693af 47 fTOFCalCh(-1),
6dc9348d 48 fToT(0),
49 fIntLen(0),
50 fTOFtime(0),
340693af 51 fMo(0),
6dc9348d 52 fTOFsignalND(0)
53{
340693af 54 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTrTime[i] = 0;
6dc9348d 55}
56//________________________________________________________________
57
58AliTOFcalibESD::AliTOFcalibESD(const AliTOFcalibESD& UnCalib):
59 AliESDtrack(UnCalib),
d4ad0d6b 60 fCombID(UnCalib.fCombID),
340693af 61 fTOFCalCh(UnCalib.fTOFCalCh),
6dc9348d 62 fToT(UnCalib.fToT),
63 fIntLen(UnCalib.fIntLen),
64 fTOFtime(UnCalib.fTOFtime),
340693af 65 fMo(UnCalib.fMo),
6dc9348d 66 fTOFsignalND(UnCalib.fTOFsignalND)
67{
340693af 68 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTrTime[i] = UnCalib.fTrTime[i];
6dc9348d 69 for (Int_t i = 0;i<15;i++) fExtCov[i] = UnCalib.fExtCov[i];
70}
71//________________________________________________________________
72
73AliTOFcalibESD::~AliTOFcalibESD()
74{
75}
76//________________________________________________________________
77
78void AliTOFcalibESD::SetIntegratedTime(const Double_t *tracktime){
340693af 79 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTrTime[i] = tracktime[i];
6dc9348d 80}
81//________________________________________________________________
82
340693af 83void AliTOFcalibESD::CopyFromAliESD(const AliESDtrack* track){
84 //copy ESD track info
85 fMo = track->GetP();
6dc9348d 86 fTOFtime = track->GetTOFsignal();
d4ad0d6b 87 fToT = track->GetTOFsignalToT();
340693af 88 fTOFCalCh = track->GetTOFCalChannel();
6dc9348d 89 fIntLen = track->GetIntegratedLength();
90 Double_t exptime[10];
91 track->GetIntegratedTimes(exptime);
92 for (Int_t i=0;i<AliPID::kSPECIES;i++) {
340693af 93 fTrTime[i] = exptime[i];
6dc9348d 94 }
95 Double_t c[15];
96 track->GetExternalCovariance(c);
97 for (Int_t i = 0;i<15;i++){
98 fExtCov[i] = c[i];
99 }
100}
101//______________________________________________________________________
102
103void AliTOFcalibESD::GetExternalCovariance(Double_t cov[15]) const {
104 for (Int_t i=0; i<15; i++) cov[i]=fExtCov[i];
105}
106//______________________________________________________________________
107
108void AliTOFcalibESD::GetIntegratedTimes(Double_t exp[AliPID::kSPECIES]) const {
340693af 109 for (Int_t i=0; i<AliPID::kSPECIES; i++) exp[i]=fTrTime[i];
6dc9348d 110}
111//______________________________________________________________________
112
113Int_t AliTOFcalibESD::Compare(const TObject* uncobj) const{
340693af 114 //To order in momentum
6dc9348d 115 Double_t c1[15];
116 this->GetExternalCovariance(c1);
117 Double_t c2[15];
118 ((AliTOFcalibESD*)uncobj)->GetExternalCovariance(c2);
119 if (c1[0]*c1[2] <c2[0]*c2[2]) return -1;
120 if (c1[0]*c1[2]>c2[0]*c2[2]) return 1;
121 return 0;
122}
123
124