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

adding fast calculation option in Decay,

Adding Decaychain plot in gui

git-svn-id: svn+ssh://svn.in2p3.fr/class@618 0e7d625b-0364-4367-a6be-d5be4a48d228
parent 4e376f85
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,7 @@
#include "ZAIMass.hxx"
#include "ZAIHeat.hxx"
#include "ZAITox.hxx"
#include "DecayDataBank.hxx"
typedef long long int cSecond;
......@@ -15,6 +16,7 @@ const ZAIHeat cZAIHeat; // Thermal power list of all nuclei [W/nucleus]
const ZAITox cZAITox;
const cSecond cYear = 3600*24*365.25; // Seconds in a year
DecayDataBank cDecayData; // Seconds in a year
#endif
......@@ -132,6 +132,7 @@ class DecayDataBank : public CLASSObject
void SetOldReadMethod(bool val) { fOldReadMethod = val; ReadDataBase();} ///< use the old reading method
void SetFastCalculation(bool val) { fFastCalculation = val; }
//}
......@@ -169,6 +170,8 @@ class DecayDataBank : public CLASSObject
protected :
bool fFastCalculation;
map<ZAI, EvolutionData> fDecayDataBank; ///< DataBank map
string fDataBaseIndex; ///< Name of the index
bool fOldReadMethod; ///< use old DB format
......
......@@ -27,6 +27,17 @@
DecayDataBank::DecayDataBank():CLASSObject(new CLASSLogger("DecayDataBank.log"))
{
string CLASSPATH = getenv("CLASS_PATH");
string DB_index_file = CLASSPATH + "/data/DECAY/Decay.idx";
fDataBaseIndex = DB_index_file;
fOldReadMethod = olfreadmethod;
fFastCalculation = true;
// Warning
INFO << " A EvolutionData has been define :" << endl;
INFO << "\t His index is : \"" << DB_index_file << "\"" << endl << endl;
}
//________________________________________________________________________
......@@ -41,6 +52,7 @@ DecayDataBank::DecayDataBank(string DB_index_file, bool olfreadmethod):CLASSObje
fDataBaseIndex = DB_index_file;
fOldReadMethod = olfreadmethod;
fFastCalculation = true;
// Warning
INFO << " A EvolutionData has been define :" << endl;
......@@ -54,11 +66,12 @@ DecayDataBank::DecayDataBank(CLASSLogger* log, string DB_index_file, bool olfrea
fDataBaseIndex = DB_index_file;
fOldReadMethod = olfreadmethod;
fFastCalculation = true;
// Warning
INFO << " A EvolutionData has been define :" << endl;
INFO << "\t His index is : \"" << DB_index_file << "\"" << endl << endl;
INFO << " A EvolutionData has been define :" << endl;
INFO << "\t His index is : \"" << DB_index_file << "\"" << endl << endl;
}
//________________________________________________________________________
......@@ -180,30 +193,46 @@ IsotopicVector DecayDataBank::GetDecay(IsotopicVector isotopicvector, cSecond t)
exit(1);
}
int evolutionDecade[17];
cSecond remainingTime = t;
for(int i = 16; i >= 0; i--)
if(fFastCalculation)
{
evolutionDecade[i] = (int)remainingTime/pow(10,i);
remainingTime -= evolutionDecade[i]*pow(10,i);
map<ZAI ,double> isotopicquantity = isotopicvector.GetIsotopicQuantity();
map<ZAI ,double >::iterator it;
for( it = isotopicquantity.begin(); it != isotopicquantity.end(); it++)
{
if((*it).second > 0)
{
IsotopicVector ivtmp = Evolution(it->first, t) * (*it).second ;
IV += ivtmp;
}
}
}
IV = isotopicvector;
for (int i = 16; i >= 0; i--)
else
{
if(evolutionDecade[i]!=0)
int evolutionDecade[17];
cSecond remainingTime = t;
for(int i = 16; i >= 0; i--)
{
map<ZAI ,double> isotopicquantity = IV.GetIsotopicQuantity();
map<ZAI ,double >::iterator it;
IV = IsotopicVector();
for( it = isotopicquantity.begin(); it != isotopicquantity.end(); it++)
IV += Evolution(it->first, evolutionDecade[i]*pow(10,i) ) * (*it).second ;
evolutionDecade[i] = (int)remainingTime/pow(10,i);
remainingTime -= evolutionDecade[i]*pow(10,i);
}
IV = isotopicvector;
for (int i = 16; i >= 0; i--)
{
if(evolutionDecade[i]!=0)
{
map<ZAI ,double> isotopicquantity = IV.GetIsotopicQuantity();
map<ZAI ,double >::iterator it;
IV = IsotopicVector();
for( it = isotopicquantity.begin(); it != isotopicquantity.end(); it++)
IV += Evolution(it->first, evolutionDecade[i]*pow(10,i) ) * (*it).second ;
}
}
}
DBGL
return IV;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment