]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Temporary fix in momentum conservation check (A. Dainese)
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 24 Jun 2009 09:44:09 +0000 (09:44 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 24 Jun 2009 09:44:09 +0000 (09:44 +0000)
STEER/AliAODRecoDecay.cxx

index 63ea75691d8f3f63f5235fdcd75c92497e9f8a35..6037574daba23f680ebaa9084476fde079c500c1 100644 (file)
@@ -584,10 +584,11 @@ Int_t AliAODRecoDecay::MatchToMC(Int_t pdgabs,TClonesArray *mcArray,
   Double_t pxMother = part->Px();
   Double_t pyMother = part->Py();
   Double_t pzMother = part->Pz();
-  // within 1 MeV
-  if(TMath::Abs(pxMother-pxSumDgs) > 0.001 ||
-     TMath::Abs(pyMother-pySumDgs) > 0.001 ||
-     TMath::Abs(pzMother-pzSumDgs) > 0.001) return -1;
+  // within 0.1%
+  if((TMath::Abs(pxMother-pxSumDgs)/(TMath::Abs(pxMother)+1.e-13)) > 0.001 &&
+     (TMath::Abs(pyMother-pySumDgs)/(TMath::Abs(pyMother)+1.e-13)) > 0.001 &&
+     (TMath::Abs(pzMother-pzSumDgs)/(TMath::Abs(pzMother)+1.e-13)) > 0.001) 
+    return -1;
  
   return labMother;
 }