diff --git a/source/branches/BaM/Model/Equivalence/EQM_FBR_MLP_Keff.cxx b/source/branches/BaM/Model/Equivalence/EQM_FBR_MLP_Keff.cxx index bce3fb3842128368962130b97720bf4548e179a1..155bf3bf5a89d318478bd3bb16de4f96a07a9b67 100644 --- a/source/branches/BaM/Model/Equivalence/EQM_FBR_MLP_Keff.cxx +++ b/source/branches/BaM/Model/Equivalence/EQM_FBR_MLP_Keff.cxx @@ -128,30 +128,33 @@ EQM_FBR_MLP_Keff::EQM_FBR_MLP_Keff(CLASSLogger* log, string TMVAWeightPath, doub DBGL } +EQM_FBR_MLP_Keff::~EQM_FBR_MLP_Keff() +{ + delete freader; +} + void EQM_FBR_MLP_Keff::InitialiseTMVAReader() { for(int i = 0 ; i< (int)fMapOfTMVAVariableNames.size() ; i++) - InputTMVA.push_back(0); + fInputTMVA.push_back(0); - reader = new TMVA::Reader( "Silent" ); + freader = new TMVA::Reader( "Silent" ); // Create a set of variables and declare them to the reader // - the variable names MUST corresponds in name and type to those given in the weight file(s) used - vector<float> InputTMVA; for(int i = 0 ; i< (int)fMapOfTMVAVariableNames.size() ; i++) - InputTMVA.push_back(0); - Float_t Time; + fInputTMVA.push_back(0); map<ZAI ,string >::iterator it; int j = 0; for( it = fMapOfTMVAVariableNames.begin() ; it != fMapOfTMVAVariableNames.end() ; it++) - { - reader->AddVariable( ( (*it).second ).c_str(),&InputTMVA[j]); - IVInputTMVA += ((*it).first)*1; + { + freader->AddVariable( ( (*it).second ).c_str(),&fInputTMVA[j]); + fIVInputTMVA += ((*it).first)*1; j++; - } + } } @@ -159,17 +162,17 @@ void EQM_FBR_MLP_Keff::UpdateInputComposition(IsotopicVector TheFreshfuel) { - IsotopicVector IVAccordingToUserInfoFile = TheFreshfuel.GetThisComposition(IVInputTMVA); + IsotopicVector IVAccordingToUserInfoFile = TheFreshfuel.GetThisComposition(fIVInputTMVA); map<ZAI,string>::iterator it; int j = 0; for( it = fMapOfTMVAVariableNames.begin() ; it != fMapOfTMVAVariableNames.end() ; it++) - { - InputTMVA[j] = IVAccordingToUserInfoFile.GetZAIIsotopicQuantity( (*it).first ) ; + { + fInputTMVA[j] = IVAccordingToUserInfoFile.GetZAIIsotopicQuantity( (*it).first ) ; j++; - } + } } @@ -179,7 +182,7 @@ double EQM_FBR_MLP_Keff::ExecuteTMVA(IsotopicVector TheFreshfuel) { DBGL - Float_t val = (reader->EvaluateRegression( "MLP Method" ))[0]; + Float_t val = (freader->EvaluateRegression( "MLP Method" ))[0]; return (double)val; //return k_{eff}(t = Time) } diff --git a/source/branches/BaM/Model/Equivalence/EQM_FBR_MLP_Keff.hxx b/source/branches/BaM/Model/Equivalence/EQM_FBR_MLP_Keff.hxx index 2da269a8451c1ba19d9328cce4813432bd652765..90664a8e5ebe832e947b4780c492bf50a8655e03 100644 --- a/source/branches/BaM/Model/Equivalence/EQM_FBR_MLP_Keff.hxx +++ b/source/branches/BaM/Model/Equivalence/EQM_FBR_MLP_Keff.hxx @@ -74,7 +74,9 @@ class EQM_FBR_MLP_Keff : public EquivalenceModel //} //@} - + + ~EQM_FBR_MLP_Keff(); + //{ /// Return the molar fissile fraction according fissile & ferile content using @f$<k_{\infty}>(t)@f$ prediction /*! @@ -181,10 +183,10 @@ class EQM_FBR_MLP_Keff : public EquivalenceModel double fTargetKeff; //!< Use for Varying Fissile content to reach fTargetKeff at time used in the MLP Training - TMVA::Reader *reader; - vector<float> InputTMVA; - IsotopicVector IVInputTMVA; - float Time; + TMVA::Reader *freader; + vector<float> fInputTMVA; + IsotopicVector fIVInputTMVA; + float fTime; /*! diff --git a/source/branches/BaM/Model/Equivalence/EQM_FBR_MLP_Keff_BOUND.cxx b/source/branches/BaM/Model/Equivalence/EQM_FBR_MLP_Keff_BOUND.cxx index fdc098c95e8f33514b64324a2ffdd5ebfc32ddfb..15f39e4b2fb79afb01c225ec795b845d4905f666 100644 --- a/source/branches/BaM/Model/Equivalence/EQM_FBR_MLP_Keff_BOUND.cxx +++ b/source/branches/BaM/Model/Equivalence/EQM_FBR_MLP_Keff_BOUND.cxx @@ -160,6 +160,14 @@ EQM_FBR_MLP_Keff_BOUND::EQM_FBR_MLP_Keff_BOUND(CLASSLogger* log, string TMVAWeig } + + +EQM_FBR_MLP_Keff_BOUND::~EQM_FBR_MLP_Keff_BOUND() +{ + delete freader; +} + + //________________________________________________________________________ TGraph* EQM_FBR_MLP_Keff_BOUND::BuildKeffGraph(IsotopicVector FreshFuel) { @@ -229,7 +237,7 @@ void EQM_FBR_MLP_Keff_BOUND::UpdateInputComposition(IsotopicVector TheFreshfuel, { - IsotopicVector IVAccordingToUserInfoFile = TheFreshfuel.GetThisComposition(IVInputTMVA); + IsotopicVector IVAccordingToUserInfoFile = TheFreshfuel.GetThisComposition(fIVInputTMVA); map<ZAI,string>::iterator it; @@ -237,11 +245,11 @@ void EQM_FBR_MLP_Keff_BOUND::UpdateInputComposition(IsotopicVector TheFreshfuel, for( it = fMapOfTMVAVariableNames.begin() ; it != fMapOfTMVAVariableNames.end() ; it++) { - InputTMVA[j] = IVAccordingToUserInfoFile.GetZAIIsotopicQuantity( (*it).first ) ; + fInputTMVA[j] = IVAccordingToUserInfoFile.GetZAIIsotopicQuantity( (*it).first ) ; j++; } - Time = ThisTime; + fTime = ThisTime; } @@ -250,29 +258,27 @@ void EQM_FBR_MLP_Keff_BOUND::InitialiseTMVAReader() { for(int i = 0 ; i< (int)fMapOfTMVAVariableNames.size() ; i++) - InputTMVA.push_back(0); + fInputTMVA.push_back(0); - reader = new TMVA::Reader( "Silent" ); + freader = new TMVA::Reader( "Silent" ); // Create a set of variables and declare them to the reader // - the variable names MUST corresponds in name and type to those given in the weight file(s) used - vector<float> InputTMVA; for(int i = 0 ; i< (int)fMapOfTMVAVariableNames.size() ; i++) - InputTMVA.push_back(0); - Float_t Time; + fInputTMVA.push_back(0); map<ZAI ,string >::iterator it; int j = 0; for( it = fMapOfTMVAVariableNames.begin() ; it != fMapOfTMVAVariableNames.end() ; it++) { - reader->AddVariable( ( (*it).second ).c_str(),&InputTMVA[j]); - IVInputTMVA += ((*it).first)*1; + freader->AddVariable( ( (*it).second ).c_str(),&fInputTMVA[j]); + fIVInputTMVA += ((*it).first)*1; j++; } if(fTMVAWeightPath.size() == 1) - reader->AddVariable( "Time" ,&Time); + freader->AddVariable( "Time" ,&fTime); } @@ -282,9 +288,9 @@ double EQM_FBR_MLP_Keff_BOUND::ExecuteTMVA(IsotopicVector TheFreshfuel, double T { UpdateInputComposition(TheFreshfuel,ThisTime); - reader->BookMVA( "MLP Method", fTMVAWeightPath ); + freader->BookMVA( "MLP Method", fTMVAWeightPath ); - Float_t val = (reader->EvaluateRegression( "MLP Method" ))[0]; + Float_t val = (freader->EvaluateRegression( "MLP Method" ))[0]; return (double)val;//retourn k_{inf}(t = Time) } diff --git a/source/branches/BaM/Model/Equivalence/EQM_FBR_MLP_Keff_BOUND.hxx b/source/branches/BaM/Model/Equivalence/EQM_FBR_MLP_Keff_BOUND.hxx index df0219738d387fe09be88211c9bb126530abbf16..0b288b1f5d02d542024cc20e70d6b78ac150e146 100644 --- a/source/branches/BaM/Model/Equivalence/EQM_FBR_MLP_Keff_BOUND.hxx +++ b/source/branches/BaM/Model/Equivalence/EQM_FBR_MLP_Keff_BOUND.hxx @@ -80,6 +80,8 @@ class EQM_FBR_MLP_Keff_BOUND : public EquivalenceModel //@} + + ~EQM_FBR_MLP_Keff_BOUND(); //{ /// Return the molar fissile fraction according fissile & ferile content using @f$<k_{\infty}>(t)@f$ prediction @@ -184,10 +186,10 @@ class EQM_FBR_MLP_Keff_BOUND : public EquivalenceModel double fTargetKeff; //!< Use for Varying Fissile content to reach fTargetKeff at time used in the MLP Training - TMVA::Reader *reader; - vector<float> InputTMVA; - IsotopicVector IVInputTMVA; - float Time; + TMVA::Reader *freader; + vector<float> fInputTMVA; + IsotopicVector fIVInputTMVA; + float fTime; diff --git a/source/branches/BaM/Model/Equivalence/EQM_MLP_Kinf.cxx b/source/branches/BaM/Model/Equivalence/EQM_MLP_Kinf.cxx index e7be2ad893ee3ac922586e7ebc0150f36986713a..9eb2a0546b8fc784d52fc5c67392dcfb65c19e55 100644 --- a/source/branches/BaM/Model/Equivalence/EQM_MLP_Kinf.cxx +++ b/source/branches/BaM/Model/Equivalence/EQM_MLP_Kinf.cxx @@ -184,6 +184,14 @@ EQM_MLP_Kinf::EQM_MLP_Kinf(CLASSLogger* log, string TMVAWeightPath, int NumOfBa } + + + +EQM_MLP_Kinf::~EQM_MLP_Kinf() +{ + delete freader; +} + //________________________________________________________________________ void EQM_MLP_Kinf::LoadKeyword() { @@ -269,29 +277,28 @@ void EQM_MLP_Kinf::InitialiseTMVAReader() { for(int i = 0 ; i< (int)fMapOfTMVAVariableNames.size() ; i++) - InputTMVA.push_back(0); + fInputTMVA.push_back(0); - reader = new TMVA::Reader( "Silent" ); + freader = new TMVA::Reader( "Silent" ); // Create a set of variables and declare them to the reader // - the variable names MUST corresponds in name and type to those given in the weight file(s) used - InputTMVA; for(int i = 0 ; i< (int)fMapOfTMVAVariableNames.size() ; i++) - InputTMVA.push_back(0); - Float_t Time; + fInputTMVA.push_back(0); + fTime; map<ZAI ,string >::iterator it; int j = 0; for( it = fMapOfTMVAVariableNames.begin() ; it != fMapOfTMVAVariableNames.end() ; it++) { - reader->AddVariable( ( (*it).second ).c_str(),&InputTMVA[j]); - IVInputTMVA += ((*it).first)*1; + freader->AddVariable( ( (*it).second ).c_str(),&fInputTMVA[j]); + fIVInputTMVA += ((*it).first)*1; j++; } if(fTMVAWeightPath.size() == 1) - reader->AddVariable( "Time" ,&Time); + freader->AddVariable( "Time" ,&fTime); } @@ -300,7 +307,7 @@ void EQM_MLP_Kinf::UpdateInputComposition(IsotopicVector TheFreshfuel, double Th { - IsotopicVector IVAccordingToUserInfoFile = TheFreshfuel.GetThisComposition(IVInputTMVA); + IsotopicVector IVAccordingToUserInfoFile = TheFreshfuel.GetThisComposition(fIVInputTMVA); double Ntot = IVAccordingToUserInfoFile.GetSumOfAll(); @@ -311,11 +318,11 @@ void EQM_MLP_Kinf::UpdateInputComposition(IsotopicVector TheFreshfuel, double Th for( it = fMapOfTMVAVariableNames.begin() ; it != fMapOfTMVAVariableNames.end() ; it++) { - InputTMVA[j] = IVAccordingToUserInfoFile.GetZAIIsotopicQuantity( (*it).first ) ; + fInputTMVA[j] = IVAccordingToUserInfoFile.GetZAIIsotopicQuantity( (*it).first ) ; j++; } - Time = ThisTime; + fTime = ThisTime; } //________________________________________________________________________ @@ -323,9 +330,9 @@ double EQM_MLP_Kinf::ExecuteTMVA(IsotopicVector TheFreshfuel, double ThisTime, s { UpdateInputComposition(TheFreshfuel,ThisTime); - reader->BookMVA( "MLP Method", TMVAWeightPath ); + freader->BookMVA( "MLP Method", TMVAWeightPath ); - Float_t val = (reader->EvaluateRegression( "MLP Method" ))[0]; + Float_t val = (freader->EvaluateRegression( "MLP Method" ))[0]; return (double)val;//retourn k_{inf}(t = Time) } diff --git a/source/branches/BaM/Model/Equivalence/EQM_MLP_Kinf.hxx b/source/branches/BaM/Model/Equivalence/EQM_MLP_Kinf.hxx index 68791a5305c74a13d7655fb5541c4aefdf0d0e4d..f923c3a0d94bcfa578bf61be430b801df45fd78c 100644 --- a/source/branches/BaM/Model/Equivalence/EQM_MLP_Kinf.hxx +++ b/source/branches/BaM/Model/Equivalence/EQM_MLP_Kinf.hxx @@ -100,6 +100,8 @@ class EQM_MLP_Kinf : public EquivalenceModel EQM_MLP_Kinf(CLASSLogger* log, string TMVAWeightPath,int NumOfBatch, string InformationFile = "", double CriticalityThreshold = 1.01); //} //@} + + ~EQM_MLP_Kinf(); //{ /// Return the molar fissile fraction according fissile & ferile content @@ -217,10 +219,10 @@ class EQM_MLP_Kinf : public EquivalenceModel double fBurnUpPrecision; //!< precision on Burnup double fPCMprecision; //!< precision on @f$\langle k \rangle@f$ prediction [pcm] - TMVA::Reader *reader; - vector<float> InputTMVA; - IsotopicVector IVInputTMVA; - float Time; + TMVA::Reader *freader; + vector<float> fInputTMVA; + IsotopicVector fIVInputTMVA; + float fTime; }; diff --git a/source/branches/BaM/Model/Equivalence/EQM_PWR_MLP_MOX.cxx b/source/branches/BaM/Model/Equivalence/EQM_PWR_MLP_MOX.cxx index 82c64e0fc48643ca63c97570c6dfa1dd3ff7a544..d4347345fcd61f681127dfffbb1e2ba16340ad74 100644 --- a/source/branches/BaM/Model/Equivalence/EQM_PWR_MLP_MOX.cxx +++ b/source/branches/BaM/Model/Equivalence/EQM_PWR_MLP_MOX.cxx @@ -28,16 +28,16 @@ EQM_PWR_MLP_MOX::EQM_PWR_MLP_MOX(string TMVAWeightPath):EquivalenceModel(new CLA { fTMVAWeightPath = TMVAWeightPath; - reader = new TMVA::Reader( "Silent" ); - reader->BookMVA( "MLP Method", fTMVAWeightPath ); - reader->AddVariable( "BU" ,&BU ); - reader->AddVariable( "U5_enrichment",&U5_enrichment ); - reader->AddVariable( "Pu8" ,&Pu8 ); - reader->AddVariable( "Pu9" ,&Pu9 ); - reader->AddVariable( "Pu10" ,&Pu10); - reader->AddVariable( "Pu11" ,&Pu11); - reader->AddVariable( "Pu12" ,&Pu12); - reader->AddVariable( "Am1" ,&Am1 ); + freader = new TMVA::Reader( "Silent" ); + freader->BookMVA( "MLP Method", fTMVAWeightPath ); + freader->AddVariable( "BU" ,&fBU ); + freader->AddVariable( "U5_enrichment",&fU5_enrichment ); + freader->AddVariable( "Pu8" ,&fPu8 ); + freader->AddVariable( "Pu9" ,&fPu9 ); + freader->AddVariable( "Pu10" ,&fPu10); + freader->AddVariable( "Pu11" ,&fPu11); + freader->AddVariable( "Pu12" ,&fPu12); + freader->AddVariable( "Am1" ,&fAm1 ); ZAI U8(92,238,0); @@ -68,16 +68,16 @@ EQM_PWR_MLP_MOX::EQM_PWR_MLP_MOX(CLASSLogger* log, string TMVAWeightPath):Equiva { fTMVAWeightPath = TMVAWeightPath; - reader = new TMVA::Reader( "Silent" ); - reader->BookMVA( "MLP Method", fTMVAWeightPath ); - reader->AddVariable( "BU" ,&BU ); - reader->AddVariable( "U5_enrichment",&U5_enrichment ); - reader->AddVariable( "Pu8" ,&Pu8 ); - reader->AddVariable( "Pu9" ,&Pu9 ); - reader->AddVariable( "Pu10" ,&Pu10); - reader->AddVariable( "Pu11" ,&Pu11); - reader->AddVariable( "Pu12" ,&Pu12); - reader->AddVariable( "Am1" ,&Am1 ); + freader = new TMVA::Reader( "Silent" ); + freader->BookMVA( "MLP Method", fTMVAWeightPath ); + freader->AddVariable( "BU" ,&fBU ); + freader->AddVariable( "U5_enrichment",&fU5_enrichment ); + freader->AddVariable( "Pu8" ,&fPu8 ); + freader->AddVariable( "Pu9" ,&fPu9 ); + freader->AddVariable( "Pu10" ,&fPu10); + freader->AddVariable( "Pu11" ,&fPu11); + freader->AddVariable( "Pu12" ,&fPu12); + freader->AddVariable( "Am1" ,&fAm1 ); @@ -104,6 +104,12 @@ EQM_PWR_MLP_MOX::EQM_PWR_MLP_MOX(CLASSLogger* log, string TMVAWeightPath):Equiva } + +EQM_PWR_MLP_MOX::~EQM_PWR_MLP_MOX() +{ + delete freader; +} + //________________________________________________________________________ void EQM_PWR_MLP_MOX::UpdateInputComposition(IsotopicVector Fissil,IsotopicVector Fertil,double BurnUp) { @@ -115,28 +121,28 @@ void EQM_PWR_MLP_MOX::UpdateInputComposition(IsotopicVector Fissil,IsotopicVecto float UTOT = U8 + U5 + U4; - Pu8 = Fissil.GetZAIIsotopicQuantity(94,238,0); - Pu9 = Fissil.GetZAIIsotopicQuantity(94,239,0); - Pu10 = Fissil.GetZAIIsotopicQuantity(94,240,0); - Pu11 = Fissil.GetZAIIsotopicQuantity(94,241,0); - Pu12 = Fissil.GetZAIIsotopicQuantity(94,242,0); - Am1 = Fissil.GetZAIIsotopicQuantity(95,241,0); + fPu8 = Fissil.GetZAIIsotopicQuantity(94,238,0); + fPu9 = Fissil.GetZAIIsotopicQuantity(94,239,0); + fPu10 = Fissil.GetZAIIsotopicQuantity(94,240,0); + fPu11 = Fissil.GetZAIIsotopicQuantity(94,241,0); + fPu12 = Fissil.GetZAIIsotopicQuantity(94,242,0); + fAm1 = Fissil.GetZAIIsotopicQuantity(95,241,0); - double TOTPU = (Pu8+Pu9+Pu10+Pu11+Pu12+Am1); + double TOTPU = (fPu8 + fPu9 + fPu10 + fPu11 + fPu12 + fAm1); - Pu8 = Pu8 / TOTPU; - Pu9 = Pu9 / TOTPU; - Pu10 = Pu10 / TOTPU; - Pu11 = Pu11 / TOTPU; - Pu12 = Pu12 / TOTPU; - Am1 = Am1 / TOTPU; + fPu8 = fPu8 / TOTPU; + fPu9 = fPu9 / TOTPU; + fPu10 = fPu10 / TOTPU; + fPu11 = fPu11 / TOTPU; + fPu12 = fPu12 / TOTPU; + fAm1 = fAm1 / TOTPU; - U5_enrichment = U5 / UTOT; + fU5_enrichment = U5 / UTOT; - BU = BurnUp; - 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 ... + fBU = BurnUp; + if(fPu8 + fPu9 + fPu10 + fPu11 + fPu12 + fAm1 > 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; + ERROR << fPu8 << " " << fPu9 << " " << fPu10 << " " << fPu11 << " " << fPu12 << " " << fAm1 << endl; exit(0); } } @@ -144,7 +150,7 @@ void EQM_PWR_MLP_MOX::UpdateInputComposition(IsotopicVector Fissil,IsotopicVecto double EQM_PWR_MLP_MOX::ExecuteTMVA(IsotopicVector Fissil,IsotopicVector Fertil,double BurnUp) { UpdateInputComposition(Fissil, Fertil, BurnUp); - Float_t val = (reader->EvaluateRegression( "MLP method" ))[0]; + Float_t val = (freader->EvaluateRegression( "MLP method" ))[0]; return (double)val; //retourne teneur diff --git a/source/branches/BaM/Model/Equivalence/EQM_PWR_MLP_MOX.hxx b/source/branches/BaM/Model/Equivalence/EQM_PWR_MLP_MOX.hxx index 413bc0b1fca316a6930c3f28915638dd516cbc56..bd62923fb7da16257eb85c502eecee77c8538d6d 100644 --- a/source/branches/BaM/Model/Equivalence/EQM_PWR_MLP_MOX.hxx +++ b/source/branches/BaM/Model/Equivalence/EQM_PWR_MLP_MOX.hxx @@ -47,6 +47,9 @@ class EQM_PWR_MLP_MOX : public EquivalenceModel EQM_PWR_MLP_MOX(CLASSLogger* log, string TMVAWeightPath); //} //@} + + ~EQM_PWR_MLP_MOX(); + //{ /// Return the molar fissile fraction according fissile & ferile content using a Multi Layer Peceptron (MLP) @@ -70,17 +73,17 @@ class EQM_PWR_MLP_MOX : public EquivalenceModel private : - float Pu8; - float Pu9; - float Pu10; - float Pu11; - float Pu12; - float Am1; + float fPu8; + float fPu9; + float fPu10; + float fPu11; + float fPu12; + float fAm1; - float BU; - float U5_enrichment; + float fBU; + float fU5_enrichment; - TMVA::Reader *reader; + TMVA::Reader *freader; string fTMVAWeightPath;;//!<The weight needed by TMVA to construct and execute the multilayer perceptron }; diff --git a/source/branches/BaM/Model/Equivalence/EQM_PWR_MLP_MOX_Am.cxx b/source/branches/BaM/Model/Equivalence/EQM_PWR_MLP_MOX_Am.cxx index eadf4a6353691df47663726e01d5c298194668e8..55bc1f11a87d3604fe5f270463b0f6e2b0c80d9f 100755 --- a/source/branches/BaM/Model/Equivalence/EQM_PWR_MLP_MOX_Am.cxx +++ b/source/branches/BaM/Model/Equivalence/EQM_PWR_MLP_MOX_Am.cxx @@ -28,23 +28,23 @@ EQM_PWR_MLP_MOX_AM::EQM_PWR_MLP_MOX_AM(string TMVAWeightPath):EquivalenceModel(n { fTMVAWeightPath = TMVAWeightPath; - reader = new TMVA::Reader( "Silent" ); - reader->BookMVA( "MLP Method", fTMVAWeightPath ); - reader->AddVariable( "Pu8" ,&Pu8 ); - reader->AddVariable( "Pu9" ,&Pu9 ); - reader->AddVariable( "Pu10" ,&Pu10); - reader->AddVariable( "Pu11" ,&Pu11); - reader->AddVariable( "Pu12" ,&Pu12); - reader->AddVariable( "Am1" ,&Am1 ); - reader->AddVariable( "Am2" ,&Am2 ); - reader->AddVariable( "Am3" ,&Am3 ); - reader->AddVariable( "BU" ,&BU ); - reader->AddVariable( "U5_enrichment",&U5_enrichment ); + freader = new TMVA::Reader( "Silent" ); + freader->BookMVA( "MLP Method", fTMVAWeightPath ); + freader->AddVariable( "Pu8" ,&fPu8 ); + freader->AddVariable( "Pu9" ,&fPu9 ); + freader->AddVariable( "Pu10" ,&fPu10); + freader->AddVariable( "Pu11" ,&fPu11); + freader->AddVariable( "Pu12" ,&fPu12); + freader->AddVariable( "Am1" ,&fAm1 ); + freader->AddVariable( "Am2" ,&fAm2 ); + freader->AddVariable( "Am3" ,&fAm3 ); + freader->AddVariable( "BU" ,&fBU ); + freader->AddVariable( "U5_enrichment",&fU5_enrichment ); ZAI U8(92,238,0); ZAI U5(92,235,0); - double U5_enrich = 0.0025; + double U5_enrich = 0.0025; ZAI Pu8(94,238,0); ZAI Pu9(94,239,0); @@ -73,18 +73,18 @@ EQM_PWR_MLP_MOX_AM::EQM_PWR_MLP_MOX_AM(CLASSLogger* log, string TMVAWeightPath): { fTMVAWeightPath = TMVAWeightPath; - reader = new TMVA::Reader( "Silent" ); - reader->BookMVA( "MLP Method", fTMVAWeightPath ); - reader->AddVariable( "Pu8" ,&Pu8 ); - reader->AddVariable( "Pu9" ,&Pu9 ); - reader->AddVariable( "Pu10" ,&Pu10); - reader->AddVariable( "Pu11" ,&Pu11); - reader->AddVariable( "Pu12" ,&Pu12); - reader->AddVariable( "Am1" ,&Am1 ); - reader->AddVariable( "Am2" ,&Am2 ); - reader->AddVariable( "Am3" ,&Am3 ); - reader->AddVariable( "BU" ,&BU ); - reader->AddVariable( "U5_enrichment",&U5_enrichment ); + freader = new TMVA::Reader( "Silent" ); + freader->BookMVA( "MLP Method", fTMVAWeightPath ); + freader->AddVariable( "Pu8" ,&fPu8 ); + freader->AddVariable( "Pu9" ,&fPu9 ); + freader->AddVariable( "Pu10" ,&fPu10); + freader->AddVariable( "Pu11" ,&fPu11); + freader->AddVariable( "Pu12" ,&fPu12); + freader->AddVariable( "Am1" ,&fAm1 ); + freader->AddVariable( "Am2" ,&fAm2 ); + freader->AddVariable( "Am3" ,&fAm3 ); + freader->AddVariable( "BU" ,&fBU ); + freader->AddVariable( "U5_enrichment",&fU5_enrichment ); ZAI U8(92,238,0); ZAI U5(92,235,0); @@ -122,43 +122,48 @@ void EQM_PWR_MLP_MOX_AM::UpdateInputComposition(IsotopicVector Fissil,IsotopicVe float UTOT = U8 + U5 + U4; - Pu8 = Fissil.GetZAIIsotopicQuantity(94,238,0); - Pu9 = Fissil.GetZAIIsotopicQuantity(94,239,0); - Pu10 = Fissil.GetZAIIsotopicQuantity(94,240,0); - Pu11 = Fissil.GetZAIIsotopicQuantity(94,241,0); - Pu12 = Fissil.GetZAIIsotopicQuantity(94,242,0); - Am1 = Fissil.GetZAIIsotopicQuantity(95,241,0); - Am2 = Fissil.GetZAIIsotopicQuantity(95,242,1); - Am3 = Fissil.GetZAIIsotopicQuantity(95,243,0); - - double TOTPU = (Pu8+Pu9+Pu10+Pu11+Pu12+Am1+Am2+Am3); - - Pu8 = Pu8 / TOTPU; - Pu9 = Pu9 / TOTPU; - Pu10 = Pu10 / TOTPU; - Pu11 = Pu11 / TOTPU; - Pu12 = Pu12 / TOTPU; - Am1 = Am1 / TOTPU; - Am2 = Am2 / TOTPU; - Am3 = Am3 / TOTPU; + fPu8 = Fissil.GetZAIIsotopicQuantity(94,238,0); + fPu9 = Fissil.GetZAIIsotopicQuantity(94,239,0); + fPu10 = Fissil.GetZAIIsotopicQuantity(94,240,0); + fPu11 = Fissil.GetZAIIsotopicQuantity(94,241,0); + fPu12 = Fissil.GetZAIIsotopicQuantity(94,242,0); + fAm1 = Fissil.GetZAIIsotopicQuantity(95,241,0); + fAm2 = Fissil.GetZAIIsotopicQuantity(95,242,1); + fAm3 = Fissil.GetZAIIsotopicQuantity(95,243,0); + + double TOTPU = (fPu8+fPu9+fPu10+fPu11+fPu12+fAm1+fAm2+fAm3); + + fPu8 = fPu8 / TOTPU; + fPu9 = fPu9 / TOTPU; + fPu10 = fPu10 / TOTPU; + fPu11 = fPu11 / TOTPU; + fPu12 = fPu12 / TOTPU; + fAm1 = fAm1 / TOTPU; + fAm2 = fAm2 / TOTPU; + fAm3 = fAm3 / TOTPU; - U5_enrichment = U5 / UTOT; + fU5_enrichment = U5 / UTOT; - BU = BurnUp; - if(Pu8 + Pu9 + Pu10 + Pu11 + Pu12 + Am1 + Am2 + Am3 > 1.00001 )//?????1.00001??? I don't know it! goes in condition if = 1 !! may be float/double issue ... + fBU = BurnUp; + if(fPu8 + fPu9 + fPu10 + fPu11 + fPu12 + fAm1 + fAm2 + fAm3 > 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 << " " << Am2 << " " << Am3 << endl; + ERROR << fPu8 << " " << fPu9 << " " << fPu10 << " " << fPu11 << " " << fPu12 << " " << fAm1 << " " << fAm2 << " " << fAm3 << endl; exit(0); } // All value are molar (!weight) } + +EQM_PWR_MLP_MOX_AM::~EQM_PWR_MLP_MOX_AM() +{ + delete freader; +} //________________________________________________________________________ double EQM_PWR_MLP_MOX_AM::ExecuteTMVA(IsotopicVector Fissil,IsotopicVector Fertil,double BurnUp) { UpdateInputComposition(Fissil, Fertil, BurnUp); - Float_t val = (reader->EvaluateRegression( "MLP method" ))[0]; + Float_t val = (freader->EvaluateRegression( "MLP method" ))[0]; return (double)val; //retourne teneur } diff --git a/source/branches/BaM/Model/Equivalence/EQM_PWR_MLP_MOX_Am.hxx b/source/branches/BaM/Model/Equivalence/EQM_PWR_MLP_MOX_Am.hxx index f1da6c5bec2cab3857b06a89a9373e8ce0c81ade..6ed625d4df8c9e0850ea2d7266a3a1fc885b4e11 100755 --- a/source/branches/BaM/Model/Equivalence/EQM_PWR_MLP_MOX_Am.hxx +++ b/source/branches/BaM/Model/Equivalence/EQM_PWR_MLP_MOX_Am.hxx @@ -48,7 +48,10 @@ class EQM_PWR_MLP_MOX_AM : public EquivalenceModel EQM_PWR_MLP_MOX_AM(CLASSLogger* log, string TMVAWeightPath); //} //@} - + + ~EQM_PWR_MLP_MOX_AM(); + + //{ /// Return the molar fissile fraction according fissile & ferile content using a Multi Layer Peceptron (MLP) /*! @@ -71,19 +74,19 @@ class EQM_PWR_MLP_MOX_AM : public EquivalenceModel private : - float Pu8; - float Pu9; - float Pu10; - float Pu11; - float Pu12; - float Am1; - float Am2; - float Am3; + float fPu8; + float fPu9; + float fPu10; + float fPu11; + float fPu12; + float fAm1; + float fAm2; + float fAm3; - float BU; - float U5_enrichment; + float fBU; + float fU5_enrichment; - TMVA::Reader *reader; + TMVA::Reader *freader; string fTMVAWeightPath;;//!<The weight needed by TMVA to construct and execute the multilayer perceptron }; diff --git a/source/branches/BaM/Model/XS/XSM_MLP.cxx b/source/branches/BaM/Model/XS/XSM_MLP.cxx index d9c7ce23bf27f02df800277896fc8a234620750d..3d4f2641d1d481d57e8dc85a810fd77e2e45afc8 100644 --- a/source/branches/BaM/Model/XS/XSM_MLP.cxx +++ b/source/branches/BaM/Model/XS/XSM_MLP.cxx @@ -79,6 +79,7 @@ XSM_MLP::XSM_MLP(CLASSLogger* Log,string TMVA_Weight_Directory,string Informatio XSM_MLP::~XSM_MLP() { DBGL + delete freader; fMapOfTMVAVariableNames.clear(); fDKeyword.clear(); DBGL @@ -233,7 +234,7 @@ void XSM_MLP::ReadWeightFile(string Filename, int &Z, int &A, int &I, int &React void XSM_MLP::UpdateInputComposition(IsotopicVector TheFreshfuel,int TimeStep) { - IsotopicVector IVAccordingToUserInfoFile = TheFreshfuel.GetThisComposition(IVInputTMVA); + IsotopicVector IVAccordingToUserInfoFile = TheFreshfuel.GetThisComposition(fIVInputTMVA); double Ntot = IVAccordingToUserInfoFile.GetSumOfAll(); @@ -247,34 +248,31 @@ void XSM_MLP::UpdateInputComposition(IsotopicVector TheFreshfuel,int TimeStep) for( it2 = fMapOfTMVAVariableNames.begin() ; it2 != fMapOfTMVAVariableNames.end() ; it2++) { - InputTMVA[j] = IVAccordingToUserInfoFile.GetZAIIsotopicQuantity( (*it2).first ); - DBGV((*it2).first.Z() << " " << (*it2).first.A() << " " << InputTMVA[j]); + fInputTMVA[j] = IVAccordingToUserInfoFile.GetZAIIsotopicQuantity( (*it2).first ); + DBGV((*it2).first.Z() << " " << (*it2).first.A() << " " << fInputTMVA[j]); j++; } - Time = fMLP_Time[TimeStep]; + fTime = fMLP_Time[TimeStep]; } void XSM_MLP::InitialiseTMVAReader() { - reader = new TMVA::Reader( "Silent" ); + freader = new TMVA::Reader( "Silent" ); for(int i = 0 ; i< (int)fMapOfTMVAVariableNames.size() ; i++) - InputTMVA.push_back(0); - - - for(int i = 0 ; i< (int)fMapOfTMVAVariableNames.size() ; i++) - InputTMVA.push_back(0); + fInputTMVA.push_back(0); map<ZAI ,string >::iterator it; int j = 0; for( it = fMapOfTMVAVariableNames.begin() ; it != fMapOfTMVAVariableNames.end() ; it++) - { reader->AddVariable( ( (*it).second ).c_str(),&InputTMVA[j]); + { + freader->AddVariable( ( (*it).second ).c_str(),&fInputTMVA[j]); j++; } if(!fIsStepTime) - reader->AddVariable( "Time" ,&Time); + freader->AddVariable( "Time" ,&fTime); } //________________________________________________________________________ @@ -295,9 +293,9 @@ double XSM_MLP::ExecuteTMVA(string WeightFile, IsotopicVector isotopicvector, in // Book method MLP TString methodName = "MLP method"; TString weightpath = dir + WeightFile ; - reader->BookMVA( methodName, weightpath ); + freader->BookMVA( methodName, weightpath ); - float val = (reader->EvaluateRegression( methodName ))[0]; + float val = (freader->EvaluateRegression( methodName ))[0]; DBGL diff --git a/source/branches/BaM/Model/XS/XSM_MLP.hxx b/source/branches/BaM/Model/XS/XSM_MLP.hxx index fd197726bb02f559c1815decb39bf5f361b9fa8b..46cad95bb11e1e7d9544cc4b03858a35d0e765bb 100644 --- a/source/branches/BaM/Model/XS/XSM_MLP.hxx +++ b/source/branches/BaM/Model/XS/XSM_MLP.hxx @@ -148,10 +148,10 @@ class XSM_MLP : public XSModel map<ZAI,string> fMapOfTMVAVariableNames;//!< List of TMVA input variable names (read from fMLPInformationFile ) , name depends on the training step - TMVA::Reader *reader; - vector<float> InputTMVA; - IsotopicVector IVInputTMVA; - float Time; + TMVA::Reader *freader; + vector<float> fInputTMVA; + IsotopicVector fIVInputTMVA; + float fTime; #ifndef __CINT__ map<string, XS_MLP_DMthPtr> fDKeyword;