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

Class that allows to split runs into the intervals of intended properties given by the lossFunction. More...

#include <Splitter.h>

Collaboration diagram for Splitter:

Public Member Functions

template<typename Evt >
std::vector< std::vector< std::map< ExpRun, std::pair< double, double > > > > getIntervals (const std::map< ExpRun, std::pair< double, double >> &runs, std::vector< Evt > evts, TString lossFunctionOuter, TString lossFunctionInner, double atomSize=3./60)
 Function to merge/divide runs into the calibration intervals of given characteristic length. More...
 

Static Public Member Functions

static std::pair< double, double > getStartEnd (std::vector< std::map< ExpRun, std::pair< double, double >>> res)
 Get the start/end time of the calibration interval (vector of the calib. More...
 
static std::vector< double > getBreaks (std::vector< std::map< ExpRun, std::pair< double, double >>> res)
 Get vector with breaks of the calib. More...
 
static std::map< ExpRun, std::pair< double, double > > mergeIntervals (std::map< ExpRun, std::pair< double, double >> I1, std::map< ExpRun, std::pair< double, double >> I2)
 Merge two subintervals into one subinterval. More...
 

Private Member Functions

std::vector< int > dynamicBreaks (const std::vector< Atom > &runs)
 Get optimal break points using algorithm based on dynamic programing. More...
 
double getMinLoss (const std::vector< Atom > &vec, int e, std::vector< int > &breaks)
 Recursive function to evaluate minimal sum of the lossFuctions for the optimal clustering. More...
 
double lossFunction (const std::vector< Atom > &vec, int s, int e) const
 lossFunction of the calibration interval consisting of several "atoms" stored in vector vec The atoms included in calibration interval have indices between s and e More...
 
template<typename Evt >
std::vector< AtomcreateAtoms (const std::vector< std::pair< double, double >> &atomsTimes, const std::vector< Evt > &evts)
 Get the vector with parameters of the calibration Atoms. More...
 
TF1 * toTF1 (TString LossString)
 Convert lossFunction from string to TF1.
 

Static Private Member Functions

static std::vector< std::pair< double, double > > splitToSmall (std::map< ExpRun, std::pair< double, double >> runs, double intSize=1./60)
 Split the runs into small calibration intervals (atoms) of a specified size. More...
 

Private Attributes

TF1 * lossFun
 loss function used for clustering of Atoms
 
std::vector< std::pair< double, std::vector< int > > > cache
 cache used by the clustering algorithm (has to be reset every time)
 

Detailed Description

Class that allows to split runs into the intervals of intended properties given by the lossFunction.

It typically avoids of having large time gaps within calibration intervals. The algorithm is based on minimizing the total loss function Notice, that the calibration interval is defined as a map, where for each run the included period is defined by the start and end time

Definition at line 108 of file Splitter.h.

Member Function Documentation

◆ createAtoms()

std::vector<Atom> createAtoms ( const std::vector< std::pair< double, double >> &  atomsTimes,
const std::vector< Evt > &  evts 
)
inlineprivate

Get the vector with parameters of the calibration Atoms.

Parameters
atomsTimesvector with start/end times of the atoms
evtsvector with events
Returns
A vector of atoms, each including start/end times and the number of events inside

Definition at line 260 of file Splitter.h.

◆ getBreaks()

static std::vector<double> getBreaks ( std::vector< std::map< ExpRun, std::pair< double, double >>>  res)
inlinestatic

Get vector with breaks of the calib.

interval

Parameters
resA single calibration interval
Returns
: Vector of times [hours] of the break points, i.e. the subintervals boundaries

Definition at line 131 of file Splitter.h.

◆ getIntervals()

std::vector<std::vector<std::map<ExpRun, std::pair<double, double> > > > getIntervals ( const std::map< ExpRun, std::pair< double, double >> &  runs,
std::vector< Evt >  evts,
TString  lossFunctionOuter,
TString  lossFunctionInner,
double  atomSize = 3. / 60 
)
inline

Function to merge/divide runs into the calibration intervals of given characteristic length.

Parameters
runsA map with key containing expNum+runNum and value start+end time in hours of the run
evtsA vector with all events
lossFunctionOuterA formula of the outer loss function (for calib. intervals)
lossFunctionInnerA formula of the inner loss function (for calib. subintervals)
atomSizelenght of the small calibration interval - atom (in hours)
Returns
: Vector of the calib. intervals always containing vector of calib. subintervals. Each subinterval is defined as a map spanning in general over several runs

Definition at line 163 of file Splitter.h.

◆ getStartEnd()

static std::pair<double, double> getStartEnd ( std::vector< std::map< ExpRun, std::pair< double, double >>>  res)
inlinestatic

Get the start/end time of the calibration interval (vector of the calib.

subintervals).

Parameters
resA single calibration interval (for example from getIntervals function)
Returns
: A pair with start/end time of the whole calib. interval

Definition at line 120 of file Splitter.h.


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