 |
Belle II Software
release-05-01-25
|
2 #include <alignment/Manager.h>
4 #include <alignment/dbobjects/VXDAlignment.h>
5 #include <alignment/GlobalTimeLine.h>
6 #include <cdc/dbobjects/CDCAlignment.h>
7 #include <cdc/dbobjects/CDCTimeWalks.h>
8 #include <cdc/dbobjects/CDCTimeZeros.h>
9 #include <cdc/dbobjects/CDCXtRelations.h>
10 #include <klm/dbobjects/bklm/BKLMAlignment.h>
11 #include <klm/dbobjects/eklm/EKLMAlignment.h>
46 const std::vector< EventMetaData >& timeSlices)
123 bool alignmentHierarchyChanged =
false;
124 bool lorentzHierarchyChanged =
false;
126 if (alignment::timeline::getContinuousIndexByTimeID(
m_iniTimeTable, uid, subrun) == 1) {
127 alignmentHierarchyChanged =
true;
132 if (alignment::timeline::getContinuousIndexByTimeID(
m_iniTimeTable, uid, subrun) == 1) {
133 lorentzHierarchyChanged =
true;
141 lorentzHierarchyChanged =
true;
144 lorentzHierarchyChanged =
true;
148 if (alignmentHierarchyChanged) {
152 if (lorentzHierarchyChanged) {
164 std::ofstream txt(txtFilename);
169 auto name = name_elements.first;
172 txt <<
"Constraint 0. ! Constraint for global label: " << name << std::endl;
173 auto& elements = name_elements.second;
174 for (
auto& label_coefficient : elements) {
175 auto label = label_coefficient.first;
176 auto coeff = label_coefficient.second;
177 txt << label <<
" " << coeff << std::endl;
179 txt << std::endl << std::endl;
186 vec.erase(std::unique(vec.begin(), vec.end()), vec.end());
198 for (
unsigned int index = 0; index <
m_dbTimeSlicing.size() - 1; ++index) {
static void setCurrentTimeInterval(gidTYPE time)
Sets current time id.
void initialize(const std::vector< std::string > &components={}, const std::vector< EventMetaData > &timeSlices={})
Initialize the manager with given configuration (from MillepedeCollector)
Very tentative interface for VXD.
Database object for xt-relations.
int updateTimeDepGlobalLabels(const EventMetaData &event)
Update the current time ID in the GlobalLabel.
void sortUniqueVector(std::vector< EventMetaData > &vec)
Sort vector of EventMetaData and make it unique to process user defined time splittings of the consta...
void preCollect(const EventMetaData &emd)
Notice manager of a comming event (from MillepedeCollector)
Database object for time-walk.
bool m_initialized
Finished initialization?
RigidBodyHierarchy & getAlignmentHierarchy() const
Get the rigid body alignment hierarchy.
This class contains the beam spot position and size modeled as a gaussian distribution in space.
Class to convert to/from global labels for Millepede II to/from detector & parameter identificators.
Class to store EKLM alignment data in the database.
GlobalCalibrationManager()
Singleton class, hidden constructor.
std::vector< EventMetaData > m_dbTimeSlicing
Vector of EventMetaData containing the time slicing of the calibration job.
The central user class to manipulate any global constant in any DB object Used to retrieve global par...
std::function< bool(const EventMetaData &, const EventMetaData &)> cmpEventMetaData
Comparison function for EventMetaData.
std::unique_ptr< LorentShiftHierarchy > m_lorentzShift
Hierarchy for Lorentz shift corrections.
std::unique_ptr< RigidBodyHierarchy > m_alignment
The alignment hierarchy.
Abstract base class for different kinds of events.
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.
std::map< long, Constraint > m_constraints
Map of constraints {unique label, labels and coefficients}.
Class to hold hierarchy of whole Belle2.
void writeConstraints(std::string txtFilename)
Write-out complete hierarchy to a text file.
Database object for timing offset (t0).
Class to store EKLM alignment data in the database.
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.
LorentShiftHierarchy & getLorentzShiftHierarchy() const
Get the Lorentz shift hierarchy.
std::unique_ptr< GlobalParamVector > m_globalVector
The global vector for unified access to DB constants.
Class to store BKLM alignment data in the database.
alignment::timeline::TimeTable m_iniTimeTable
The initial time table generated from time intervals in GlobalLabel used to check if payload (labels)...
static void initGlobalVector(GlobalParamVector &vector)
Initialize a given GlobalParamVector with all DB objects and interfaces.
void addDBObj(std::shared_ptr< IGlobalParamInterface > interface={})
Add a DB object to the vector, optionally with interface.
VXD alignment (and maybe some calibration) parameters.
bool isValid() const
Check whether the object was created.