output argument (AliFemtoV0*) changed to return value in CopyAODtoFemtoV0
authormaszyman <maszyman@cern.ch>
Tue, 1 Jul 2014 11:38:09 +0000 (13:38 +0200)
committermaszyman <maszyman@cern.ch>
Tue, 1 Jul 2014 11:51:11 +0000 (13:51 +0200)
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderAOD.cxx
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderAOD.h

index 7fc30bd..928eecf 100644 (file)
@@ -343,7 +343,6 @@ void AliFemtoEventReaderAOD::CopyAODtoFemtoEvent(AliFemtoEvent *tEvent)
       if(fMinPlpContribSPD) anaUtil->SetMinPlpContribSPD(fMinPlpContribSPD);
       if(fisPileUp)
        if(anaUtil->IsPileUpEvent(fEvent)) return; //Pile-up rejection.
-      delete anaUtil;   
     }
 
   // Primary Vertex position
@@ -824,7 +823,7 @@ void AliFemtoEventReaderAOD::CopyAODtoFemtoEvent(AliFemtoEvent *tEvent)
       if(aodv0->CosPointingAngle(fV1)<0.998) continue;
       AliFemtoV0* trackCopyV0 = new AliFemtoV0();
       count_pass++;
-      CopyAODtoFemtoV0(aodv0, trackCopyV0);
+      trackCopyV0 = CopyAODtoFemtoV0(aodv0);
       tEvent->V0Collection()->push_back(trackCopyV0);
       //cout<<"Pushback v0 to v0collection"<<endl;
     }
@@ -992,8 +991,10 @@ void AliFemtoEventReaderAOD::CopyAODtoFemtoTrack(AliAODTrack *tAodTrack,
 
 }
 
-void AliFemtoEventReaderAOD::CopyAODtoFemtoV0(AliAODv0 *tAODv0, AliFemtoV0 *tFemtoV0)
+AliFemtoV0* AliFemtoEventReaderAOD::CopyAODtoFemtoV0(AliAODv0 *tAODv0 )
 {
+  AliFemtoV0 *tFemtoV0 = new AliFemtoV0();
+
   tFemtoV0->SetdecayLengthV0(tAODv0->DecayLength(fV1));
   tFemtoV0->SetdecayVertexV0X(tAODv0->DecayVertexV0X());
   tFemtoV0->SetdecayVertexV0Y(tAODv0->DecayVertexV0Y());
@@ -1022,6 +1023,7 @@ void AliFemtoEventReaderAOD::CopyAODtoFemtoV0(AliAODv0 *tAODv0, AliFemtoV0 *tFem
   //void SetTrackTopologyMapPos(unsigned int word, const unsigned long& m);
   //void SetTrackTopologyMapNeg(unsigned int word, const unsigned long& m);
 
+
   tFemtoV0->SetmomV0X(tAODv0->MomV0X());
   tFemtoV0->SetmomV0Y(tAODv0->MomV0Y());
   tFemtoV0->SetmomV0Z(tAODv0->MomV0Z());
@@ -1060,6 +1062,7 @@ void AliFemtoEventReaderAOD::CopyAODtoFemtoV0(AliAODv0 *tAODv0, AliFemtoV0 *tFem
   tFemtoV0->SetCosPointingAngle(tAODv0->CosPointingAngle(fV1));
   //tFemtoV0->SetYV0(tAODv0->Y());
 
+
   //void SetdedxNeg(float x);
   //void SeterrdedxNeg(float x);//Gael 04Fev2002
   //void SetlendedxNeg(float x);//Gael 04Fev2002
@@ -1073,6 +1076,7 @@ void AliFemtoEventReaderAOD::CopyAODtoFemtoV0(AliAODv0 *tAODv0, AliFemtoV0 *tFem
   AliAODTrack *trackpos = (AliAODTrack*)tAODv0->GetDaughter(0);
   AliAODTrack *trackneg = (AliAODTrack*)tAODv0->GetDaughter(1);
 
+
   if(trackpos && trackneg)
   {
     tFemtoV0->SetEtaPos(trackpos->Eta());
@@ -1127,6 +1131,7 @@ void AliFemtoEventReaderAOD::CopyAODtoFemtoV0(AliAODv0 *tAODv0, AliFemtoV0 *tFem
     tmpVec.SetX(tpcExitNeg[0]); tmpVec.SetY(tpcExitNeg[1]); tmpVec.SetZ(tpcExitNeg[2]);
     tFemtoV0->SetNominalTpcExitPointNeg(tmpVec);
 
+
     AliFemtoThreeVector vecTpcPos[9];
     AliFemtoThreeVector vecTpcNeg[9];
     for(int i=0;i<9;i++)
@@ -1185,13 +1190,17 @@ void AliFemtoEventReaderAOD::CopyAODtoFemtoV0(AliAODv0 *tAODv0, AliFemtoV0 *tFem
       tFemtoV0->SetTOFKaonTimeNeg(TOFSignalNeg-pidNeg[3]);
       tFemtoV0->SetTOFProtonTimeNeg(TOFSignalNeg-pidNeg[4]);
     }
+
   }
   else
   {
+
     tFemtoV0->SetStatusPos(999);
     tFemtoV0->SetStatusNeg(999);
   }
+
   tFemtoV0->SetOnFlyStatusV0(tAODv0->GetOnFlyStatus());
+  return tFemtoV0;
 }
 
 void AliFemtoEventReaderAOD::SetFilterBit(UInt_t ibit)
index 3a45e1c..c90c5aa 100644 (file)
@@ -72,7 +72,7 @@ class AliFemtoEventReaderAOD : public AliFemtoEventReader
                                    AliFemtoTrack *tFemtoTrack
                                    //                              AliPWG2AODTrack *tPWG2AODTrack
                                    );
-  virtual void CopyAODtoFemtoV0(AliAODv0 *tAODv0, AliFemtoV0 *tFemtoV0);
+  virtual AliFemtoV0* CopyAODtoFemtoV0(AliAODv0 *tAODv0);
   virtual void CopyPIDtoFemtoTrack( AliAODTrack *tAodTrack,
                                   AliFemtoTrack *tFemtoTrack);