1 //_________________________________________________________________________
2 // TOF digit: member variables
3 // fSector : TOF sector
5 // fStrip : strips number
6 // fPadx : pad number along x
7 // fPadz : pad number along z
11 // Getters, setters and member functions defined here
13 //*-- Authors: F. Pierella, A. Seganti, D. Vicinanza
16 /**************************************************************************
17 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
19 * Author: The ALICE Off-line Project. *
20 * Contributors are mentioned in the code where appropriate. *
22 * Permission to use, copy, modify and distribute this software and its *
23 * documentation strictly for non-commercial purposes is hereby granted *
24 * without fee, provided that the above copyright notice appears in all *
25 * copies and that both the copyright notice and this permission notice *
26 * appear in the supporting documentation. The authors make no claims *
27 * about the suitability of this software for any purpose. It is *
28 * provided "as is" without express or implied warranty. *
29 **************************************************************************/
31 #include <Riostream.h>
34 #include "AliTOFdigit.h"
39 //______________________________________________________________________________
40 AliTOFdigit::AliTOFdigit(Int_t *tracks, Int_t *vol,Float_t *digit)
44 // Constructor of digit object
55 //____________________________________________________________________________
56 AliTOFdigit::AliTOFdigit(const AliTOFdigit & digit)
59 // copy ctor for AliTOFdigit object
63 for ( i = 0; i < 3 ; i++)
64 fTracks[i] = digit.fTracks[i] ;
65 fSector = digit.fSector;
66 fPlate = digit.fPlate;
67 fStrip = digit.fStrip;
75 //______________________________________________________________________________
76 AliTOFdigit::AliTOFdigit(Int_t sector, Int_t plate, Int_t strip, Int_t padx,
77 Int_t padz, Float_t tdc, Float_t adc)
80 // Constructor for sdigit
91 //______________________________________________________________________________
92 void AliTOFdigit::GetLocation(Int_t *Loc) const
95 // Get the cohordinates of the digit
96 // in terms of Sector - Plate - Strip - Pad
106 //______________________________________________________________________________
107 Int_t AliTOFdigit::GetTotPad() const
110 // Get the "total" index of the pad inside a Sector
111 // starting from the digits data.
117 tof =(AliTOF*) gAlice->GetDetector("TOF");
119 printf("AliTOFdigit::GetTotPad - No AliRun object present, exiting");
123 Int_t pad = fPadx+tof->GetNpadX()*(fPadz-1);
129 case 2: before = tof->GetNStripC();
131 case 3: before = tof->GetNStripB() + tof->GetNStripC();
133 case 4: before = tof->GetNStripA() + tof->GetNStripB() + tof->GetNStripC();
135 case 5: before = tof->GetNStripA() + 2*tof->GetNStripB() + tof->GetNStripC();
139 Int_t strip = fStrip+before;
140 Int_t padTot = tof->GetPadXStr()*(strip-1)+pad;
144 //______________________________________________________________________________
145 void AliTOFdigit::AddTrack(Int_t track)
148 // Add a new and different track to the digit
150 if (track==fTracks[0] || track==fTracks[1] || track==fTracks[2]) return;
153 }else if (fTracks[2]==0){
156 // printf("AliTOFdigit::AddTrack ERROR: Too many Tracks (>3) \n");
160 // Overloading of Streaming, Sum and Comparison operators
162 //______________________________________________________________________________
163 Bool_t AliTOFdigit::operator==(AliTOFdigit const &digit) const
166 // Overloading of Comparison operator
168 if (fSector==digit.fSector &&
169 fPlate==digit.fPlate &&
170 fStrip==digit.fStrip &&
171 fPadx==digit.fPadx &&
172 fPadz==digit.fPadz &&
174 fAdc==digit.fAdc) return kTRUE;
178 //______________________________________________________________________________
179 AliTOFdigit& AliTOFdigit::operator+(AliTOFdigit const &digit)
182 // Overloading of Sum operator
183 // Note: Some convolution
184 // between the two digit variables has to be inserted
186 if (fSector==digit.fSector &&
187 fPlate==digit.fPlate &&
188 fStrip==digit.fStrip &&
189 fPadx==digit.fPadx &&
190 fPadz==digit.fPadz) {
191 // convolution to be inserted here
195 AliTOFdigit(fSector,fPlate,fStrip,fPadx,fPadz,fTdc,fAdc);
199 //______________________________________________________________________________
200 ostream& operator << (ostream& out, const AliTOFdigit &digit)
203 // Output streamer: output of the digit data
205 out << "Sector " << digit.fSector << ", Plate " << digit.fPlate << ", Strip " << digit.fStrip << endl;
206 out << "Padx" << digit.fPadx << ", Padz " << digit.fPadz << endl;
207 out << "TDC " << digit.fTdc << ", ADC "<< digit.fAdc << endl;