CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
ApvTimingHistosUsingDb Class Reference

#include <ApvTimingHistosUsingDb.h>

Inheritance diagram for ApvTimingHistosUsingDb:
CommissioningHistosUsingDb ApvTimingHistograms CommissioningHistograms CommissioningHistograms

Public Member Functions

 ApvTimingHistosUsingDb (const edm::ParameterSet &pset, DQMStore *, SiStripConfigDb *const )
 
virtual void uploadConfigurations ()
 
virtual ~ApvTimingHistosUsingDb ()
 
- Public Member Functions inherited from CommissioningHistosUsingDb
 CommissioningHistosUsingDb (SiStripConfigDb *const, sistrip::RunType=sistrip::UNDEFINED_RUN_TYPE)
 
bool doUploadAnal () const
 
void doUploadAnal (bool)
 
bool doUploadConf () const
 
void doUploadConf (bool)
 
void uploadToConfigDb ()
 
virtual ~CommissioningHistosUsingDb ()
 
- Public Member Functions inherited from CommissioningHistograms
 CommissioningHistograms (const edm::ParameterSet &pset, DQMStore *const, const sistrip::RunType &)
 
 CommissioningHistograms ()
 
virtual void configure (const edm::ParameterSet &, const edm::EventSetup &)
 
void createCollations (const std::vector< std::string > &)
 
virtual void createSummaryHisto (const sistrip::Monitorable &, const sistrip::Presentation &, const std::string &top_level_dir, const sistrip::Granularity &)
 
void extractHistograms (const std::vector< std::string > &)
 
virtual void printAnalyses ()
 
virtual void printSummary ()
 
void remove (std::string pattern="")
 
void save (std::string &filename, uint32_t run_number=0)
 
virtual ~CommissioningHistograms ()
 
- Public Member Functions inherited from ApvTimingHistograms
 ApvTimingHistograms (const edm::ParameterSet &pset, DQMStore *)
 
void histoAnalysis (bool debug)
 
virtual ~ApvTimingHistograms ()
 

Private Member Functions

void create (SiStripConfigDb::AnalysisDescriptionsV &, Analysis)
 
bool update (SiStripConfigDb::DeviceDescriptionsRange)
 
void update (SiStripConfigDb::FedDescriptionsRange)
 

Private Attributes

bool skipFecUpdate_
 
bool skipFedUpdate_
 

Additional Inherited Members

- Public Types inherited from CommissioningHistograms
typedef std::map< uint32_t,
CommissioningAnalysis * > 
Analyses
 
typedef Analyses::iterator Analysis
 
typedef SummaryPlotFactory
< CommissioningAnalysis * > 
Factory
 
typedef std::map< uint32_t,
uint32_t > 
FedToFecMap
 
typedef std::vector< Histo * > Histos
 
typedef std::map< uint32_t,
Histos
HistosMap
 
- Static Public Member Functions inherited from CommissioningHistograms
static void copyCustomInformation (DQMStore *const, const std::vector< std::string > &)
 
static void getContents (DQMStore *const, std::vector< std::string > &)
 
static uint32_t runNumber (DQMStore *const, const std::vector< std::string > &)
 
static sistrip::RunType runType (DQMStore *const, const std::vector< std::string > &)
 
- Protected Member Functions inherited from CommissioningHistosUsingDb
virtual void addDcuDetIds ()
 
void buildDetInfo ()
 
SiStripFedCabling *const cabling () const
 
virtual void createAnalyses (SiStripConfigDb::AnalysisDescriptionsV &)
 
SiStripConfigDb *const db () const
 
std::pair< std::string, DetInfodetInfo (const SiStripFecKey &)
 
bool deviceIsPresent (const SiStripFecKey &)
 
void uploadAnalyses ()
 
- Protected Member Functions inherited from CommissioningHistograms
DQMStore *const bei () const
 
void clearHistosMap ()
 
Analysesdata ()
 
Factory *const factory ()
 
TH1 * histogram (const sistrip::Monitorable &, const sistrip::Presentation &, const sistrip::View &, const std::string &directory, const uint32_t &xbins, const float &xlow=1.*sistrip::invalid_, const float &xhigh=1.*sistrip::invalid_)
 
const HistosMaphistos () const
 
const FedToFecMapmapping () const
 
void printHistosMap ()
 
const edm::ParameterSetpset () const
 
const sistrip::RunTypetask () const
 
- Protected Attributes inherited from CommissioningHistograms
std::auto_ptr< Factoryfactory_
 

Detailed Description

Definition at line 8 of file ApvTimingHistosUsingDb.h.

Constructor & Destructor Documentation

ApvTimingHistosUsingDb::ApvTimingHistosUsingDb ( const edm::ParameterSet pset,
DQMStore bei,
SiStripConfigDb * const  db 
)

Definition at line 14 of file ApvTimingHistosUsingDb.cc.

References edm::ParameterSet::getParameter(), LogTrace, sistrip::mlDqmClient_, CommissioningHistograms::pset(), skipFecUpdate_, and skipFedUpdate_.

17  : CommissioningHistograms( pset.getParameter<edm::ParameterSet>("ApvTimingParameters"),
18  bei,
22  ApvTimingHistograms( pset.getParameter<edm::ParameterSet>("ApvTimingParameters"),
23  bei )
24 {
26  << "[ApvTimingHistosUsingDb::" << __func__ << "]"
27  << " Constructing object...";
28  skipFecUpdate_ = this->pset().getParameter<bool>("SkipFecUpdate");
29  skipFedUpdate_ = this->pset().getParameter<bool>("SkipFedUpdate");
30  if (skipFecUpdate_)
32  << "[ApvTimingHistosUsingDb::" << __func__ << "]"
33  << " Skipping update of FEC parameters.";
34  if (skipFedUpdate_)
36  << "[ApvTimingHistosUsingDb::" << __func__ << "]"
37  << " Skipping update of FED parameters.";
38 }
T getParameter(std::string const &) const
const edm::ParameterSet & pset() const
static const char mlDqmClient_[]
#define LogTrace(id)
ApvTimingHistograms(const edm::ParameterSet &pset, DQMStore *)
ApvTimingHistosUsingDb::~ApvTimingHistosUsingDb ( )
virtual

Definition at line 42 of file ApvTimingHistosUsingDb.cc.

References LogTrace, and sistrip::mlDqmClient_.

42  {
44  << "[ApvTimingHistosUsingDb::" << __func__ << "]"
45  << " Destructing object...";
46 }
static const char mlDqmClient_[]
#define LogTrace(id)

Member Function Documentation

void ApvTimingHistosUsingDb::create ( SiStripConfigDb::AnalysisDescriptionsV desc,
Analysis  analysis 
)
privatevirtual

Reimplemented from CommissioningHistosUsingDb.

Definition at line 398 of file ApvTimingHistosUsingDb.cc.

References ApvTimingAnalysis::base(), CommissioningHistosUsingDb::db(), SiStripConfigDb::dbParams(), ApvTimingAnalysis::delay(), benchmark_cfg::errors, CommissioningAnalysis::fecKey(), CommissioningAnalysis::fedKey(), ApvTimingAnalysis::frameFindingThreshold(), CommissioningAnalysis::getErrorCodes(), ApvTimingAnalysis::height(), SiStripFecKey::i2cAddr(), ApvTimingAnalysis::isValid(), ApvTimingAnalysis::optimumSamplingPoint(), SiStripDbParams::partitions(), ApvTimingAnalysis::peak(), ApvTimingAnalysis::refTime(), ApvTimingAnalysis::tickMarkHeightThreshold_, ApvTimingAnalysis::time(), and tmp.

399  {
400 
401  ApvTimingAnalysis* anal = dynamic_cast<ApvTimingAnalysis*>( analysis->second );
402  if ( !anal ) { return; }
403 
404  SiStripFecKey fec_key( anal->fecKey() );
405  SiStripFedKey fed_key( anal->fedKey() );
406 
407  for ( uint16_t iapv = 0; iapv < 2; ++iapv ) {
408 
409 // std::stringstream ss;
410 // if ( anal->isValid() ) { ss << " TEST VALID "; }
411 // else { ss << " TEST INVALID "; }
412 // ss << std::hex << anal->fecKey() << std::dec << " "
413 // << anal->base() << " "
414 // << anal->peak() << " "
415 // << anal->height() << " "
416 // << ( anal->base() + anal->height() * ApvTimingAnalysis::frameFindingThreshold_ ) << " "
417 // << anal->frameFindingThreshold();
418 // edm::LogError("TEST") << ss.str();
419 
420  // Create description
421  TimingAnalysisDescription* tmp;
422  tmp = new TimingAnalysisDescription( anal->time(),
423  anal->refTime(),
424  anal->delay(),
425  anal->height(),
426  anal->base(),
427  anal->peak(),
428  anal->frameFindingThreshold(),
429  anal->optimumSamplingPoint(),
431  true, //@@ APV timing analysis (not FED timing)
432  fec_key.fecCrate(),
433  fec_key.fecSlot(),
434  fec_key.fecRing(),
435  fec_key.ccuAddr(),
436  fec_key.ccuChan(),
437  SiStripFecKey::i2cAddr( fec_key.lldChan(), !iapv ),
438  db()->dbParams().partitions().begin()->second.partitionName(),
439  db()->dbParams().partitions().begin()->second.runNumber(),
440  anal->isValid(),
441  "",
442  fed_key.fedId(),
443  fed_key.feUnit(),
444  fed_key.feChan(),
445  fed_key.fedApv() );
446 
447  // Add comments
448  typedef std::vector<std::string> Strings;
449  Strings errors = anal->getErrorCodes();
450  Strings::const_iterator istr = errors.begin();
451  Strings::const_iterator jstr = errors.end();
452  for ( ; istr != jstr; ++istr ) { tmp->addComments( *istr ); }
453 
454  // Store description
455  desc.push_back( tmp );
456 
457  }
458 
459 }
const uint32_t & fedKey() const
A container class for generic run and event-related info, information required by the commissioning a...
Definition: SiStripFedKey.h:56
std::vector< std::string > Strings
Definition: MsgTools.h:18
const float & refTime() const
static const float tickMarkHeightThreshold_
const float & optimumSamplingPoint() const
const uint16_t & i2cAddr() const
const float & base() const
Utility class that identifies a position within the strip tracker control structure, down to the level of an APV25.
Definition: SiStripFecKey.h:45
const_iterator_range partitions() const
const uint32_t & fecKey() const
const float & peak() const
const float & time() const
const float & delay() const
uint16_t frameFindingThreshold() const
const SiStripDbParams & dbParams() const
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
SiStripConfigDb *const db() const
Analysis for timing run using APV tick marks.
const VString & getErrorCodes() const
const float & height() const
bool ApvTimingHistosUsingDb::update ( SiStripConfigDb::DeviceDescriptionsRange  devices)
private

Definition at line 129 of file ApvTimingHistosUsingDb.cc.

References SiStripFecKey::ccuAddr(), SiStripConfigDb::DeviceAddress::ccuAddr_, SiStripFecKey::ccuChan(), SiStripConfigDb::DeviceAddress::ccuChan_, SiStripKey::channel(), sistrip::CHANS_PER_LLD, CommissioningHistograms::data(), CommissioningHistosUsingDb::db(), ApvTimingAnalysis::delay(), SiStripConfigDb::deviceAddress(), CommissioningHistosUsingDb::deviceIsPresent(), SiStripFecKey::fecCrate(), SiStripConfigDb::DeviceAddress::fecCrate_, SiStripFecKey::fecRing(), SiStripConfigDb::DeviceAddress::fecRing_, SiStripFecKey::fecSlot(), SiStripConfigDb::DeviceAddress::fecSlot_, align::invalid, sistrip::invalid_, edm::isDebugEnabled(), getDQMSummary::iter, SiStripKey::key(), LogTrace, sistrip::mlDqmClient_, and contentValuesCheck::ss.

Referenced by progressbar.ProgressBar::__next__(), relval_steps.Matrix::__setitem__(), relval_steps.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), relval_steps.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), Vispa.Gui.PortConnection.PointToPointConnection::updateConnection(), and uploadConfigurations().

129  {
130 
131  // Iterate through devices and update device descriptions
132  uint16_t updated = 0;
133  std::vector<SiStripFecKey> invalid;
134  SiStripConfigDb::DeviceDescriptionsV::const_iterator idevice;
135 
136  for ( idevice = devices.begin(); idevice != devices.end(); idevice++ ) {
137 
138  // Check device type
139  if ( (*idevice)->getDeviceType() != PLL ) { continue; }
140 
141  // Cast to retrieve appropriate description object
142  pllDescription* desc = dynamic_cast<pllDescription*>( *idevice );
143  if ( !desc ) { continue; }
144 
145  // Retrieve device addresses from device description
146  const SiStripConfigDb::DeviceAddress& addr = db()->deviceAddress(*desc);
147  SiStripFecKey fec_path;
148 
149  // PLL delay settings
150  uint32_t coarse = sistrip::invalid_;
151  uint32_t fine = sistrip::invalid_;
152 
153  // Iterate through LLD channels
154  for ( uint16_t ichan = 0; ichan < sistrip::CHANS_PER_LLD; ichan++ ) {
155 
156  // Construct key from device description
157  SiStripFecKey fec_key( addr.fecCrate_,
158  addr.fecSlot_,
159  addr.fecRing_,
160  addr.ccuAddr_,
161  addr.ccuChan_,
162  ichan+1 );
163  fec_path = fec_key;
164 
165  // Locate appropriate analysis object
166  Analyses::const_iterator iter = data().find( fec_key.key() );
167  if ( iter != data().end() ) {
168 
169  ApvTimingAnalysis* anal = dynamic_cast<ApvTimingAnalysis*>( iter->second );
170  if ( !anal ) {
172  << "[ApvTimingHistosUsingDb::" << __func__ << "]"
173  << " NULL pointer to analysis object!";
174  continue;
175  }
176 
177  // Calculate coarse and fine delays
178  int32_t delay = static_cast<int32_t>( rint( anal->delay() )*24./25 );
179  // first set course delay
180  coarse = static_cast<uint16_t>( desc->getDelayCoarse() + (delay/24) )
181  + ( static_cast<uint16_t>( desc->getDelayFine() ) + (delay%24) ) / 24;
182  delay = delay % 24; // only bother with fine delay now
183  if ( ( static_cast<uint16_t>( desc->getDelayFine() ) + delay ) % 24 < 0 ) {
184  coarse -= 1;
185  delay += 24;
186  }
187  fine = ( static_cast<uint16_t>( desc->getDelayFine() ) + delay ) % 24;
188 
189  // Record PPLs maximum coarse setting
190  if ( coarse > 15 ) { invalid.push_back(fec_key); }
191 
192  } else {
193  if ( deviceIsPresent(fec_key) ) {
195  << "[ApvTimingHistosUsingDb::" << __func__ << "]"
196  << " Unable to find FEC key with params crate/FEC/ring/CCU/module/LLD: "
197  << fec_key.fecCrate() << "/"
198  << fec_key.fecSlot() << "/"
199  << fec_key.fecRing() << "/"
200  << fec_key.ccuAddr() << "/"
201  << fec_key.ccuChan() << "/"
202  << fec_key.channel();
203  }
204  }
205 
206  // Exit LLD channel loop if coarse and fine delays are known
207  if ( coarse != sistrip::invalid_ &&
208  fine != sistrip::invalid_ ) { break; }
209 
210  } // lld channel loop
211 
212  // Update PLL settings
213  if ( coarse != sistrip::invalid_ &&
214  fine != sistrip::invalid_ ) {
215 
216  std::stringstream ss;
217  if ( edm::isDebugEnabled() ) {
218  ss << "[ApvTimingHistosUsingDb::" << __func__ << "]"
219  << " Updating coarse/fine PLL settings"
220  << " for crate/FEC/ring/CCU/module "
221  << fec_path.fecCrate() << "/"
222  << fec_path.fecSlot() << "/"
223  << fec_path.fecRing() << "/"
224  << fec_path.ccuAddr() << "/"
225  << fec_path.ccuChan()
226  << " from "
227  << static_cast<uint16_t>( desc->getDelayCoarse() ) << "/"
228  << static_cast<uint16_t>( desc->getDelayFine() );
229  }
230  desc->setDelayCoarse(coarse);
231  desc->setDelayFine(fine);
232  updated++;
233  if ( edm::isDebugEnabled() ) {
234  ss << " to "
235  << static_cast<uint16_t>( desc->getDelayCoarse() ) << "/"
236  << static_cast<uint16_t>( desc->getDelayFine() );
237  LogTrace(mlDqmClient_) << ss.str();
238  }
239 
240  } else {
242  << "[ApvTimingHistosUsingDb::" << __func__ << "]"
243  << " Invalid PLL delay settings course/fine = "
244  << coarse << "/" << fine
245  << " for crate/FEC/ring/CCU/module "
246  << fec_path.fecCrate() << "/"
247  << fec_path.fecSlot() << "/"
248  << fec_path.fecRing() << "/"
249  << fec_path.ccuAddr() << "/"
250  << fec_path.ccuChan();
251  }
252 
253  }
254 
255  // Check if invalid settings were found
256  if ( !invalid.empty() ) {
257  std::stringstream ss;
258  ss << "[ApvTimingHistosUsingDb::" << __func__ << "]"
259  << " Found PLL coarse setting of >15"
260  << " (not allowed!) for "
261  << invalid.size()
262  << " channels";
263  ss << " (Example is crate/FEC/ring/CCU/module/LLD: "
264  << invalid.front().fecCrate() << "/"
265  << invalid.front().fecSlot() << "/"
266  << invalid.front().fecRing() << "/"
267  << invalid.front().ccuAddr() << "/"
268  << invalid.front().ccuChan() << "/"
269  << invalid.front().channel();
270  edm::LogWarning(mlDqmClient_) << ss.str();
271  return false;
272  }
273 
275  << "[ApvTimingHistosUsingDb::" << __func__ << "]"
276  << " Updated PLL settings for "
277  << updated << " modules";
278  return true;
279 
280 }
bool isDebugEnabled()
const uint16_t & fecRing() const
bool deviceIsPresent(const SiStripFecKey &)
static const char mlDqmClient_[]
const uint16_t & fecSlot() const
Utility class that identifies a position within the strip tracker control structure, down to the level of an APV25.
Definition: SiStripFecKey.h:45
static const uint16_t CHANS_PER_LLD
DeviceAddress deviceAddress(const deviceDescription &)
#define LogTrace(id)
const float & delay() const
const uint16_t & fecCrate() const
const uint16_t & ccuAddr() const
static const uint16_t invalid_
Definition: Constants.h:16
const uint16_t & ccuChan() const
SiStripConfigDb *const db() const
Analysis for timing run using APV tick marks.
void ApvTimingHistosUsingDb::update ( SiStripConfigDb::FedDescriptionsRange  feds)
private

Definition at line 284 of file ApvTimingHistosUsingDb.cc.

References ApvTimingAnalysis::base(), CommissioningHistosUsingDb::cabling(), FedChannelConnection::ccuAddr(), FedChannelConnection::ccuChan(), results_mgr::conn, CommissioningHistograms::data(), CommissioningHistosUsingDb::deviceIsPresent(), FedChannelConnection::fecCrate(), SiStripFedKey::feChan(), FedChannelConnection::fecRing(), FedChannelConnection::fecSlot(), FedChannelConnection::fedCh(), sistrip::FEDCH_PER_FED, SiStripFedKey::fedChannel(), SiStripFedCabling::fedConnection(), SiStripFedKey::fedId(), FedChannelConnection::fedId(), SiStripFedCabling::fedIds(), SiStripFedKey::feUnit(), spr::find(), ApvTimingAnalysis::frameFindingThreshold(), ApvTimingAnalysis::height(), sistrip::invalid_, ApvTimingAnalysis::isValid(), getDQMSummary::iter, SiStripKey::key(), FedChannelConnection::lldChannel(), sistrip::mlDqmClient_, ApvTimingAnalysis::peak(), ApvTimingAnalysis::print(), and contentValuesCheck::ss.

Referenced by progressbar.ProgressBar::__next__(), relval_steps.Matrix::__setitem__(), relval_steps.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), relval_steps.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

284  {
285 
286  // Retrieve FED ids from cabling
287  auto ids = cabling()->fedIds();
288 
289  // Iterate through feds and update fed descriptions
290  uint16_t updated = 0;
291  for ( auto ifed = feds.begin(); ifed != feds.end(); ++ifed ) {
292 
293  // If FED id not found in list (from cabling), then continue
294  if ( find( ids.begin(), ids.end(), (*ifed)->getFedId() ) == ids.end() ) { continue; }
295 
296  for ( uint16_t ichan = 0; ichan < sistrip::FEDCH_PER_FED; ichan++ ) {
297 
298  // Build FED and FEC keys
299  const FedChannelConnection& conn = cabling()->fedConnection( (*ifed)->getFedId(), ichan );
300  if ( conn.fecCrate() == sistrip::invalid_ ||
301  conn.fecSlot() == sistrip::invalid_ ||
302  conn.fecRing() == sistrip::invalid_ ||
303  conn.ccuAddr() == sistrip::invalid_ ||
304  conn.ccuChan() == sistrip::invalid_ ||
305  conn.lldChannel() == sistrip::invalid_ ) { continue; }
306  SiStripFedKey fed_key( conn.fedId(),
307  SiStripFedKey::feUnit( conn.fedCh() ),
308  SiStripFedKey::feChan( conn.fedCh() ) );
309  SiStripFecKey fec_key( conn.fecCrate(),
310  conn.fecSlot(),
311  conn.fecRing(),
312  conn.ccuAddr(),
313  conn.ccuChan(),
314  conn.lldChannel() );
315 
316  // Locate appropriate analysis object
317  Analyses::const_iterator iter = data().find( fec_key.key() );
318  if ( iter != data().end() ) {
319 
320  ApvTimingAnalysis* anal = dynamic_cast<ApvTimingAnalysis*>( iter->second );
321  if ( !anal ) {
323  << "[ApvTimingHistosUsingDb::" << __func__ << "]"
324  << " NULL pointer to analysis object!";
325  continue;
326  }
327 
328  // Update frame finding threshold
329  Fed9U::Fed9UAddress addr( ichan );
330  uint16_t old_threshold = static_cast<uint16_t>( (*ifed)->getFrameThreshold( addr ) );
331  if ( anal->isValid() ) {
332  (*ifed)->setFrameThreshold( addr, anal->frameFindingThreshold() );
333  updated++;
334  }
335  uint16_t new_threshold = static_cast<uint16_t>( (*ifed)->getFrameThreshold( addr ) );
336 
337  // Debug
338  std::stringstream ss;
339  ss << "[ApvTimingHistosUsingDb::" << __func__ << "]";
340  if ( anal->isValid() ) {
341  ss << " Updating the frame-finding threshold"
342  << " from " << old_threshold
343  << " to " << new_threshold
344  << " using tick mark base/peak/height "
345  << anal->base() << "/"
346  << anal->peak() << "/"
347  << anal->height();
348  } else {
349  ss << " Cannot update the frame-finding threshold"
350  << " from " << old_threshold
351  << " to a new value using invalid analysis ";
352  }
353  ss << " for crate/FEC/ring/CCU/module/LLD "
354  << fec_key.fecCrate() << "/"
355  << fec_key.fecSlot() << "/"
356  << fec_key.fecRing() << "/"
357  << fec_key.ccuAddr() << "/"
358  << fec_key.ccuChan()
359  << fec_key.channel()
360  << " and FED id/ch "
361  << fed_key.fedId() << "/"
362  << fed_key.fedChannel();
363  anal->print(ss);
364  //LogTrace(mlDqmClient_) << ss.str();
365 
366  } else {
367  if ( deviceIsPresent(fec_key) ) {
368  std::stringstream ss;
369  ss << "[ApvTimingHistosUsingDb::" << __func__ << "]"
370  << " Unable to find analysis object and update ticker thresholds"
371  << " for key/crate/FEC/ring/CCU/module/LLD "
372  << std::hex << std::setw(8) << std::setfill('0') << fec_key.key() << std::dec
373  << fec_key.fecCrate() << "/"
374  << fec_key.fecSlot() << "/"
375  << fec_key.fecRing() << "/"
376  << fec_key.ccuAddr() << "/"
377  << fec_key.ccuChan() << "/"
378  << fec_key.channel()
379  << " and FED key/id/ch "
380  << std::hex << std::setw(8) << std::setfill('0') << fed_key.key() << std::dec
381  << fed_key.fedId() << "/"
382  << fed_key.fedChannel();
383  edm::LogWarning(mlDqmClient_) << ss.str();
384  }
385  }
386  }
387  }
388 
390  << "[ApvTimingHistosUsingDb::" << __func__ << "]"
391  << " Updated ticker thresholds for " << updated
392  << " channels on " << ids.size() << " FEDs!";
393 
394 }
const uint16_t & fecSlot() const
const uint16_t & fecCrate() 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...
Definition: SiStripFedKey.h:56
const uint16_t & fedCh() const
bool deviceIsPresent(const SiStripFecKey &)
static const char mlDqmClient_[]
uint16_t lldChannel() const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
const uint16_t & fedId() const
const float & base() const
Utility class that identifies a position within the strip tracker control structure, down to the level of an APV25.
Definition: SiStripFecKey.h:45
const uint16_t & fecRing() const
Class containning control, module, detector and connection information, at the level of a FED channel...
FedsConstIterRange fedIds() const
const uint16_t & ccuChan() const
const float & peak() const
const uint16_t & ccuAddr() const
void print(std::stringstream &, uint32_t not_used=0)
uint16_t frameFindingThreshold() const
const uint16_t & feUnit() const
static const uint16_t invalid_
Definition: Constants.h:16
static const uint16_t FEDCH_PER_FED
const uint16_t & feChan() const
Analysis for timing run using APV tick marks.
SiStripFedCabling *const cabling() const
const float & height() const
tuple conn
Definition: results_mgr.py:53
void ApvTimingHistosUsingDb::uploadConfigurations ( )
virtual

Reimplemented from CommissioningHistosUsingDb.

Definition at line 50 of file ApvTimingHistosUsingDb.cc.

References CommissioningHistosUsingDb::db(), CommissioningHistosUsingDb::doUploadConf(), SiStripConfigDb::getDeviceDescriptions(), SiStripConfigDb::getFedDescriptions(), LogTrace, sistrip::mlDqmClient_, skipFecUpdate_, skipFedUpdate_, update(), alcaDQMUpload::upload(), SiStripConfigDb::uploadDeviceDescriptions(), and SiStripConfigDb::uploadFedDescriptions().

50  {
52  << "[ApvTimingHistosUsingDb::" << __func__ << "]";
53 
54  if ( !db() ) {
56  << "[ApvTimingHistosUsingDb::" << __func__ << "]"
57  << " NULL pointer to SiStripConfigDb interface!"
58  << " Aborting upload...";
59  return;
60  }
61 
62  if ( !skipFecUpdate_ ) {
63 
64  // Retrieve and update PLL device descriptions
66  bool upload = update( devices );
67 
68  // Check if new PLL settings are valid
69  if ( !upload ) {
71  << "[ApvTimingHistosUsingDb::" << __func__ << "]"
72  << " Found invalid PLL settings (coarse > 15)"
73  << " Aborting update to database...";
74  return;
75  }
76 
77  // Upload PLL device descriptions
78  if ( doUploadConf() ) {
80  << "[ApvTimingHistosUsingDb::" << __func__ << "]"
81  << " Uploading PLL settings to DB...";
84  << "[ApvTimingHistosUsingDb::" << __func__ << "]"
85  << " Upload of PLL settings to DB finished!";
86  } else {
88  << "[ApvTimingHistosUsingDb::" << __func__ << "]"
89  << " TEST only! No PLL settings will be uploaded to DB...";
90  }
91 
92  } else {
94  << "[ApvTimingHistosUsingDb::" << __func__ << "]"
95  << " No upload of PLL settings to DB, as defined by .cfg file!";
96  }
97 
98  if ( !skipFedUpdate_ ) {
99 
100  // Update FED descriptions with new ticker thresholds
102  update( feds );
103 
104  // Update FED descriptions with new ticker thresholds
105  if ( doUploadConf() ) {
107  << "[ApvTimingHistosUsingDb::" << __func__ << "]"
108  << " Uploading FED ticker thresholds to DB...";
111  << "[ApvTimingHistosUsingDb::" << __func__ << "]"
112  << " Upload of FED ticker thresholds to DB finished!";
113  } else {
115  << "[ApvTimingHistosUsingDb::" << __func__ << "]"
116  << " TEST only! No FED ticker thresholds will be uploaded to DB...";
117  }
118 
119  } else {
121  << "[ApvTimingHistosUsingDb::" << __func__ << "]"
122  << " No Upload of FED ticker thresholds to DB, as defined by .cfg file!";
123  }
124 
125 }
FedDescriptionsRange getFedDescriptions(std::string partition="")
FedDescriptions::range FedDescriptionsRange
static const char mlDqmClient_[]
bool update(SiStripConfigDb::DeviceDescriptionsRange)
DeviceDescriptions::range DeviceDescriptionsRange
#define LogTrace(id)
void uploadFedDescriptions(std::string partition="")
SiStripConfigDb *const db() const
DeviceDescriptionsRange getDeviceDescriptions(std::string partition="")
void uploadDeviceDescriptions(std::string partition="")

Member Data Documentation

bool ApvTimingHistosUsingDb::skipFecUpdate_
private

Definition at line 29 of file ApvTimingHistosUsingDb.h.

Referenced by ApvTimingHistosUsingDb(), and uploadConfigurations().

bool ApvTimingHistosUsingDb::skipFedUpdate_
private

Definition at line 31 of file ApvTimingHistosUsingDb.h.

Referenced by ApvTimingHistosUsingDb(), and uploadConfigurations().