]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TOF/AliTOFrawData.cxx
set as default configuration the geometry with PHOS holes
[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 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 ClassImp(AliTOFrawData)
40
41 //_____________________________________________________________________________
42 AliTOFrawData::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 //_____________________________________________________________________________
62 AliTOFrawData::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) :
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 //_____________________________________________________________________________
83 AliTOFrawData::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) :
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
100
101 }
102
103 //_____________________________________________________________________________
104 AliTOFrawData::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 //_____________________________________________________________________________
136 AliTOFrawData& 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 //_____________________________________________________________________________
157 void AliTOFrawData::Update(Int_t tof, Int_t tot, Int_t leading, Int_t trailing, Int_t psBit, Int_t acq, Int_t errorFlag)
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
168   if (fLeading!=-1 && fTime==-1 && fToT==-1 && trailing!=-1) {
169
170     fTrailing = trailing;
171     fTime = fLeading;
172     fToT = Int_t((trailing - fLeading)*AliTOFGeometry::TdcBinWidth()/AliTOFGeometry::ToTBinWidth());
173     
174   }
175   /*
176   else if (fLeading!=-1 && fTime==-1 && fToT==-1 && leading==-1 && trailing!=-1) {
177
178     fTime = fLeading;
179     fToT = Int_t((trailing - fLeading)*AliTOFGeometry::TdcBinWidth()/AliTOFGeometry::ToTBinWidth());
180     
181   }
182   */
183
184 }