MURE
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
XSDIR Class Reference

Handle XSDIR file in order to extract information that could be easily retreived. More...

#include <XSDIR.hxx>

Public Member Functions

 XSDIR (const char *base_name, const char *base_version, const char *xsdir_name=nullptr, const char *builder="STD")
 
bool FindFirstIsotope ()
 
XSDIRLineReadNextIsotope ()
 
void SetXSDirName (const char *xsdir_name)
 
int Find (const char *search, string Line)
 find "search" in Line
 
void ScanXSDIR ()
 loops on each isotopes of the xsdir
 
void WriteData ()
 write information of xsdir in the BaseSummary.dat file
 
void SetDataFile (const char *name="BaseSummary.dat")
 
string GetDataFile ()
 
void Close ()
 
void AddNewPathInDirLine (string path)
 

Static Public Member Functions

static void ExtractDataLine (string Line, int &Z, int &A, int &I, string &BaseName, string &BaseVersion, double &T, string &Code, string &Extension, string &Builder, string &xs_filename, int &DataType)
 

Private Member Functions

int Compare (string Line)
 return -1, 0 or 1 if fMyGoodLine<Line, fMyGoodLine==Line, or fMyGoodLine>Line
 

Private Attributes

string fXSdirName
 name of the xsdir
 
string fBaseName
 base name (endfb, jendl, ...)
 
string fBaseVersion
 base version (6.8, 3.3, ...)
 
ifstream XSinput
 the xsdir file
 
bool f1stIsotope
 true is a first Isotope has been found
 
string fBuilder
 builder of the base (STD, JOY or MOD)
 
XSDIRLinefMyGoodLine
 The extracted XSDIRLine.
 
string fDataFile
 the BaseSummary file
 
string fModifiedPath
 The modified path (if exists)
 
string fKeepBaseVersion
 

Detailed Description

Handle XSDIR file in order to extract information that could be easily retreived.

Information are written in BaseSummary file with the following convention: Z A I BaseName BaseVersion T(K) Extension Builder xsdirline where extension is the MCNP extension (e.g. ".60c"), Builder is the base Builder which can be "STD" for a MCNP/NEA base, "JOY" for a Njoy home made base and "MOD" for a base modify by a user (e.g. multiply the fission cross section of U5 by 2). xsdirline is the line found in the xsdir with full path for nuclear data file. BaseSummary.dat file could be built from ExtractXsdir.cxx and/or ExtractTree.cxx found in MURE/Evo/utils. This 2 programs build respectively the file from a xsdir or a directory tree.

Author
PTO
Version
0.5

Constructor & Destructor Documentation

◆ XSDIR()

XSDIR::XSDIR ( const char *  base_name,
const char *  base_version,
const char *  xsdir_name = nullptr,
const char *  builder = "STD" 
)

Normal Constructor. if xsdir_name is not provid, looking in DATAPATH environment variable.

Parameters
base_name: name of the base (e.g. ENDFB, JEFF, JENDL)
base_version: base version (e.g. 6.2, 2.2, 3.2)
xsdir_name: xsdir file name (e.g. "xsdir")
builder: who built the base (STD=MCNP/NEA, JOY=NJoy home made, MOD=modification of normal cross-section)

Member Function Documentation

◆ AddNewPathInDirLine()

void XSDIR::AddNewPathInDirLine ( string  path)

Modify the path of the nuclear data file. When NJoy build a nuclear base, it creates a "Dir" file containing the base name without path (for example "ace"). When one want to use it, the full path has to be known (/home/XS/../ace) This fonction do this job.

Parameters
path: the path (/home/XS/../, in the previous example)

◆ Close()

void XSDIR::Close ( )
inline

< close xsdir file

◆ Compare()

int XSDIR::Compare ( string  Line)
private

return -1, 0 or 1 if fMyGoodLine<Line, fMyGoodLine==Line, or fMyGoodLine>Line

◆ ExtractDataLine()

void XSDIR::ExtractDataLine ( string  Line,
int &  Z,
int &  A,
int &  I,
string &  BaseName,
string &  BaseVersion,
double &  T,
string &  Code,
string &  Extension,
string &  Builder,
string &  xs_filename,
int &  DataType 
)
static

Extract info from a line of BaseSummary.dat

Parameters
Line: a line of BaseSummary.dat
Z: proton number
A: nucleon number
I: isomeric state
BaseName: name of the base (ENDFB, JEFF, ...)
BaseVersion: base version (6.1, ...)
T: temperature in K
Code: MCNP code without extension (92235 if 92235.60c)
Extension: MCNP extension (.60c)
Builder: the builder (STD(MCNP/NEA), JOY(Njoy home made) or MOD(locally modified))
xs_filename: the file name where nuclear data are store (e.g. /home/XS/endf602)
DataType: the data type of the base (1=ascii, 2=binary)

◆ Find()

int XSDIR::Find ( const char *  search,
string  Line 
)

find "search" in Line

◆ FindFirstIsotope()

bool XSDIR::FindFirstIsotope ( )

Find the first isotope in the xsdir file. if this is normal xsdir return true after reading the word "directory" ; if the xsdir contains only one line, it suppose that it is the result of NJoy calculation and thus the line is the first (and only) isotope (returns true).

◆ GetDataFile()

string XSDIR::GetDataFile ( )
inline

< returns file name where infos are stored

◆ ReadNextIsotope()

XSDIRLine * XSDIR::ReadNextIsotope ( )

Read next Isotope from the xsdir file. returns a XSDIRLine *if isotope is found, else 0

◆ ScanXSDIR()

void XSDIR::ScanXSDIR ( )

loops on each isotopes of the xsdir

◆ SetDataFile()

void XSDIR::SetDataFile ( const char *  name = "BaseSummary.dat")
inline

< set file name where infos are stored

◆ SetXSDirName()

void XSDIR::SetXSDirName ( const char *  xsdir_name)

Set xsdir file name. if xsdir_name=0, used DATAPATH environment variable.

◆ WriteData()

void XSDIR::WriteData ( )

write information of xsdir in the BaseSummary.dat file

Member Data Documentation

◆ f1stIsotope

bool XSDIR::f1stIsotope
private

true is a first Isotope has been found

◆ fBaseName

string XSDIR::fBaseName
private

base name (endfb, jendl, ...)

◆ fBaseVersion

string XSDIR::fBaseVersion
private

base version (6.8, 3.3, ...)

◆ fBuilder

string XSDIR::fBuilder
private

builder of the base (STD, JOY or MOD)

◆ fDataFile

string XSDIR::fDataFile
private

the BaseSummary file

◆ fKeepBaseVersion

string XSDIR::fKeepBaseVersion
private

◆ fModifiedPath

string XSDIR::fModifiedPath
private

The modified path (if exists)

◆ fMyGoodLine

XSDIRLine* XSDIR::fMyGoodLine
private

The extracted XSDIRLine.

◆ fXSdirName

string XSDIR::fXSdirName
private

name of the xsdir

◆ XSinput

ifstream XSDIR::XSinput
private

the xsdir file


The documentation for this class was generated from the following files:

MURE Project, documentation generated by Doxygen 1.9.7 - Fri Jan 19 2024