10 using namespace sistrip;
22 <<
" Constructing object...";
27 <<
" Skipping update of FEC parameters.";
30 <<
" Skipping update of FED parameters.";
36 <<
" Enabling selective update of FED parameters.";
43 <<
" Destructing object...";
53 <<
" NULL pointer to SiStripConfigDb interface!"
54 <<
" Aborting upload...";
66 <<
" Found invalid PLL settings (coarse > 15)"
67 <<
" Aborting update to database...";
74 <<
" Uploading PLL settings to DB...";
77 <<
" Upload of PLL settings to DB finished!";
80 <<
" TEST only! No PLL settings will be uploaded to DB...";
85 <<
" No upload of PLL settings to DB, as defined by .cfg file!";
96 <<
" Uploading FED ticker thresholds to DB...";
99 <<
" Upload of FED ticker thresholds to DB finished!";
102 <<
" TEST only! No FED ticker thresholds will be uploaded to DB...";
107 <<
" No Upload of FED ticker thresholds to DB, as defined by .cfg file!";
115 uint16_t updated = 0;
116 std::vector<SiStripFecKey>
invalid;
117 SiStripConfigDb::DeviceDescriptionsV::const_iterator idevice;
119 for (idevice = devices.begin(); idevice != devices.end(); idevice++) {
121 if ((*idevice)->getDeviceType() != PLL) {
126 pllDescription*
desc =
dynamic_cast<pllDescription*
>(*idevice);
151 <<
" NULL pointer to analysis object!";
156 int32_t delay =
static_cast<int32_t
>(rint(anal->
delay()) * 24. / 25);
158 coarse =
static_cast<uint16_t
>(desc->getDelayCoarse() + (delay / 24)) +
159 (
static_cast<uint16_t
>(desc->getDelayFine()) + (delay % 24)) / 24;
161 if ((static_cast<uint16_t>(desc->getDelayFine()) + delay) % 24 < 0) {
165 fine = (
static_cast<uint16_t
>(desc->getDelayFine()) + delay) % 24;
169 invalid.push_back(fec_key);
175 <<
" Unable to find FEC key with params crate/FEC/ring/CCU/module/LLD: "
191 std::stringstream
ss;
193 ss <<
"[ApvTimingHistosUsingDb::" << __func__ <<
"]"
194 <<
" Updating coarse/fine PLL settings"
195 <<
" for crate/FEC/ring/CCU/module " << fec_path.
fecCrate() <<
"/" << fec_path.
fecSlot() <<
"/"
197 <<
static_cast<uint16_t
>(desc->getDelayCoarse()) <<
"/" << static_cast<uint16_t>(desc->getDelayFine());
199 desc->setDelayCoarse(coarse);
200 desc->setDelayFine(fine);
203 ss <<
" to " <<
static_cast<uint16_t
>(desc->getDelayCoarse()) <<
"/"
204 << static_cast<uint16_t>(desc->getDelayFine());
210 <<
" Invalid PLL delay settings course/fine = " << coarse <<
"/" << fine
211 <<
" for crate/FEC/ring/CCU/module " << fec_path.
fecCrate() <<
"/"
218 if (!invalid.empty()) {
219 std::stringstream
ss;
220 ss <<
"[ApvTimingHistosUsingDb::" << __func__ <<
"]"
221 <<
" Found PLL coarse setting of >15"
222 <<
" (not allowed!) for " << invalid.size() <<
" channels";
223 ss <<
" (Example is crate/FEC/ring/CCU/module/LLD: " << invalid.front().fecCrate() <<
"/"
224 << invalid.front().fecSlot() <<
"/" << invalid.front().fecRing() <<
"/" << invalid.front().ccuAddr() <<
"/"
225 << invalid.front().ccuChan() <<
"/" << invalid.front().channel();
231 <<
" Updated PLL settings for " << updated <<
" modules";
242 uint16_t updated = 0;
243 for (
auto ifed = feds.begin(); ifed != feds.end(); ++ifed) {
245 if (
find(ids.begin(), ids.end(), (*ifed)->getFedId()) == ids.end()) {
267 <<
" NULL pointer to analysis object!";
272 Fed9U::Fed9UAddress
addr(ichan);
273 uint16_t old_threshold =
static_cast<uint16_t
>((*ifed)->getFrameThreshold(addr));
278 uint16_t new_threshold =
static_cast<uint16_t
>((*ifed)->getFrameThreshold(addr));
281 std::stringstream
ss;
282 ss <<
"[ApvTimingHistosUsingDb::" << __func__ <<
"]";
284 ss <<
" Updating the frame-finding threshold"
285 <<
" from " << old_threshold <<
" to " << new_threshold <<
" using tick mark base/peak/height "
288 ss <<
" Cannot update the frame-finding threshold"
289 <<
" from " << old_threshold <<
" to a new value using invalid analysis ";
291 ss <<
" for crate/FEC/ring/CCU/module/LLD " << fec_key.fecCrate() <<
"/" << fec_key.fecSlot() <<
"/"
292 << fec_key.fecRing() <<
"/" << fec_key.ccuAddr() <<
"/" << fec_key.ccuChan() << fec_key.channel()
293 <<
" and FED id/ch " << fed_key.
fedId() <<
"/" << fed_key.
fedChannel();
299 std::stringstream
ss;
300 ss <<
"[ApvTimingHistosUsingDb::" << __func__ <<
"]"
301 <<
" Unable to find analysis object and update ticker thresholds"
302 <<
" for key/crate/FEC/ring/CCU/module/LLD " << std::hex << std::setw(8) << std::setfill(
'0')
303 << fec_key.key() <<
std::dec << fec_key.fecCrate() <<
"/" << fec_key.fecSlot() <<
"/" << fec_key.fecRing()
304 <<
"/" << fec_key.ccuAddr() <<
"/" << fec_key.ccuChan() <<
"/" << fec_key.channel()
305 <<
" and FED key/id/ch " << std::hex << std::setw(8) << std::setfill(
'0') << fed_key.
key() <<
std::dec
314 <<
" Updated ticker thresholds for " << updated <<
" channels on " << ids.size()
329 for (uint16_t iapv = 0; iapv < 2; ++iapv) {
342 TimingAnalysisDescription*
tmp;
343 tmp =
new TimingAnalysisDescription(anal->
time(),
369 typedef std::vector<std::string>
Strings;
371 Strings::const_iterator istr = errors.begin();
372 Strings::const_iterator jstr = errors.end();
373 for (; istr != jstr; ++istr) {
374 tmp->addComments(*istr);
const uint16_t & fecSlot() const
Log< level::Info, true > LogVerbatim
const uint16_t & fecCrate() const
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
const uint32_t & fedKey() const
void uploadConfigurations() override
Analyses::iterator Analysis
Analyses & data(bool getMaskedData=false)
const uint16_t & fecRing() const
FedChannelConnection fedConnection(uint16_t fed_id, uint16_t fed_ch) const
A container class for generic run and event-related info, information required by the commissioning a...
const uint16_t & fedCh() const
const edm::ParameterSet & pset() const
bool deviceIsPresent(const SiStripFecKey &)
FedDescriptionsRange getFedDescriptions(std::string partition="")
const float & refTime() const
FedDescriptions::range FedDescriptionsRange
static const float tickMarkHeightThreshold_
static const char mlDqmClient_[]
const uint16_t & fecSlot() const
const float & optimumSamplingPoint() const
uint16_t lldChannel() const
Log< level::Error, false > LogError
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
const uint16_t & i2cAddr() const
const uint16_t & fedId() const
bool update(SiStripConfigDb::DeviceDescriptionsRange)
const float & base() const
const uint32_t & key() const
Utility class that identifies a position within the strip tracker control structure, down to the level of an APV25.
const_iterator_range partitions() const
ApvTimingHistosUsingDb(const edm::ParameterSet &pset, DQMStore *, SiStripConfigDb *const, edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken)
const uint16_t & fecRing() const
Class containning control, module, detector and connection information, at the level of a FED channel...
FedsConstIterRange fedIds() const
DeviceDescriptions::range DeviceDescriptionsRange
bool isValid() const override
static const uint16_t CHANS_PER_LLD
An interface class to the DeviceFactory.
const uint16_t & ccuChan() const
bool doUploadConf() const
void print(std::stringstream &, uint32_t not_used=0) override
const uint32_t & fecKey() const
DeviceAddress deviceAddress(const deviceDescription &)
uint16_t fedChannel() const
bool allowSelectiveUpload_
const float & peak() const
const uint16_t & ccuAddr() const
const float & time() const
const float & delay() const
const uint16_t & fecCrate() const
uint16_t frameFindingThreshold() const
const uint16_t & feUnit() const
const SiStripDbParams & dbParams() const
const uint16_t & channel() const
void uploadFedDescriptions(std::string partition="")
T getParameter(std::string const &) const
const uint16_t & ccuAddr() const
static const uint16_t invalid_
static const uint16_t FEDCH_PER_FED
std::vector< AnalysisDescription * > AnalysisDescriptionsV
const uint16_t & feChan() const
const uint16_t & ccuChan() const
const uint16_t & fedId() const
SiStripConfigDb *const db() const
DeviceDescriptionsRange getDeviceDescriptions(std::string partition="")
~ApvTimingHistosUsingDb() override
Log< level::Warning, false > LogWarning
void uploadDeviceDescriptions(std::string partition="")
Analysis for timing run using APV tick marks.
SiStripFedCabling *const cabling() const
const VString & getErrorCodes() const
const float & height() const
void create(SiStripConfigDb::AnalysisDescriptionsV &, Analysis) override