pointers fix
authorjbook <jbook>
Thu, 6 Mar 2014 21:47:32 +0000 (22:47 +0100)
committerjbook <jbook@cern.ch>
Thu, 6 Mar 2014 21:47:32 +0000 (22:47 +0100)
PWGDQ/dielectron/AliDielectron.cxx

index 281d9dd..c84199c 100644 (file)
@@ -1199,10 +1199,11 @@ void AliDielectron::FillPairArrays(Int_t arr1, Int_t arr2)
     Int_t end=ntrack2;
     if (arr1==arr2) end=itrack1;
     for (Int_t itrack2=0; itrack2<end; ++itrack2){
-      //create the pair
-      candidate->SetTracks(static_cast<AliVTrack*>(arrTracks1.UncheckedAt(itrack1)), fPdgLeg1,
-                          static_cast<AliVTrack*>(arrTracks2.UncheckedAt(itrack2)), fPdgLeg2);
+      //create the pair (direct pointer to the memory by this daughter reference are kept also for ME)
+      candidate->SetTracks(&(*static_cast<AliVTrack*>(arrTracks1.UncheckedAt(itrack1))), fPdgLeg1,
+                          &(*static_cast<AliVTrack*>(arrTracks2.UncheckedAt(itrack2))), fPdgLeg2);
       candidate->SetType(pairIndex);
+
       Int_t label=AliDielectronMC::Instance()->GetLabelMotherWithPdg(candidate,fPdgMother);
       candidate->SetLabel(label);
       if (label>-1) candidate->SetPdgCode(fPdgMother);