HOPS
HOPS class reference
Public Member Functions | Protected Member Functions | List of all members
hops::MHO_AFileInfoExtractor Class Reference

Class MHO_AFileInfoExtractor. More...

#include <MHO_AFileInfoExtractor.hh>

Public Member Functions

 MHO_AFileInfoExtractor ()
 
virtual ~MHO_AFileInfoExtractor ()
 
std::string ConvertToAlistRow (const mho_json &data, int version)
 Converts mho_json data to alist row string for versions 5 or 6. More...
 
std::string GetAlistHeader (int version, int type, char comment_char)
 Getter for alist header (row text) More...
 
bool SummarizeFringeFile (std::string filename, mho_json &fsum)
 Summarizes a fringe file and populates the json object fsum with its data. More...
 

Protected Member Functions

template<typename XValueType >
std::string ConvertToString (XValueType value, const std::string &pformat)
 Converts a value to string using specified format or default precision. More...
 
par_type DetermineParameterType (std::string etype)
 Determines parameter type based on input string. More...
 
void RetrieveParameter (mho_json &obj, const std::string &name, const MHO_ParameterStore &paramStore, const std::string &path, const std::string &type)
 Retrieves a parameter from the store and populates it into a json object. More...
 
std::string RetrieveParameterAsString (const mho_json &obj, const std::string &name, const std::string &type, const std::string &pformat)
 Retrieve and convert a parameter from a json object to string based on its type. More...
 

Detailed Description

Class MHO_AFileInfoExtractor.

extract useful inpformation from .cor, .frng. and root files for afile generation

Author
Email:
Date
Wed Sep 20 16:12:23 2023 -0400

Constructor & Destructor Documentation

◆ MHO_AFileInfoExtractor()

hops::MHO_AFileInfoExtractor::MHO_AFileInfoExtractor ( )
inline

◆ ~MHO_AFileInfoExtractor()

virtual hops::MHO_AFileInfoExtractor::~MHO_AFileInfoExtractor ( )
inlinevirtual

Member Function Documentation

◆ ConvertToAlistRow()

std::string hops::MHO_AFileInfoExtractor::ConvertToAlistRow ( const mho_json data,
int  version 
)

Converts mho_json data to alist row string for versions 5 or 6.

Parameters
dataInput mho_json data object
versionALIST format version (5 or 6)
Returns
Generated ALIST row string

◆ ConvertToString()

template<typename XValueType >
std::string hops::MHO_AFileInfoExtractor::ConvertToString ( XValueType  value,
const std::string &  pformat 
)
inlineprotected

Converts a value to string using specified format or default precision.

Parameters
valueInput value of type XValueType
pformatOptional format string for value conversion
Returns
String representation of the input value

◆ DetermineParameterType()

par_type hops::MHO_AFileInfoExtractor::DetermineParameterType ( std::string  etype)
protected

Determines parameter type based on input string.

Parameters
etypeInput string representing parameter type.
Returns
par_type enum value corresponding to the determined parameter type.

◆ GetAlistHeader()

std::string hops::MHO_AFileInfoExtractor::GetAlistHeader ( int  version,
int  type,
char  comment_char 
)

Getter for alist header (row text)

Parameters
versionVersion number for which to retrieve the header
typeType of header to retrieve
comment_charComment character used in the header
Returns
Alist header as a string

◆ RetrieveParameter()

void hops::MHO_AFileInfoExtractor::RetrieveParameter ( mho_json obj,
const std::string &  name,
const MHO_ParameterStore paramStore,
const std::string &  path,
const std::string &  type 
)
protected

Retrieves a parameter from the store and populates it into a json object.

Parameters
objReference to an mho_json object where the retrieved parameter will be stored
nameName of the parameter to retrieve
paramStoreConstant reference to the MHO_ParameterStore containing the parameters
pathPath to the parameter in the store
typeType of the parameter

◆ RetrieveParameterAsString()

std::string hops::MHO_AFileInfoExtractor::RetrieveParameterAsString ( const mho_json obj,
const std::string &  name,
const std::string &  type,
const std::string &  pformat 
)
protected

Retrieve and convert a parameter from a json object to string based on its type.

Parameters
objInput json object containing the parameter
nameName of the parameter to retrieve
typeType of the parameter (int, int64, double, string, bool)
pformatFormat for converting numeric types to string
Returns
Parameter value as a string in specified format

◆ SummarizeFringeFile()

bool hops::MHO_AFileInfoExtractor::SummarizeFringeFile ( std::string  filename,
mho_json fsum 
)

Summarizes a fringe file and populates the json object fsum with its data.

Parameters
filenameThe path to the fringe file to summarize.
fsum(mho_json&)
Returns
True if the file is successfully summarized, false otherwise.

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