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 "AliTOFGeometryV4.h"
39 #include "AliTOFGeometryV5.h"
40 #include "AliTOFdigit.h"
44 //______________________________________________________________________________
45 AliTOFdigit::AliTOFdigit(Int_t *tracks, Int_t *vol,Float_t *digit)
49 // Constructor of digit object
62 //____________________________________________________________________________
63 AliTOFdigit::AliTOFdigit(const AliTOFdigit & digit)
67 // copy ctor for AliTOFdigit object
71 for ( i = 0; i < 3 ; i++)
72 fTracks[i] = digit.fTracks[i] ;
73 fSector = digit.fSector;
74 fPlate = digit.fPlate;
75 fStrip = digit.fStrip;
79 fTdcND = digit.fTdcND;
85 //______________________________________________________________________________
86 AliTOFdigit::AliTOFdigit(Int_t sector, Int_t plate, Int_t strip, Int_t padx,
87 Int_t padz, Float_t tdc, Float_t adc)
90 // Constructor for sdigit
103 //______________________________________________________________________________
104 void AliTOFdigit::GetLocation(Int_t *Loc) const
107 // Get the cohordinates of the digit
108 // in terms of Sector - Plate - Strip - Pad
118 //______________________________________________________________________________
119 Int_t AliTOFdigit::GetTotPad(AliTOFGeometry *tofGeom) const
122 // Get the "total" index of the pad inside a Sector
123 // starting from the digits data.
133 before = tofGeom->NStripC();
136 before = tofGeom->NStripC() + AliTOFGeometry::NStripB();
139 before = tofGeom->NStripC() + AliTOFGeometry::NStripB() + AliTOFGeometry::NStripA();
142 before = tofGeom->NStripC() + 2*AliTOFGeometry::NStripB() + AliTOFGeometry::NStripA();
146 Int_t pad = 2*fPadx + fPadz;
147 //Int_t pad = fPadx+AliTOFGeometry::NpadX()*fPadz;
148 Int_t strip = fStrip + before;
149 Int_t padTot = AliTOFGeometry::NpadXStrip()*strip + pad;
154 //______________________________________________________________________________
155 void AliTOFdigit::AddTrack(Int_t track)
158 // Add a new and different track to the digit
160 if (track==fTracks[0] || track==fTracks[1] || track==fTracks[2]) return;
163 }else if (fTracks[2]==0){
166 // printf("AliTOFdigit::AddTrack ERROR: Too many Tracks (>3) \n");
170 // Overloading of Streaming, Sum and Comparison operators
172 //______________________________________________________________________________
173 Bool_t AliTOFdigit::operator==(AliTOFdigit const &digit) const
176 // Overloading of Comparison operator
178 if (fSector==digit.fSector &&
179 fPlate==digit.fPlate &&
180 fStrip==digit.fStrip &&
181 fPadx==digit.fPadx &&
182 fPadz==digit.fPadz &&
184 fTdcND==digit.fTdcND &&
186 fToT==digit.fToT ) return kTRUE;
190 //______________________________________________________________________________
191 AliTOFdigit& AliTOFdigit::operator+(AliTOFdigit const &digit)
194 // Overloading of Sum operator
195 // Note: Some convolution
196 // between the two digit variables has to be inserted
198 if (fSector==digit.fSector &&
199 fPlate==digit.fPlate &&
200 fStrip==digit.fStrip &&
201 fPadx==digit.fPadx &&
202 fPadz==digit.fPadz) {
203 // convolution to be inserted here
207 AliTOFdigit(fSector,fPlate,fStrip,fPadx,fPadz,fTdc,fAdc);
211 //______________________________________________________________________________
212 ostream& operator << (ostream& out, const AliTOFdigit &digit)
215 // Output streamer: output of the digit data
217 out << "Sector " << digit.fSector << ", Plate " << digit.fPlate << ", Strip " << digit.fStrip << endl;
218 out << "Padx" << digit.fPadx << ", Padz " << digit.fPadz << endl;
219 out << "TDC " << digit.fTdc << ", ADC "<< digit.fAdc << endl;