Ox analysis initialization.
More...
#include <OxInit.h>
|
void | AttachTree (TTree *aTree) |
| Attach a TTree to the output file.
|
|
void | CloseOutputFile (void) |
| Closes the current ouput file (if any).
|
|
bool | CreateOutputFile (string &aOutFileName, const unsigned int aTime) |
| Creates an ouput file.
|
|
string | GetName (void) |
| Returns the object name.
|
|
string | GetOutputDirectory (void) |
| Returns the path to the output directory.
|
|
unsigned int | GetOxFileN (void) |
| Returns the number of Ox files.
|
|
bool | GetStatus (void) |
| Returns the class status.
|
|
|
| OxInit (const string aOptionFile) |
| Constructor of the OxInit class.
|
|
virtual | ~OxInit (void) |
| Destructor of the OxInit class.
|
|
|
void | AddOptions (void) |
| Adds options from the text file.
|
|
void | DefineOption (const string aTag, const string aKey, const double aDefaultValue, const unsigned int aSize) |
| Defines an option (double).
|
|
void | DefineOption (const string aTag, const string aKey, const int aDefaultValue, const unsigned int aSize) |
| Defines an option (integer).
|
|
void | DefineOption (const string aTag, const string aKey, const string aDefaultValue, const unsigned int aSize) |
| Defines an option (string).
|
|
void | DefineOption (const string aTag, const string aKey, const unsigned int aDefaultValue, const unsigned int aSize) |
| Defines an option (unsigned integer).
|
|
string | GetOxFileName (const unsigned int aFileIndex) |
| Returns the path to the Ox file.
|
|
void | OverloadOption (const string aTag, const string aKey) |
| Overloads an option using the text file as a reference.
|
|
|
GwollumOptions * | ox_opt |
| List of options.
|
|
bool | status |
| Class status.
|
|
|
string * | ox_filename |
| List of Ox file names.
|
|
string | ox_name |
| Object name.
|
|
unsigned int | ox_nfiles |
| Number of input Ox files matching the patterns (without checking content).
|
|
string | ox_opt_filepath |
| Path to the option text file.
|
|
GwollumOptions * | ox_opt_text |
| List of options extracted from a txt file.
|
|
string | ox_outdir |
| Path to the output directory.
|
|
TFile * | ox_outfile |
| Output file.
|
|
Ox analysis initialization.
This class is designed to initialize an Ox analysis with a set of options.
◆ OxInit()
OxInit::OxInit |
( |
const string |
aOptionFile | ) |
|
Constructor of the OxInit class.
The list of options is given in a text file. They are identified with a set of tag and key words:
OXI OXFILELIST
: list of file patterns pointing to Ox files.
OXI NAME
: analysis name. If a list of Ox files is provided, the name is extracted from the files.
OXI OUTDIR
: path to the output directory.
If a list of Ox files is provided, the options are downloaded from the Ox files. Some options are overwritten when provided in the text file:
OXI OXFILELIST
OXI OUTDIR
- Parameters
-
[in] | aOptionFile | Path to the option text file. |
◆ ~OxInit()
Destructor of the OxInit class.
◆ AddOptions()
void OxInit::AddOptions |
( |
void |
| ) |
|
|
protected |
Adds options from the text file.
Options (and values) in the text file are added if:
- No Ox files are provided.
- The option is missing in the Ox files
- New options were defined with DefineOption().
◆ AttachTree()
void OxInit::AttachTree |
( |
TTree * |
aTree | ) |
|
|
inline |
Attach a TTree to the output file.
- Parameters
-
[in] | aTree | Pointer to the TTree. |
- Precondition
- The output file must exist: see CreateOutputFile().
◆ CloseOutputFile()
void OxInit::CloseOutputFile |
( |
void |
| ) |
|
Closes the current ouput file (if any).
All the ROOT objects are saved in the file before closing.
◆ CreateOutputFile()
bool OxInit::CreateOutputFile |
( |
string & |
aOutFileName, |
|
|
const unsigned int |
aTime |
|
) |
| |
Creates an ouput file.
A new ROOT file is opened in the output directory to save the Ox analysis results. The file name is "[NAME]_[TIME].root", where "[TIME] must be provided by the user. [NAME] is the name provided in the option file. The file remains open.
@warning If [TIME]=0, the [TIME] variable is incremented (+1) to guarantee the output file does not already exist. Moreover, [NAME] also includes a "_results" suffix.
The option TTree is saved in the file.
- Note
- If a file is already open, it is closed before opening a new file (saving all the pending objects).
- Parameters
-
[out] | aOutFileName | Output ROOT file name. |
[in] | aTime | Time used to name the ouput file. |
◆ DefineOption() [1/4]
void OxInit::DefineOption |
( |
const string |
aTag, |
|
|
const string |
aKey, |
|
|
const double |
aDefaultValue, |
|
|
const unsigned int |
aSize |
|
) |
| |
|
inlineprotected |
Defines an option (double).
- Parameters
-
[in] | aTag | Option tag. |
[in] | aKey | Option aKey. |
[in] | aDefaultValue | Default value. |
[in] | aSize | Number of values for this option. Use 0 for no limits on the size. |
◆ DefineOption() [2/4]
void OxInit::DefineOption |
( |
const string |
aTag, |
|
|
const string |
aKey, |
|
|
const int |
aDefaultValue, |
|
|
const unsigned int |
aSize |
|
) |
| |
|
inlineprotected |
Defines an option (integer).
- Parameters
-
[in] | aTag | Option tag. |
[in] | aKey | Option aKey. |
[in] | aDefaultValue | Default value. |
[in] | aSize | Number of values for this option. Use 0 for no limits on the size. |
◆ DefineOption() [3/4]
void OxInit::DefineOption |
( |
const string |
aTag, |
|
|
const string |
aKey, |
|
|
const string |
aDefaultValue, |
|
|
const unsigned int |
aSize |
|
) |
| |
|
inlineprotected |
Defines an option (string).
- Parameters
-
[in] | aTag | Option tag. |
[in] | aKey | Option aKey. |
[in] | aDefaultValue | Default value. |
[in] | aSize | Number of values for this option. Use 0 for no limits on the size. |
◆ DefineOption() [4/4]
void OxInit::DefineOption |
( |
const string |
aTag, |
|
|
const string |
aKey, |
|
|
const unsigned int |
aDefaultValue, |
|
|
const unsigned int |
aSize |
|
) |
| |
|
inlineprotected |
Defines an option (unsigned integer).
- Parameters
-
[in] | aTag | Option tag. |
[in] | aKey | Option aKey. |
[in] | aDefaultValue | Default value. |
[in] | aSize | Number of values for this option. Use 0 for no limits on the size. |
◆ GetName()
string OxInit::GetName |
( |
void |
| ) |
|
|
inline |
◆ GetOptionsFromOxFiles()
void OxInit::GetOptionsFromOxFiles |
( |
void |
| ) |
|
|
private |
Gets options from a list of Ox files.
When a list of Ox files is provided, this function lists all the files matching the file patterns. From these files, the Ox options are extracted. If a file does not contain Ox options, the file is ignored.
The list of options must be uniform across all the Ox files.
◆ GetOutputDirectory()
string OxInit::GetOutputDirectory |
( |
void |
| ) |
|
|
inline |
Returns the path to the output directory.
◆ GetOxFileN()
unsigned int OxInit::GetOxFileN |
( |
void |
| ) |
|
|
inline |
Returns the number of Ox files.
This the number of files matching the patterns listed with OXI/OXFILELIST
containing Ox options.
◆ GetOxFileName()
string OxInit::GetOxFileName |
( |
const unsigned int |
aFileIndex | ) |
|
|
inlineprotected |
Returns the path to the Ox file.
- Parameters
-
[in] | aFileIndex | File index: must be valid. |
◆ GetStatus()
bool OxInit::GetStatus |
( |
void |
| ) |
|
|
inline |
Returns the class status.
◆ OverloadOption()
void OxInit::OverloadOption |
( |
const string |
aTag, |
|
|
const string |
aKey |
|
) |
| |
|
protected |
Overloads an option using the text file as a reference.
- Parameters
-
[in] | aTag | Option tag. |
[in] | aKey | Option key. |
◆ ox_filename
string* OxInit::ox_filename |
|
private |
◆ ox_name
◆ ox_nfiles
unsigned int OxInit::ox_nfiles |
|
private |
Number of input Ox files matching the patterns (without checking content).
◆ ox_opt
GwollumOptions* OxInit::ox_opt |
|
protected |
◆ ox_opt_filepath
string OxInit::ox_opt_filepath |
|
private |
Path to the option text file.
◆ ox_opt_text
GwollumOptions* OxInit::ox_opt_text |
|
private |
List of options extracted from a txt file.
◆ ox_outdir
Path to the output directory.
◆ ox_outfile
TFile* OxInit::ox_outfile |
|
private |
◆ status
The documentation for this class was generated from the following files: