X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=TOF%2FAliTOFSDigit.cxx;h=25a797ca32cc32955db9a689b2cd89b83fc97315;hb=550c8e217c8eb8c4915c2af44cff87a73eacd3cc;hp=a506517d75af09ee4a02a78256c06a1235dafec8;hpb=8a190ba28397d08a3826976c55dff231b8f86fb1;p=u%2Fmrichter%2FAliRoot.git diff --git a/TOF/AliTOFSDigit.cxx b/TOF/AliTOFSDigit.cxx index a506517d75a..25a797ca32c 100644 --- a/TOF/AliTOFSDigit.cxx +++ b/TOF/AliTOFSDigit.cxx @@ -31,8 +31,6 @@ // -- Authors: F. Pierella, A. Seganti, D. Vicinanza // //_________________________________________________________________________// -//#include "TArrayI.h" - #include "AliLog.h" #include "AliTOFGeometry.h" @@ -58,7 +56,7 @@ AliTOFSDigit::AliTOFSDigit(): } //////////////////////////////////////////////////////////////////////// -AliTOFSDigit::AliTOFSDigit(Int_t tracknum, Int_t *vol,Int_t *digit): +AliTOFSDigit::AliTOFSDigit(Int_t tracknum, Int_t * const vol,Int_t * const digit): TObject(), fSector(-1), fPlate(-1), @@ -186,7 +184,7 @@ void AliTOFSDigit::Update(Float_t tdcbin, Int_t tdc, Int_t adc, Int_t track) // Int_t sameTime = -1; - Float_t tdcwindow=((Float_t)AliTOFGeometry::TimeDiff())/tdcbin; + Float_t tdcwindow = AliTOFGeometry::DeadTime()/tdcbin; for (Int_t i = 0; i < fNDigits; i++) { if (TMath::Abs(tdc-fTdc->At(i)) < tdcwindow) { sameTime = i; @@ -194,22 +192,35 @@ void AliTOFSDigit::Update(Float_t tdcbin, Int_t tdc, Int_t adc, Int_t track) } } - if (sameTime >= 0) { + if (sameTime >= 0) { // another time measurement happens during the + // dead time of the hit pad => it corresponds + // to the same time measurement (*fAdc)[sameTime] += adc; - // update track - find the first -1 value and replace it by the - // track number - for (Int_t iTrack=0; iTrackSet(fNDigits); @@ -218,70 +229,45 @@ void AliTOFSDigit::Update(Float_t tdcbin, Int_t tdc, Int_t adc, Int_t track) (*fAdc)[fNDigits-1] = adc; fTracks->Set(fNDigits*kMAXDIGITS); (*fTracks)[(fNDigits-1)*kMAXDIGITS] = track; - for (Int_t i = 1; i GetNDigits(); + Float_t tdcbin = AliTOFGeometry::TdcBinWidth();// [ps] hardwired for the time being + + Int_t track = -1; + Int_t adc = -1; + Int_t tdc = -1; + // start loop on all sdig locations + Int_t nlocations = sdig->GetNDigits(); for (Int_t j = 0; j < nlocations; j++) { - Float_t tdcbin = AliTOFGeometry::TdcBinWidth();// [ps] hardwired for the time being - Int_t tdc=(Int_t)sdig->GetTdc(j); - Int_t adc=(Int_t)sdig->GetAdc(j); + tdc = (Int_t)sdig->GetTdc(j); + adc = (Int_t)sdig->GetAdc(j); + // getting here only the first track number - Int_t track=GetTrack(j,0); - - - Int_t sameTime = -1; - Float_t tdcwindow=((Float_t)AliTOFGeometry::TimeDiff())/tdcbin; - for (Int_t i = 0; i < fNDigits; i++) { - if (TMath::Abs(tdc-fTdc->At(i)) < tdcwindow) { - sameTime = i; - break; - } - } - - if (sameTime >= 0) { - (*fAdc)[sameTime] += adc; - // update track - find the first -1 value and replace it by the - // track number - for (Int_t iTrack=0; iTrackSet(fNDigits); - (*fTdc)[fNDigits-1] = tdc; - fAdc->Set(fNDigits); - (*fAdc)[fNDigits-1] = adc; - fTracks->Set(fNDigits*kMAXDIGITS); - (*fTracks)[(fNDigits-1)*kMAXDIGITS] = track; - for (Int_t i = 1; i = 0) + //Int_t track = GetTrack(j,0); + + // getting here all the track numbers + for (Int_t iTrack = 0; iTrackGetTrack(j,iTrack); + Update(tdcbin, tdc, adc, track); + } // end loop on tracks + } // end loop on sdig locations + + } //////////////////////////////////////////////////////////////////////// @@ -304,8 +290,7 @@ Int_t AliTOFSDigit::GetTotPad() const // starting from the digits data. // - Int_t pad = 2*fPadx + fPadz; - //Int_t pad = fPadx+AliTOFGeometry::NpadX()*fPadz; + Int_t pad = AliTOFGeometry::NpadZ()*fPadx + fPadz; Int_t before=0; switch(fPlate){