Line data Source code
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$
18 : Revision 1.2 2007/03/28 10:50:33 decaro
19 : Rounding off problem in rawData coding/decoding: solved
20 :
21 : Revision 1.1 2007/02/20 15:57:00 decaro
22 : Raw data update: to read the TOF raw data defined in UNPACKED mode
23 :
24 : Revision 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 :
39 26 : ClassImp(AliTOFrawData)
40 :
41 : //_____________________________________________________________________________
42 : AliTOFrawData::AliTOFrawData() :
43 0 : TObject(),
44 0 : fACQflag(-1),
45 0 : fPSbit(-1),
46 0 : fTRM(-1),
47 0 : fTRMchain(-1),
48 0 : fTDC(-1),
49 0 : fTDCchannel(-1),
50 0 : fLeading(-1),
51 0 : fTrailing(-1),
52 0 : fToT(-1),
53 0 : fTime(-1),
54 0 : fError(-1),
55 0 : fDeltaBC(-1),
56 0 : fL0L1Latency(-1)
57 0 : {
58 :
59 : // default ctr
60 :
61 0 : }
62 :
63 : //_____________________________________________________________________________
64 : AliTOFrawData::AliTOFrawData(Int_t a, Int_t b, Int_t c, Int_t d, Int_t e,
65 : Int_t f, Int_t g, Int_t h, Int_t l) :
66 0 : TObject(),
67 0 : fACQflag(h),
68 0 : fPSbit(g),
69 0 : fTRM(a),
70 0 : fTRMchain(b),
71 0 : fTDC(c),
72 0 : fTDCchannel(d),
73 0 : fLeading(-1),
74 0 : fTrailing(-1),
75 0 : fToT(f),
76 0 : fTime(e),
77 0 : fError(l),
78 0 : fDeltaBC(0),
79 0 : fL0L1Latency(0)
80 0 : {
81 :
82 : // ctr
83 :
84 0 : }
85 :
86 : //_____________________________________________________________________________
87 : AliTOFrawData::AliTOFrawData(Int_t a, Int_t b, Int_t c, Int_t d, Int_t e,
88 : Int_t f, Int_t ee, Int_t ff, Int_t g, Int_t h, Int_t l, Int_t deltaBC, Int_t l0l1) :
89 200 : TObject(),
90 200 : fACQflag(h),
91 200 : fPSbit(g),
92 200 : fTRM(a),
93 200 : fTRMchain(b),
94 200 : fTDC(c),
95 200 : fTDCchannel(d),
96 200 : fLeading(ee),
97 200 : fTrailing(ff),
98 200 : fToT(f),
99 200 : fTime(e),
100 200 : fError(l),
101 200 : fDeltaBC(deltaBC),
102 200 : fL0L1Latency(l0l1)
103 1000 : {
104 :
105 : // ctr
106 200 : if (fTime==-1) fTime = fLeading;
107 400 : }
108 :
109 : //_____________________________________________________________________________
110 : AliTOFrawData::AliTOFrawData(const AliTOFrawData& r) :
111 0 : TObject(),
112 0 : fACQflag(-1),
113 0 : fPSbit(-1),
114 0 : fTRM(-1),
115 0 : fTRMchain(-1),
116 0 : fTDC(-1),
117 0 : fTDCchannel(-1),
118 0 : fLeading(-1),
119 0 : fTrailing(-1),
120 0 : fToT(-1),
121 0 : fTime(-1),
122 0 : fError(-1),
123 0 : fDeltaBC(-1),
124 0 : fL0L1Latency(-1)
125 0 : {
126 :
127 : // dummy copy constructor
128 :
129 0 : fACQflag = r.fACQflag;
130 0 : fPSbit = r.fPSbit;
131 0 : fTRM = r.fTRM;
132 0 : fTRMchain = r.fTRMchain;
133 0 : fTDC = r.fTDC;
134 0 : fTDCchannel = r.fTDCchannel;
135 0 : fLeading = r.fLeading;
136 0 : fTrailing = r.fTrailing;
137 0 : fToT = r.fToT;
138 0 : fTime = r.fTime;
139 0 : fError = r.fError;
140 0 : fDeltaBC = r.fDeltaBC;
141 0 : fL0L1Latency = r.fL0L1Latency;
142 :
143 0 : }
144 :
145 : //_____________________________________________________________________________
146 : AliTOFrawData& AliTOFrawData::operator=(const AliTOFrawData& r)
147 : {
148 :
149 : // Assignment operator
150 :
151 0 : if (this == &r)
152 0 : return *this;
153 :
154 0 : TObject::operator=(r);
155 0 : fACQflag = r.fACQflag;
156 0 : fPSbit = r.fPSbit;
157 0 : fTRM = r.fTRM;
158 0 : fTRMchain = r.fTRMchain;
159 0 : fTDC = r.fTDC;
160 0 : fTDCchannel = r.fTDCchannel;
161 0 : fLeading = r.fLeading;
162 0 : fTrailing = r.fTrailing;
163 0 : fToT = r.fToT;
164 0 : fTime = r.fTime;
165 0 : fError = r.fError;
166 0 : fDeltaBC = r.fDeltaBC;
167 0 : fL0L1Latency= r.fL0L1Latency;
168 0 : return *this;
169 :
170 0 : }
171 :
172 : //_____________________________________________________________________________
173 : void AliTOFrawData::Update(Int_t tof, Int_t tot, Int_t leading, Int_t trailing, Int_t psBit, Int_t acq, Int_t errorFlag)
174 : {
175 : //
176 : // To update a raw data object:
177 : // if there is just a leading edge measurement,
178 : // this method adds the trailing edge measurement
179 : // to evaluate the time-of-flight and time-over-threshold measurements
180 : //
181 :
182 0 : AliDebug(2,Form(" %d %d %d %d %d %d",tof, tot, leading, psBit, acq, errorFlag));
183 :
184 0 : if (fLeading!=-1 /*&& fTime==-1*/ && fToT==-1 && trailing!=-1) { // adc
185 :
186 0 : fTrailing = trailing;
187 0 : fTime = fLeading;
188 0 : fToT = Int_t((trailing - fLeading)*AliTOFGeometry::TdcBinWidth()/AliTOFGeometry::ToTBinWidth());
189 :
190 0 : }
191 :
192 0 : }
193 :
194 : //_____________________________________________________________________________
195 : Int_t AliTOFrawData::GetTOT() const
196 : {
197 : //
198 : // Return the TOT measurement
199 : //
200 :
201 : Int_t dummyToT = 0;
202 600 : if (fLeading!=-1 && fToT==-1) dummyToT = 0;
203 200 : else dummyToT = fToT;
204 :
205 200 : return dummyToT;
206 :
207 : }
|