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(Int_t *tracks, Int_t *vol,Float_t *digit)
47 // Constructor of digit object
60 //____________________________________________________________________________
61 AliTOFdigit::AliTOFdigit(const AliTOFdigit & digit)
65 // copy ctor for AliTOFdigit object
69 for ( i = 0; i < 3 ; i++)
70 fTracks[i] = digit.fTracks[i] ;
71 fSector = digit.fSector;
72 fPlate = digit.fPlate;
73 fStrip = digit.fStrip;
77 fTdcND = digit.fTdcND;
83 //______________________________________________________________________________
84 AliTOFdigit::AliTOFdigit(Int_t sector, Int_t plate, Int_t strip, Int_t padx,
85 Int_t padz, Float_t tdc, Float_t adc)
88 // Constructor for sdigit
101 //______________________________________________________________________________
102 void AliTOFdigit::GetLocation(Int_t *Loc) const
105 // Get the cohordinates of the digit
106 // in terms of Sector - Plate - Strip - Pad
116 //______________________________________________________________________________
117 Int_t AliTOFdigit::GetTotPad(AliTOFGeometry *tofGeom) const
120 // Get the "total" index of the pad inside a Sector
121 // starting from the digits data.
131 before = tofGeom->NStripC();
134 before = tofGeom->NStripC() + AliTOFGeometry::NStripB();
137 before = tofGeom->NStripC() + AliTOFGeometry::NStripB() + AliTOFGeometry::NStripA();
140 before = tofGeom->NStripC() + 2*AliTOFGeometry::NStripB() + AliTOFGeometry::NStripA();
144 Int_t pad = 2*fPadx + fPadz;
145 //Int_t pad = fPadx+AliTOFGeometry::NpadX()*fPadz;
146 Int_t strip = fStrip + before;
147 Int_t padTot = AliTOFGeometry::NpadXStrip()*strip + pad;
152 //______________________________________________________________________________
153 void AliTOFdigit::AddTrack(Int_t track)
156 // Add a new and different track to the digit
158 if (track==fTracks[0] || track==fTracks[1] || track==fTracks[2]) return;
161 }else if (fTracks[2]==0){
164 // printf("AliTOFdigit::AddTrack ERROR: Too many Tracks (>3) \n");
168 // Overloading of Streaming, Sum and Comparison operators
170 //______________________________________________________________________________
171 Bool_t AliTOFdigit::operator==(AliTOFdigit const &digit) const
174 // Overloading of Comparison operator
176 if (fSector==digit.fSector &&
177 fPlate==digit.fPlate &&
178 fStrip==digit.fStrip &&
179 fPadx==digit.fPadx &&
180 fPadz==digit.fPadz &&
182 fTdcND==digit.fTdcND &&
184 fToT==digit.fToT ) return kTRUE;
188 //______________________________________________________________________________
189 AliTOFdigit& AliTOFdigit::operator+(AliTOFdigit const &digit)
192 // Overloading of Sum operator
193 // Note: Some convolution
194 // between the two digit variables has to be inserted
196 if (fSector==digit.fSector &&
197 fPlate==digit.fPlate &&
198 fStrip==digit.fStrip &&
199 fPadx==digit.fPadx &&
200 fPadz==digit.fPadz) {
201 // convolution to be inserted here
205 AliTOFdigit(fSector,fPlate,fStrip,fPadx,fPadz,fTdc,fAdc);
209 //______________________________________________________________________________
210 ostream& operator << (ostream& out, const AliTOFdigit &digit)
213 // Output streamer: output of the digit data
215 out << "Sector " << digit.fSector << ", Plate " << digit.fPlate << ", Strip " << digit.fStrip << endl;
216 out << "Padx" << digit.fPadx << ", Padz " << digit.fPadz << endl;
217 out << "TDC " << digit.fTdc << ", ADC "<< digit.fAdc << endl;