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 //_________________________________________________________________________//
20 // TOF digit: member variables //
21 // fSector : TOF sector //
22 // fPlate : TOF plate //
23 // fStrip : strips number //
24 // fPadx : pad number along x //
25 // fPadz : pad number along z //
29 // Getters, setters and member functions defined here //
31 // -- Authors: F. Pierella, A. Seganti, D. Vicinanza //
32 //_________________________________________________________________________//
35 #include "Riostream.h"
37 #include "AliTOFdigit.h"
38 #include "AliTOFGeometry.h"
42 //______________________________________________________________________________
43 AliTOFdigit::AliTOFdigit()
56 //______________________________________________________________________________
57 AliTOFdigit::AliTOFdigit(Int_t *tracks, Int_t *vol,Int_t *digit)
70 // Constructor of digit object
85 //____________________________________________________________________________
86 AliTOFdigit::AliTOFdigit(const AliTOFdigit & digit)
99 // copy ctor for AliTOFdigit object
103 for ( i = 0; i < 3 ; i++)
104 fTracks[i] = digit.fTracks[i] ;
105 fSector = digit.fSector;
106 fPlate = digit.fPlate;
107 fStrip = digit.fStrip;
111 fTdcND = digit.fTdcND;
117 //______________________________________________________________________________
118 AliTOFdigit::AliTOFdigit(Int_t sector, Int_t plate, Int_t strip, Int_t padx,
119 Int_t padz, Int_t tdc, Int_t adc):
131 // Constructor for sdigit
144 //______________________________________________________________________________
145 void AliTOFdigit::GetLocation(Int_t *Loc) const
148 // Get the cohordinates of the digit
149 // in terms of Sector - Plate - Strip - Pad
159 //______________________________________________________________________________
160 Int_t AliTOFdigit::GetTotPad() const
163 // Get the "total" index of the pad inside a Sector
164 // starting from the digits data.
174 before = AliTOFGeometry::NStripC();
177 before = AliTOFGeometry::NStripC() + AliTOFGeometry::NStripB();
180 before = AliTOFGeometry::NStripC() + AliTOFGeometry::NStripB() + AliTOFGeometry::NStripA();
183 before = AliTOFGeometry::NStripC() + 2*AliTOFGeometry::NStripB() + AliTOFGeometry::NStripA();
187 Int_t pad = 2*fPadx + fPadz;
188 //Int_t pad = fPadx+AliTOFGeometry::NpadX()*fPadz;
189 Int_t strip = fStrip + before;
190 Int_t padTot = AliTOFGeometry::NpadXStrip()*strip + pad;
195 //______________________________________________________________________________
196 void AliTOFdigit::AddTrack(Int_t track)
199 // Add a new and different track to the digit
201 if (track==fTracks[0] || track==fTracks[1] || track==fTracks[2]) return;
204 }else if (fTracks[2]==0){
207 // printf("AliTOFdigit::AddTrack ERROR: Too many Tracks (>3) \n");
211 // Overloading of Streaming, Sum and Comparison operators
213 //______________________________________________________________________________
214 Bool_t AliTOFdigit::operator==(AliTOFdigit const &digit) const
217 // Overloading of Comparison operator
219 if (fSector==digit.fSector &&
220 fPlate==digit.fPlate &&
221 fStrip==digit.fStrip &&
222 fPadx==digit.fPadx &&
223 fPadz==digit.fPadz &&
225 fTdcND==digit.fTdcND &&
227 fToT==digit.fToT ) return kTRUE;
231 //______________________________________________________________________________
232 AliTOFdigit AliTOFdigit::operator+(const AliTOFdigit &digit)
235 // Overloading of Sum operator
236 // Note: Some convolution
237 // between the two digit variables has to be inserted
239 if (fSector==digit.fSector &&
240 fPlate==digit.fPlate &&
241 fStrip==digit.fStrip &&
242 fPadx==digit.fPadx &&
243 fPadz==digit.fPadz) {
244 // convolution to be inserted here
248 AliTOFdigit(fSector,fPlate,fStrip,fPadx,fPadz,fTdc,fAdc);
252 //______________________________________________________________________________
253 ostream& operator << (ostream& out, const AliTOFdigit &digit)
256 // Output streamer: output of the digit data
259 out << "Sector " << digit.fSector << ", Plate " << digit.fPlate << ", Strip " << digit.fStrip << endl;
260 out << "Padx" << digit.fPadx << ", Padz " << digit.fPadz << endl;
261 out << "TDC " << digit.fTdc << ", ADC "<< digit.fAdc << endl;