diff --git a/Utils/ROOT2ROOT/GENERIC/CLASS_R2R b/Utils/ROOT2ROOT/GENERIC/CLASS_R2R new file mode 100755 index 0000000000000000000000000000000000000000..3dad266940b6c68314acc8d8552505201239fc38 Binary files /dev/null and b/Utils/ROOT2ROOT/GENERIC/CLASS_R2R differ diff --git a/Utils/ROOT2ROOT/GENERIC/CLASS_ROOT2ROOT.cxx b/Utils/ROOT2ROOT/GENERIC/CLASS_ROOT2ROOT.cxx index feda0aa8fa9e46d5d23f3b1ce9dd64cef257daf0..c86a039028a88daa0319fcb9606fbf7a616df630 100644 --- a/Utils/ROOT2ROOT/GENERIC/CLASS_ROOT2ROOT.cxx +++ b/Utils/ROOT2ROOT/GENERIC/CLASS_ROOT2ROOT.cxx @@ -1,10 +1,7 @@ /* -Simple code used to convert root output file produced by CLASS to simple data file - -Remains : - -First Cycle Time +Code to use in Sensitivity Analysis +Read and store in a TTree N Scenario information (Input and Output) Authors: @@ -43,33 +40,14 @@ string exec(const char* cmd) int main(int argc, char** argv) { //--------------------------------------------------------------------------------------------------------------------------------------------- -//---------------------------------------------------------------TO ADAPT---------------------------------------------------------------------- +//---------------------------------------------------------------DATA TO CHANGE---------------------------------------------------------------- //--------------------------------------------------------------------------------------------------------------------------------------------- // Size limits for crashed and correct jobs string s_SizeLimit = "14M"; //--------------------------------------------------------------------------------------------------------------------------------------------- -//---------------------------------------------------------------VARIABLES--------------------------------------------------------------------- -//--------------------------------------------------------------------------------------------------------------------------------------------- - - string s_tmp; - Long64_t TimeSecond = 0; - - IsotopicVector v_Pu; - v_Pu.Add(94,238,0,1); - v_Pu.Add(94,239,0,1); - v_Pu.Add(94,240,0,1); - v_Pu.Add(94,241,0,1); - v_Pu.Add(94,242,0,1); - v_Pu.Add(95,241,0,1); - - IsotopicVector v_U; - v_U.Add(92,238,0,1); - v_U.Add(92,235,0,1); - -//--------------------------------------------------------------------------------------------------------------------------------------------- -//---------------------------------------------------------------BRANCHES --------------------------------------------------------------------- +//---------------------------------------------------------------INPUT BRANCHES TO CHANGE------------------------------------------------------ //--------------------------------------------------------------------------------------------------------------------------------------------- TFile *FileScenario = new TFile("Scenario.root","RECREATE"); @@ -92,7 +70,62 @@ int main(int argc, char** argv) double Fr_SPu = 0; TreeScenario->Branch("Fr_SPu",&Fr_SPu,"Fr_SPu/D"); //--------------------------------------------------------------------------------------------------------------------------------------------- -//---------------------------------------------------------------INPUT ------------------------------------------------------------------------ +//---------------------------------------------------------------VARIABLES--------------------------------------------------------------------- +//--------------------------------------------------------------------------------------------------------------------------------------------- + + string s_tmp; + Long64_t TimeSecond = 0; + + Long64_t Time = 0; + double Power = 0; + vector<IsotopicVector *> IV_Branch; + int NStocks=0; int NPools=0; int NReactors=0; int NFabPlants=0; + + vector <string> v_Branches; // vector that will contain all the branches stored in the TTree + +//--------------------------------------------------------------------------------------------------------------------------------------------- +//---------------------------------------------------------------IV --------------------------------------------------------------------------- +//--------------------------------------------------------------------------------------------------------------------------------------------- + + IsotopicVector v_U; + v_U.Add(92,234,0,1); + v_U.Add(92,235,0,1); + v_U.Add(92,236,0,1); + v_U.Add(92,237,0,1); + v_U.Add(92,238,0,1); + v_U.Add(92,239,0,1); + + IsotopicVector v_Np; + v_Np.Add(93,236,0,1); + v_Np.Add(93,237,0,1); + v_Np.Add(93,238,0,1); + v_Np.Add(93,239,0,1); + + IsotopicVector v_Pu; + v_Pu.Add(94,238,0,1); + v_Pu.Add(94,239,0,1); + v_Pu.Add(94,240,0,1); + v_Pu.Add(94,241,0,1); + v_Pu.Add(94,242,0,1); + + IsotopicVector v_Am; + v_Am.Add(95,241,0,1); + v_Am.Add(95,242,0,1); + v_Am.Add(95,242,1,1); + v_Am.Add(95,243,0,1); + v_Am.Add(95,244,0,1); + + IsotopicVector v_Cm; + v_Cm.Add(96,242,0,1); + v_Cm.Add(96,243,0,1); + v_Cm.Add(96,244,0,1); + v_Cm.Add(96,245,0,1); + v_Cm.Add(96,246,0,1); + v_Cm.Add(96,247,0,1); + v_Cm.Add(96,248,0,1); + +//--------------------------------------------------------------------------------------------------------------------------------------------- +//--------------------------------------------------------------- BRANCHES INFO --------------------------------------------------------------- //--------------------------------------------------------------------------------------------------------------------------------------------- string PathToROOTFiles = string(argv[1]); @@ -115,10 +148,80 @@ int main(int argc, char** argv) TFile *TFileName = new TFile(s_OneFileForBranches.c_str()); TTree *fData = new TTree(); fData = (TTree*) gDirectory->Get(TFileName->GetListOfKeys()->At(TFileName->GetNkeys() - 1)->GetName()); + fData->SetBranchStatus("*", 0); // All branches are unbranched + int NBranches = fData->GetListOfBranches()->GetEntries(); + + cout<<endl<<endl<<"################################################"<<endl; + cout<<"TTree " << fData->GetName()<<" Loaded "<<endl; + cout<<"################################################"<<endl; + cout<<"List of existing Branches : "<<endl<<endl; + for(int i=0; i<NBranches; i++) + { + s_tmp = fData->GetListOfBranches()->At(i)->GetName(); + if(s_tmp[s_tmp.size()-1]=='.') s_tmp = s_tmp.substr(0, s_tmp.size()-1); + v_Branches.push_back(s_tmp); + cout<<v_Branches[i]<<endl; + } + cout<<"################################################"<<endl; + cout<<"################################################"<<endl<<endl; + + // Number of Stocks + for(int i=0; i<NBranches; i++) if (v_Branches[i].substr(0,2)=="S_") NStocks++; + Storage* B_Stock[NStocks]; int IndiceStock=0; + // Number of Pools + for(int i=0; i<NBranches; i++) if (v_Branches[i].substr(0,2)=="P_") NPools++; + Pool* B_Pool[NPools]; int IndicePool=0; + // Number of Reactors + for(int i=0; i<NBranches; i++) if (v_Branches[i].substr(0,2)=="R_") NReactors++; + Reactor* B_Reactor[NReactors]; int IndiceReactor=0; + // Number of Fabrication Plants + for(int i=0; i<NBranches; i++) if (v_Branches[i].substr(0,2)=="F_") NFabPlants++; + FabricationPlant* B_FabPlant[NFabPlants]; int IndiceFabPlant=0; + //Time Steps Long64_t NTime = fData->GetEntries(); TFileName->Close(); + + + +exit(1); + +//--------------------------------------------------------------------------------------------------------------------------------------------- +//--------------------------------------------------------------- Fill MATRIX In File---------------------------------------------------------- +//--------------------------------------------------------------------------------------------------------------------------------------------- + + // Output data ascii file name + //size_t SPos = FileName.find(".root"); FileName.replace(SPos, std::string(".root").length(), ".dat"); + ofstream DataFileName("Scenario.info"); DataFileName<<scientific<<setprecision(5); + + int NumberOfIsotopes = 7; // Number of group to be printed (i.e. MA, U, FP, Unat, etc...) + + DataFileName<<"C AbsTime 0"<<endl; + DataFileName<<"C ParcPower 1"<<endl; + DataFileName<<"C ---------------------------------------------------------------------"<<endl; + DataFileName<<"C "<<setw(20)<<" "<<setw(5)<<"U"<<setw(5)<<"Np"<<setw(5)<<"Pu"<<setw(5)<<"Am"<<setw(5)<<"Cm"<<setw(5)<<"MA"<<setw(5)<<"PF"<<endl; + DataFileName<<"C ---------------------------------------------------------------------"<<endl; + for(int i=2; i<NBranches; i++) + { + DataFileName<<"C "<<setw(20)<<v_Branches[i]; + //DataFileName.seekp((i-1) * 100 + 20); + for(int e=0; e<NumberOfIsotopes; e++) + { + DataFileName<<setw(5)<<2 + NumberOfIsotopes*(i-2) + e; + }DataFileName<<endl; + if(i%6==0) + { + DataFileName<<"C ---------------------------------------------------------------------"<<endl; + DataFileName<<"C "<<setw(20)<<" "<<setw(5)<<"U"<<setw(5)<<"Np"<<setw(5)<<"Pu"<<setw(5)<<"Am"<<setw(5)<<"Cm"<<setw(5)<<"MA"<<setw(5)<<"PF"<<endl; + DataFileName<<"C ---------------------------------------------------------------------"<<endl; + } + } + DataFileName<<"C ---------------------------------------------------------------------"<<endl; + DataFileName<<"C"<<endl; + DataFileName<<"C"<<endl; + DataFileName<<"C"<<endl; + //--------------------------------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------WRITING ---------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------------------------------------------------- @@ -138,9 +241,71 @@ int main(int argc, char** argv) cout<<endl; //--------------------------------------------------------------------------------------------------------------------------------------------- -//---------------------------------------------------------------LOAD BRANCHES----------------------------------------------------------------- +//---------------------------------------------------------------CONNECT BRANCHES-------------------------------------------------------------- //--------------------------------------------------------------------------------------------------------------------------------------------- + // Time + fData->SetBranchStatus("AbsTime", 1); //Branch activation + fData->SetBranchAddress("AbsTime", &Time); //Connection between variable and Branches + // Thermal Power + fData->SetBranchStatus("ParcPower", 1); + fData->SetBranchAddress("ParcPower", &Power); + + for(int i=0; i<NBranches; i++) IV_Branch.push_back(0); + + for(int i=2; i<NBranches; i++) + { + if (v_Branches[i].substr(0,2)=="S_") + { + B_Stock[IndiceStock] = new Storage(); + fData->SetBranchStatus((v_Branches[i] + "*").c_str(), 1); + fData->SetBranchAddress((v_Branches[i] + ".").c_str(), &B_Stock[IndiceStock]); + IndiceStock++; + } + else if (v_Branches[i].substr(0,2)=="P_") + { + B_Pool[IndicePool] = new Pool(); + fData->SetBranchStatus((v_Branches[i] + "*").c_str(), 1); + fData->SetBranchAddress((v_Branches[i] + ".").c_str(), &B_Pool[IndicePool]); + IndicePool++; + } + else if (v_Branches[i].substr(0,2)=="R_") + { + B_Reactor[IndiceReactor] = new Reactor(); + fData->SetBranchStatus((v_Branches[i] + "*").c_str(), 1); + fData->SetBranchAddress((v_Branches[i] + ".").c_str(), &B_Reactor[IndiceReactor]); + IndiceReactor++; + } + else if (v_Branches[i].substr(0,2)=="F_") + { + B_FabPlant[IndiceFabPlant] = new FabricationPlant(); + fData->SetBranchStatus((v_Branches[i] + "*").c_str(), 1); + fData->SetBranchAddress((v_Branches[i] + ".").c_str(), &B_FabPlant[IndiceFabPlant]); + IndiceFabPlant++; + } + else + { + fData->SetBranchStatus((v_Branches[i] + "*").c_str(), 1); //Branch activation + fData->SetBranchAddress((v_Branches[i] + ".").c_str(), &IV_Branch[i]); //Connection between variable and Branches + } + } + + + + + + + + + + + + + +//--------------------------------------------------------------------------------------------------------------------------------------------- +//---------------------------------------------------------------LOAD BRANCHES----------------------------------------------------------------- +//--------------------------------------------------------------------------------------------------------------------------------------------- +/* cout<<endl<<"#########################"<<endl; cout<<"Number Of ROOT Files : "<<NumberOfElements<<endl; cout<<"Number Of Time Step / Files : "<<NTime<<endl<<endl; @@ -214,37 +379,7 @@ int main(int argc, char** argv) fData->SetBranchStatus((Branchname+"*").c_str(), 1); fData->SetBranchAddress((Branchname+".").c_str(), &IV_TOTAL); - Reactor* PWR_UOX = new Reactor(); - Branchname = "R_PWR_UOx"; - ActiveBranchName = Branchname + "*"; - fData->SetBranchStatus(ActiveBranchName.c_str(), 1); - fData->SetBranchAddress((Branchname+".").c_str(), &PWR_UOX); - - Reactor* PWR_MOX = new Reactor(); - Branchname = "R_PWR_MOX"; - ActiveBranchName = Branchname + "*"; - fData->SetBranchStatus(ActiveBranchName.c_str(), 1); - fData->SetBranchAddress((Branchname+".").c_str(), &PWR_MOX); - - Reactor* SFR_MOX = new Reactor(); - Branchname = "R_SFR_MOX"; - ActiveBranchName = Branchname + "*"; - fData->SetBranchStatus(ActiveBranchName.c_str(), 1); - fData->SetBranchAddress((Branchname+".").c_str(), &SFR_MOX); - - Storage* Stock_UOX = new Storage(); - Branchname = "S_StockUOx"; - ActiveBranchName = Branchname + "*"; - fData->SetBranchStatus(ActiveBranchName.c_str(), 1); - fData->SetBranchAddress((Branchname+".").c_str(), &Stock_UOX); - - Storage* Stock_MOX = new Storage(); - Branchname = "S_StockMOx"; - ActiveBranchName = Branchname + "*"; - fData->SetBranchStatus(ActiveBranchName.c_str(), 1); - fData->SetBranchAddress((Branchname+".").c_str(), &Stock_MOX); - - //--------------------------------------------------------------------------------------------------------------------------------------------- + //--------------------------------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------LOOP ON EVENTS AND FILE WRITING----------------------------------------------- //--------------------------------------------------------------------------------------------------------------------------------------------- @@ -269,8 +404,9 @@ int main(int argc, char** argv) FileScenario->Write(); FileScenario->Close(); +*/ } /* - g++ -std=c++11 -o CLASS_R2D CLASS_ROOT2DAT.cxx -I $CLASS_include -L $CLASS_lib -lCLASSpkg `root-config --cflags` `root-config --libs` -fopenmp -lgomp -Wunused-result + g++ -std=c++11 -o CLASS_R2R CLASS_ROOT2ROOT.cxx -I $CLASS_include -L $CLASS_lib -lCLASSpkg `root-config --cflags` `root-config --libs` -fopenmp -lgomp -Wunused-result */ diff --git a/Utils/ROOT2ROOT/GENERIC/Makefile b/Utils/ROOT2ROOT/GENERIC/Makefile deleted file mode 100644 index b35d0bc1c43bfc7dc5e72b5c29ca2138934ce397..0000000000000000000000000000000000000000 --- a/Utils/ROOT2ROOT/GENERIC/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -SRC=$(wildcard *.cxx) -OBJ=$(SRC:.cxx=.ex) -CC=g++ -std=c++11 -LIB=-I ${CLASS_include} -L ${CLASS_lib} -L SSENAR -lCLASSpkg -lSsenar `root-config --cflags` `root-config --libs` -fopenmp -lgomp -Wunused-result -lTMVA - -all: $(OBJ) - -%.ex: %.cxx - ${CC} -o $@ $< ${LIB} - -clean: - rm *.ex - - diff --git a/Utils/ROOT2ROOT/GENERIC/ROOTFileList.txt b/Utils/ROOT2ROOT/GENERIC/ROOTFileList.txt new file mode 100644 index 0000000000000000000000000000000000000000..a17759cbee58e0b45c5cfe3b1bb5e7f259070978 --- /dev/null +++ b/Utils/ROOT2ROOT/GENERIC/ROOTFileList.txt @@ -0,0 +1,2 @@ +ROOT_FILES/OUT_3.391e+01_3.432e+01_8.256e+01_8.583e-01_1.009e-01_4.077e-02_6.226e+00_3.485e+00_8.609e+00_3.000e+00_1.500e-01/OUT.root +ROOT_FILES/OUT_5.992e+01_5.275e+01_6.886e+01_8.936e-01_6.936e-02_3.708e-02_9.185e+00_1.902e+01_3.535e+00_4.000e+00_1.900e-01/OUT.root diff --git a/Utils/ROOT2ROOT/GENERIC/ROOTFileListCrashed.txt b/Utils/ROOT2ROOT/GENERIC/ROOTFileListCrashed.txt new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/Utils/ROOT2ROOT/GENERIC/RUN/Makefile b/Utils/ROOT2ROOT/GENERIC/RUN/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..4ab20a8bb033c1953d56725ee6fdec61b71ca2c4 --- /dev/null +++ b/Utils/ROOT2ROOT/GENERIC/RUN/Makefile @@ -0,0 +1,61 @@ +ROOTCFLAGS:=$(shell ${ROOTSYS}/bin/root-config --cflags) +ROOTGLIBS:=$(shell ${ROOTSYS}/bin/root-config --glibs) +ROOTLIBS:=$(shell ${ROOTSYS}/bin/root-config --libs) + +CXX= g++ -std=c++11 +CXXFLAGS= -O2 -g -fPIC -finline-functions + +LIBDIR=lib/ + +SRC_dir = src/ +INC_dir = inc/ + +SRC_files = $(wildcard $(SRC_dir)/*.cxx) +INC_files = $(wildcard $(INC_dir)/*.hxx) + +OBJ_dir = obj/ +LIBNAME = Runpkg + +# files need a dictionary by ROOT +OBJ_Dict = ZAIDict.o \ + IsotopicVectorDict.o \ + ReactorDict.o \ + FacilityDict.o \ + RunDict.o + +# all object files (build from source and dictionry list) +OBJ = $(SRC_files:$(SRC_dir)/%.cxx=$(OBJ_dir)/%.o) +OBJ += $(OBJ_Dict:%.o=$(OBJ_dir)/%.o) + +# root object files, I don't understand this one +ROOTOBJS_ = ZAI.o ZAIDict.o \ + IsotopicVector.o IsotopicVectorDict.o \ + Reactor.o ReactorDict.o \ + Facility.o FacilityDict.o \ + Run.o RunDict.o + +ROOTOBJS = $(ROOTOBJS_:%.o=$(OBJ_dir)/%.o) + +CXXFLAGS += -I$(INC_dir) $(ROOTCFLAGS) +LD = $(CXX) +LIBS = -L$(LIBDIR) $(ROOTLIBS) -lTMVA $(OMPLIB) +LDFLAGS += -shared + +all: $(OBJ) $(OBJ_model) $(OBJ_ext) + @echo "\033[33m"lib$(LIBNAME).so : "\033[0m" + $(LD) $(LDFLAGS) $(OBJ) $(LIBS) -o $(LIBDIR)/lib$(LIBNAME).so + @echo "\033[1m lib$(LIBNAME).so done\033[0m" + @echo "\033[33m"lib$(LIBNAME)_root.so : "\033[0m" + $(LD) $(LDFLAGS) $(ROOTOBJS) $(LIBS) -o $(LIBDIR)/lib$(LIBNAME)_root.so + @echo "\033[1m lib$(LIBNAME)_root.so done\033[0m" + +clean: + @echo "\033[41;97;1mclean\033[0m" + rm -f $(OBJ) $(OBJ_model) $(OBJ_ext) $(SRC_dir)/*~ $(SRC_dir)/*Dict.cxx $(SRC_dir)/*Dict.h + +.SUFFIXES: .cxx + +# build standard sources +$(OBJ_dir)/%.o: $(SRC_dir)/%.cxx $(INC_files) + @echo "\033[95m"$(notdir $@) : "\033[0m" + $(CXX) $(CXXFLAGS) -c $< -o $@ diff --git a/Utils/ROOT2ROOT/GENERIC/RUN/inc/Facility.hxx b/Utils/ROOT2ROOT/GENERIC/RUN/inc/Facility.hxx new file mode 100644 index 0000000000000000000000000000000000000000..c26601df8517ed3f778ec3629548ca99eb8c9131 --- /dev/null +++ b/Utils/ROOT2ROOT/GENERIC/RUN/inc/Facility.hxx @@ -0,0 +1,27 @@ +#include <string> +#include <iostream> +#include <IsotopicVector.hxx> + +using namespace std; + +class Facility +{ + + public : + + // Constructors + Facility(); + // estructor + ~Facility(); + + string GetName() {return fName;} + void SetName(string Name) {fName = Name;} + + private : + + string fName; + IsotopicVector fIV; // The IV vector according to the time + + + + }; diff --git a/Utils/ROOT2ROOT/GENERIC/RUN/inc/Header.hxx b/Utils/ROOT2ROOT/GENERIC/RUN/inc/Header.hxx new file mode 100644 index 0000000000000000000000000000000000000000..63773d6b40af3538f54567fe8a94ca40ae8a67c9 --- /dev/null +++ b/Utils/ROOT2ROOT/GENERIC/RUN/inc/Header.hxx @@ -0,0 +1,8 @@ +#include <iostream> +#include <cmath> +#include <iostream> +#include <fstream> +#include <string> +#include <algorithm> + +using namespace std; diff --git a/Utils/ROOT2ROOT/GENERIC/SSENAR/IsotopicVector.hxx b/Utils/ROOT2ROOT/GENERIC/RUN/inc/IsotopicVector.hxx similarity index 100% rename from Utils/ROOT2ROOT/GENERIC/SSENAR/IsotopicVector.hxx rename to Utils/ROOT2ROOT/GENERIC/RUN/inc/IsotopicVector.hxx diff --git a/Utils/ROOT2ROOT/GENERIC/RUN/inc/Reactor.hxx b/Utils/ROOT2ROOT/GENERIC/RUN/inc/Reactor.hxx new file mode 100644 index 0000000000000000000000000000000000000000..394f80afd647e901c5cbfcd9fc395323c222a618 --- /dev/null +++ b/Utils/ROOT2ROOT/GENERIC/RUN/inc/Reactor.hxx @@ -0,0 +1,45 @@ +#include <string> +#include <iostream> + +using namespace std; + +class Reactor : public Facility +{ + + public : + + // Constructor + Reactor() + // Destructor + ~Reactor() + + // Get and Set Methods + + string GetFuelType() {return fFuelType;} + void SetFuelType(string FuelType) {fFuelType=FuelType;} + + vector <double> GetPower() {return fPower;} // Power as a function of the time + void SetPower(vector<double> Power) {fPower=Power;} // Power as a function of the time + + vector <double> GetEnergy() {return fEnergy;} // Energy as a function of the time + void Setenergy(vector<double> energy) {fEnergy=Energy;} // Energy as a function of the time + + private : + + string fFuelType; + + vector <double> fPower; // Power as a function of the time + vector <double> fEnergy; // Energy as a function of the time + + vector <double> fBurnup; // BU as a function of the time + + double fStartingTime; + double fShutDownTime; + + double fCycleTime; + double fThermalPower; + double fLoadFactor; + double fHMMass; + + vector <IsotopicVector> fIVAtBOC; // IV @ BOC as a function of the time +}; diff --git a/Utils/ROOT2ROOT/GENERIC/RUN/inc/Run.hxx b/Utils/ROOT2ROOT/GENERIC/RUN/inc/Run.hxx new file mode 100644 index 0000000000000000000000000000000000000000..5131de32229d3225fc21320fbc1988ec1298a387 --- /dev/null +++ b/Utils/ROOT2ROOT/GENERIC/RUN/inc/Run.hxx @@ -0,0 +1,59 @@ +#include <string> +#include <iostream> + +using namespace std; + + + +class Run +{ + + public : + + // Contructors + Run(); + // Destructors + ~Run(); + + // Get and Set methods + map<string, double> GetRunParameter() {return fRunParameter;} // The map of user input parameters + void SetRunParameter(map<string, double> RunParameter) {fRunParameter=RunParameter;} // The map of user input parameters + + int GetRunID() {return fRunID;} // Integer ID for this run + void SetRunID(int RunID) {fRunID=RunID;} // Integer ID for this run + + bool GetRunIsOK() {return fIsOK;} // Tell is Run is OK + void SetRunIsOK(bool IsOK) {fIsOK = IsOK;} // Tell is Run is OK + + int GetNTimeStep() {return fNTimeStep;} // Number of Time Steps + void SetNTimeStep(int NTimeStep) {fNTimeStep=NTimeStep;} // Number of Time Steps + + vector<double> GetTimeStepVector {return fTimeStepVector;} // Vector of time steps + void SetTimeStepVector(vector<double> TimeStepVector) {fTimeStepVector = TimeStepVector;} // Vector of time steps + + private : + + map<string, double> fRunParameter; // The map of user input parameters + + int fRunID; // Integer ID for this run + + bool fIsOK; // Tell is Run is OK + + int fNTimeStep; // Number of Time Steps + vector<double> fTimeStepVector; // Vector of time steps + + // Number of Facilities + int fNumberOfFacilities; + int fNumberOfRectaors; + int fNumberOfStorages; + int fNumberOfPools; + int fNumberOfFabPlants; + int fNumberOfSepPlants; + + // Names of Facilities + vector<string> fNamesOfReactors; + vector<string> fNamesOfStorages; + vector<string> fNamesOfPools; + vector<string> fNamesOfFabPlants; + vector<string> fNamesOfSepPlants; +}; diff --git a/Utils/ROOT2ROOT/GENERIC/SSENAR/ZAI.hxx b/Utils/ROOT2ROOT/GENERIC/RUN/inc/ZAI.hxx similarity index 100% rename from Utils/ROOT2ROOT/GENERIC/SSENAR/ZAI.hxx rename to Utils/ROOT2ROOT/GENERIC/RUN/inc/ZAI.hxx diff --git a/Utils/ROOT2ROOT/GENERIC/RUN/inc/ZAIHeat.hxx b/Utils/ROOT2ROOT/GENERIC/RUN/inc/ZAIHeat.hxx new file mode 100644 index 0000000000000000000000000000000000000000..f126c7348aa402b4d60bc397039abda7763851e9 --- /dev/null +++ b/Utils/ROOT2ROOT/GENERIC/RUN/inc/ZAIHeat.hxx @@ -0,0 +1,70 @@ +#ifndef _ZAIHeat_ +#define _ZAIHeat_ + +/*! + \file + \brief Header file for ZAIHeat classes. + + + @author BaM + @author BLG + @version 2.0 + */ + +#include <map> + +#include "ZAI.hxx" +#include "TObject.h" +#include <iostream> + +using namespace std; + + +class IsotopicVector; + +//-----------------------------------------------------------------------------// +//! Defines the decay heat of a ZAI + /*! + The aims of this class is to handle decay heat + Activity-to-Heat factors are from (92SDOe + M.e.Brendan, dec 98). + Values are in CLASS_PATH/data/HeatTox.dat + + @author BLG + @author BaM + @version 1.0 + */ +//________________________________________________________________________ + + +class ZAIHeat +{ + + +public: + /*! + \name Constructor/Desctructor + */ + //@{ + + ZAIHeat();//!< Normal Constructor. + + ~ZAIHeat();//!< Normal Destructor. + //@} + + /*! + \name Fucntions returning decay Heat [W] + */ + //@{ + double GetHeat(ZAI zai ) const; //!< get with ZAI + double GetHeat(const int Z, const int A, const int I ) const { return GetHeat( ZAI(Z, A, I) ); } //!< Get with Z, A + + double GetHeat(const IsotopicVector IV) const; //return Heat of IV [W] + //@} +private: + map<ZAI, double> fZAIHeat; //! ZAI Heat list + + +}; + + +#endif diff --git a/Utils/ROOT2ROOT/GENERIC/RUN/inc/ZAIMass.hxx b/Utils/ROOT2ROOT/GENERIC/RUN/inc/ZAIMass.hxx new file mode 100644 index 0000000000000000000000000000000000000000..524e699ded768ebd608849e7e5601bde5bdca71d --- /dev/null +++ b/Utils/ROOT2ROOT/GENERIC/RUN/inc/ZAIMass.hxx @@ -0,0 +1,70 @@ +#ifndef _ZAIMass_ +#define _ZAIMass_ + +/*! + \file + \brief Header file for ZAIMass classes. + + + @author BaM + @author BLG + @version 2.0 + */ + +#include <map> + +#include "ZAI.hxx" +#include "TObject.h" +#include <iostream> + +using namespace std; + + +class IsotopicVector; + +//-----------------------------------------------------------------------------// +//! Defines the molar mass of a ZAI + +/*! + The aims of this class is to handle the molar mass of each ZAI + + @author BaM + @author BLG + @version 1.0 + */ +//________________________________________________________________________ + + +class ZAIMass +{ + + +public: + /*! + \name Constructor/Desctructor + */ + //@{ + + ZAIMass();//!< Normal Constructor. + + ~ZAIMass();//!< Normal Destructor. + //@} + + /*! + \name Fucntions returning molar mass [g/mol] + */ + //@{ + double GetMass(ZAI zai ) const; //!< get with ZAI + double GetMass(const int Z, const int A ) const { return GetMass( ZAI(Z, A, 0) ); } //!< Get with Z, A + //@} + + double GetMass(const IsotopicVector & IV) const; //return Mass of IV [t] + +private: + map<ZAI, double> fZAIMass; //! ZAI mass list + + +}; + + +#endif diff --git a/Utils/ROOT2ROOT/GENERIC/RUN/inc/ZAITox.hxx b/Utils/ROOT2ROOT/GENERIC/RUN/inc/ZAITox.hxx new file mode 100644 index 0000000000000000000000000000000000000000..9a7b05904e4953025b4e8a3731b4c030dc5c0a39 --- /dev/null +++ b/Utils/ROOT2ROOT/GENERIC/RUN/inc/ZAITox.hxx @@ -0,0 +1,70 @@ +#ifndef _ZAITox_ +#define _ZAITox_ + +/*! + \file + \brief Header file for ZAITox classes. + + + @author BaM + @author BLG + @version 2.0 + */ + +#include <map> + +#include "ZAI.hxx" +#include "TObject.h" +#include <iostream> + +using namespace std; + + +class IsotopicVector; + +//-----------------------------------------------------------------------------// +//! Defines the Radiotoxicity of a ZAI + /*! + The aims of this class is to handle radiotoxicity + Activity-to-Sievert factors are from (??). + Values are in CLASS_PATH/data/HeatTox.dat + + @author BLG + @author BaM + @version 1.0 + */ +//________________________________________________________________________ + + +class ZAITox +{ + + +public: + /*! + \name Constructor/Desctructor + */ + //@{ + + ZAITox();//!< Normal Constructor. + + ~ZAITox();//!< Normal Destructor. + //@} + + /*! + \name Fucntions returning radiotoxicity [Sv] + */ + //@{ + double GetRadioTox(ZAI zai ) const; //!< get with ZAI + double GetRadioTox(const int Z, const int A, const int I ) const { return GetRadioTox( ZAI(Z, A, I) ); } //!< Get with Z, A + + double GetRadioTox(const IsotopicVector IV) const; //return Heat of IV [W] + //@} +private: + map<ZAI, double> fZAITox; //! ZAI Radiotox list + + +}; + + +#endif diff --git a/Utils/ROOT2ROOT/GENERIC/RUN/src/Facility.cxx b/Utils/ROOT2ROOT/GENERIC/RUN/src/Facility.cxx new file mode 100644 index 0000000000000000000000000000000000000000..3fb1993f493a0668804446064b2eff837110e7cb --- /dev/null +++ b/Utils/ROOT2ROOT/GENERIC/RUN/src/Facility.cxx @@ -0,0 +1,15 @@ +#include <Header.hxx> +#include <Facility.hxx> + +using namespace std; + +// -------------------------------------------------------- +Facility::Facility() +{ + +} +// -------------------------------------------------------- +Facility::~Facility() +{ + +} diff --git a/Utils/ROOT2ROOT/GENERIC/SSENAR/IsotopicVector.cxx b/Utils/ROOT2ROOT/GENERIC/RUN/src/IsotopicVector.cxx similarity index 99% rename from Utils/ROOT2ROOT/GENERIC/SSENAR/IsotopicVector.cxx rename to Utils/ROOT2ROOT/GENERIC/RUN/src/IsotopicVector.cxx index d3c2d0e4b3a4adf4599f7de0e228a0243f9c2bd2..c94e6ecb9c97ea6f88d39e2cbd53bb2e526380de 100644 --- a/Utils/ROOT2ROOT/GENERIC/SSENAR/IsotopicVector.cxx +++ b/Utils/ROOT2ROOT/GENERIC/RUN/src/IsotopicVector.cxx @@ -1,14 +1,6 @@ -#include "IsotopicVector.hxx" +#include <Header.hxx> +#include <IsotopicVector.hxx> -#include "CLASSLogger.hxx" -#include "CLASSConstante.hxx" - - -#include <cmath> -#include <iostream> -#include <fstream> -#include <string> -#include <algorithm> //________________________________________________________________________ //________________________________________________________________________ // diff --git a/Utils/ROOT2ROOT/GENERIC/RUN/src/Reactor.cxx b/Utils/ROOT2ROOT/GENERIC/RUN/src/Reactor.cxx new file mode 100644 index 0000000000000000000000000000000000000000..65b54374df7a2c63823ab92ff37835c7396eca02 --- /dev/null +++ b/Utils/ROOT2ROOT/GENERIC/RUN/src/Reactor.cxx @@ -0,0 +1,17 @@ +#include <Header.hxx> +#include <Reactor.hxx> + +using namespace std; + + +// -------------------------------------------------------- +Reactor::Reactor() +{ + +} +// -------------------------------------------------------- +Reactor::~Reactor() +{ + + +} diff --git a/Utils/ROOT2ROOT/GENERIC/RUN/src/Run.cxx b/Utils/ROOT2ROOT/GENERIC/RUN/src/Run.cxx new file mode 100644 index 0000000000000000000000000000000000000000..6c7392aab5659d73a0d52943706688c7f882a942 --- /dev/null +++ b/Utils/ROOT2ROOT/GENERIC/RUN/src/Run.cxx @@ -0,0 +1,17 @@ +#include <Header.hxx> +#include <Run.hxx> + +using namespace std; + +// -------------------------------------------------------- +Run::Run() +{ + + +} +// -------------------------------------------------------- +Run::~Run() +{ + + +} diff --git a/Utils/ROOT2ROOT/GENERIC/SSENAR/ZAI.cxx b/Utils/ROOT2ROOT/GENERIC/RUN/src/ZAI.cxx similarity index 100% rename from Utils/ROOT2ROOT/GENERIC/SSENAR/ZAI.cxx rename to Utils/ROOT2ROOT/GENERIC/RUN/src/ZAI.cxx diff --git a/Utils/ROOT2ROOT/GENERIC/RUN/src/ZAIHeat.cxx b/Utils/ROOT2ROOT/GENERIC/RUN/src/ZAIHeat.cxx new file mode 100644 index 0000000000000000000000000000000000000000..7a51e9f365575a4675e26e31d7dbdbf4a93c9c2c --- /dev/null +++ b/Utils/ROOT2ROOT/GENERIC/RUN/src/ZAIHeat.cxx @@ -0,0 +1,99 @@ +#include "ZAIHeat.hxx" + +//#include "CLASSConstante.hxx" + +#include "stdlib.h" +#include <fstream> +#include <string> + +#include "IsotopicVector.hxx" +#include "external/StringLine.hxx" + +#include "IrradiationModel.hxx" + + //________________________________________________________________________ + // + // ZAI + // + // + // + // + //________________________________________________________________________ + //____________________________InClass Operator____________________________ + //________________________________________________________________________ + +//________________________________________________________________________ +ZAIHeat::ZAIHeat() +{ + string CLASSPATH = getenv("CLASS_PATH"); + string HeatToxFile = CLASSPATH + "/data/HeatTox.dat"; + + ifstream infile(HeatToxFile.c_str()); + + if(!infile.good()) + { + cout << "Error in ZAIHeat : can't find/open file " << HeatToxFile << endl; + exit(1); + } + + IrradiationModel* IM = new IrradiationModel(); + IM->SetZAIThreshold(0); + IM->LoadDecay(); + + int Z,A,I; + string Name; + double WperBq,SvperBq; + while (!infile.eof()) + { + string line; + stringstream ossline; + getline(infile, line); + ossline << line; + + if(StringLine::IsDouble(line.substr(0,1))) //else is a comment + { ossline>>Z>>A>>I>>WperBq>>SvperBq; + fZAIHeat.insert( pair< ZAI,double >( ZAI(Z,A,I),IM->GetDecayConstant(ZAI(Z,A,I))*WperBq) ); + } + } + + delete IM; + infile.close(); +} +//________________________________________________________________________ +ZAIHeat::~ZAIHeat() +{ + fZAIHeat.clear(); +} +//________________________________________________________________________ +double ZAIHeat::GetHeat(ZAI zai ) const +{ + + map<ZAI ,double> ZAIHeat = fZAIHeat; + map<ZAI ,double>::iterator it; + it = ZAIHeat.find(zai); + + if ( it != ZAIHeat.end() ) + { + return it->second; + } + else + { + return 0; + } + +} +//________________________________________________________________________ +double ZAIHeat::GetHeat(const IsotopicVector IV) const +{ + double TotalHeat = 0; + + map<ZAI ,double >::iterator it; + map<ZAI ,double > isotopicquantity = IV.GetIsotopicQuantity(); + + for( it = isotopicquantity.begin(); it != isotopicquantity.end(); it++) + TotalHeat += (*it).second * GetHeat( (*it).first ) ; + + + return TotalHeat; + +} diff --git a/Utils/ROOT2ROOT/GENERIC/RUN/src/ZAIMass.cxx b/Utils/ROOT2ROOT/GENERIC/RUN/src/ZAIMass.cxx new file mode 100644 index 0000000000000000000000000000000000000000..07cf799e82c98206e15ae660956905e9a9c0bf94 --- /dev/null +++ b/Utils/ROOT2ROOT/GENERIC/RUN/src/ZAIMass.cxx @@ -0,0 +1,78 @@ +#include "ZAIMass.hxx" + +//#include "CLASSConstante.hxx" + +#include "stdlib.h" +#include <fstream> +#include <string> + +#include "IsotopicVector.hxx" + //________________________________________________________________________ + // + // ZAI + // + // + // + // + //________________________________________________________________________ + //____________________________InClass Operator____________________________ + //________________________________________________________________________ + + +ZAIMass::ZAIMass() +{ + string CLASSPATH = getenv("CLASS_PATH"); + string MassDataFile = CLASSPATH + "/data/Mass.dat"; + + ifstream infile(MassDataFile.c_str()); + + if(!infile.good()) + { + cout << " ZAIMass Error.\n can't find/open file " << MassDataFile << endl; + exit(1); + } + + int Z,A; + string Name; + double MassUnity,MassDec,error; + while (infile>>Z>>A>>Name>>MassUnity>>MassDec>>error) + { + double Masse = MassUnity + MassDec * 1e-6; + fZAIMass.insert( pair< ZAI,double >( ZAI(Z,A,0), Masse ) ); + } + + infile.close(); +} + + +ZAIMass::~ZAIMass() +{ + fZAIMass.clear(); +} + + +double ZAIMass::GetMass( ZAI zai ) const +{ + map<ZAI,double>::const_iterator MassIT = fZAIMass.find( ZAI(zai.Z(), zai.A(), 0) ); + + if(MassIT == fZAIMass.end()) + return zai.A(); + else + return MassIT->second; + +} + + +double ZAIMass::GetMass(const IsotopicVector & IV) const +{ + double AVOGADRO = 6.02214129e23; + double TotalMass = 0; + + for( IsotopicVector::const_iterator it = IV.begin(); it != IV.end(); it++) + { + TotalMass += it->second/AVOGADRO * GetMass( it->first ) ; + } + + return TotalMass*1e-6; + +} diff --git a/Utils/ROOT2ROOT/GENERIC/RUN/src/ZAITox.cxx b/Utils/ROOT2ROOT/GENERIC/RUN/src/ZAITox.cxx new file mode 100644 index 0000000000000000000000000000000000000000..7b340e8838c11cdbda09e1e2f623881cab9d17bd --- /dev/null +++ b/Utils/ROOT2ROOT/GENERIC/RUN/src/ZAITox.cxx @@ -0,0 +1,99 @@ +#include "ZAITox.hxx" + +//#include "CLASSConstante.hxx" + +#include "stdlib.h" +#include <fstream> +#include <string> + +#include "IsotopicVector.hxx" +#include "external/StringLine.hxx" + +#include "IrradiationModel.hxx" + + //________________________________________________________________________ + // + // ZAI + // + // + // + // + //________________________________________________________________________ + //____________________________InClass Operator____________________________ + //________________________________________________________________________ + +//________________________________________________________________________ +ZAITox::ZAITox() +{ + string CLASSPATH = getenv("CLASS_PATH"); + string HeatToxFile = CLASSPATH + "/data/HeatTox.dat"; + + ifstream infile(HeatToxFile.c_str()); + + if(!infile.good()) + { + cout << "Error in ZAITox : can't find/open file " << HeatToxFile << endl; + exit(1); + } + + IrradiationModel* IM = new IrradiationModel(); + IM->SetZAIThreshold(1); + IM->LoadDecay(); + + int Z,A,I; + string Name; + double WperBq,SvperBq; + while (!infile.eof()) + { + string line; + stringstream ossline; + getline(infile, line); + ossline << line; + + if(StringLine::IsDouble(line.substr(0,1))) //else is a comment + { ossline>>Z>>A>>I>>WperBq>>SvperBq; + fZAITox.insert( pair< ZAI,double >( ZAI(Z,A,I),IM->GetDecayConstant(ZAI(Z,A,I))*SvperBq) ); + } + } + + delete IM; + infile.close(); +} +//________________________________________________________________________ +ZAITox::~ZAITox() +{ + fZAITox.clear(); +} +//________________________________________________________________________ +double ZAITox::GetRadioTox(ZAI zai ) const +{ + + map<ZAI ,double> ZAITox = fZAITox; + map<ZAI ,double>::iterator it; + it = ZAITox.find(zai); + + if ( it != ZAITox.end() ) + { + return it->second; + } + else + { + return 0; + } + +} +//________________________________________________________________________ +double ZAITox::GetRadioTox(const IsotopicVector IV) const +{ + double TotalTox = 0; + + map<ZAI ,double >::iterator it; + map<ZAI ,double > isotopicquantity = IV.GetIsotopicQuantity(); + + for( it = isotopicquantity.begin(); it != isotopicquantity.end(); it++) + TotalTox += (*it).second * GetRadioTox( (*it).first ) ; + + + return TotalTox; + +} diff --git a/Utils/ROOT2ROOT/GENERIC/SSENAR/Linkdef.hxx b/Utils/ROOT2ROOT/GENERIC/SSENAR/Linkdef.hxx deleted file mode 100644 index 51a6545d0cd2828d1c94c6dc43609dbaa517e47a..0000000000000000000000000000000000000000 --- a/Utils/ROOT2ROOT/GENERIC/SSENAR/Linkdef.hxx +++ /dev/null @@ -1,21 +0,0 @@ -// ===================================================================================== - -#include "ZAI.hxx" -#include "IsotopicVector.hxx" -#include "Scenar_t.hxx" - -#ifdef __CINT__ - -#pragma link off all globals; -#pragma link off all classes; -#pragma link off all functions; -#pragma link C++ nestedclasses; - - -#pragma link C++ class pair<ZAI,double>+; -#pragma link C++ class map<ZAI,double>+; -#pragma link C++ class vector<IsotopicVector*>+; -#pragma link C++ class Scenar_t+; -#pragma link C++ all_functions Scenar_t; - -#endif diff --git a/Utils/ROOT2ROOT/GENERIC/SSENAR/Makefile b/Utils/ROOT2ROOT/GENERIC/SSENAR/Makefile deleted file mode 100644 index cc32d372cc6d593913872c747ba4c6fd0e1c7479..0000000000000000000000000000000000000000 --- a/Utils/ROOT2ROOT/GENERIC/SSENAR/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -CC=g++ -std=c++11 -shared -LIBCINT=-I${CLASS_include} -LIB=`root-config --ldflags` -I${ROOTSYS}/include -I${CLASS_include} -L${CLASS_lib} -lCLASSpkg -fPIC -fopenmp -lgomp -Wunused-result - -all: libSsenar.so - -Scenar_t_dict.cxx: ZAI.hxx IsotopicVector.hxx Scenar_t.hxx Linkdef.hxx - rootcint -f $@ -c ${LIBCINT} -p $^ - -libSsenar.so: Scenar_t_dict.cxx ZAI.cxx IsotopicVector.cxx Scenar_t.cxx - ${CC} -o $@ ${LIB} $^ - -clean: - rm libSsenar.so *dict* - diff --git a/Utils/ROOT2ROOT/GENERIC/SSENAR/README.rst b/Utils/ROOT2ROOT/GENERIC/SSENAR/README.rst deleted file mode 100644 index c0a6bf1db0a42cfdc9188414c2db6f0a7986bd9b..0000000000000000000000000000000000000000 --- a/Utils/ROOT2ROOT/GENERIC/SSENAR/README.rst +++ /dev/null @@ -1,14 +0,0 @@ -class Scenar_t -============== - -Les objets de type **Scenar_t** sont utilisés pour décrire un *scénario* CLASS. En pratique les attributs de **Scenar_t** sont les paramètres qui identifient le scénario. Par exemple, dans une étude multiparamétrique ces attributs sont (au minimum) les paramètres avec lesquels on exécutes CLASS_Exec : - -* Burn-Up -* Nbre de rechargements -* Facteur de charge -* Temps de refroidissement -* Temps de fabrication -* Vecteurs Isotopiques (Dans les différentes étapes du cycle combustible) -* ... - -L'utilisation des objets **Scenar_t** implique que l'ensemble des observables d'intérêt, par exemple l'inventaire total des noyaux, ne soient accessibles que par des methodes internes de la class. L'objectif est de pouvoir calculer ce que l'on veut à la demande. diff --git a/Utils/ROOT2ROOT/GENERIC/SSENAR/Scenar_t.cxx b/Utils/ROOT2ROOT/GENERIC/SSENAR/Scenar_t.cxx deleted file mode 100644 index b0840486446e09e869147280097c70c1bc67a93f..0000000000000000000000000000000000000000 --- a/Utils/ROOT2ROOT/GENERIC/SSENAR/Scenar_t.cxx +++ /dev/null @@ -1,509 +0,0 @@ -// ===================================================================================== - -#include "Scenar_t.hxx" - -ClassImp(Scenar_t) // Needed by ROOT - -// -// Const -// ===================================================================================== -Scenar_t::Scenar_t():TObject() -{ - NTimeStep = 0; - S_IsOk = false ; - // - UOx_CT = 0.0; - MOx_CT = 0.0; - // Cumulated Number of Load - UOx_NLOAD = 0; - MOx_NLOAD = 0; - MOx_MLOAD = 0; -} -Scenar_t::Scenar_t(const unsigned short vlength):TObject() -{ - - NTimeStep = vlength; - Time.resize(vlength); // [Year] - Power.resize(vlength); - // - S_IsOk = false ; - // - UOx_CT = 0.0; - MOx_CT = 0.0; - // Cumulated Number of Load - UOx_NLOAD = 0; - MOx_NLOAD = 0; - MOx_MLOAD = 0; - - // Facilities IV of Interest - // - v_PWR_UOx_BOC.resize(vlength); - v_PWR_MOx_BOC.resize(vlength); - - v_PWR_UOx_EOC.resize(vlength); - v_PWR_MOx_EOC.resize(vlength); - - v_StockUOx_CIN.resize(vlength); - v_StockUOx_COU.resize(vlength); - v_StockUOx.resize(vlength); - - v_StockMOx_CIN.resize(vlength); - v_StockMOx_COU.resize(vlength); - v_StockMOx.resize(vlength); - - // Isotopic vectors, CYCLE - // - v_IVTOTAL.resize(vlength); - v_IVINCYCLE.resize(vlength); - v_IVWASTE.resize(vlength); -} -// -// Dest -// ===================================================================================== -Scenar_t::~Scenar_t() -{} - -// -// Methods -// ===================================================================================== - -void Scenar_t::Print() -{ - - cout << " =============================================================== " << endl; - cout << " Scenario Info " << endl; - cout << " BU_UOx : " << this->BU_UOx << endl; - cout << " TC_UOx : " << this->TC_UOx << endl; - cout << " BU_MOx : " << this->BU_MOx << endl; - cout << " TC_MOx : " << this->TC_MOx << endl; - cout << " TF_MOx : " << this->TF_MOx << endl; - cout << " IsMOxAm : " << this->IsMOxAm << endl; - cout << " Fr_MOx : " << this->Fr_MOx << endl; - cout << " NB_Fuel : " << this->NB_Fuel << endl; - cout << " Ks_Fuel : " << this->Ks_Fuel << endl; - cout << " LF_Fuel : " << this->LF_Fuel << endl; - cout << " StMMOx : " << this->StMMOx << endl; - cout << " NTimeStep: " << this->NTimeStep << endl; - cout << " TimeStep : " << this->TimeStep << endl; - cout << " S_IsOk : " << this->S_IsOk << endl; - cout << " =============================================================== " << endl; - -} - - -void Scenar_t::Clear() -{ - - Time.clear(); // [Year] - Power.clear(); - - // Facilities IV of Interest - // - v_PWR_UOx_BOC.clear(); - v_PWR_MOx_BOC.clear(); - - v_PWR_UOx_EOC.clear(); - v_PWR_MOx_EOC.clear(); - - v_StockUOx_CIN.clear(); - v_StockUOx_COU.clear(); - v_StockUOx.clear(); - - v_StockMOx_CIN.clear(); - v_StockMOx_COU.clear(); - v_StockMOx.clear(); - - // Isotopic vectors, CYCLE - // - v_IVTOTAL.clear(); - v_IVINCYCLE.clear(); - v_IVWASTE.clear(); -} - - -// ===================================================================================== - -vector<double> Scenar_t::GetPWR_UOx_BOC(unsigned short Z) -{// - vector<double> v_tBOC; - v_tBOC.reserve(this->NTimeStep); - for (unsigned short i = 0; i < this->NTimeStep; i++){ - v_tBOC.push_back(this->v_PWR_UOx_BOC[i]->GetSpeciesComposition(Z).GetTotalMass()); - } - return v_tBOC; -} - -vector<double> Scenar_t::GetPWR_UOx_BOC(unsigned short Z, unsigned short A, unsigned short I) -{// - IsotopicVector tIV; tIV.Add(Z,A,I,1); - vector<double> v_tBOC; - for (unsigned short i = 0; i < this->NTimeStep; i++){ - v_tBOC.push_back(this->v_PWR_UOx_BOC[i]->GetThisComposition(tIV).GetTotalMass()); - } - return v_tBOC; -} -/// - -vector<double> Scenar_t::GetPWR_MOx_BOC(unsigned short Z) -{// - vector<double> v_tBOC; - v_tBOC.reserve(this->NTimeStep); - for (unsigned short i = 0; i < this->NTimeStep; i++){ - v_tBOC.push_back(this->v_PWR_MOx_BOC[i]->GetSpeciesComposition(Z).GetTotalMass()); - } - return v_tBOC; -} - -vector<double> Scenar_t::GetPWR_MOx_BOC(unsigned short Z, unsigned short A, unsigned short I) -{// - IsotopicVector tIV; tIV.Add(Z,A,I,1); - vector<double> v_tBOC; - v_tBOC.reserve(this->NTimeStep); - for (unsigned short i = 0; i < this->NTimeStep; i++){ - v_tBOC.push_back(this->v_PWR_MOx_BOC[i]->GetThisComposition(tIV).GetTotalMass()); - } - return v_tBOC; -} - -//// - -vector<double> Scenar_t::GetPWR_UOx_EOC(unsigned short Z) -{// - vector<double> v_tEOC; - v_tEOC.reserve(this->NTimeStep); - for (unsigned short i = 0; i < this->NTimeStep; i++){ - v_tEOC.push_back(this->v_PWR_UOx_EOC[i]->GetSpeciesComposition(Z).GetTotalMass()); - } - return v_tEOC; -} - -vector<double> Scenar_t::GetPWR_UOx_EOC(unsigned short Z, unsigned short A, unsigned short I) -{// - IsotopicVector tIV; tIV.Add(Z,A,I,1); - vector<double> v_tEOC; - v_tEOC.reserve(this->NTimeStep); - for (unsigned short i = 0; i < this->NTimeStep; i++){ - v_tEOC.push_back(this->v_PWR_UOx_EOC[i]->GetThisComposition(tIV).GetTotalMass()); - } - return v_tEOC; -} -/// - -vector<double> Scenar_t::GetPWR_MOx_EOC(unsigned short Z) -{// - vector<double> v_tEOC; - v_tEOC.reserve(this->NTimeStep); - for (unsigned short i = 0; i < this->NTimeStep; i++){ - v_tEOC.push_back(this->v_PWR_MOx_EOC[i]->GetSpeciesComposition(Z).GetTotalMass()); - } - return v_tEOC; -} - -vector<double> Scenar_t::GetPWR_MOx_EOC(unsigned short Z, unsigned short A, unsigned short I) -{// - IsotopicVector tIV; tIV.Add(Z,A,I,1); - vector<double> v_tEOC; - v_tEOC.reserve(this->NTimeStep); - for (unsigned short i = 0; i < this->NTimeStep; i++){ - v_tEOC.push_back(this->v_PWR_MOx_EOC[i]->GetThisComposition(tIV).GetTotalMass()); - } - return v_tEOC; -} - - -// ===================================================================================== - -vector<double> Scenar_t::GetTotalInvOfIsotope(unsigned short Z) -{ - vector<double> v_tTotalInv; - v_tTotalInv.reserve(this->NTimeStep); - // - for (unsigned short i =0; i < this->NTimeStep; i++){// - v_tTotalInv.push_back((this->v_IVTOTAL)[i]->GetSpeciesComposition(Z).GetTotalMass()); - } - return v_tTotalInv; -} - -vector<double> Scenar_t::GetTotalInvOfIsotope(unsigned short Z, unsigned short A, unsigned short I) -{ - IsotopicVector tIV; tIV.Add(Z,A,I,1); - vector<double> v_tTotalInv; - v_tTotalInv.reserve(this->NTimeStep); - // - for (unsigned short i =0; i < this->NTimeStep; i++){// - v_tTotalInv.push_back((this->v_IVTOTAL)[i]->GetThisComposition(tIV).GetTotalMass()); - } - return v_tTotalInv; -} - -double Scenar_t::GetTotalInvOfIsotopeAtTime(unsigned short Z, double time) -{ - if (this->v_IVTOTAL.empty()) return 0.0; - else{ - unsigned short i = (unsigned short) (time/(this->TimeStep)); - return (this->v_IVTOTAL)[i]->GetSpeciesComposition(Z).GetTotalMass(); - } -} - -double Scenar_t::GetTotalInvOfIsotopeAtTime(unsigned short Z, unsigned short A, unsigned short I, double time) -{ - if (this->v_IVTOTAL.empty()) return 0.0; - else{ - unsigned short i = (unsigned short) (time/(this->TimeStep)); - IsotopicVector tIV; tIV.Add(Z,A,I,1); - // - return (this->v_IVTOTAL)[i]->GetThisComposition(tIV).GetTotalMass(); - } -} - -// ===================================================================================== - -vector<double> Scenar_t::GetIncycleInvOfIsotope(unsigned short Z) -{ - vector<double> v_tIncycleInv; - v_tIncycleInv.reserve(this->NTimeStep); - // - for (unsigned short i =0; i < this->NTimeStep; i++){// - v_tIncycleInv.push_back((this->v_IVINCYCLE)[i]->GetSpeciesComposition(Z).GetTotalMass()); - } - return v_tIncycleInv; -} - -vector<double> Scenar_t::GetIncycleInvOfIsotope(unsigned short Z, unsigned short A, unsigned short I) -{ - IsotopicVector tIV; tIV.Add(Z,A,I,1); - vector<double> v_tIncycleInv; - v_tIncycleInv.reserve(this->NTimeStep); - // - for (unsigned short i =0; i < this->NTimeStep; i++){// - v_tIncycleInv.push_back((this->v_IVINCYCLE)[i]->GetThisComposition(tIV).GetTotalMass()); - } - return v_tIncycleInv; -} - -double Scenar_t::GetIncycleInvOfIsotopeAtTime(unsigned short Z, double time) -{ - if (this->v_IVINCYCLE.empty()) return 0.0; - else{ - unsigned short i = (unsigned short) (time/(this->TimeStep)); - return (this->v_IVINCYCLE)[i]->GetSpeciesComposition(Z).GetTotalMass(); - } -} - -double Scenar_t::GetIncycleInvOfIsotopeAtTime(unsigned short Z, unsigned short A, unsigned short I, double time) -{ - if (this->v_IVINCYCLE.empty()) return 0.0; - else{ - unsigned short i = (unsigned short) (time/(this->TimeStep)); - IsotopicVector tIV; tIV.Add(Z,A,I,1); - // - return (this->v_IVINCYCLE)[i]->GetThisComposition(tIV).GetTotalMass(); - } -} - - -// ===================================================================================== - -vector<double> Scenar_t::GetWasteInvOfIsotope(unsigned short Z) -{ - vector<double> v_tWasteInv; - v_tWasteInv.reserve(this->NTimeStep); - // - for (unsigned short i =0; i < this->NTimeStep; i++){// - v_tWasteInv.push_back((this->v_IVWASTE)[i]->GetSpeciesComposition(Z).GetTotalMass()); - } - return v_tWasteInv; -} - -vector<double> Scenar_t::GetWasteInvOfIsotope(unsigned short Z, unsigned short A, unsigned short I) -{ - IsotopicVector tIV; tIV.Add(Z,A,I,1); - vector<double> v_tWasteInv; - v_tWasteInv.reserve(this->NTimeStep); - // - for (unsigned short i =0; i < this->NTimeStep; i++){// - v_tWasteInv.push_back((this->v_IVWASTE)[i]->GetThisComposition(tIV).GetTotalMass()); - } - return v_tWasteInv; -} - -double Scenar_t::GetWasteInvOfIsotopeAtTime(unsigned short Z, double time) -{ - if (this->v_IVWASTE.empty()) return 0.0; - else{ - unsigned short i = (unsigned short) (time/(this->TimeStep)); - return (this->v_IVWASTE)[i]->GetSpeciesComposition(Z).GetTotalMass(); - } -} - - -double Scenar_t::GetWasteInvOfIsotopeAtTime(unsigned short Z, unsigned short A, unsigned short I, double time) -{ - if (this->v_IVWASTE.empty()) return 0.0; - else{ - unsigned short i = (unsigned short) (time/(this->TimeStep)); - IsotopicVector tIV; tIV.Add(Z,A,I,1); - // - return (this->v_IVWASTE)[i]->GetThisComposition(tIV).GetTotalMass(); - } -} - - -// ===================================================================================== - -vector<double> Scenar_t::GetStockUOxFlux(unsigned short Z) -{ - vector<double> v_tStockUOxFlux; - v_tStockUOxFlux.reserve(this->NTimeStep); - // - for (unsigned short i =0; i < this->NTimeStep; i++){ - double cumin = (this->v_StockUOx_CIN[i])->GetSpeciesComposition(Z).GetTotalMass(); - double cumout = (this->v_StockUOx_COU[i])->GetSpeciesComposition(Z).GetTotalMass(); - - v_tStockUOxFlux.push_back(cumin - cumout); - } - return v_tStockUOxFlux; -} - -vector<double> Scenar_t::GetStockUOxFlux(unsigned short Z, unsigned short A, unsigned short I) -{ - IsotopicVector tIV; tIV.Add(Z,A,I,1); - vector<double> v_tStockUOxFlux; - v_tStockUOxFlux.reserve(this->NTimeStep); - // - for (unsigned short i =0; i < this->NTimeStep; i++){ - double cumin = (this->v_StockUOx_CIN[i])->GetThisComposition(tIV).GetTotalMass(); - double cumout = (this->v_StockUOx_COU[i])->GetThisComposition(tIV).GetTotalMass(); - v_tStockUOxFlux.push_back(cumin - cumout); - } - return v_tStockUOxFlux; -} - -vector<double> Scenar_t::GetStockUOxInvOfIsotope(unsigned short Z) -{ - vector<double> v_tStockInv; - v_tStockInv.reserve(this->NTimeStep); - // - for (unsigned short i =0; i < this->NTimeStep; i++){// - v_tStockInv.push_back((this->v_StockUOx)[i]->GetSpeciesComposition(Z).GetTotalMass()); - } - return v_tStockInv; -} - - -vector<double> Scenar_t::GetStockUOxInvOfIsotope(unsigned short Z, unsigned short A, unsigned short I) -{ - IsotopicVector tIV; tIV.Add(Z,A,I,1); - vector<double> v_tStockInv; - v_tStockInv.reserve(this->NTimeStep); - // - for (unsigned short i =0; i < this->NTimeStep; i++){// - - v_tStockInv.push_back((this->v_StockUOx)[i]->GetThisComposition(tIV).GetTotalMass()); - - } - return v_tStockInv; -} - - -double Scenar_t::GetStockUOxInvOfIsotopeAtTime(unsigned short Z, double time) -{ - if (this->v_StockUOx.empty()) return 0.0; - else{ - unsigned short i = (unsigned short) (time/(this->TimeStep)); - // - return (this->v_StockUOx)[i]->GetSpeciesComposition(Z).GetTotalMass(); - } -} - - -double Scenar_t::GetStockUOxInvOfIsotopeAtTime(unsigned short Z, unsigned short A, unsigned short I, double time) -{ - if (this->v_StockUOx.empty()) return 0.0; - else{ - unsigned short i = (unsigned short) (time/(this->TimeStep)); - IsotopicVector tIV; tIV.Add(Z,A,I,1); - // - return (this->v_StockUOx)[i]->GetThisComposition(tIV).GetTotalMass(); - } -} - -//// - -vector<double> Scenar_t::GetStockMOxFlux(unsigned short Z) -{ - vector<double> v_tStockMOxFlux; - v_tStockMOxFlux.reserve(this->NTimeStep); - // - for (unsigned short i =0; i < this->NTimeStep; i++){ - double cumin = (this->v_StockMOx_CIN[i])->GetSpeciesComposition(Z).GetTotalMass(); - double cumout = (this->v_StockMOx_COU[i])->GetSpeciesComposition(Z).GetTotalMass(); - - v_tStockMOxFlux.push_back(cumin - cumout); - } - return v_tStockMOxFlux; -} - -vector<double> Scenar_t::GetStockMOxFlux(unsigned short Z, unsigned short A, unsigned short I) -{ - IsotopicVector tIV; tIV.Add(Z,A,I,1); - vector<double> v_tStockMOxFlux; - v_tStockMOxFlux.reserve(this->NTimeStep); - // - for (unsigned short i =0; i < this->NTimeStep; i++){ - double cumin = (this->v_StockMOx_CIN[i])->GetThisComposition(tIV).GetTotalMass(); - double cumout = (this->v_StockMOx_COU[i])->GetThisComposition(tIV).GetTotalMass(); - v_tStockMOxFlux.push_back(cumin - cumout); - } - return v_tStockMOxFlux; -} - -vector<double> Scenar_t::GetStockMOxInvOfIsotope(unsigned short Z) -{ - vector<double> v_tStockInv; - v_tStockInv.reserve(this->NTimeStep); - // - for (unsigned short i =0; i < this->NTimeStep; i++){// - v_tStockInv.push_back((this->v_StockMOx)[i]->GetSpeciesComposition(Z).GetTotalMass()); - } - return v_tStockInv; -} - - -vector<double> Scenar_t::GetStockMOxInvOfIsotope(unsigned short Z, unsigned short A, unsigned short I) -{ - IsotopicVector tIV; tIV.Add(Z,A,I,1); - vector<double> v_tStockInv; - v_tStockInv.reserve(this->NTimeStep); - // - for (unsigned short i =0; i < this->NTimeStep; i++){// - - v_tStockInv.push_back((this->v_StockMOx)[i]->GetThisComposition(tIV).GetTotalMass()); - - } - return v_tStockInv; -} - - -double Scenar_t::GetStockMOxInvOfIsotopeAtTime(unsigned short Z, double time) -{ - if (this->v_StockMOx.empty()) return 0.0; - else{ - unsigned short i = (unsigned short) (time/(this->TimeStep)); - // - return (this->v_StockMOx)[i]->GetSpeciesComposition(Z).GetTotalMass(); - } -} - - -double Scenar_t::GetStockMOxInvOfIsotopeAtTime(unsigned short Z, unsigned short A, unsigned short I, double time) -{ - if (this->v_StockMOx.empty()) return 0.0; - else{ - unsigned short i = (unsigned short) (time/(this->TimeStep)); - IsotopicVector tIV; tIV.Add(Z,A,I,1); - // - return (this->v_StockMOx)[i]->GetThisComposition(tIV).GetTotalMass(); - } -} - diff --git a/Utils/ROOT2ROOT/GENERIC/SSENAR/Scenar_t.hxx b/Utils/ROOT2ROOT/GENERIC/SSENAR/Scenar_t.hxx deleted file mode 100644 index 010eca4b6908db039eb9e0b2fbecb683f7cc7449..0000000000000000000000000000000000000000 --- a/Utils/ROOT2ROOT/GENERIC/SSENAR/Scenar_t.hxx +++ /dev/null @@ -1,127 +0,0 @@ -#ifndef SCENAR_T_HXX -#define SCENAR_T_HXX - -#include <vector> - -#include "ZAI.hxx" -#include "IsotopicVector.hxx" -#include "TObject.h" - -// -// data structure -// - -// Length of the vector for the constuctor -// this is actually equivalent to NTimeStep - -class ZAI; -class Isotopicvector; -// -class Scenar_t: public TObject -{ - public: - // - Scenar_t(); - Scenar_t(const unsigned short vlength); - virtual ~Scenar_t(); - // - double BU_UOx; // [GWd/t] - double TC_UOx; - double BU_MOx; - double TC_MOx; - double TF_MOx; - bool IsMOxAm; // - double Fr_MOx; // [%] - double NB_Fuel; - double Ks_Fuel; - double LF_Fuel; - unsigned short StMMOx; - unsigned short NTimeStep; - double TimeStep; - vector<double> Time; // [Year] - vector<double> Power; - // - bool S_IsOk; - // - double UOx_CT; - double MOx_CT; - // Cumulated Number of Load - unsigned short UOx_NLOAD; - unsigned short MOx_NLOAD; - unsigned short MOx_MLOAD; - - // Facilities IV of Interest - // - vector<IsotopicVector*> v_PWR_UOx_BOC; - vector<IsotopicVector*> v_PWR_MOx_BOC; - - vector<IsotopicVector*> v_PWR_UOx_EOC; - vector<IsotopicVector*> v_PWR_MOx_EOC; - - vector<IsotopicVector*> v_StockUOx_CIN; - vector<IsotopicVector*> v_StockUOx_COU; - vector<IsotopicVector*> v_StockUOx; - - vector<IsotopicVector*> v_StockMOx_CIN; - vector<IsotopicVector*> v_StockMOx_COU; - vector<IsotopicVector*> v_StockMOx; - - // Isotopic vectors, CYCLE - // - vector<IsotopicVector*> v_IVTOTAL; - vector<IsotopicVector*> v_IVINCYCLE; - vector<IsotopicVector*> v_IVWASTE; - - // - // Methods - // - - void Print(); - void Clear(); - // - vector<double> GetPWR_UOx_BOC(unsigned short Z); // - vector<double> GetPWR_UOx_BOC(unsigned short Z, unsigned short A, unsigned short I=0); - vector<double> GetPWR_MOx_BOC(unsigned short Z); - vector<double> GetPWR_MOx_BOC(unsigned short Z, unsigned short A, unsigned short I=0); - - vector<double> GetPWR_UOx_EOC(unsigned short Z); // - vector<double> GetPWR_UOx_EOC(unsigned short Z, unsigned short A, unsigned short I=0); // - vector<double> GetPWR_MOx_EOC(unsigned short Z); - vector<double> GetPWR_MOx_EOC(unsigned short Z, unsigned short A, unsigned short I=0); - - // - vector<double> GetTotalInvOfIsotope(unsigned short Z); - vector<double> GetTotalInvOfIsotope(unsigned short Z, unsigned short A, unsigned short I=0); - double GetTotalInvOfIsotopeAtTime(unsigned short Z, double Time); - double GetTotalInvOfIsotopeAtTime(unsigned short Z, unsigned short A, unsigned short I, double time); - - vector<double> GetIncycleInvOfIsotope(unsigned short Z); - vector<double> GetIncycleInvOfIsotope(unsigned short Z, unsigned short A, unsigned short I=0); - double GetIncycleInvOfIsotopeAtTime(unsigned short Z, double Time); - double GetIncycleInvOfIsotopeAtTime(unsigned short Z, unsigned short A, unsigned short I, double time); - - vector<double> GetWasteInvOfIsotope(unsigned short Z); - vector<double> GetWasteInvOfIsotope(unsigned short Z, unsigned short A, unsigned short I=0); - double GetWasteInvOfIsotopeAtTime(unsigned short Z, double Time); - double GetWasteInvOfIsotopeAtTime(unsigned short Z, unsigned short A, unsigned short I, double time); - - vector<double> GetStockUOxFlux(unsigned short Z); - vector<double> GetStockUOxFlux(unsigned short Z, unsigned short A, unsigned short I=0); - vector<double> GetStockUOxInvOfIsotope(unsigned short Z); - vector<double> GetStockUOxInvOfIsotope(unsigned short Z, unsigned short A, unsigned short I=0); - double GetStockUOxInvOfIsotopeAtTime(unsigned short Z, double time); - double GetStockUOxInvOfIsotopeAtTime(unsigned short Z, unsigned short A, unsigned short I, double time); - - vector<double> GetStockMOxFlux(unsigned short Z); - vector<double> GetStockMOxFlux(unsigned short Z, unsigned short A, unsigned short I=0); - vector<double> GetStockMOxInvOfIsotope(unsigned short Z); - vector<double> GetStockMOxInvOfIsotope(unsigned short Z, unsigned short A, unsigned short I=0); - double GetStockMOxInvOfIsotopeAtTime(unsigned short Z, double time); - double GetStockMOxInvOfIsotopeAtTime(unsigned short Z, unsigned short A, unsigned short I, double time); - - // - ClassDef (Scenar_t,1) - -}; - -#endif