]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Forcing the order of the V0 daughter inside the constructor
authorbelikov <belikov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 18 Jan 2011 13:57:42 +0000 (13:57 +0000)
committerbelikov <belikov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 18 Jan 2011 13:57:42 +0000 (13:57 +0000)
STEER/AliESDv0.cxx

index 131907964ef25a5e68827c23a336d47308e7c5f1..8cf2c3074400edeed86ebdc96255e60d186b8ef4 100644 (file)
@@ -156,6 +156,15 @@ AliESDv0::AliESDv0(const AliExternalTrackParam &t1, Int_t i1,
   // Main constructor  (K0s)
   //--------------------------------------------------------------------
 
+  //Make sure the daughters are ordered (needed for the on-the-fly V0s)
+  Short_t cN=t1.Charge(), cP=t2.Charge();
+  if ((cN>0) && (cN != cP)) {
+     fParamN.~AliExternalTrackParam();
+     new (&fParamN) AliExternalTrackParam(t2);
+     fParamP.~AliExternalTrackParam();
+     new (&fParamP) AliExternalTrackParam(t1);
+  }
+
   for (Int_t i=0; i<6; i++) {
     fPosCov[i]= 0.;
   }