From a762e4c7d0a823352b581749e55ad16dbe9baa80 Mon Sep 17 00:00:00 2001
From: Bertram Kopf <bertram@ep1.rub.de>
Date: Fri, 15 Nov 2024 11:02:37 +0100
Subject: [PATCH] minor modifications for calculating the 4-vectors of mother
 mother reference system in the decay levels >=3

---
 PwaUtils/AbsDecay.cc | 27 ++++++++-------------------
 1 file changed, 8 insertions(+), 19 deletions(-)

diff --git a/PwaUtils/AbsDecay.cc b/PwaUtils/AbsDecay.cc
index 0df8dc7b..75f03d28 100644
--- a/PwaUtils/AbsDecay.cc
+++ b/PwaUtils/AbsDecay.cc
@@ -572,32 +572,21 @@ void AbsDecay::fillWignerDs(std::map<std::string, Vector4<double> >& fsMap,
       }
       
        std::vector< std::shared_ptr<AbsDecay> > motherMotherAmpList=motherAmpList.at(0)->motherAmpRefList();
-      if(motherMotherAmpList.size()>1 || motherMotherAmpList.size()==0){
+       if(motherMotherAmpList.size()>1 || motherMotherAmpList.size()==0){
         Alert << "decay level " << whichDecayLevel() << " for the decay " << name() << " contains 0 or more than 1 production reference amplitude! Production plane cannot be set properly" << endmsg;
         Alert << "motherMotherAmpList.size(): " << motherMotherAmpList.size() << endmsg;
         exit(0);
       }
  
-      Vector4<double> motherRefDaughter1_4Vec;
-      std::vector<Particle*> motherRefDaughter1List=motherMotherAmpList.at(0)->finalStateParticlesDaughter1();
-      for(itP=motherRefDaughter1List.begin(); itP!=motherRefDaughter1List.end(); ++itP){
-	itMap=fsMap.find((*itP)->name());
-	motherRefDaughter1_4Vec+=itMap->second;
+      std::vector<Particle*> motherMotherFStPs=motherMotherAmpList.at(0)->finalStateParticles();
+      motherRefVec=Vector4<double>(0.,0.,0.,0.);
+      for(itP=motherMotherFStPs.begin(); itP!=motherMotherFStPs.end(); ++itP){
+        itMap=fsMap.find((*itP)->name());
+	motherRefVec+=itMap->second;
       }
-      
-      //fill daughter2
-      Vector4<double> motherRefDaughter2_4Vec;
-      std::vector<Particle*> motherRefDaughter2List=motherMotherAmpList.at(0)->finalStateParticlesDaughter2();
-      for(itP=motherRefDaughter2List.begin(); itP!=motherRefDaughter2List.end(); ++itP){
-	itMap=fsMap.find((*itP)->name());
-	motherRefDaughter2_4Vec+=itMap->second;
-      }
-      
-      motherRefVec=motherRefDaughter1_4Vec+motherRefDaughter2_4Vec;
-      //InfoMsg << "motherRefVec: " << motherRefVec << endmsg;
-      //InfoMsg << "prodParticle4Vec: " << prodParticle4Vec << endmsg;
+      // InfoMsg << "motherRefVec: " << motherRefVec << "\tmass: " << motherRefVec.M() << endmsg;
+      // InfoMsg << "prodParticle4Vec: " << prodParticle4Vec << "\tmass: " << prodParticle4Vec.M() << endmsg;
     }  
-
     daughter2HelMother=KinUtils::heliVec(motherRefVec, prodParticle4Vec, mother4Vec, daughter2_4Vec);
     daughter1HelMother=KinUtils::heliVec(motherRefVec, prodParticle4Vec, mother4Vec, daughter1_4Vec);
   }
-- 
GitLab