- if (sameTime >= 0) {
- (*fAdc)[sameTime] += static_cast<Float_t>(adc);
- // update track - find the first -1 value and replace it by the
- // track number
- for (Int_t iTrack=0; iTrack<kMAXDIGITS; iTrack++) {
- if ((*fTracks)[sameTime*kMAXDIGITS+iTrack] == -1) {
- (*fTracks)[sameTime*kMAXDIGITS+iTrack] = track;
- break;
- }
- // write warning about many tracks going to this pad
- if (iTrack == kMAXDIGITS) {
- cerr<<"WARNING: AliTOFSDigit::Update Many hits in the padhit"<<endl;
- cerr<<" ";
- // PrintPad();
+ 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 index array in case the current digit track index
+ // is different from -1
+ if (track!=-1) {
+
+ //Find the first -1 value of the track index array and replace
+ //it by the current digit track index
+ for (Int_t iTrack=0; iTrack<kMAXDIGITS; iTrack++) {
+ if (track==(*fTracks)[sameTime*kMAXDIGITS+iTrack]) break;
+ if ((*fTracks)[sameTime*kMAXDIGITS+iTrack] == -1) {
+ (*fTracks)[sameTime*kMAXDIGITS+iTrack] = track;
+ break;
+ }
+ // write warning about many tracks going to this pad at same time
+ if (iTrack == kMAXDIGITS-1) {
+ AliDebug(1,Form("Update: Many different tracks in the same TOF pad"
+ " (%2d %1d %2d %1d %2d)\n",
+ fSector,fPlate,fStrip,fPadz,fPadx));
+ //ToAliWarning(PrintPad());
+ }