1 /**************************************************************************
2 * Copyright(c) 2004-2006, 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 **************************************************************************/
16 #include <AliITSUDigitPix.h>
19 ///////////////////////////////////////////////////////////////////
21 // Class defining the digit object
23 // Inherits from AliITSdigit
25 ///////////////////////////////////////////////////////////////////
27 ClassImp(AliITSUDigitPix)
29 //______________________________________________________________________
30 AliITSUDigitPix::AliITSUDigitPix()
35 // default constructor, zero coordinates and set array
36 // elements to clearly unphysical values. A value of 0 may
37 // be a valide track of hit number.
40 for(i=0;i<fgkSize;i++) fTracks[i] = -3;
41 for(i=0;i<fgkSize;i++) fHits[i] = -1;
44 //______________________________________________________________________
45 AliITSUDigitPix::AliITSUDigitPix(const Int_t *digits)
46 :fSignalPix(digits[2])
49 // Creates a pixel digit object
52 for(i=0;i<fgkSize;i++) fTracks[i] = -3;
53 for(i=0;i<fgkSize;i++) fHits[i] = -1;
59 //______________________________________________________________________
60 AliITSUDigitPix::AliITSUDigitPix(const Int_t *digits,const Int_t *tracks,const Int_t *hits)
61 : fSignalPix(digits[2])
64 // Creates a simulated pixel digit object
66 for(Int_t i=0; i<fgkSize; i++) {
67 fTracks[i] = tracks[i];
75 //______________________________________________________________________
76 Int_t AliITSUDigitPix::GetListOfTracks(TArrayI &t)
78 // Fills the TArrayI t with the tracks found in fTracks removing
79 // duplicated tracks, but otherwise in the same order. It will return
80 // the number of tracks and fill the remaining elements to the array
83 // TArrayI &t Reference to a TArrayI to contain the list of
84 // nonduplicated track numbers.
86 // TArrayI &t The input array filled with the nonduplicated track
89 // Int_t The number of none -1 entries in the TArrayI t.
90 Int_t nt = t.GetSize();
91 Int_t nth = this->GetNTracks();
93 Bool_t inlist = kFALSE;
95 t.Reset(-1); // -1 array.
97 if(this->GetTrack(i) == -1) continue;
99 for(j=0;j<n;j++)if(this->GetTrack(i) == t.At(j)) inlist = kTRUE;
100 if(!inlist){ // add to end of list
101 t.AddAt(this->GetTrack(i),n);
108 //______________________________________________________________________
109 void AliITSUDigitPix::Print(ostream *os)
111 //Standard output format for this class
114 AliITSdigit::Print(os);
115 for(i=0;i<fgkSize;i++) *os <<","<< fTracks[i];
116 for(i=0;i<fgkSize;i++) *os <<","<< fHits[i];
117 *os << "," << fSignalPix;
118 *os << "," << fROCycle;
121 //______________________________________________________________________
122 void AliITSUDigitPix::Read(istream *os)
124 //Standard input for this class
127 AliITSdigit::Read(os);
128 for(i=0;i<fgkSize;i++) *os >> fTracks[i];
129 for(i=0;i<fgkSize;i++) *os >> fHits[i];
134 //______________________________________________________________________
135 ostream &operator<<(ostream &os,AliITSUDigitPix &source)
137 // Standard output streaming function.
143 //______________________________________________________________________
144 istream &operator>>(istream &os,AliITSUDigitPix &source)
146 // Standard output streaming function.