Shuttle debugging line removed.
[u/mrichter/AliRoot.git] / TOF / AliTOFrawData.cxx
CommitLineData
15ec34b9 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/*
17$Log$
bf33f8f0 18Revision 1.2 2007/03/28 10:50:33 decaro
19Rounding off problem in rawData coding/decoding: solved
20
d11fc181 21Revision 1.1 2007/02/20 15:57:00 decaro
22Raw data update: to read the TOF raw data defined in UNPACKED mode
23
15ec34b9 24Revision 0.1 2006/12/15 A.De Caro
25 Introuction
26*/
27
28//////////////////////////////////////////////////////
29// //
30// This class provides the TOF raw data object //
31// //
32//////////////////////////////////////////////////////
33
34#include "AliLog.h"
35
36#include "AliTOFGeometry.h"
37#include "AliTOFrawData.h"
38
39ClassImp(AliTOFrawData)
40
41//_____________________________________________________________________________
42AliTOFrawData::AliTOFrawData() :
43 TObject(),
44 fACQflag(-1),
45 fPSbit(-1),
46 fTRM(-1),
47 fTRMchain(-1),
48 fTDC(-1),
49 fTDCchannel(-1),
50 fLeading(-1),
51 fTrailing(-1),
52 fToT(-1),
53 fTime(-1),
54 fError(-1)
55{
56
57 // default ctr
58
59}
60
61//_____________________________________________________________________________
bf33f8f0 62AliTOFrawData::AliTOFrawData(Int_t a, Int_t b, Int_t c, Int_t d, Int_t e,
63 Int_t f, Int_t g, Int_t h, Int_t l) :
15ec34b9 64 TObject(),
65 fACQflag(h),
66 fPSbit(g),
67 fTRM(a),
68 fTRMchain(b),
69 fTDC(c),
70 fTDCchannel(d),
71 fLeading(-1),
72 fTrailing(-1),
73 fToT(f),
74 fTime(e),
75 fError(l)
76{
77
78// ctr
79
80}
81
82//_____________________________________________________________________________
bf33f8f0 83AliTOFrawData::AliTOFrawData(Int_t a, Int_t b, Int_t c, Int_t d, Int_t e,
84 Int_t f, Int_t ee, Int_t ff, Int_t g, Int_t h, Int_t l) :
15ec34b9 85 TObject(),
86 fACQflag(h),
87 fPSbit(g),
88 fTRM(a),
89 fTRMchain(b),
90 fTDC(c),
91 fTDCchannel(d),
92 fLeading(ee),
93 fTrailing(ff),
94 fToT(f),
95 fTime(e),
96 fError(l)
97{
98
99 // ctr
17ebc9c0 100 if (fTime==-1) fTime = fLeading;
15ec34b9 101}
102
103//_____________________________________________________________________________
104AliTOFrawData::AliTOFrawData(const AliTOFrawData& r) :
105 TObject(),
106 fACQflag(-1),
107 fPSbit(-1),
108 fTRM(-1),
109 fTRMchain(-1),
110 fTDC(-1),
111 fTDCchannel(-1),
112 fLeading(-1),
113 fTrailing(-1),
114 fToT(-1),
115 fTime(-1),
116 fError(-1)
117{
118
119 // dummy copy constructor
120
121 fACQflag = r.fACQflag;
122 fPSbit = r.fPSbit;
123 fTRM = r.fTRM;
124 fTRMchain = r.fTRMchain;
125 fTDC = r.fTDC;
126 fTDCchannel = r.fTDCchannel;
127 fLeading = r.fLeading;
128 fTrailing = r.fTrailing;
129 fToT = r.fToT;
130 fTime = r.fTime;
131 fError = r.fError;
132
133}
134
135//_____________________________________________________________________________
136AliTOFrawData& AliTOFrawData::operator=(const AliTOFrawData& r)
137{
138
139 // dummy assignment operator
140
141 this->fACQflag = r.fACQflag;
142 this->fPSbit = r.fPSbit;
143 this->fTRM = r.fTRM;
144 this->fTRMchain = r.fTRMchain;
145 this->fTDC = r.fTDC;
146 this->fTDCchannel = r.fTDCchannel;
147 this->fLeading = r.fLeading;
148 this->fTrailing = r.fTrailing;
149 this->fToT = r.fToT;
150 this->fTime = r.fTime;
151 this->fError = r.fError;
152 return *this;
153
154}
155
156//_____________________________________________________________________________
bf33f8f0 157void AliTOFrawData::Update(Int_t tof, Int_t tot, Int_t leading, Int_t trailing, Int_t psBit, Int_t acq, Int_t errorFlag)
15ec34b9 158{
159 //
160 // To update a raw data object:
161 // if there is just a leading edge measurement,
162 // this method adds the trailing edge measurement
163 // to evaluate the time-of-flight and time-over-threshold measurements
164 //
165
166 AliDebug(2,Form(" %10.0f %10.0f %10.0f %1i %1i %1i",tof, tot, leading, psBit, acq, errorFlag));
167
0192b95f 168 if (fLeading!=-1 /*&& fTime==-1*/ && fToT==-1 && trailing!=-1) { // adc
15ec34b9 169
170 fTrailing = trailing;
171 fTime = fLeading;
172 fToT = Int_t((trailing - fLeading)*AliTOFGeometry::TdcBinWidth()/AliTOFGeometry::ToTBinWidth());
173
174 }
15ec34b9 175
0192b95f 176}
177
178//_____________________________________________________________________________
179Int_t AliTOFrawData::GetTOT() const
180{
181 //
182 //
183 //
184
185 Int_t dummyToT = 0;
186 if (fLeading!=-1 && fToT==-1) dummyToT = 0;
187 else dummyToT = fToT;
188
189 return dummyToT;
15ec34b9 190
191}