musrfit  1.9.2
dump_header.cpp File Reference
#include <unistd.h>
#include <cerrno>
#include <cctype>
#include <cstring>
#include <ctime>
#include <cassert>
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include <memory>
#include <boost/algorithm/string.hpp>
#include <TObject.h>
#include <TObjArray.h>
#include <TObjString.h>
#include <TFile.h>
#include <TFolder.h>
#include <TString.h>
#include <TH1F.h>
#include "PFindRun.h"
#include "PStartupHandler.h"
#include "TMusrRunHeader.h"
#include "TLemRunHeader.h"
#include "MuSR_td_PSI_bin.h"
#include "mud.h"
Include dependency graph for dump_header.cpp:

Go to the source code of this file.

Macros

#define DH_MUSR_ROOT   0
 
#define DH_LEM_ROOT   1
 

Functions

void dump_header_syntax ()
 
int dump_header_root (const std::string fileName, const bool summary, const bool counts)
 
int dump_header_nexus (const std::string fileName, const bool counts)
 
std::vector< std::string > dump_header_instrument_info (std::string fileName)
 
int dump_header_psi_bin (const std::string fileName, const std::string fileFormat, const bool counts)
 
int dump_header_mud (const std::string fileName, const bool counts)
 
int dump_header_wkm (const std::string fileName)
 
bool dump_is_number (const char *s)
 
int dump_current_year ()
 
int main (int argc, char *argv[])
 

Macro Definition Documentation

◆ DH_LEM_ROOT

#define DH_LEM_ROOT   1

Definition at line 75 of file dump_header.cpp.

Referenced by dump_header_root().

◆ DH_MUSR_ROOT

#define DH_MUSR_ROOT   0

Definition at line 74 of file dump_header.cpp.

Referenced by dump_header_root().

Function Documentation

◆ dump_current_year()

int dump_current_year ( )

reads the current year from the system and converts it to a string.

Returns
the current year as a string.

Definition at line 755 of file dump_header.cpp.

Referenced by main().

◆ dump_header_instrument_info()

std::vector<std::string> dump_header_instrument_info ( std::string  fileName)

dump the instrument specific info for the PSI-BIN format.

Parameters
fileNamefile name of the PSI-BIN.
Returns
string vector with the instrument specific info.

Definition at line 342 of file dump_header.cpp.

Referenced by dump_header_psi_bin().

◆ dump_header_mud()

int dump_header_mud ( const std::string  fileName,
const bool  counts 
)

dump the header information of a MUD file.

Parameters
fileNamefile name of the MUD file
countsbool, if true dump detector counts
Returns
0 on success, 1 otherwise

Definition at line 515 of file dump_header.cpp.

Referenced by main().

◆ dump_header_nexus()

int dump_header_nexus ( const std::string  fileName,
const bool  counts 
)

dumps the header information of a NeXus file.

Parameters
fileNamefile name of the NeXus file.
countsbool, if true dump detector counts
Returns
0 on success, 1 otherwise

Definition at line 314 of file dump_header.cpp.

Referenced by main().

◆ dump_header_psi_bin()

int dump_header_psi_bin ( const std::string  fileName,
const std::string  fileFormat,
const bool  counts 
)

dump the header information of a PSI-BIN file.

Parameters
fileNamefile name of the PSI-BIN
fileFormateither PSI-BIN or PSI-MDU
countsbool, if true dump detector counts
Returns
0 on success, 1 otherwise

Definition at line 407 of file dump_header.cpp.

References dump_header_instrument_info(), and status.

Referenced by main().

◆ dump_header_root()

int dump_header_root ( const std::string  fileName,
const bool  summary,
const bool  counts 
)

dumps header of a ROOT file.

Parameters
fileNamefile name of the ROOT file
summarybool, if true dump the summary
countsbool, if true dump detector counts
Returns
0 on success, otherwise 1.

Definition at line 120 of file dump_header.cpp.

References DH_LEM_ROOT, and DH_MUSR_ROOT.

Referenced by main().

◆ dump_header_syntax()

void dump_header_syntax ( )

dump help to stdout.

Definition at line 81 of file dump_header.cpp.

Referenced by main().

◆ dump_header_wkm()

int dump_header_wkm ( const std::string  fileName)

dump the header information of a WKM file.

Parameters
fileNamefile name of the WKM file.
Returns
0 on success, 1 otherwise

Definition at line 702 of file dump_header.cpp.

Referenced by main().

◆ dump_is_number()

bool dump_is_number ( const char *  s)

checks if a string is a number

Parameters
snumber string to be checked
Returns
true if 's' is a number, false otherwise

Definition at line 733 of file dump_header.cpp.

Referenced by main().

◆ main()

int main ( int  argc,
char *  argv[] 
)

dump_header allows to dump the header (meta) information for various muSR specific file formats.

Parameters
argcargument count
argvargument list
Returns
0 on success, 1 otherwise

Definition at line 778 of file dump_header.cpp.

References dump_current_year(), dump_header_mud(), dump_header_nexus(), dump_header_psi_bin(), dump_header_root(), dump_header_syntax(), dump_header_wkm(), dump_is_number(), parseXmlFile(), startup_path_name, and status.