26 <<
"[ApvTimingHistosUsingDb::" << __func__ <<
"]" 27 <<
" Constructing object...";
32 <<
"[ApvTimingHistosUsingDb::" << __func__ <<
"]" 33 <<
" Skipping update of FEC parameters.";
36 <<
"[ApvTimingHistosUsingDb::" << __func__ <<
"]" 37 <<
" Skipping update of FED parameters.";
42 <<
"[ApvTimingHistosUsingDb::" << __func__ <<
"]" 43 <<
" Enabling selective update of FED parameters.";
51 <<
"[ApvTimingHistosUsingDb::" << __func__ <<
"]" 52 <<
" Destructing object...";
59 <<
"[ApvTimingHistosUsingDb::" << __func__ <<
"]";
63 <<
"[ApvTimingHistosUsingDb::" << __func__ <<
"]" 64 <<
" NULL pointer to SiStripConfigDb interface!" 65 <<
" Aborting upload...";
78 <<
"[ApvTimingHistosUsingDb::" << __func__ <<
"]" 79 <<
" Found invalid PLL settings (coarse > 15)" 80 <<
" Aborting update to database...";
87 <<
"[ApvTimingHistosUsingDb::" << __func__ <<
"]" 88 <<
" Uploading PLL settings to DB...";
91 <<
"[ApvTimingHistosUsingDb::" << __func__ <<
"]" 92 <<
" Upload of PLL settings to DB finished!";
95 <<
"[ApvTimingHistosUsingDb::" << __func__ <<
"]" 96 <<
" TEST only! No PLL settings will be uploaded to DB...";
101 <<
"[ApvTimingHistosUsingDb::" << __func__ <<
"]" 102 <<
" No upload of PLL settings to DB, as defined by .cfg file!";
114 <<
"[ApvTimingHistosUsingDb::" << __func__ <<
"]" 115 <<
" Uploading FED ticker thresholds to DB...";
118 <<
"[ApvTimingHistosUsingDb::" << __func__ <<
"]" 119 <<
" Upload of FED ticker thresholds to DB finished!";
122 <<
"[ApvTimingHistosUsingDb::" << __func__ <<
"]" 123 <<
" TEST only! No FED ticker thresholds will be uploaded to DB...";
128 <<
"[ApvTimingHistosUsingDb::" << __func__ <<
"]" 129 <<
" No Upload of FED ticker thresholds to DB, as defined by .cfg file!";
139 uint16_t updated = 0;
140 std::vector<SiStripFecKey>
invalid;
141 SiStripConfigDb::DeviceDescriptionsV::const_iterator idevice;
143 for ( idevice = devices.begin(); idevice != devices.end(); idevice++ ) {
146 if ( (*idevice)->getDeviceType() != PLL ) {
continue; }
149 pllDescription* desc =
dynamic_cast<pllDescription*
>( *idevice );
150 if ( !desc ) {
continue; }
179 <<
"[ApvTimingHistosUsingDb::" << __func__ <<
"]" 180 <<
" NULL pointer to analysis object!";
185 int32_t delay =
static_cast<int32_t
>( rint( anal->
delay() )*24./25 );
187 coarse =
static_cast<uint16_t
>( desc->getDelayCoarse() + (delay/24) )
188 + (
static_cast<uint16_t
>( desc->getDelayFine() ) + (delay%24) ) / 24;
190 if ( ( static_cast<uint16_t>( desc->getDelayFine() ) + delay ) % 24 < 0 ) {
194 fine = (
static_cast<uint16_t
>( desc->getDelayFine() ) + delay ) % 24;
197 if ( coarse > 15 ) { invalid.push_back(fec_key); }
202 <<
"[ApvTimingHistosUsingDb::" << __func__ <<
"]" 203 <<
" Unable to find FEC key with params crate/FEC/ring/CCU/module/LLD: " 223 std::stringstream ss;
225 ss <<
"[ApvTimingHistosUsingDb::" << __func__ <<
"]" 226 <<
" Updating coarse/fine PLL settings" 227 <<
" for crate/FEC/ring/CCU/module " 234 <<
static_cast<uint16_t
>( desc->getDelayCoarse() ) <<
"/" 235 << static_cast<uint16_t>( desc->getDelayFine() );
237 desc->setDelayCoarse(coarse);
238 desc->setDelayFine(fine);
242 <<
static_cast<uint16_t
>( desc->getDelayCoarse() ) <<
"/" 243 << static_cast<uint16_t>( desc->getDelayFine() );
249 <<
"[ApvTimingHistosUsingDb::" << __func__ <<
"]" 250 <<
" Invalid PLL delay settings course/fine = " 251 << coarse <<
"/" << fine
252 <<
" for crate/FEC/ring/CCU/module " 263 if ( !invalid.empty() ) {
264 std::stringstream ss;
265 ss <<
"[ApvTimingHistosUsingDb::" << __func__ <<
"]" 266 <<
" Found PLL coarse setting of >15" 267 <<
" (not allowed!) for " 270 ss <<
" (Example is crate/FEC/ring/CCU/module/LLD: " 271 << invalid.front().fecCrate() <<
"/" 272 << invalid.front().fecSlot() <<
"/" 273 << invalid.front().fecRing() <<
"/" 274 << invalid.front().ccuAddr() <<
"/" 275 << invalid.front().ccuChan() <<
"/" 276 << invalid.front().channel();
282 <<
"[ApvTimingHistosUsingDb::" << __func__ <<
"]" 283 <<
" Updated PLL settings for " 284 << updated <<
" modules";
297 uint16_t updated = 0;
298 for (
auto ifed = feds.begin(); ifed != feds.end(); ++ifed ) {
301 if (
find( ids.begin(), ids.end(), (*ifed)->getFedId() ) == ids.end() ) {
continue; }
330 <<
"[ApvTimingHistosUsingDb::" << __func__ <<
"]" 331 <<
" NULL pointer to analysis object!";
336 Fed9U::Fed9UAddress addr( ichan );
337 uint16_t old_threshold =
static_cast<uint16_t
>( (*ifed)->getFrameThreshold( addr ) );
342 uint16_t new_threshold =
static_cast<uint16_t
>( (*ifed)->getFrameThreshold( addr ) );
345 std::stringstream ss;
346 ss <<
"[ApvTimingHistosUsingDb::" << __func__ <<
"]";
348 ss <<
" Updating the frame-finding threshold" 349 <<
" from " << old_threshold
350 <<
" to " << new_threshold
351 <<
" using tick mark base/peak/height " 352 << anal->
base() <<
"/" 353 << anal->
peak() <<
"/" 356 ss <<
" Cannot update the frame-finding threshold" 357 <<
" from " << old_threshold
358 <<
" to a new value using invalid analysis ";
360 ss <<
" for crate/FEC/ring/CCU/module/LLD " 361 << fec_key.fecCrate() <<
"/" 362 << fec_key.fecSlot() <<
"/" 363 << fec_key.fecRing() <<
"/" 364 << fec_key.ccuAddr() <<
"/" 368 << fed_key.
fedId() <<
"/" 375 std::stringstream ss;
376 ss <<
"[ApvTimingHistosUsingDb::" << __func__ <<
"]" 377 <<
" Unable to find analysis object and update ticker thresholds" 378 <<
" for key/crate/FEC/ring/CCU/module/LLD " 379 << std::hex << std::setw(8) << std::setfill(
'0') << fec_key.key() <<
std::dec 380 << fec_key.fecCrate() <<
"/" 381 << fec_key.fecSlot() <<
"/" 382 << fec_key.fecRing() <<
"/" 383 << fec_key.ccuAddr() <<
"/" 384 << fec_key.ccuChan() <<
"/" 386 <<
" and FED key/id/ch " 387 << std::hex << std::setw(8) << std::setfill(
'0') << fed_key.
key() <<
std::dec 388 << fed_key.
fedId() <<
"/" 397 <<
"[ApvTimingHistosUsingDb::" << __func__ <<
"]" 398 <<
" Updated ticker thresholds for " << updated
399 <<
" channels on " << ids.size() <<
" FEDs!";
409 if ( !anal ) {
return; }
414 for ( uint16_t iapv = 0; iapv < 2; ++iapv ) {
428 TimingAnalysisDescription*
tmp;
429 tmp =
new TimingAnalysisDescription( anal->
time(),
455 typedef std::vector<std::string>
Strings;
457 Strings::const_iterator istr = errors.begin();
458 Strings::const_iterator jstr = errors.end();
459 for ( ; istr != jstr; ++istr ) { tmp->addComments( *istr ); }
462 desc.push_back( tmp );
def upload(url, args, files)
const uint16_t & fecSlot() const
T getParameter(std::string const &) const
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_[]
ApvTimingHistosUsingDb(const edm::ParameterSet &pset, DQMStore *, SiStripConfigDb *const )
const uint16_t & fecSlot() const
const float & optimumSamplingPoint() const
uint16_t lldChannel() const
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
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
static const uint16_t CHANS_PER_LLD
An interface class to the DeviceFactory.
const uint16_t & ccuChan() const
bool isValid() const override
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="")
const uint16_t & ccuAddr() const
static const uint16_t invalid_
std::vector< std::vector< double > > tmp
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
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