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