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

Class to hold hierarchy of whole Belle2. More...

#include <Manager.h>

Collaboration diagram for GlobalCalibrationManager:

Public Member Functions

 ~GlobalCalibrationManager ()
 Destructor.
 
void sortUniqueVector (std::vector< EventMetaData > &vec)
 Sort vector of EventMetaData and make it unique to process user defined time splittings of the constants.
 
void initialize (const std::vector< std::string > &components={}, const std::vector< EventMetaData > &timeSlices={})
 Initialize the manager with given configuration (from MillepedeCollector) More...
 
void preCollect (const EventMetaData &emd)
 Notice manager of a comming event (from MillepedeCollector)
 
RigidBodyHierarchygetAlignmentHierarchy () const
 Get the rigid body alignment hierarchy. More...
 
LorentShiftHierarchygetLorentzShiftHierarchy () const
 Get the Lorentz shift hierarchy.
 
Constraints & getConstraints ()
 Get the constraints collected so far.
 
void writeConstraints (std::string txtFilename)
 Write-out complete hierarchy to a text file.
 

Static Public Member Functions

static GlobalCalibrationManagergetInstance ()
 Get instance of the Manager auto& gcm = GlobalCalibrationManager::getInstance();. More...
 
static void initGlobalVector (GlobalParamVector &vector)
 Initialize a given GlobalParamVector with all DB objects and interfaces. More...
 

Public Attributes

std::function< bool(const EventMetaData &, const EventMetaData &)> cmpEventMetaData
 Comparison function for EventMetaData. More...
 

Private Member Functions

 GlobalCalibrationManager ()
 Singleton class, hidden constructor.
 
 GlobalCalibrationManager (const GlobalCalibrationManager &)
 Singleton class, hidden copy constructor.
 
GlobalCalibrationManageroperator= (const GlobalCalibrationManager &)
 Singleton class, hidden assignment operator.
 
int updateTimeDepGlobalLabels (const EventMetaData &event)
 Update the current time ID in the GlobalLabel. More...
 

Private Attributes

bool m_initialized {false}
 Finished initialization?
 
std::unique_ptr< RigidBodyHierarchym_alignment {new RigidBodyHierarchy()}
 The alignment hierarchy.
 
std::unique_ptr< LorentShiftHierarchym_lorentzShift {new LorentShiftHierarchy()}
 Hierarchy for Lorentz shift corrections.
 
std::unique_ptr< GlobalParamVectorm_globalVector {new GlobalParamVector()}
 The global vector for unified access to DB constants.
 
std::map< long, Constraint > m_constraints {}
 Map of constraints {unique label, labels and coefficients}.
 
std::vector< EventMetaDatam_dbTimeSlicing {}
 Vector of EventMetaData containing the time slicing of the calibration job.
 
alignment::timeline::TimeTable m_iniTimeTable {}
 The initial time table generated from time intervals in GlobalLabel used to check if payload (labels) can change and update the hierarchy if so.
 

Detailed Description

Class to hold hierarchy of whole Belle2.

Definition at line 50 of file Manager.h.

Member Function Documentation

◆ getAlignmentHierarchy()

RigidBodyHierarchy& getAlignmentHierarchy ( ) const
inline

Get the rigid body alignment hierarchy.


Definition at line 106 of file Manager.h.

106 { return *m_alignment; }
std::unique_ptr< RigidBodyHierarchy > m_alignment
The alignment hierarchy.
Definition: Manager.h:133

◆ getInstance()

GlobalCalibrationManager & getInstance ( )
static

Get instance of the Manager auto& gcm = GlobalCalibrationManager::getInstance();.

Note you actually initialize the Manager with your specific selection of DB objects to calibrate (or select all for global calibration -default) and other options.

Definition at line 27 of file Manager.cc.

28  {
29  static std::unique_ptr<GlobalCalibrationManager> instance(new GlobalCalibrationManager());
30  return *instance;
31  }
GlobalCalibrationManager()
Singleton class, hidden constructor.
Definition: Manager.h:117

◆ initGlobalVector()

void initGlobalVector ( GlobalParamVector vector)
static

Initialize a given GlobalParamVector with all DB objects and interfaces.

  auto gpv = GlobalParamVector({"BeamSpot"});
  GlobalCalibrationManager::initGlobalVector(gpv);

This one central function should be used to prepare the global vectors even for local calibrations using Millepede. By setting the components argument of GlobalParamVector one can limit which addDBObj<>() calls are actually executed

Definition at line 33 of file Manager.cc.

◆ initialize()

void initialize ( const std::vector< std::string > &  components = {},
const std::vector< EventMetaData > &  timeSlices = {} 
)

Initialize the manager with given configuration (from MillepedeCollector)


To be used by MillepedeCollector

Definition at line 52 of file Manager.cc.

◆ updateTimeDepGlobalLabels()

int updateTimeDepGlobalLabels ( const EventMetaData event)
private

Update the current time ID in the GlobalLabel.

Parameters
eventcurrent event EventMetaData - generated time ID will be the index of the smallest slice larger than (or. equal) to EventMetaData

Definition at line 196 of file Manager.cc.

Member Data Documentation

◆ cmpEventMetaData

std::function<bool(const EventMetaData&, const EventMetaData&)> cmpEventMetaData
Initial value:
= [](const EventMetaData& lhs,
const EventMetaData& rhs) -> bool {
if (lhs.getExperiment() < rhs.getExperiment()) return true;
if (lhs.getExperiment() > rhs.getExperiment()) return false;
if (lhs.getRun() < rhs.getRun()) return true;
if (lhs.getRun() > rhs.getRun()) return false;
if (lhs.getEvent() < rhs.getEvent()) return true;
return false;
}

Comparison function for EventMetaData.

Definition at line 57 of file Manager.h.


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