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