Belle II Software  release-08-01-10
MilleData Class Reference

Mergeable class holding list of so far opened mille binaries and providing the binaries. More...

#include <MilleData.h>

Inheritance diagram for MilleData:
Collaboration diagram for MilleData:

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.
 
MilleDataoperator= (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 MilleDataClone (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. More...
 
virtual void SetDirectory (TDirectory *)
 Root-like Clone function for "template compatibility" with ROOT objects. More...
 

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::MilleBinarym_binary {nullptr}
 Pointer to current binary file.
 
int m_numRecords {0}
 Pointer to opened binary file (not streamed) More...
 

Detailed Description

Mergeable class holding list of so far opened mille binaries and providing the binaries.

Definition at line 24 of file MilleData.h.

Member Function Documentation

◆ Reset()

virtual void Reset ( )
inlinevirtualinherited

Root-like Reset function for "template compatibility" with ROOT objects.

Alias for clear().

Definition at line 52 of file MergeableNamed.h.

52 {clear();}
virtual void clear()=0
Clear content of this object (e.g. set to zeroes). Called by the Reset() function.

◆ SetDirectory()

virtual void SetDirectory ( TDirectory *  )
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.

Member Data Documentation

◆ m_numRecords

int m_numRecords {0}
private

Pointer to opened binary file (not streamed)

Number of written trajectories

Definition at line 80 of file MilleData.h.


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