1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 Revision 1.2 2007/03/28 10:50:33 decaro
19 Rounding off problem in rawData coding/decoding: solved
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
24 Revision 0.1 2006/12/15 A.De Caro
28 //////////////////////////////////////////////////////
30 // This class provides the TOF raw data object //
32 //////////////////////////////////////////////////////
36 #include "AliTOFGeometry.h"
37 #include "AliTOFrawData.h"
39 ClassImp(AliTOFrawData)
41 //_____________________________________________________________________________
42 AliTOFrawData::AliTOFrawData() :
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) :
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) :
106 if (fTime==-1) fTime = fLeading;
109 //_____________________________________________________________________________
110 AliTOFrawData::AliTOFrawData(const AliTOFrawData& r) :
127 // dummy copy constructor
129 fACQflag = r.fACQflag;
132 fTRMchain = r.fTRMchain;
134 fTDCchannel = r.fTDCchannel;
135 fLeading = r.fLeading;
136 fTrailing = r.fTrailing;
140 fDeltaBC = r.fDeltaBC;
141 fL0L1Latency = r.fL0L1Latency;
145 //_____________________________________________________________________________
146 AliTOFrawData& AliTOFrawData::operator=(const AliTOFrawData& r)
149 // dummy assignment operator
151 this->fACQflag = r.fACQflag;
152 this->fPSbit = r.fPSbit;
154 this->fTRMchain = r.fTRMchain;
156 this->fTDCchannel = r.fTDCchannel;
157 this->fLeading = r.fLeading;
158 this->fTrailing = r.fTrailing;
160 this->fTime = r.fTime;
161 this->fError = r.fError;
162 this->fDeltaBC = r.fDeltaBC;
163 this->fL0L1Latency = r.fL0L1Latency;
168 //_____________________________________________________________________________
169 void AliTOFrawData::Update(Int_t tof, Int_t tot, Int_t leading, Int_t trailing, Int_t psBit, Int_t acq, Int_t errorFlag)
172 // To update a raw data object:
173 // if there is just a leading edge measurement,
174 // this method adds the trailing edge measurement
175 // to evaluate the time-of-flight and time-over-threshold measurements
178 AliDebug(2,Form(" %d %d %d %d %d %d",tof, tot, leading, psBit, acq, errorFlag));
180 if (fLeading!=-1 /*&& fTime==-1*/ && fToT==-1 && trailing!=-1) { // adc
182 fTrailing = trailing;
184 fToT = Int_t((trailing - fLeading)*AliTOFGeometry::TdcBinWidth()/AliTOFGeometry::ToTBinWidth());
190 //_____________________________________________________________________________
191 Int_t AliTOFrawData::GetTOT() const
194 // Return the TOT measurement
198 if (fLeading!=-1 && fToT==-1) dummyToT = 0;
199 else dummyToT = fToT;