9#include <alignment/Manager.h>
11#include <alignment/dbobjects/VXDAlignment.h>
12#include <alignment/GlobalTimeLine.h>
13#include <cdc/dbobjects/CDCAlignment.h>
14#include <cdc/dbobjects/CDCTimeWalks.h>
15#include <cdc/dbobjects/CDCTimeZeros.h>
16#include <cdc/dbobjects/CDCXtRelations.h>
17#include <klm/dbobjects/bklm/BKLMAlignment.h>
18#include <klm/dbobjects/eklm/EKLMAlignment.h>
53 const std::vector< EventMetaData >& timeSlices)
130 bool alignmentHierarchyChanged =
false;
131 bool lorentzHierarchyChanged =
false;
133 if (alignment::timeline::getContinuousIndexByTimeID(
m_iniTimeTable, uid, subrun) == 1) {
134 alignmentHierarchyChanged =
true;
139 if (alignment::timeline::getContinuousIndexByTimeID(
m_iniTimeTable, uid, subrun) == 1) {
140 lorentzHierarchyChanged =
true;
148 lorentzHierarchyChanged =
true;
151 lorentzHierarchyChanged =
true;
155 if (alignmentHierarchyChanged) {
159 if (lorentzHierarchyChanged) {
171 std::ofstream txt(txtFilename);
176 auto name = name_elements.first;
179 txt <<
"Constraint 0. ! Constraint for global label: " << name << std::endl;
180 auto& elements = name_elements.second;
181 for (
auto& label_coefficient : elements) {
182 auto label = label_coefficient.first;
183 auto coeff = label_coefficient.second;
184 txt << label <<
" " << coeff << std::endl;
186 txt << std::endl << std::endl;
193 vec.erase(std::unique(vec.begin(), vec.end()), vec.end());
205 for (
unsigned int index = 0; index <
m_dbTimeSlicing.size() - 1; ++index) {
Class to store BKLM alignment data in the database.
This class contains the beam spot position and size modeled as a gaussian distribution in space.
Database object for time-walk.
Database object for timing offset (t0).
Database object for xt-relations.
Class to store EKLM alignment data in the database.
Class to store EKLM alignment data in the database.
Class to convert to/from global labels for Millepede II to/from detector & parameter identificators.
static void setCurrentTimeInterval(gidTYPE time)
Sets current time id.
static void setComponents(const std::set< unsigned short > &components)
Set which DB objects have non-zero labels (by their id)
Type-safe access to single objects in the data store.
bool isValid() const
Check whether the object was created.
VXD alignment (and maybe some calibration) parameters.
Class to hold hierarchy of whole Belle2.
std::function< bool(const EventMetaData &, const EventMetaData &)> cmpEventMetaData
Comparison function for EventMetaData.
bool m_initialized
Finished initialization?
LorentShiftHierarchy & getLorentzShiftHierarchy() const
Get the Lorentz shift hierarchy.
std::unique_ptr< RigidBodyHierarchy > m_alignment
The alignment hierarchy.
GlobalCalibrationManager()
Singleton class, hidden constructor.
void writeConstraints(std::string txtFilename)
Write-out complete hierarchy to a text file.
void initialize(const std::vector< std::string > &components={}, const std::vector< EventMetaData > &timeSlices={})
Initialize the manager with given configuration (from MillepedeCollector)
std::vector< EventMetaData > m_dbTimeSlicing
Vector of EventMetaData containing the time slicing of the calibration job.
std::unique_ptr< LorentShiftHierarchy > m_lorentzShift
Hierarchy for Lorentz shift corrections.
void sortUniqueVector(std::vector< EventMetaData > &vec)
Sort vector of EventMetaData and make it unique to process user defined time splittings of the consta...
std::unique_ptr< GlobalParamVector > m_globalVector
The global vector for unified access to DB constants.
std::map< long, Constraint > m_constraints
Map of constraints {unique label, labels and coefficients}.
int updateTimeDepGlobalLabels(const EventMetaData &event)
Update the current time ID in the GlobalLabel.
static void initGlobalVector(GlobalParamVector &vector)
Initialize a given GlobalParamVector with all DB objects and interfaces.
RigidBodyHierarchy & getAlignmentHierarchy() const
Get the rigid body alignment hierarchy.
void preCollect(const EventMetaData &emd)
Notice manager of a comming event (from MillepedeCollector)
alignment::timeline::TimeTable m_iniTimeTable
The initial time table generated from time intervals in GlobalLabel used to check if payload (labels)...
static GlobalCalibrationManager & getInstance()
Get instance of the Manager auto& gcm = GlobalCalibrationManager::getInstance();.
void buildConstraints(Constraints &constraints)
Adds constraints from current hierarchy to a constraints vector.
The central user class to manipulate any global constant in any DB object Used to retrieve global par...
void addDBObj(std::shared_ptr< IGlobalParamInterface > interface={})
Add a DB object to the vector, optionally with interface.
Very tentative interface for VXD.
Abstract base class for different kinds of events.