diff --git a/source/trunk/Model/Equivalence/EQM_MLP_PWR_MOX.cxx b/source/trunk/Model/Equivalence/EQM_MLP_PWR_MOX.cxx index d1ba8bcd06cfcfc0b7929d420c5b636590150dbc..684936b22cc649d5e417e919b1abbcefaf98d24f 100644 --- a/source/trunk/Model/Equivalence/EQM_MLP_PWR_MOX.cxx +++ b/source/trunk/Model/Equivalence/EQM_MLP_PWR_MOX.cxx @@ -126,8 +126,6 @@ TTree* EQM_MLP_MOX::CreateTMVAInputTree(IsotopicVector Fissil,IsotopicVector Fer U5_enrichment = U5 / UTOT; BU=BurnUp; - //cout<<"Pu8 "<<Pu8 <<" Pu9 "<< Pu9 <<" Pu10 "<< Pu10 << " Pu11 "<< Pu11 <<" Pu12 "<<Pu12 <<" Am1 "<<Am1<<endl; - //cout<<"BU "<<BU<<" U5_enrichment "<<U5_enrichment<<endl; if(Pu8 + Pu9 + Pu10 + Pu11 + Pu12 + Am1 > 1.00001 )//?????1.00001??? I don't know it! goes in condition if =1 !! may be float/double issue ... { ERROR << Pu8 << " " << Pu9 << " " << Pu10 << " " << Pu11 << " " << Pu12 << " " << Am1 << endl; diff --git a/source/trunk/Model/Equivalence/EQM_POL_PWR_UO2.cxx b/source/trunk/Model/Equivalence/EQM_POL_PWR_UO2.cxx index ebf2dd1f7ca926cf1651ab71648b90850fe4f130..7cd78ba705763d7df632043b7df7c4a0ff83603f 100644 --- a/source/trunk/Model/Equivalence/EQM_POL_PWR_UO2.cxx +++ b/source/trunk/Model/Equivalence/EQM_POL_PWR_UO2.cxx @@ -1,34 +1,33 @@ -#include "EquivalenceModel.hxx" -#include "EQM_POL_PWR_UO2.hxx" +#include "EquivalenceModel.hxx" +#include "EQM_POL_PWR_UO2.hxx" #include "CLASSLogger.hxx" -/*Whatever include you need */ -// ________________________________________________________________________ + + +// ________________________________________________________________________ // EQM_POL_PWR_UO2 // // Brief description -// ________________________________________________________________________ +// ________________________________________________________________________ + + + + //Constructor(s) -EQM_POL_PWR_UO2::EQM_POL_PWR_UO2 ( /*parameters*/ ) +EQM_POL_PWR_UO2::EQM_POL_PWR_UO2() { -//.....Do whatever you want with your parameters -/* -Fill the two isotopic vectors fFissileList and fFertileList -see explanation in the manual */ -// Fertile -ZAI U8(92 ,238 ,0) ; -fFertileList = U8*1; -// Fissile -ZAI U5(92 ,235 ,0) ; -// ... -fFissileList = U5*1; + + // Fertile + ZAI U8(92 ,238 ,0) ; + fFertileList = U8*1; + // Fissile + ZAI U5(92 ,235 ,0) ; + // ... + fFissileList = U5*1; } // _______________________________________________________________________ double EQM_POL_PWR_UO2::GetFissileMolarFraction ( IsotopicVector Fissil , IsotopicVector Fertil , double BurnUp ) { -/*Code your Equivalence Model : This function has to return the molar fraction of fissile in -the fuel needed to reach the BurnUp(GWd/tHM) according to -the composition of the Fissil and Fertil vectors -*/ -return 0.0125575 + 0.00053602*BurnUp + 1.80023e-06*BurnUp*BurnUp ; + return 0.0125575 + 0.00053602*BurnUp + 1.80023e-06*BurnUp*BurnUp ; + } \ No newline at end of file diff --git a/source/trunk/Model/Equivalence/EQM_POL_PWR_UO2.hxx b/source/trunk/Model/Equivalence/EQM_POL_PWR_UO2.hxx index 90add1cbd074ebf13f990da83e36fa012b8b9d3e..67fa734a27dd76f8412a618c2f5b0b6f5f94fefe 100644 --- a/source/trunk/Model/Equivalence/EQM_POL_PWR_UO2.hxx +++ b/source/trunk/Model/Equivalence/EQM_POL_PWR_UO2.hxx @@ -1,26 +1,33 @@ #ifndef _EQM_POL_PWR_UO2_HXX #define _EQM_POL_PWR_UO2_HXX -#include "EquivalenceModel.hxx" + +#include "EquivalenceModel.hxx" + using namespace std; + //−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−// /*! -Define a EQM_POL_PWR_UO2 -Explain briefly what is it . @author YourName -@version 3.0 -*/ + Define a EQM_POL_PWR_UO2 + Explain briefly what is it . @author BaM + @version 3.0 + */ //________________________________________________________________________ -class EQM_POL_PWR_UO2 : public EquivalenceModel -{ - public: -/*Constructor*/ -EQM_POL_PWR_UO2(/*parameters*/ ); //!< Explain what is the parameters (if any) -/**This function IS the equivalence model**/ -double GetFissileMolarFraction(IsotopicVector Fissil, IsotopicVector Fertil,double BurnUp) ; // !<Return the molar fraction of fissile element - private: -/*Your private variables */ +class EQM_POL_PWR_UO2 : public EquivalenceModel +{ + +public: + /*Constructor*/ + EQM_POL_PWR_UO2( ); + + /**This function IS the equivalence model**/ + double GetFissileMolarFraction(IsotopicVector Fissil, IsotopicVector Fertil,double BurnUp) ; // !<Return the molar fraction of fissile element + +private: + /*Your private variables */ + }; #endif \ No newline at end of file diff --git a/source/trunk/Model/XS/XSM_MLP.cxx b/source/trunk/Model/XS/XSM_MLP.cxx index 7862f11b46f0c13b83978ab9956f741e01101cf4..1ae0e7f394a8233ae85480af1ea0afa2ba2aae5c 100644 --- a/source/trunk/Model/XS/XSM_MLP.cxx +++ b/source/trunk/Model/XS/XSM_MLP.cxx @@ -402,12 +402,12 @@ EvolutionData XSM_MLP::GetCrossSectionsTime(IsotopicVector IV) double XSValue = ExecuteTMVA(fWeightFiles[i],InputTree ); if(IResult.second ) { - (IResult.first)->second->SetPoint(0, (double)GetMLPTime()[TimeStep], XSValue ); + (IResult.first)->second->SetPoint(0, (double)fMLP_Time[TimeStep], XSValue ); } else { - (IResult.first)->second->SetPoint( (IResult.first)->second->GetN(), (double)GetMLPTime()[TimeStep], XSValue ); + (IResult.first)->second->SetPoint( (IResult.first)->second->GetN(), (double)fMLP_Time[TimeStep], XSValue ); } delete InputTree; @@ -477,7 +477,6 @@ void XSM_MLP::ReadWeightFileStep(string Filename, int &Z, int &A, int &I, int &R EvolutionData XSM_MLP::GetCrossSectionsStep(IsotopicVector IV) {DBGL TTree* InputTree=CreateTMVAInputTree(IV); - //cout<<"=====Building Evolution Data From TMVA MLP====="<<endl; EvolutionData EvolutionDataFromMLP = EvolutionData(); @@ -508,11 +507,11 @@ EvolutionData XSM_MLP::GetCrossSectionsStep(IsotopicVector IV) if( IResult.second ) { - (IResult.first)->second->SetPoint(0, (double)GetMLPTime()[TimeStep], ExecuteTMVA(fWeightFiles[i],InputTree) ); + (IResult.first)->second->SetPoint(0, (double)fMLP_Time[TimeStep], ExecuteTMVA(fWeightFiles[i],InputTree) ); } else { - (IResult.first)->second->SetPoint( (IResult.first)->second->GetN(), (double)GetMLPTime()[TimeStep], ExecuteTMVA(fWeightFiles[i],InputTree) ); + (IResult.first)->second->SetPoint( (IResult.first)->second->GetN(), (double)fMLP_Time[TimeStep], ExecuteTMVA(fWeightFiles[i],InputTree) ); } } } diff --git a/source/trunk/Model/XS/XSM_MLP.hxx b/source/trunk/Model/XS/XSM_MLP.hxx index e790c63ec26793858c5a390dae9429addd0cab3e..d75d1532cc04d231154924a732b0b10f4013e8df 100644 --- a/source/trunk/Model/XS/XSM_MLP.hxx +++ b/source/trunk/Model/XS/XSM_MLP.hxx @@ -49,38 +49,45 @@ class XSM_MLP : public XSModel */ XSM_MLP(string TMVA_Weight_Directory,string InformationFile="",bool IsTimeStep=false); + XSM_MLP(CLASSLogger* Log,string TMVA_Weight_Directory,string InformationFile="",bool IsTimeStep=false); + ~XSM_MLP(); //{ - virtual EvolutionData GetCrossSections(IsotopicVector IV,double t=0) ;//!< Return calculated cross section by the MLP regression + virtual EvolutionData GetCrossSections(IsotopicVector IV,double t=0); //!< Return calculated cross section by the MLP regression private : - void GetDataBaseInformation(); //<! Read information file and fill Reactor Type, Fuel type, HM mass, Power, time vector, and TMVA input variables names (looks at Data Bases example for format details) - vector<double> GetMLPTime() {return fMLP_Time; }//<! Return time vector (seconds) defined in the DataBaseInformation file + + void GetDataBaseInformation(); //<! Read information file and fill Reactor Type, Fuel type, HM mass, Power, time vector, and TMVA input variables names + + void GetMLPWeightFiles(); //<! Find all .xml file in TMVA_Weight_Directory + EvolutionData GetCrossSectionsStep(IsotopicVector IV); //!< Return calculated cross section by the MLP regression when fIsTimeStep==true + EvolutionData GetCrossSectionsTime(IsotopicVector IV); //!< Return calculated cross section by the MLP regression when fIsTimeStep==false + + void ReadWeightFile(string Filename, int &Z, int &A, int &I, int &Reaction) ; //<! Select the reaction according to the weight file name + void ReadWeightFileStep(string Filename, int &Z, int &A, int &I, int &Reaction, int &TimeStep);; //<! Select the reaction according to the weight file name - void GetMLPWeightFiles();//<! Find all .xml file in TMVA_Weight_Directory - void ReadWeightFile(string Filename, int &Z, int &A, int &I, int &Reaction) ;//<! Select the reaction according to the weight file name (file name is formated !!) read the manual to know it (formated for fIsTimeStep==false) - double ExecuteTMVA(string WeightFile, TTree* InputTree);//!<Execute the MLP according to the input tree created by CreateTMVAInputTree - TTree* CreateTMVAInputTree(IsotopicVector isotopicvector,int TimeStep=0);//!<Create input tmva tree to be read by ExecuteTMVA - EvolutionData GetCrossSectionsTime(IsotopicVector IV) ;//!< Return calculated cross section by the MLP regression when fIsTimeStep==false - void ReadWeightFileStep(string Filename, int &Z, int &A, int &I, int &Reaction, int &TimeStep) ;//<! Select the reaction according to the weight file name (file name is formated !!) read the manual to know it (formated for fIsTimeStep==true) - EvolutionData GetCrossSectionsStep(IsotopicVector IV) ;//!< Return calculated cross section by the MLP regression when fIsTimeStep==true + double ExecuteTMVA(string WeightFile, TTree* InputTree); //!<Execute the MLP according to the input tree created + TTree* CreateTMVAInputTree(IsotopicVector isotopicvector,int TimeStep=0); //!<Create input tmva tree to be read by ExecuteTMVA - vector<double> fMLP_Time;//<! Time vector of the data base - vector<string> fWeightFiles;//<! All the weight file contains in fTMVAWeightFolder - string fTMVAWeightFolder;//<! folder containing all the weight file - string fMLPInformationFile;//<! file containing Reactor Type, Fuel type, HM mass, Power, time vector, and TMVA input variables names (looks the manual for format details) - double fDataBasePower;//<!Power of the data base (read from fMLPInformationFile ) - double fDataBaseHMMass;//<!Heavy metal mass of the data base (read from fMLPInformationFile ) - string fDataBaseFType; //<! Reactor Type (e.g PWR, RNR, ADS..) - string fDataBaseRType; //<! Fuel Type (e.g MOX, UOX, ThU, ThPu ...) - bool fIsStepTime;//<!true if one TMVA weihgt per step time is requiered otherwise it assumes time is part of the MLP inputs + vector<double> fMLP_Time; //<! Time vector of the data base + vector<string> fWeightFiles; //<! All the weight file contains in fTMVAWeightFolder + + string fTMVAWeightFolder; //<! folder containing all the weight file + string fMLPInformationFile; //<! file containing Reactor Type, Fuel type, HM mass, Power, time vector, and TMVA input variables names (looks the manual for format details) + + double fDataBasePower; //<!Power of the data base (read from fMLPInformationFile ) + double fDataBaseHMMass; //<!Heavy metal mass of the data base (read from fMLPInformationFile ) + string fDataBaseFType; //<! Reactor Type (e.g PWR, RNR, ADS..) + string fDataBaseRType; //<! Fuel Type (e.g MOX, UOX, ThU, ThPu ...) + + bool fIsStepTime; //<!true if one TMVA weihgt per step time is requiered otherwise it assumes time is part of the MLP inputs map<ZAI,string> fMapOfTMVAVariableNames;//<! List of TMVA input variable names (read from fMLPInformationFile ) , name depends on the training step diff --git a/source/trunk/include/Storage.hxx b/source/trunk/include/Storage.hxx index e80688e77a5527872dfb8ad0df8f109ef43f4695..7b7df5f96271d7a1043b8be17ffd4ddba18edeef 100644 --- a/source/trunk/include/Storage.hxx +++ b/source/trunk/include/Storage.hxx @@ -104,8 +104,8 @@ public : */ //@{ - void TakeFractionFromStock(int IVId,double fraction); //!< Take a part from an IV in sotck; - void TakeFromStock(IsotopicVector isotopicvector); //!< + void TakeFractionFromStock(int IVId,double fraction); //!< Take a part from an IV in sotck; + void TakeFromStock(IsotopicVector isotopicvector); //!< void AddIV(IsotopicVector isotopicvector); //!< Add an Isotopicvector to the IVArray diff --git a/source/trunk/src/IrradiationModel.cxx b/source/trunk/src/IrradiationModel.cxx index 096b3efe4cb20a759ed3dffc7429a3b27031190f..2055a9b620343db153c9824f733f5d4a1412d783 100644 --- a/source/trunk/src/IrradiationModel.cxx +++ b/source/trunk/src/IrradiationModel.cxx @@ -310,7 +310,7 @@ void IrradiationModel::GetNuclearProcessMatrix(TMatrixT<double> &NuclearProcessM } } else - WARNING << " Can't have nuclear process on this nucleus, ZAI : " << Mother.Z() << " " << Mother.A() << " " << Mother.I() << " its halflife seems to be below the threshold!" << endl; + WARNING << " Can't have nuclear process on this nucleus, ZAI " << Mother.Z() << " " << Mother.A() << " " << Mother.I() << " : its halflife seems to be below the threshold!" << endl; DBGL } @@ -580,7 +580,9 @@ TMatrixT<double> IrradiationModel::GetFissionXsMatrix(EvolutionData EvolutionDat GetNuclearProcessMatrix( FissionMatrix, Mother, FissionProductIV, XS_Value ); // add the Nuclear process in the Reaction Matrix else { - WARNING << "Don't have fission Yield for this nuclei, ZAI : " << Mother.Z() << " " << Mother.A() << " " << Mother.I() << endl; + if(fReactionYieldFile!="") + WARNING << "Don't have fission Yield for this nuclei, ZAI : " << Mother.Z() << " " << Mother.A() << " " << Mother.I() << endl; + GetNuclearProcessMatrix(FissionMatrix, Mother, ZAI(-2, -2, -2) * 2 , XS_Value ); // add the Nuclear process in the Reaction Matrix }