R3BROOT
R3B analysis software
Loading...
Searching...
No Matches

#include <Mille.h>

Public Member Functions

 Mille (std::string_view outFileName, bool asBinary=true, bool writeZero=false)
void set_buffer_size (std::size_t buffer_size)
void mille (const MilleDataPoint &data_point)
 Write the MilleDataPoint structure to the internal data buffer of the type MilleBuffer.
void special (const std::vector< std::pair< int, float > > &special_data)
void reset ()
void end ()
 Streaming an entry data to the output file.
void close ()
auto get_n_entries () const -> uint64_t

Private Member Functions

void check_buffer_size (std::size_t nLocal, std::size_t nGlobal)
void write_to_binary ()
void write_to_non_binary ()

Private Attributes

bool has_special_done_ = false
 if true, special(..) already called for this record
bool is_binary_ = true
 if false output as text
bool is_zero_written_ = false
 if true also write out derivatives/labels ==0
MilleBuffer< int, float > buffer_
 Data buffer to store the points of the events.
std::size_t max_buffer_size_ = DEFAULT_BUFFER_SIZE
 Maximum size of the data buffer.
std::ofstream output_file_
 C-binary for output.
uint64_t num_of_entries_ = 0

Static Private Attributes

static constexpr unsigned int max_label_size_ = (0xFFFFFFFF - (1U << 31U))

Detailed Description

Definition at line 39 of file Mille.h.

Constructor & Destructor Documentation

◆ Mille()

R3B::Mille::Mille ( std::string_view outFileName,
bool asBinary = true,
bool writeZero = false )
explicit

Definition at line 42 of file Mille.cxx.

Member Function Documentation

◆ check_buffer_size()

void R3B::Mille::check_buffer_size ( std::size_t nLocal,
std::size_t nGlobal )
private

Definition at line 156 of file Mille.cxx.

◆ close()

void R3B::Mille::close ( )

Definition at line 155 of file Mille.cxx.

◆ end()

void R3B::Mille::end ( )

Streaming the entry data to the output file and call the reset() function to clear the internal buffer. Before writing the data from the buffer, the size of the buffer is first written, as the start of the entry data and also the indicator of the end of the entry data.

Definition at line 121 of file Mille.cxx.

◆ get_n_entries()

auto R3B::Mille::get_n_entries ( ) const -> uint64_t
inline

Definition at line 74 of file Mille.h.

◆ mille()

void R3B::Mille::mille ( const MilleDataPoint & data_point)

The conversion of the MilleDataPoint to the MilleBuffer follows the sequence:

  1. If the sigma value is negative, returns immediately.
  2. Check if the current internal buffer has enough of space to store the latest data point.
  3. Check if the size of the global and local values from the data point is zero. If so, store [0, 0] to the internal buffer.
  4. Add an index-value pair [0, measurement]
  5. Add all local derivatives with indices.
  6. Add an index-value pair [0, sigma]
  7. Add all global derivatives with indices.
Parameters
data_pointInput data structure which stores the local/global derivatives, measurement and error.

Definition at line 55 of file Mille.cxx.

◆ reset()

void R3B::Mille::reset ( )

Definition at line 149 of file Mille.cxx.

◆ set_buffer_size()

void R3B::Mille::set_buffer_size ( std::size_t buffer_size)
inline

Definition at line 43 of file Mille.h.

◆ special()

void R3B::Mille::special ( const std::vector< std::pair< int, float > > & special_data)

Definition at line 97 of file Mille.cxx.

◆ write_to_binary()

void R3B::Mille::write_to_binary ( )
private

Definition at line 132 of file Mille.cxx.

◆ write_to_non_binary()

void R3B::Mille::write_to_non_binary ( )
private

Definition at line 142 of file Mille.cxx.

Member Data Documentation

◆ buffer_

MilleBuffer<int, float> R3B::Mille::buffer_
private

Definition at line 80 of file Mille.h.

◆ has_special_done_

bool R3B::Mille::has_special_done_ = false
private

Definition at line 77 of file Mille.h.

◆ is_binary_

bool R3B::Mille::is_binary_ = true
private

Definition at line 78 of file Mille.h.

◆ is_zero_written_

bool R3B::Mille::is_zero_written_ = false
private

Definition at line 79 of file Mille.h.

◆ max_buffer_size_

std::size_t R3B::Mille::max_buffer_size_ = DEFAULT_BUFFER_SIZE
private

Definition at line 81 of file Mille.h.

◆ max_label_size_

unsigned int R3B::Mille::max_label_size_ = (0xFFFFFFFF - (1U << 31U))
staticconstexprprivate

Definition at line 85 of file Mille.h.

◆ num_of_entries_

uint64_t R3B::Mille::num_of_entries_ = 0
private

Definition at line 83 of file Mille.h.

◆ output_file_

std::ofstream R3B::Mille::output_file_
private

Definition at line 82 of file Mille.h.


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