Belle II Software development
|
Mergeable class holding list of so far opened mille binaries and providing the binaries. More...
#include <MilleData.h>
Public Member Functions | |
MilleData (bool doublePrecision=false, bool absFilePaths=false) | |
Constructor. Set doublePrecision to true to write binary files with doubles instead of floats. | |
virtual | ~MilleData () |
Destructor. | |
virtual void | merge (const MergeableNamed *other) override |
Implementation of merging. | |
virtual void | clear () override |
Implementation of clearing. | |
void | open (std::string filename) |
Open a new file and remember it. Filename should encode also process id! | |
bool | isOpen () |
Is some file already open? | |
void | fill (gbl::GblTrajectory &trajectory) |
Write a GBL trajectory to the binary file. | |
void | close () |
Close current mille binary if opened. | |
const std::vector< std::string > & | getFiles () const |
Get the list of all created files. | |
MilleData & | operator= (const MilleData &other) |
Copy by assignment (if some file on LHS is opened, it is closed during this operation; file pointers not transfered - new file to be opened) | |
MilleData (const MilleData &other) | |
Construct from other object (pointer to binary file is not transfered - new file has to be opened by new object) | |
virtual MilleData * | Clone (const char *newname="") const override |
Clone object (with optionally a new name) | |
int | getNumRecords () |
Get number of records (trajectories) written to binary files. | |
bool | hasDoublePrecision () |
Are files written with double precision? | |
void | addFile (const std::string &path) |
Add a filename (path) to the file list manually. | |
virtual Long64_t | Merge (TCollection *hlist) |
Allow merging using TFileMerger if saved directly to a file. | |
virtual void | Reset () |
Root-like Reset function for "template compatibility" with ROOT objects. | |
virtual void | SetDirectory (TDirectory *) |
Root-like Clone function for "template compatibility" with ROOT objects. | |
Private Member Functions | |
ClassDef (MergeableNamed, 0) | |
Abstract base class for objects that can be merged and named. | |
Private Attributes | |
bool | m_doublePrecision {false} |
Use double-precision for binary files. | |
bool | m_absFilePaths {false} |
Use absolute file paths to binary files Default is False - so you have to move the binaries to working dir of the algorithm If True, the original location of binaries is remebered in datastore and Millepede will take them from there. | |
std::vector< std::string > | m_files {} |
List of already created file names. | |
gbl::MilleBinary * | m_binary {nullptr} |
Pointer to current binary file. | |
int | m_numRecords {0} |
Pointer to opened binary file (not streamed) | |
Mergeable class holding list of so far opened mille binaries and providing the binaries.
Definition at line 24 of file MilleData.h.
|
inline |
Constructor. Set doublePrecision to true to write binary files with doubles instead of floats.
Definition at line 27 of file MilleData.h.
|
inlinevirtual |
Destructor.
Definition at line 30 of file MilleData.h.
Construct from other object (pointer to binary file is not transfered - new file has to be opened by new object)
Definition at line 49 of file MilleData.h.
|
inline |
Add a filename (path) to the file list manually.
Definition at line 63 of file MilleData.h.
|
inlineoverridevirtual |
|
overridevirtual |
Clone object (with optionally a new name)
Definition at line 37 of file MilleData.cc.
void close | ( | ) |
Close current mille binary if opened.
Definition at line 56 of file MilleData.cc.
void fill | ( | gbl::GblTrajectory & | trajectory | ) |
Write a GBL trajectory to the binary file.
Definition at line 64 of file MilleData.cc.
|
inline |
|
inline |
Get number of records (trajectories) written to binary files.
Definition at line 58 of file MilleData.h.
|
inline |
|
inline |
|
overridevirtual |
Implementation of merging.
Implements MergeableNamed.
Definition at line 19 of file MilleData.cc.
|
virtualinherited |
Allow merging using TFileMerger if saved directly to a file.
Definition at line 14 of file MergeableNamed.cc.
void open | ( | std::string | filename | ) |
Open a new file and remember it. Filename should encode also process id!
Definition at line 72 of file MilleData.cc.
Copy by assignment (if some file on LHS is opened, it is closed during this operation; file pointers not transfered - new file to be opened)
Definition at line 46 of file MilleData.cc.
|
inlinevirtualinherited |
Root-like Reset function for "template compatibility" with ROOT objects.
Alias for clear().
Definition at line 52 of file MergeableNamed.h.
|
inlinevirtualinherited |
Root-like Clone function for "template compatibility" with ROOT objects.
Calls clone() Root-like SetDirectory function for "template compatibility" with ROOT objects. Does nothing.
Definition at line 56 of file MergeableNamed.h.
|
private |
Use absolute file paths to binary files Default is False - so you have to move the binaries to working dir of the algorithm If True, the original location of binaries is remebered in datastore and Millepede will take them from there.
Definition at line 75 of file MilleData.h.
|
private |
Pointer to current binary file.
Definition at line 78 of file MilleData.h.
|
private |
Use double-precision for binary files.
Definition at line 70 of file MilleData.h.
|
private |
List of already created file names.
Definition at line 76 of file MilleData.h.
|
private |
Pointer to opened binary file (not streamed)
Number of written trajectories
Definition at line 80 of file MilleData.h.