31 tkGeomToken_{tkGeomToken},
34 <<
" Constructing object...";
42 <<
" Destructing object...";
59 <<
" NULL pointer to SiStripConfigDb interface!" 60 <<
" Aborting upload...";
72 <<
" Found invalid PLL settings (coarse > 15)" 73 <<
" Aborting update to database...";
80 <<
" Uploading PLL settings to DB...";
83 <<
" Upload of PLL settings to DB finished!";
86 <<
" TEST only! No PLL settings will be uploaded to DB...";
97 <<
" Uploading FED ticker thresholds to DB...";
100 <<
" Upload of FED ticker thresholds to DB finished!";
103 <<
" TEST only! No FED ticker thresholds will be uploaded to DB...";
124 float bestDelay_ = 0.;
126 Analyses::const_iterator iter =
data().begin();
134 for (
auto ifed = ids.begin(); ifed != ids.end(); ++ifed) {
137 for (
auto iconn = conns.begin(); iconn != conns.end(); ++iconn) {
145 float tof = dist /
c;
147 float delay = bestDelay_ + tof;
150 iconn->fecCrate(), iconn->fecSlot(), iconn->fecRing(), iconn->ccuAddr(), iconn->ccuChan(), 0)
153 <<
"] Computed Delay to be added to PLL: " << bestDelay_ <<
" " << tof <<
" " 154 <<
delay << std::endl;
157 <<
" Tracker geometry not initialized. Impossible to compute the delays.";
170 uint16_t updated = 0;
171 std::vector<SiStripFecKey>
invalid;
172 SiStripConfigDb::DeviceDescriptionsV::const_iterator idevice;
173 for (idevice =
devices.begin(); idevice !=
devices.end(); idevice++) {
175 if ((*idevice)->getDeviceType() != PLL) {
180 pllDescription*
desc =
dynamic_cast<pllDescription*
>(*idevice);
194 float delay =
desc->getDelayCoarse() * 25 +
desc->getDelayFine() * 25. / 24. +
delays_[fec_key];
196 int delayFine =
int(round((
delay - 25 * delayCoarse) * 24. / 25.));
197 if (delayFine == 24) {
202 if (delayCoarse > 15) {
209 std::stringstream
ss;
210 ss <<
"[FineDelayHistosUsingDb::" << __func__ <<
"]" 211 <<
" Updating coarse/fine PLL settings" 212 <<
" for Crate/FEC/slot/ring/CCU " << fec_path.
fecCrate() <<
"/" << fec_path.
fecSlot() <<
"/" 214 <<
static_cast<uint16_t
>(
desc->getDelayCoarse()) <<
"/" << static_cast<uint16_t>(
desc->getDelayFine());
215 desc->setDelayCoarse(delayCoarse);
216 desc->setDelayFine(delayFine);
218 ss <<
" to " <<
static_cast<uint16_t
>(
desc->getDelayCoarse()) <<
"/" 219 << static_cast<uint16_t>(
desc->getDelayFine());
224 <<
" Unexpected PLL delay settings for Crate/FEC/slot/ring/CCU " << fec_path.
fecCrate()
232 std::stringstream
ss;
233 ss <<
"[FineDelayHistosUsingDb::" << __func__ <<
"]" 234 <<
" Found PLL coarse setting of 15" 235 <<
" (not allowed!) for following channels" 236 <<
" (Crate/FEC/slot/ring/CCU/LLD): ";
237 std::vector<SiStripFecKey>::iterator ikey =
invalid.begin();
238 std::vector<SiStripFecKey>::iterator jkey =
invalid.end();
239 for (; ikey != jkey; ++ikey) {
240 ss << ikey->fecCrate() <<
"/" << ikey->fecSlot() <<
"/" << ikey->fecRing() <<
"/" << ikey->ccuAddr() <<
"/" 241 << ikey->ccuChan() <<
", ";
248 <<
" Updated PLL settings for " << updated <<
" modules";
262 for (SiStripConfigDb::FedDescriptionsV::const_iterator ifed =
feds.begin(); ifed !=
feds.end(); ifed++) {
264 if (
find(ids.begin(), ids.end(), (*ifed)->getFedId()) == ids.end()) {
269 for (
auto iconn = conns.begin(); iconn != conns.end(); iconn++) {
274 Fed9U::Fed9UAddress fedChannel = Fed9U::Fed9UAddress(iconn->fedCh());
276 int fedDelayCoarse = (*ifed)->getCoarseDelay(fedChannel);
277 int fedDelayFine = (*ifed)->getFineDelay(fedChannel);
278 int fedDelay =
int(fedDelayCoarse * 25. - fedDelayFine * 24. / 25.);
282 iconn->fecCrate(), iconn->fecSlot(), iconn->fecRing(), iconn->ccuAddr(), iconn->ccuChan(), 0)
287 fedDelayCoarse = (fedDelay / 25) + 1;
288 fedDelayFine = fedDelayCoarse * 25 - fedDelay;
289 if (fedDelayFine == 25) {
294 std::stringstream
ss;
295 ss <<
"[FineDelayHistosUsingDb::" << __func__ <<
"]" 296 <<
" Updating the FED delay" 297 <<
" for loop FED id/ch " << (*ifed)->getFedId() <<
"/" << iconn->fedCh() <<
" from " 298 << (*ifed)->getCoarseDelay(fedChannel) <<
"/" << (*ifed)->getFineDelay(fedChannel) <<
" to ";
299 (*ifed)->setDelay(fedChannel, fedDelayCoarse, fedDelayFine);
300 ss << (*ifed)->getCoarseDelay(fedChannel) <<
"/" << (*ifed)->getFineDelay(fedChannel) << std::endl;
306 <<
" Updated FED delay for " << ids.size() <<
" FEDs!";
320 FineDelayAnalysisDescription*
tmp;
321 tmp =
new FineDelayAnalysisDescription(
anal->maximum(),
339 typedef std::vector<std::string>
Strings;
341 Strings::const_iterator istr =
errors.begin();
342 Strings::const_iterator jstr =
errors.end();
343 for (; istr != jstr; ++istr) {
344 tmp->addComments(*istr);
def upload(url, args, files)
Log< level::Info, true > LogVerbatim
T getParameter(std::string const &) const
static const char tracker_[]
Analysis for latency run.
void uploadConfigurations() override
Analyses::iterator Analysis
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Analyses & data(bool getMaskedData=false)
const uint16_t & ccuAddr() const
void create(SiStripConfigDb::AnalysisDescriptionsV &, Analysis) override
A container class for generic run and event-related info, information required by the commissioning a...
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
FedDescriptionsRange getFedDescriptions(std::string partition="")
const uint16_t & ccuChan() const
Global3DPoint GlobalPoint
FedDescriptions::range FedDescriptionsRange
std::map< unsigned int, float > delays_
static const char mlDqmClient_[]
Log< level::Error, false > LogError
void configure(const edm::ParameterSet &, const edm::EventSetup &) override
void clearDeviceDescriptions(std::string partition="")
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
const_iterator_range partitions() const
void configure(const edm::ParameterSet &, const edm::EventSetup &) override
void configure(const edm::ParameterSet &, const edm::EventSetup &) override
Utility class that identifies a position within the strip tracker control structure, down to the level of an APV25.
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkGeomToken_
SiStripConfigDb *const db() const
DeviceDescriptions::range DeviceDescriptionsRange
An interface class to the DeviceFactory.
const uint32_t & key() const
DeviceAddress deviceAddress(const deviceDescription &)
SiStripFedCabling *const cabling() const
~FineDelayHistosUsingDb() override
bool update(SiStripConfigDb::DeviceDescriptionsRange)
void uploadFedDescriptions(std::string partition="")
static const uint16_t invalid_
const uint16_t & fecSlot() const
const TrackerGeometry * tracker_
std::vector< AnalysisDescription * > AnalysisDescriptionsV
const edm::ParameterSet & pset() const
FineDelayHistosUsingDb(const edm::ParameterSet &pset, DQMStore *, SiStripConfigDb *const, edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken, edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkGeomToken)
const SiStripDbParams & dbParams() const
void clearFedDescriptions(std::string partition="")
DeviceDescriptionsRange getDeviceDescriptions(std::string partition="")
Log< level::Warning, false > LogWarning
void uploadDeviceDescriptions(std::string partition="")
const uint16_t & fecRing() const
FedsConstIterRange fedIds() const
bool doUploadConf() const
const uint16_t & fecCrate() const
ConnsConstIterRange fedConnections(uint16_t fed_id) const