Skip to content
Snippets Groups Projects
Commit ea3f79d3 authored by BaM's avatar BaM
Browse files

Adding CLASSNucleiFiliation : deal all the produced nuclei (with different...

Adding CLASSNucleiFiliation : deal all the produced nuclei (with different branching ratio) from a mother nuclei - by exemple for Fission Yield, or cute decay... -> not yet added to the Makefile... so not compiled...


Adding some method in IsotopicVector (GetQuantity) which are equivalent to the old one : GetZAIIsotopicQuantity ....

git-svn-id: svn+ssh://svn.in2p3.fr/class@450 0e7d625b-0364-4367-a6be-d5be4a48d228
parent 3d13494f
No related branches found
No related tags found
No related merge requests found
...@@ -44,6 +44,7 @@ class CLASSFuelPlan : public CLASSObject ...@@ -44,6 +44,7 @@ class CLASSFuelPlan : public CLASSObject
CLASSFuelPlan(CLASSLogger* log); CLASSFuelPlan(CLASSLogger* log);
void AddFuel(cSecond time, CLASSFuel fuel, double BurnUp); void AddFuel(cSecond time, CLASSFuel fuel, double BurnUp);
void AddFuel(cSecond time, EvolutionData* fuel, double BurnUp) {AddFuel( time, CLASSFuel(fuel), BurnUp);} void AddFuel(cSecond time, EvolutionData* fuel, double BurnUp) {AddFuel( time, CLASSFuel(fuel), BurnUp);}
void AddFuel(cSecond time, PhysicsModels* fuel, double BurnUp) {AddFuel( time, CLASSFuel(fuel), BurnUp);} void AddFuel(cSecond time, PhysicsModels* fuel, double BurnUp) {AddFuel( time, CLASSFuel(fuel), BurnUp);}
......
#ifndef _CLASSNucleiFiliation_
#define _CLASSNucleiFiliation_
/*!
\file
\brief Header file for CLASSNucleiFiliation classes.
*/
#include "CLASSObject.hxx"
#include "IsotopicVector.hxx"
using namespace std;
//-----------------------------------------------------------------------------//
/*!
Define a nuclei as : Z A I.
The aim of this class is to discribe each CLASSNucleiFiliation.
@author BaM
@version 2.0
*/
//________________________________________________________________________
class CLASSNucleiFiliation : public CLASSObject
{
public:
//********* Constructor/Destructor Method *********//
/*!
\name Constructor/Desctructor
*/
//@{
CLASSNucleiFiliation(); ///< Default constructor
//}
CLASSNucleiFiliation(CLASSNucleiFiliation CNF);
~CLASSNucleiFiliation(); ///< Normal Destructor.
void AddDaughterToZAI(ZAI Mother, IsotopicVector Daughter );
IsotopicVector GetFiliation(ZAI Mother);
map<ZAI, IsotopicVector> GetNucleiFIliation() const {return fNucleiFiliation;}
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 :
map<ZAI, IsotopicVector> fNucleiFiliation;
ClassDef(CLASSNucleiFiliation,1);
};
#endif
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "TObject.h" #include "TObject.h"
#include <string> #include <string>
#include <vector>
#include <map> #include <map>
using namespace std; using namespace std;
...@@ -62,8 +63,15 @@ public : ...@@ -62,8 +63,15 @@ public :
IsotopicVector GetThisComposition(IsotopicVector IV) const; //!< Return the composition according the IV list... IsotopicVector GetThisComposition(IsotopicVector IV) const; //!< Return the composition according the IV list...
vector<ZAI> GetZAIList() const; //!< Return the list of ZAI present in the IV vector<ZAI> GetZAIList() const; //!< Return the list of ZAI present in the IV
IsotopicVector GetActinidesComposition() const; //!< Return the Actinides composition of the "z" atom IsotopicVector GetActinidesComposition() const; //!< Return the Actinides composition of the "z" atom
double GetZAIIsotopicQuantity(const ZAI& zai) const; ///< Return the quantity of the ZAI double GetZAIIsotopicQuantity(const ZAI& zai) const; ///< Return the quantity of the ZAI
double GetZAIIsotopicQuantity(const int z, const int a, const int i) const; ///< Return the quantity of the ZAI double GetZAIIsotopicQuantity(const int z, const int a, const int i) const; ///< Return the quantity of the ZAI
double GetQuantity(const int z, const int a, const int i) const {return GetZAIIsotopicQuantity(z,a,i);}
double GetQuantity(const ZAI& zai) const {return GetZAIIsotopicQuantity(zai);}
double GetTotalMass() const; //!< Return the mass (in tons) of the isotopic vector double GetTotalMass() const; //!< Return the mass (in tons) of the isotopic vector
double MeanMolar() const; //<! Return the mean molar mass of the isotopic vector double MeanMolar() const; //<! Return the mean molar mass of the isotopic vector
......
#include "CLASSNucleiFiliation.hxx"
#include "ZAI.hxx"
#include "IsotopicVector.hxx"
#include <map>
#include <vector>
#include "stdlib.h"
using namespace std;
//const string DEFAULTDATABASE = "DecayBase.dat";
//________________________________________________________________________
//
// CLASSNucleiFiliation
//
//
//
//
//________________________________________________________________________
//____________________________InClass Operator____________________________
//________________________________________________________________________
ClassImp(CLASSNucleiFiliation)
CLASSNucleiFiliation::CLASSNucleiFiliation():CLASSObject()
{
}
CLASSNucleiFiliation::CLASSNucleiFiliation(CLASSNucleiFiliation CNF):CLASSObject()
{
fNucleiFIliation = CNF.GetNucleiFIliation();
}
//________________________________________________________________________
CLASSNucleiFiliation::~CLASSNucleiFiliation()
{
}
//________________________________________________________________________
void CLASSNucleiFiliation::AddDaughterToZAI(ZAI Mother, IsotopicVector Daughter )
{
DBGL
pair< map<ZAI, IsotopicVector>::iterator, bool> IResult;
IResult = fNucleiFiliation.insert( pair<ZAI, IsotopicVector> ( Mother, Daughter ) );
if( !IResult.second)
(*IResult.first).second += Daughter ;
DBGL
}
//________________________________________________________________________
IsotopicVector CLASSNucleiFiliation::GetFiliation(ZAI Mother)
{
DBGL
map<ZAI, IsotopicVector>::iterator it_Filiation;
it_Filiation = fNucleiFiliation.find(Mother);
DBGL
if(it_Filiation != fNucleiFiliation.end())
return it_Filiation->second;
else
return ZAI(-1,-1,-1)*1; // return -1 -1 _1 ZAI if unknown nuclei....
}
//________________________________________________________________________
void CLASSNucleiFiliation::FiliationCleanUp(map<ZAI, int> GoodNuclei, CLASSNucleiFiliation CuttedNuclei)
{
DBGL
map<ZAI, IsotopicVector>::iterator it_Filiation;
for(it_Filiation = fNucleiFiliation.begin(); it_Filiation != fNucleiFiliation.end(); it_Filiation++)
{
vector<ZAI> DautherList = it_Filiation->second.GetZAIList();
for (int i = 0; i < (int)DautherList.size(); i++)
{
if(GoodNuclei.find(DautherList[i]) == GoodNuclei.end() ) // if the ZAI is not in a dealed nuclei (cutted or unknown)
{
double Daughter_BR = it_Filiation->second.GetQuantity(DautherList[i]); // Get the quantity of the ZAI
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
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
else
it_Filiation->second += Daughter_BR * ZAI(-3,-3,-3); // Add a TMP nuclei the daughter nuclei is not known at all...
}
}
}
DBGL
}
//________________________________________________________________________
void CLASSNucleiFiliation::SelfFiliationCleanUp(map<ZAI, int> GoodNuclei)
{
DBGL
bool Cleaned = false;
while (!Cleaned)
{
Cleaned = true;
CLASSNucleiFiliation CuttedNuclei(*this);
map<ZAI, IsotopicVector>::iterator it_Filiation;
for(it_Filiation = fNucleiFiliation.begin(); it_Filiation != fNucleiFiliation.end(); it_Filiation++)
{
vector<ZAI> DautherList = it_Filiation->second.GetZAIList();
for (int i = 0; i < (int)DautherList.size(); i++)
{
if(GoodNuclei.find(DautherList[i]) == GoodNuclei.end() ) // if the ZAI is not in a dealed nuclei (cutted or unknown)
{
Cleaned = false;
double Daughter_BR = it_Filiation->second.GetQuantity(DautherList[i]); // Get the quantity of the ZAI
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
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
else
it_Filiation->second += Daughter_BR * ZAI(-3,-3,-3); // Add a TMP nuclei the daughter nuclei is not known at all...
}
}
}
}
DBGL
}
//________________________________________________________________________
void CLASSNucleiFiliation::NormalizeBranchingRatio(double Value)
{
DBGL
map<ZAI, IsotopicVector>::iterator it_Filiation;
for(it_Filiation = fNucleiFiliation.begin(); it_Filiation != fNucleiFiliation.end(); it_Filiation++)
{
it_Filiation->second *= Value/it_Filiation->second.GetSumOfAll();
}
DBGL
}
//________________________________________________________________________
void CLASSNucleiFiliation::NormalizeBranchingRatio(ZAI Mother, double Value)
{
DBGL
map<ZAI, IsotopicVector>::iterator it_Filiation = fNucleiFiliation.find(Mother);
if( it_Filiation != fNucleiFiliation.end())
it_Filiation->second *= Value/it_Filiation->second.GetSumOfAll();
else
WARNING << "Trying to normaliza a Branching Ratio for a Mother wich are not present in the Filiatiuon List...." << endl;
DBGL
}
#include "CLASSObject.hxx" #include "CLASSObject.hxx"
#include "CLASSLogger.hxx"
using namespace std; using namespace std;
//________________________________________________________________________ //________________________________________________________________________
......
...@@ -7,8 +7,6 @@ ...@@ -7,8 +7,6 @@
#include "Scenario.hxx" #include "Scenario.hxx"
#include "CLASSConstante.hxx" #include "CLASSConstante.hxx"
#include "CLASSLogger.hxx"
#include <iostream> #include <iostream>
#include <cmath> #include <cmath>
#include <omp.h> #include <omp.h>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment