30 os <<
"calibToFET: " << delay.
calibToFET <<
"\n";
31 os <<
"localToBC: " << delay.
localToBC <<
"\n";
32 os <<
"localToReg: " << delay.
localToReg <<
"\n";
40 if (inFile.is_open()) {
42 while (std::getline(inFile, line)) {
43 line.erase(std::remove_if(line.begin(), line.end(), [](
unsigned char x) { return std::isspace(x); }), line.end());
44 auto pos = line.find(
":");
45 if (
pos != std::string::npos) {
46 std::string
key = line.substr(0,
pos);
47 int16_t
val = std::atoi(line.substr(
pos + 1).c_str());
48 if (
key ==
"calibToFET") {
50 }
else if (
key ==
"localToBC") {
52 }
else if (
key ==
"localToReg") {
58 std::cout <<
"Error: cannot open file " <<
filename << std::endl;
60 return electronicsDelay;
65 int16_t
val =
static_cast<int16_t
>(
bc) + delay;
66 int16_t resetPeriod =
static_cast<int16_t
>(maxBunches);
74 }
else if (
val >= resetPeriod) {
81 bc =
static_cast<uint16_t
>(
val);
Delay parameters for MID electronics.
std::ostream & operator<<(std::ostream &os, const Cluster &data)
void applyElectronicsDelay(uint32_t &orbit, uint16_t &bc, int16_t delay, uint16_t maxBunches=constants::lhc::LHCMaxBunches)
ElectronicsDelay readElectronicsDelay(const char *filename)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
int16_t localToReg
Delay between regional board and local board answers.
int16_t calibToFET
Delay between FET and calibration event.
int16_t localToBC
Delay between collision BC and local clock.