- Int_t nTracks = (Int_t) treeH->GetEntries();
- for (Int_t iTrack = 0; iTrack < nTracks; iTrack++) {
- vzero->ResetHits();
- treeH->GetEvent(iTrack);
- Int_t nHits = hits->GetEntriesFast();
- for (Int_t iHit = 0; iHit < nHits; iHit++) {
- AliVZEROhit* hit = (AliVZEROhit *)hits->UncheckedAt(iHit);
- Int_t nPhot = hit->Nphot();
- Int_t cell = hit->Cell();
- map[cell] += nPhot;
- Float_t dt_scintillator = gRandom->Gaus(0,0.7);
- time[cell] = dt_scintillator + 1e9*hit->Tof();
- if(time[cell] < timeV0) timeV0 = time[cell];
- } // hit loop
- } // track loop
-
- loader->UnloadHits();
+ Int_t nTracks = (Int_t) treeH->GetEntries();
+ for (Int_t iTrack = 0; iTrack < nTracks; iTrack++) {
+ for (Int_t i=0; i<80; i++) {time_ref[i] = 999999.0;}
+ vzero->ResetHits();
+ treeH->GetEvent(iTrack);
+ Int_t nHits = hits->GetEntriesFast();
+ for (Int_t iHit = 0; iHit < nHits; iHit++) {
+ AliVZEROhit* hit = (AliVZEROhit *)hits->UncheckedAt(iHit);
+ Int_t nPhot = hit->Nphot();
+ Int_t cell = hit->Cell();
+ map[cell] += nPhot;
+ Float_t dt_scintillator = gRandom->Gaus(0,0.7);
+ Float_t t = dt_scintillator + 1e9*hit->Tof();
+ if (t > 0.0) {
+ if(t < time_ref[cell]) time_ref[cell] = t;
+ time[cell] = TMath::Min(t,time_ref[cell]); }
+ } // hit loop
+ } // track loop
+
+ loader->UnloadHits();