class for TOF alignment
[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$
18Revision 1.1 2006/02/13 16:10:48 arcelli
19Add classes for TOF Calibration (C.Zampolli)
20
6dc9348d 21author: Chiara Zampolli, zampolli@bo.infn.it
762446e0 22*/
6dc9348d 23
24///////////////////////////////////////////////////////////////////////////////
25// //
26// class for TOF calibration //
27// //
28///////////////////////////////////////////////////////////////////////////////
29
30#include "AliTOFcalibESD.h"
31#include <Riostream.h>
32#include <stdlib.h>
33
34
35ClassImp(AliTOFcalibESD)
36
37//________________________________________________________________
38AliTOFcalibESD::AliTOFcalibESD():
39 fToT(0),
40 fIntLen(0),
41 fTOFtime(0),
42 fP(0),
43 fSector(-1),
44 fPlate(-1),
45 fStrip(-1),
46 fPadz(-1),
47 fPadx(-1),
48 fTOFsignalND(0)
49{
50 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTrackTime[i] = 0;
51}
52//________________________________________________________________
53
54AliTOFcalibESD::AliTOFcalibESD(const AliTOFcalibESD& UnCalib):
55 AliESDtrack(UnCalib),
56 fToT(UnCalib.fToT),
57 fIntLen(UnCalib.fIntLen),
58 fTOFtime(UnCalib.fTOFtime),
59 fP(UnCalib.fP),
60 fCombID(UnCalib.fCombID),
61 fSector(UnCalib.fSector),
62 fPlate(UnCalib.fPlate),
63 fStrip(UnCalib.fStrip),
64 fPadz(UnCalib.fPadz),
65 fPadx(UnCalib.fPadx),
66 fTOFsignalND(UnCalib.fTOFsignalND)
67{
68 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTrackTime[i] = UnCalib.fTrackTime[i];
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){
79 for (Int_t i=0;i<AliPID::kSPECIES;i++) fTrackTime[i] = tracktime[i];
80}
81//________________________________________________________________
82
83void AliTOFcalibESD::CopyFromAliESD(const AliESDtrack* track)
84{
85 fP = track->GetP();
86 fTOFtime = track->GetTOFsignal();
87 fIntLen = track->GetIntegratedLength();
88 Double_t exptime[10];
89 track->GetIntegratedTimes(exptime);
90 for (Int_t i=0;i<AliPID::kSPECIES;i++) {
91 fTrackTime[i] = exptime[i];
92 }
93 Double_t c[15];
94 track->GetExternalCovariance(c);
95 for (Int_t i = 0;i<15;i++){
96 fExtCov[i] = c[i];
97 }
98}
99//______________________________________________________________________
100
101void AliTOFcalibESD::GetExternalCovariance(Double_t cov[15]) const {
102 for (Int_t i=0; i<15; i++) cov[i]=fExtCov[i];
103}
104//______________________________________________________________________
105
106void AliTOFcalibESD::GetIntegratedTimes(Double_t exp[AliPID::kSPECIES]) const {
107 for (Int_t i=0; i<AliPID::kSPECIES; i++) exp[i]=fTrackTime[i];
108}
109//______________________________________________________________________
110
111Int_t AliTOFcalibESD::Compare(const TObject* uncobj) const{
112 Double_t c1[15];
113 this->GetExternalCovariance(c1);
114 Double_t c2[15];
115 ((AliTOFcalibESD*)uncobj)->GetExternalCovariance(c2);
116 if (c1[0]*c1[2] <c2[0]*c2[2]) return -1;
117 if (c1[0]*c1[2]>c2[0]*c2[2]) return 1;
118 return 0;
119}
120
121