CLASS  5.1
Fuel Cycle Simulator
EQ_OneParameter.hxx
Go to the documentation of this file.
1 #ifndef _EQONEPARAMETER_HXX_
2 #define _EQONEPARAMETER_HXX_
3 
15 #include "EquivalenceModel.hxx"
16 #include "IsotopicVector.hxx"
17 #include "CLASSReader.hxx"
18 #include <math.h>
19 #include "TTree.h"
20 #include <map>
21 
22 
23 using namespace std;
24 
25 class EQ_OneParameter;
26 typedef void (EQ_OneParameter::*EQOP_MthPtr)( const string & );
27 
28 //-----------------------------------------------------------------------------//
29 
31 
54 //________________________________________________________________________
55 
56 
58 {
59  public :
64  EQ_OneParameter(string TMVAXMLFilePath, string TMVANFOFilePath);
65  EQ_OneParameter(CLASSLogger* log, string TMVAXMLFilePath, string TMVANFOFilePath);
66 
67  EQ_OneParameter(string TMVANFOFilePath);
68  EQ_OneParameter(CLASSLogger* log, string TMVANFOFilePath);
69 
70  virtual ~EQ_OneParameter();
71 
72 
77 
78  //{
80 
86  virtual map <string , vector<double> > BuildFuel(double BurnUp, double HMMass, map < string , vector <IsotopicVector> > StreamArray, map < string , double> StreamListMassFractionMin, map < string , double> StreamListMassFractionMax, map < int , string> StreamListPriority, map < string , bool> StreamListIsBuffer);
87  //}
88 
89 
91  void BookTMVAReader(); //Book TMVA method
92 
93  vector<float> CreateTMVAInput(IsotopicVector TheFreshfuel, double ThisTime) ;
94  double CalculateTargetParameter(IsotopicVector TheFuel, string TargetParameterName);
95  double CalculateBurnUpMax(IsotopicVector TheFuel, map<string, double> ModelParameter);
96  double CalculateKeffAtBOC(IsotopicVector TheFuel);
97 
98  string GetTMVAXMLFilePath() {return fTMVAXMLFilePath;} // Return the path to TMVA XML File path
99  string GetTMVANFOFilePath() {return fTMVANFOFilePath;} // Return the path to TMVA NFO File path
100  void SetTMVAXMLFilePath(string TMVAXMLFilePath) {fTMVAXMLFilePath = TMVAXMLFilePath;} // Set the path to TMVA XML File path
101  void SetTMVANFOFilePath(string TMVANFOFilePath) {fTMVANFOFilePath = TMVANFOFilePath;} // Set the path to TMVA NFO File path
102 
107 
108  int GetStreamListNumber(){return fStreamList.size();};
109  int GetMaxIterration() const { return fMaxIterration; }
110  double GetTargetParameterStDev(){return fTargetParameterStDev;}
111  double GetStreamListEqMMassFractionMax(string keyword){return fStreamListEqMMassFractionMax[keyword] ;}
112  double GetStreamListEqMMassFractionMin(string keyword){return fStreamListEqMMassFractionMin[keyword] ;}
113  double GetPCMPrecision(){return fPCMprecision/1e5;}
114 
115  void SetModelParameter(string sMP, double dMP) { fModelParameter[sMP] = dMP; }
116  map<string, double> GetModelParameter() { return fModelParameter; }
117 
118  void SetNonZaiTMVAVariable(string snZP, double dnZP);
119  vector< pair<double, string> > GetNonZaiTMVAVariables() { return fListOfNonZaiTMVAVariables; }
120 
121  void SetMaxIterration(int val) { fMaxIterration = val; }
122  void SetTargetParameterStDev(double TPSD){fTargetParameterStDev = TPSD;}
123  void SetStreamListEqMMassFractionMax(string keyword, double value){fStreamListEqMMassFractionMax[keyword] = value;}
124  void SetStreamListEqMMassFractionMin(string keyword, double value){fStreamListEqMMassFractionMin[keyword] = value;}
125 
126  void SetPCMPrecision(double pcm){fPCMprecision = pcm;}
127 
132 
133  double SecondToBurnup(double Second){return Second*fSpecificPower/(24*3.6e6);}
134  double BurnupToSecond(double BurnUp){return BurnUp/fSpecificPower*(24*3.6e6);}
135 
137 
139 
144  void ReadNFO();
145  virtual void ReadLine(string line);
146 
147 
148  virtual void LoadKeyword();
149  void ReadZAIlimits(const string &line);
150  void ReadType(const string &line);
151 
152  //{
154 
157  void ReadZAIName(const string &line);
158  //}
159 
160  //{
162 
165  void ReadMaxBurnUp(const string &line);
166  //}
167 
168  //{
170 
173  void ReadSpecificPower(const string &line);
174  //}
175 
176  //{
178 
181  void ReadTargetParameter(const string &line);
182  //}
183  //{
185 
188  void ReadNonZaiTMVAVariables(const string &line);
189  //}
190  //{
192 
195  void ReadOutput(const string &line);
196  //}
197 
198  //{
200 
203  void ReadBuffer(const string &line);
204  //}
205 
206  //{
208 
211  void ReadModelParameter(const string &line);
212  //}
213 
214  //{
216 
219  void ReadPredictorType(const string &line);
220  //}
221 
222  //{
224 
227  void ReadTargetParameterStDev(const string &line);
228  //}
229 
230  void PrintInfo(); //Print the information red in the INFO stream
231 
232  //{
234 
237  void ReadList(const string &line);
238 
239  void ReadEqMaxFraction(const string &line);
240  void ReadEqMinFraction(const string &line);
241 
242  IsotopicVector BuildFuelToTest(map < string, vector<double> >& lambda, map < string , vector <IsotopicVector> > const& StreamArray, double HMMass, map <string, bool> StreamListIsBuffer); //Build a fuel with the buffer according to fissile lambda
243  void CheckTargetParameterConsistency(map < int , string > StreamListPriority, map < string , double > TargetParameterMin, map < string , double > TargetParameterMax);
244 
245  protected :
246 
248 
249  map < string , double> fStreamListEqMMassFractionMax;
250  map < string , double> fStreamListEqMMassFractionMin;
251 
252  string fPredictorType ;
253  string fOutput ;
254  string fBuffer ;
255 
256  map<string, double> fModelParameter ;
257  vector< pair<double, string> > fListOfNonZaiTMVAVariables ;
258 
259  map<ZAI, string> fMapOfTMVAVariableNames;
260 
262 
263  double fMaximalBU;
266 
269 
270 
272  map<string, EQOP_MthPtr> fKeyword;
273 
274  map< ZAI, pair<double,double> > fZAILimits;
275 
277  string fDBFType;
278  string fDBRType;
279 
280  private :
281 
282  double fPCMprecision;
283 
284 };
285 
286 #endif
287 
288 
289 
290 
291 
292 
293 
294 
295 
Determines how to build a fresh fuel.
Definition: EquivalenceModel.hxx:59
string GetTMVANFOFilePath()
Definition: EQ_OneParameter.hxx:99
string fOutput
Type of output calculated by the predictor.
Definition: EQ_OneParameter.hxx:253
vector< pair< double, string > > fListOfNonZaiTMVAVariables
Definition: EQ_OneParameter.hxx:257
double GetStreamListEqMMassFractionMin(string keyword)
Definition: EQ_OneParameter.hxx:112
bool fUseTMVAPredictor
Bool that says if we need a TMVA predictor. If not, fuel fraction isimpoased by the FP...
Definition: EQ_OneParameter.hxx:247
string GetTMVAXMLFilePath()
Definition: EQ_OneParameter.hxx:98
void SetStreamListEqMMassFractionMin(string keyword, double value)
Definition: EQ_OneParameter.hxx:124
map< string, double > GetModelParameter()
Get Model Parameters precised in NFO file.
Definition: EQ_OneParameter.hxx:116
double fTargetParameterStDev
Precision on target parameter calculation.
Definition: EQ_OneParameter.hxx:261
void SetStreamListEqMMassFractionMax(string keyword, double value)
Definition: EQ_OneParameter.hxx:123
Allows to store & operate on radioactive sample.
Definition: IsotopicVector.hxx:37
void SetTargetParameterStDev(double TPSD)
Set the precision on Target Parameter.
Definition: EQ_OneParameter.hxx:122
string fInformationFile
file containing Reactor Type, Fuel type, HM mass, Power, time vector, and TMVA input variables names ...
Definition: EQ_OneParameter.hxx:276
vector< pair< double, string > > GetNonZaiTMVAVariables()
Get NonZaiTMVAVariables.
Definition: EQ_OneParameter.hxx:119
map< string, double > fStreamListEqMMassFractionMax
Map that contains lists of stream according to the EqModel with mass maximum fraction.
Definition: EQ_OneParameter.hxx:249
Definition: CLASSBackEndDict.cxx:37
string fTMVANFOFilePath
The weight needed by TMVA to construct and execute the multilayer perceptron.
Definition: EQ_OneParameter.hxx:268
string fPredictorType
Type of predictor used in Equivalence Model (ex: MLP)
Definition: EQ_OneParameter.hxx:252
double GetTargetParameterStDev()
Get the precision on fTargetParameterStDev.
Definition: EQ_OneParameter.hxx:110
map< string, double > fStreamListEqMMassFractionMin
Map that contains lists of stream according to the EqModel with mass minimum fraction.
Definition: EQ_OneParameter.hxx:250
string fTMVAXMLFilePath
The weight needed by TMVA to construct and execute the multilayer perceptron.
Definition: EQ_OneParameter.hxx:267
map< string, EQOP_MthPtr > fKeyword
Definition: EQ_OneParameter.hxx:272
string fDBFType
Fuel Type (e.g MOX, UOX, ThU, ThPu ...)
Definition: EQ_OneParameter.hxx:277
string fBuffer
Name of material used as buffer in fuel.
Definition: EQ_OneParameter.hxx:254
map< ZAI, string > fMapOfTMVAVariableNames
!< List of TMVA input variable names that are not ZAIs
Definition: EQ_OneParameter.hxx:259
string fTargetParameter
Type of target parameter optimized in build fuel (ex. BUmax)
Definition: EQ_OneParameter.hxx:264
Header file for EquivalenceModel class.
CLASSReader * fReader
Definition: EQ_OneParameter.hxx:271
double GetPCMPrecision()
Get the precision on prediction []. Neural network predictor constructors.
Definition: EQ_OneParameter.hxx:113
Definition: CLASSReader.hxx:17
string fDBRType
Reactor Type (e.g PWR, FBR-Na, ADS..)
Definition: EQ_OneParameter.hxx:278
double fMaximalBU
The Maximum burn-up of the model in GWd/t.
Definition: EQ_OneParameter.hxx:263
Header file for IsotopicVector class.
map< string, double > fModelParameter
Map of equivalence model parameter.
Definition: EQ_OneParameter.hxx:256
void SetModelParameter(string sMP, double dMP)
Set Model Parameters precised in NFO file.
Definition: EQ_OneParameter.hxx:115
Object to handle output messages.
Definition: CLASSLogger.hxx:144
int GetStreamListNumber()
Definition: EQ_OneParameter.hxx:108
void SetPCMPrecision(double pcm)
Set the precision on prediction [pcm]. Neural network predictor constructors.
Definition: EQ_OneParameter.hxx:126
int fMaxIterration
Max iterrations in build fueld algorithm.
Definition: EQ_OneParameter.hxx:265
double BurnupToSecond(double BurnUp)
Definition: EQ_OneParameter.hxx:134
double SecondToBurnup(double Second)
Definition: EQ_OneParameter.hxx:133
void(EQ_OneParameter::* EQOP_MthPtr)(const string &)
Definition: EQ_OneParameter.hxx:26
map< ZAI, pair< double, double > > fZAILimits
Fresh fuel range : map<ZAI<min edge ,max edge >>
Definition: EQ_OneParameter.hxx:274
void SetTMVANFOFilePath(string TMVANFOFilePath)
Definition: EQ_OneParameter.hxx:101
Determines how to build a fresh fuel.
Definition: EQ_OneParameter.hxx:57
double GetStreamListEqMMassFractionMax(string keyword)
Definition: EQ_OneParameter.hxx:111
void SetTMVAXMLFilePath(string TMVAXMLFilePath)
Definition: EQ_OneParameter.hxx:100
int GetMaxIterration() const
Max iterration in build fueld algorythm.
Definition: EQ_OneParameter.hxx:109
void SetMaxIterration(int val)
Max iteration in build fuel algorithm.
Definition: EQ_OneParameter.hxx:121