MURE
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
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=0, const char *builder="STD")
 
bool FindFirstIsotope ()
 
XSDIRLineReadNextIsotope ()
 
void SetXSDirName (const char *xsdir_name)
 
int Find (const char *search, string Line)
 find "search" in Line More...
 
void ScanXSDIR ()
 loops on each isotopes of the xsdir More...
 
void WriteData ()
 write information of xsdir in the BaseSummary.dat file More...
 
void SetDataFile (const char *name="BaseSummary.dat")
 set file name where infos are stored More...
 
string GetDataFile ()
 returns file name where infos are stored More...
 
void Close ()
 close xsdir file More...
 
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 More...
 

Private Attributes

string fXSdirName
 name of the xsdir More...
 
string fBaseName
 base name (endfb,jendl,...) More...
 
string fBaseVersion
 base version (6.8,3.3,...) More...
 
ifstream XSinput
 the xsdir file More...
 
bool fOriginal
 true for original MCNP xsdir More...
 
bool f1stIsotope
 true is a first Isotope has been found More...
 
string fBuilder
 builder of the base (STD, JOY or MOD) More...
 
XSDIRLinefMyGoodLine
 The extracted XSDIRLine. More...
 
string fDataFile
 the BaseSummary file More...
 
string fModifiedPath
 The modified path (if exists) More...
 
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 ( const char *  base_name,
const char *  base_version,
const char *  xsdir_name = 0,
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

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)
void XSDIR::Close ( )
inline

close xsdir file

int XSDIR::Compare ( string  Line)
private

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

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)
int XSDIR::Find ( const char *  search,
string  Line 
)

find "search" in Line

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).

string XSDIR::GetDataFile ( )
inline

returns file name where infos are stored

XSDIRLine * XSDIR::ReadNextIsotope ( )

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

void XSDIR::ScanXSDIR ( )

loops on each isotopes of the xsdir

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

set file name where infos are stored

void XSDIR::SetXSDirName ( const char *  xsdir_name)

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

void XSDIR::WriteData ( )

write information of xsdir in the BaseSummary.dat file

Member Data Documentation

bool XSDIR::f1stIsotope
private

true is a first Isotope has been found

string XSDIR::fBaseName
private

base name (endfb,jendl,...)

string XSDIR::fBaseVersion
private

base version (6.8,3.3,...)

string XSDIR::fBuilder
private

builder of the base (STD, JOY or MOD)

string XSDIR::fDataFile
private

the BaseSummary file

string XSDIR::fKeepBaseVersion
private
string XSDIR::fModifiedPath
private

The modified path (if exists)

XSDIRLine* XSDIR::fMyGoodLine
private

The extracted XSDIRLine.

bool XSDIR::fOriginal
private

true for original MCNP xsdir

string XSDIR::fXSdirName
private

name of the xsdir

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.8.5 - Mon Nov 17 2014