29 <<
" Constructing object...";
37 <<
" Destructing object...";
57 <<
" NULL pointer to SiStripConfigDb interface!"
58 <<
" Aborting upload...";
70 <<
" Found invalid PLL settings (coarse > 15)"
71 <<
" Aborting update to database...";
78 <<
" Uploading PLL settings to DB...";
81 <<
" Upload of PLL settings to DB finished!";
84 <<
" TEST only! No PLL settings will be uploaded to DB...";
95 <<
" Uploading FED ticker thresholds to DB...";
98 <<
" Upload of FED ticker thresholds to DB finished!";
101 <<
" TEST only! No FED ticker thresholds will be uploaded to DB...";
122 float bestDelay_ = 0.;
124 Analyses::const_iterator iter =
data().begin();
125 bestDelay_ = dynamic_cast<SamplingAnalysis*>(iter->second)->maximum();
132 for (
auto ifed = ids.begin(); ifed != ids.end(); ++ifed) {
135 for (
auto iconn = conns.begin(); iconn != conns.end(); ++iconn) {
143 float tof = dist /
c;
145 float delay = bestDelay_ + tof;
148 iconn->fecCrate(), iconn->fecSlot(), iconn->fecRing(), iconn->ccuAddr(), iconn->ccuChan(), 0)
151 <<
"] Computed Delay to be added to PLL: " << bestDelay_ <<
" " << tof <<
" "
152 <<
delay << std::endl;
155 <<
" Tracker geometry not initialized. Impossible to compute the delays.";
168 uint16_t updated = 0;
169 std::vector<SiStripFecKey>
invalid;
170 SiStripConfigDb::DeviceDescriptionsV::const_iterator idevice;
171 for (idevice = devices.begin(); idevice != devices.end(); idevice++) {
173 if ((*idevice)->getDeviceType() != PLL) {
178 pllDescription*
desc = dynamic_cast<pllDescription*>(*idevice);
192 float delay =
desc->getDelayCoarse() * 25 +
desc->getDelayFine() * 25. / 24. +
delays_[fec_key];
194 int delayFine =
int(round((
delay - 25 * delayCoarse) * 24. / 25.));
195 if (delayFine == 24) {
200 if (delayCoarse > 15) {
207 std::stringstream
ss;
208 ss <<
"[FineDelayHistosUsingDb::" << __func__ <<
"]"
209 <<
" Updating coarse/fine PLL settings"
210 <<
" for Crate/FEC/slot/ring/CCU " << fec_path.
fecCrate() <<
"/" << fec_path.
fecSlot() <<
"/"
212 << static_cast<uint16_t>(
desc->getDelayCoarse()) <<
"/" << static_cast<uint16_t>(
desc->getDelayFine());
213 desc->setDelayCoarse(delayCoarse);
214 desc->setDelayFine(delayFine);
216 ss <<
" to " << static_cast<uint16_t>(
desc->getDelayCoarse()) <<
"/"
217 << static_cast<uint16_t>(
desc->getDelayFine());
222 <<
" Unexpected PLL delay settings for Crate/FEC/slot/ring/CCU " << fec_path.
fecCrate()
230 std::stringstream
ss;
231 ss <<
"[FineDelayHistosUsingDb::" << __func__ <<
"]"
232 <<
" Found PLL coarse setting of 15"
233 <<
" (not allowed!) for following channels"
234 <<
" (Crate/FEC/slot/ring/CCU/LLD): ";
235 std::vector<SiStripFecKey>::iterator ikey =
invalid.begin();
236 std::vector<SiStripFecKey>::iterator jkey =
invalid.end();
237 for (; ikey != jkey; ++ikey) {
238 ss << ikey->fecCrate() <<
"/" << ikey->fecSlot() <<
"/" << ikey->fecRing() <<
"/" << ikey->ccuAddr() <<
"/"
239 << ikey->ccuChan() <<
", ";
246 <<
" Updated PLL settings for " << updated <<
" modules";
260 for (SiStripConfigDb::FedDescriptionsV::const_iterator ifed =
feds.begin(); ifed !=
feds.end(); ifed++) {
262 if (
find(ids.begin(), ids.end(), (*ifed)->getFedId()) == ids.end()) {
267 for (
auto iconn = conns.begin(); iconn != conns.end(); iconn++) {
272 Fed9U::Fed9UAddress fedChannel = Fed9U::Fed9UAddress(iconn->fedCh());
274 int fedDelayCoarse = (*ifed)->getCoarseDelay(fedChannel);
275 int fedDelayFine = (*ifed)->getFineDelay(fedChannel);
276 int fedDelay =
int(fedDelayCoarse * 25. - fedDelayFine * 24. / 25.);
280 iconn->fecCrate(), iconn->fecSlot(), iconn->fecRing(), iconn->ccuAddr(), iconn->ccuChan(), 0)
285 fedDelayCoarse = (fedDelay / 25) + 1;
286 fedDelayFine = fedDelayCoarse * 25 - fedDelay;
287 if (fedDelayFine == 25) {
292 std::stringstream
ss;
293 ss <<
"[FineDelayHistosUsingDb::" << __func__ <<
"]"
294 <<
" Updating the FED delay"
295 <<
" for loop FED id/ch " << (*ifed)->getFedId() <<
"/" << iconn->fedCh() <<
" from "
296 << (*ifed)->getCoarseDelay(fedChannel) <<
"/" << (*ifed)->getFineDelay(fedChannel) <<
" to ";
297 (*ifed)->setDelay(fedChannel, fedDelayCoarse, fedDelayFine);
298 ss << (*ifed)->getCoarseDelay(fedChannel) <<
"/" << (*ifed)->getFineDelay(fedChannel) << std::endl;
304 <<
" Updated FED delay for " << ids.size() <<
" FEDs!";
318 FineDelayAnalysisDescription*
tmp;
319 tmp =
new FineDelayAnalysisDescription(
anal->maximum(),
337 typedef std::vector<std::string>
Strings;
339 Strings::const_iterator istr =
errors.begin();
340 Strings::const_iterator jstr =
errors.end();
341 for (; istr != jstr; ++istr) {
342 tmp->addComments(*istr);