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 //_________________________________________________________________________
19 // TOF digit: member variables
20 // fSector : TOF sector
22 // fStrip : strips number
23 // fPadx : pad number along x
24 // fPadz : pad number along z
28 // Getters, setters and member functions defined here
30 //*-- Authors: F. Pierella, A. Seganti, D. Vicinanza
33 #include <Riostream.h>
37 #include "AliTOFGeometry.h"
38 #include "AliTOFdigit.h"
42 //______________________________________________________________________________
43 AliTOFdigit::AliTOFdigit(Int_t *tracks, Int_t *vol,Float_t *digit)
47 // Constructor of digit object
58 //____________________________________________________________________________
59 AliTOFdigit::AliTOFdigit(const AliTOFdigit & digit)
63 // copy ctor for AliTOFdigit object
67 for ( i = 0; i < 3 ; i++)
68 fTracks[i] = digit.fTracks[i] ;
69 fSector = digit.fSector;
70 fPlate = digit.fPlate;
71 fStrip = digit.fStrip;
79 //______________________________________________________________________________
80 AliTOFdigit::AliTOFdigit(Int_t sector, Int_t plate, Int_t strip, Int_t padx,
81 Int_t padz, Float_t tdc, Float_t adc)
84 // Constructor for sdigit
95 //______________________________________________________________________________
96 void AliTOFdigit::GetLocation(Int_t *Loc) const
99 // Get the cohordinates of the digit
100 // in terms of Sector - Plate - Strip - Pad
110 //______________________________________________________________________________
111 Int_t AliTOFdigit::GetTotPad() const
114 // Get the "total" index of the pad inside a Sector
115 // starting from the digits data.
125 before = AliTOFGeometry::NStripC();
128 before = AliTOFGeometry::NStripC() + AliTOFGeometry::NStripB();
131 before = AliTOFGeometry::NStripC() + AliTOFGeometry::NStripB() + AliTOFGeometry::NStripA();
134 before = AliTOFGeometry::NStripC() + 2*AliTOFGeometry::NStripB() + AliTOFGeometry::NStripA();
138 Int_t pad = 2*fPadx + fPadz;
139 //Int_t pad = fPadx+AliTOFGeometry::NpadX()*fPadz;
140 Int_t strip = fStrip + before;
141 Int_t padTot = AliTOFGeometry::NpadXStrip()*strip + pad;
146 //______________________________________________________________________________
147 void AliTOFdigit::AddTrack(Int_t track)
150 // Add a new and different track to the digit
152 if (track==fTracks[0] || track==fTracks[1] || track==fTracks[2]) return;
155 }else if (fTracks[2]==0){
158 // printf("AliTOFdigit::AddTrack ERROR: Too many Tracks (>3) \n");
162 // Overloading of Streaming, Sum and Comparison operators
164 //______________________________________________________________________________
165 Bool_t AliTOFdigit::operator==(AliTOFdigit const &digit) const
168 // Overloading of Comparison operator
170 if (fSector==digit.fSector &&
171 fPlate==digit.fPlate &&
172 fStrip==digit.fStrip &&
173 fPadx==digit.fPadx &&
174 fPadz==digit.fPadz &&
176 fAdc==digit.fAdc) return kTRUE;
180 //______________________________________________________________________________
181 AliTOFdigit& AliTOFdigit::operator+(AliTOFdigit const &digit)
184 // Overloading of Sum operator
185 // Note: Some convolution
186 // between the two digit variables has to be inserted
188 if (fSector==digit.fSector &&
189 fPlate==digit.fPlate &&
190 fStrip==digit.fStrip &&
191 fPadx==digit.fPadx &&
192 fPadz==digit.fPadz) {
193 // convolution to be inserted here
197 AliTOFdigit(fSector,fPlate,fStrip,fPadx,fPadz,fTdc,fAdc);
201 //______________________________________________________________________________
202 ostream& operator << (ostream& out, const AliTOFdigit &digit)
205 // Output streamer: output of the digit data
207 out << "Sector " << digit.fSector << ", Plate " << digit.fPlate << ", Strip " << digit.fStrip << endl;
208 out << "Padx" << digit.fPadx << ", Padz " << digit.fPadz << endl;
209 out << "TDC " << digit.fTdc << ", ADC "<< digit.fAdc << endl;