- emc = (AliPHOSEmcRecPoint *) emcRecPoints->At(linkLow->GetEmc()) ;
- ppsdLow = (AliPHOSPpsdRecPoint *) ppsdRecPointsLow->At(linkLow->GetPpsd()) ;
- if( (emc) && (ppsdLow) ){ // RecPoints not removed yet
- ppsdUp = 0 ;
-
- while ( (linkUp = (AliPHOSLink *)nextUp() ) ){
- if(linkLow->GetEmc() == linkUp->GetEmc() ){
- ppsdUp = (AliPHOSPpsdRecPoint *) ppsdRecPointsUp->At(linkUp->GetPpsd()) ;
- break ;
- }
-
- } // while nextUp
-
- nextUp.Reset();
-// AliPHOSTrackSegment * subtr = new AliPHOSTrackSegment(emc, ppsdUp, ppsdLow ) ;
-// trsl->Add(subtr) ;
- fNTrackSegments = trsl->GetEntries() ;
- new( (*trsl)[fNTrackSegments] ) AliPHOSTrackSegment(emc, ppsdUp, ppsdLow ) ;
- fNTrackSegments++ ;
- emcRecPoints->AddAt(nullpointer,linkLow->GetEmc()) ;
- ppsdRecPointsLow->AddAt(nullpointer,linkLow->GetPpsd()) ;
-
- if(ppsdUp)
- ppsdRecPointsUp->AddAt(nullpointer,linkUp->GetPpsd()) ;
-
+
+ emc = emcRecPoints->At(linkLow->GetEmc()) ;
+ ppsdLow = ppsdRecPointsLow->At(linkLow->GetPpsd()) ;
+ if( (emc >= 0) && (ppsdLow >= 0) ){ // RecPoints not removed yet
+
+ new( (*trsl)[fNTrackSegments] ) AliPHOSTrackSegment((AliPHOSEmcRecPoint *)fPlease->GimeRecPoint(emc,"emc"),
+ nullpointer,
+ (AliPHOSPpsdRecPoint *)fPlease->GimeRecPoint(ppsdLow,"ppsd") ) ;
+ ((AliPHOSTrackSegment* )trsl->At(fNTrackSegments))->SetIndexInList(fNTrackSegments);
+ //replace index of emc to negative and shifted index of TS
+ emcRecPoints->AddAt(-2 - fNTrackSegments,linkLow->GetEmc()) ;
+ //replace index of emc to negative and shifted index of TS
+ ppsdRecPointsLow->AddAt(-2 - fNTrackSegments,linkLow->GetPpsd()) ;
+ fNTrackSegments++ ;
+