From dedb7940282e81ddea73345cd19266a9243ebca0 Mon Sep 17 00:00:00 2001 From: Baptiste Mouginot <mouginot.baptiste@gmail.com> Date: Wed, 3 Dec 2014 12:14:16 +0000 Subject: [PATCH] Adding some comment, and few bug corrections git-svn-id: svn+ssh://svn.in2p3.fr/class@451 0e7d625b-0364-4367-a6be-d5be4a48d228 --- .../CLASSV3/include/CLASSNucleiFiliation.hxx | 42 ++++++++++++++++--- .../CLASSV3/src/CLASSNucleiFiliation.cxx | 23 +++++----- 2 files changed, 48 insertions(+), 17 deletions(-) diff --git a/source/branches/CLASSV3/include/CLASSNucleiFiliation.hxx b/source/branches/CLASSV3/include/CLASSNucleiFiliation.hxx index 8fff72da2..6754f4080 100644 --- a/source/branches/CLASSV3/include/CLASSNucleiFiliation.hxx +++ b/source/branches/CLASSV3/include/CLASSNucleiFiliation.hxx @@ -36,31 +36,63 @@ public: //@{ CLASSNucleiFiliation(); ///< Default constructor - //} - CLASSNucleiFiliation(CLASSNucleiFiliation CNF); + CLASSNucleiFiliation(CLASSNucleiFiliation CNF); ///< Copy Constructor ~CLASSNucleiFiliation(); ///< Normal Destructor. - void AddDaughterToZAI(ZAI Mother, IsotopicVector Daughter ); + //} + + //********* Get Method *********// + /*! + \name Get Method + */ + //@{ + map<ZAI, IsotopicVector> GetNucleiFIliation() const {return fNucleiFiliation;} + IsotopicVector GetFiliation(ZAI Mother); + + //} + + //********* Add Method *********// + + /*! + \name Adding Method + */ + //@{ + + + void AddDaughterToZAI(ZAI Mother, IsotopicVector Daughter ); + + //} - map<ZAI, IsotopicVector> GetNucleiFIliation() const {return fNucleiFiliation;} + //********* Modification Method *********// + + /*! + \name Modification Method + */ + //@{ + void FiliationCleanUp(map<ZAI, int> GoodNuclei, CLASSNucleiFiliation CuttedNuclei); void SelfFiliationCleanUp(map<ZAI, int> GoodNuclei); + + + void NormalizeBranchingRatio(double Value = 1); void NormalizeBranchingRatio(ZAI Mother, double Value); + //} + - protected : +protected : map<ZAI, IsotopicVector> fNucleiFiliation; diff --git a/source/branches/CLASSV3/src/CLASSNucleiFiliation.cxx b/source/branches/CLASSV3/src/CLASSNucleiFiliation.cxx index 7bdaa34bd..785e88a6b 100644 --- a/source/branches/CLASSV3/src/CLASSNucleiFiliation.cxx +++ b/source/branches/CLASSV3/src/CLASSNucleiFiliation.cxx @@ -65,10 +65,10 @@ IsotopicVector CLASSNucleiFiliation::GetFiliation(ZAI Mother) DBGL map<ZAI, IsotopicVector>::iterator it_Filiation; - it_Filiation = fNucleiFiliation.find(Mother); + it_Filiation = fNucleiFiliation.find(Mother); // search for the ZAI in the map DBGL - if(it_Filiation != fNucleiFiliation.end()) + if(it_Filiation != fNucleiFiliation.end()) // test if it is present in the map return it_Filiation->second; else return ZAI(-1,-1,-1)*1; // return -1 -1 _1 ZAI if unknown nuclei.... @@ -80,11 +80,11 @@ void CLASSNucleiFiliation::FiliationCleanUp(map<ZAI, int> GoodNuclei, CLASSNucle { DBGL map<ZAI, IsotopicVector>::iterator it_Filiation; - for(it_Filiation = fNucleiFiliation.begin(); it_Filiation != fNucleiFiliation.end(); it_Filiation++) + for(it_Filiation = fNucleiFiliation.begin(); it_Filiation != fNucleiFiliation.end(); it_Filiation++) // loop on the filiation map (on the Mother ZAI) { - vector<ZAI> DautherList = it_Filiation->second.GetZAIList(); + vector<ZAI> DautherList = it_Filiation->second.GetZAIList(); // recover for each mother ZAI, the list of its daughter ZAI - for (int i = 0; i < (int)DautherList.size(); i++) + for (int i = 0; i < (int)DautherList.size(); i++) // Loop on the Daughter ZAI { if(GoodNuclei.find(DautherList[i]) == GoodNuclei.end() ) // if the ZAI is not in a dealed nuclei (cutted or unknown) { @@ -113,18 +113,17 @@ void CLASSNucleiFiliation::SelfFiliationCleanUp(map<ZAI, int> GoodNuclei) bool Cleaned = false; - while (!Cleaned) + while (!Cleaned) // loop until all the map is cleaned (all cut have been done) { Cleaned = true; - CLASSNucleiFiliation CuttedNuclei(*this); - + map<ZAI, IsotopicVector>::iterator it_Filiation; - for(it_Filiation = fNucleiFiliation.begin(); it_Filiation != fNucleiFiliation.end(); it_Filiation++) + for(it_Filiation = fNucleiFiliation.begin(); it_Filiation != fNucleiFiliation.end(); it_Filiation++) // Loop on the mother ZAI { - vector<ZAI> DautherList = it_Filiation->second.GetZAIList(); + vector<ZAI> DautherList = it_Filiation->second.GetZAIList(); // Get the list of daughter ZAI - for (int i = 0; i < (int)DautherList.size(); i++) + for (int i = 0; i < (int)DautherList.size(); i++) //Loop on daughter { if(GoodNuclei.find(DautherList[i]) == GoodNuclei.end() ) // if the ZAI is not in a dealed nuclei (cutted or unknown) { @@ -134,7 +133,7 @@ void CLASSNucleiFiliation::SelfFiliationCleanUp(map<ZAI, int> GoodNuclei) it_Filiation->second -= Daughter_BR * DautherList[i]; // Remove it from the daughter list - IsotopicVector FastDecayChain = CuttedNuclei.GetFiliation(DautherList[i]); // Get the fast decay chain of it + IsotopicVector FastDecayChain = (*this).GetFiliation(DautherList[i]); // Get the fast decay chain of it if(FastDecayChain.GetQuantity(-1, -1, -1) != 0) // Check if the FastDecayChain is known it_Filiation->second += Daughter_BR * FastDecayChain; // Add the FastDecayCHain & apply the BR for the cutted Daughter -- GitLab