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
LatencyHistosUsingDb Class Reference

#include <LatencyHistosUsingDb.h>

Inheritance diagram for LatencyHistosUsingDb:
CommissioningHistosUsingDb SamplingHistograms CommissioningHistograms CommissioningHistograms

Public Member Functions

virtual void configure (const edm::ParameterSet &, const edm::EventSetup &)
 
 LatencyHistosUsingDb (const edm::ParameterSet &pset, DQMStore *, SiStripConfigDb *const )
 
virtual void uploadConfigurations ()
 
virtual ~LatencyHistosUsingDb ()
 
- 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 ()
 
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 SamplingHistograms
void histoAnalysis (bool debug)
 
 SamplingHistograms (const edm::ParameterSet &pset, DQMStore *, const sistrip::RunType &task=sistrip::APV_LATENCY)
 
virtual ~SamplingHistograms ()
 

Private Member Functions

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

Private Attributes

bool perPartition_
 

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 12 of file LatencyHistosUsingDb.h.

Constructor & Destructor Documentation

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

Definition at line 15 of file LatencyHistosUsingDb.cc.

References LogTrace, and sistrip::mlDqmClient_.

18  : CommissioningHistograms( pset.getParameter<edm::ParameterSet>("LatencyParameters"),
19  bei,
23  SamplingHistograms( pset.getParameter<edm::ParameterSet>("LatencyParameters"),
24  bei,
26 {
28  << "[LatencyHistosUsingDb::" << __func__ << "]"
29  << " Constructing object...";
30 }
T getParameter(std::string const &) const
SamplingHistograms(const edm::ParameterSet &pset, DQMStore *, const sistrip::RunType &task=sistrip::APV_LATENCY)
static const char mlDqmClient_[]
#define LogTrace(id)
DQMStore *const bei() const
LatencyHistosUsingDb::~LatencyHistosUsingDb ( )
virtual

Definition at line 34 of file LatencyHistosUsingDb.cc.

References LogTrace, and sistrip::mlDqmClient_.

34  {
36  << "[LatencyHistosUsingDb::" << __func__ << "]"
37  << " Destructing object...";
38 }
static const char mlDqmClient_[]
#define LogTrace(id)

Member Function Documentation

void LatencyHistosUsingDb::configure ( const edm::ParameterSet pset,
const edm::EventSetup es 
)
virtual

Reimplemented from SamplingHistograms.

Definition at line 378 of file LatencyHistosUsingDb.cc.

References edm::ParameterSet::getParameter(), perPartition_, and CommissioningHistograms::pset().

379 {
380  perPartition_ = this->pset().getParameter<bool>("OptimizePerPartition");
381 }
T getParameter(std::string const &) const
const edm::ParameterSet & pset() const
void LatencyHistosUsingDb::create ( SiStripConfigDb::AnalysisDescriptionsV desc,
Analysis  analysis 
)
privatevirtual

Reimplemented from CommissioningHistosUsingDb.

Definition at line 338 of file LatencyHistosUsingDb.cc.

References begin, CommissioningHistosUsingDb::db(), SiStripConfigDb::dbParams(), benchmark_cfg::errors, CommissioningAnalysis::fecKey(), CommissioningAnalysis::fedKey(), CommissioningAnalysis::getErrorCodes(), CommissioningAnalysis::isValid(), SamplingAnalysis::maximum(), SiStripDbParams::partitions(), edm::second(), and tmp.

339  {
340 
341  SamplingAnalysis* anal = dynamic_cast<SamplingAnalysis*>( analysis->second );
342  if ( !anal ) { return; }
343 
344  SiStripFecKey fec_key( anal->fecKey() ); //@@ analysis->first
345  SiStripFedKey fed_key( anal->fedKey() );
346 
347  uint16_t latency = static_cast<uint16_t>( ( anal->maximum() / (-25.) ) + 0.5 );
348 
349  ApvLatencyAnalysisDescription* tmp;
350  tmp = new ApvLatencyAnalysisDescription( latency,
351  0,
352  0,
353  0,
354  0,
355  0,
356  0,
357  db()->dbParams().partitions().begin()->second.partitionName(),
358  db()->dbParams().partitions().begin()->second.runNumber(),
359  anal->isValid(),
360  "",
361  fed_key.fedId(),
362  fed_key.feUnit(),
363  fed_key.feChan(),
364  fed_key.fedApv() );
365 
366  // Add comments
367  typedef std::vector<std::string> Strings;
368  Strings errors = anal->getErrorCodes();
369  Strings::const_iterator istr = errors.begin();
370  Strings::const_iterator jstr = errors.end();
371  for ( ; istr != jstr; ++istr ) { tmp->addComments( *istr ); }
372 
373  // Store description
374  desc.push_back( tmp );
375 
376 }
Analysis for latency run.
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
virtual bool isValid() const
std::vector< std::string > Strings
Definition: MsgTools.h:18
Utility class that identifies a position within the strip tracker control structure, down to the level of an APV25.
Definition: SiStripFecKey.h:45
U second(std::pair< T, U > const &p)
const_iterator_range partitions() const
const uint32_t & fecKey() const
const SiStripDbParams & dbParams() const
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
#define begin
Definition: vmac.h:30
const float & maximum() const
SiStripConfigDb *const db() const
const VString & getErrorCodes() const
bool LatencyHistosUsingDb::update ( SiStripConfigDb::DeviceDescriptionsRange  devices,
SiStripConfigDb::FedDescriptionsRange  feds 
)
private

Definition at line 91 of file LatencyHistosUsingDb.cc.

References begin, CommissioningHistosUsingDb::cabling(), SiStripFecKey::ccuAddr(), SiStripConfigDb::DeviceAddress::ccuAddr_, SiStripFecKey::ccuChan(), SiStripConfigDb::DeviceAddress::ccuChan_, CommissioningHistograms::data(), CommissioningHistosUsingDb::db(), SiStripConfigDb::deviceAddress(), SiStripFecKey::fecCrate(), SiStripConfigDb::DeviceAddress::fecCrate_, CommissioningAnalysis::fecKey(), SiStripFecKey::fecRing(), SiStripConfigDb::DeviceAddress::fecRing_, SiStripFecKey::fecSlot(), SiStripConfigDb::DeviceAddress::fecSlot_, SiStripFedCabling::fedConnections(), SiStripFedCabling::fedIds(), spr::find(), i, SiStripConfigDb::DeviceAddress::i2cAddr_, align::invalid, sistrip::invalid_, SiStripKey::key(), LogTrace, MAXFEDCOARSE, SamplingAnalysis::maximum(), sistrip::mlDqmClient_, NULL, hltrates_dqm_sourceclient-live_cfg::offset, sistrip::PARTITION, perPartition_, edm::second(), edm::shift, findQualityFiles::size, contentValuesCheck::ss, DetId::Tracker, and sistrip::TRACKER.

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().

92  {
93 
94  // Obtain the latency from the analysis object
95  if(!data().size() || !data().begin()->second->isValid() ) {
97  << "[LatencyHistosUsingDb::" << __func__ << "]"
98  << " Updated NO Latency settings. No analysis result available !" ;
99  return false;
100  }
101 
102  // Compute the minimum coarse delay
103  uint16_t minCoarseDelay = 256;
104  SiStripConfigDb::DeviceDescriptionsV::const_iterator idevice;
105  for ( idevice = devices.begin(); idevice != devices.end(); idevice++ ) {
106  // Check device type
107  if ( (*idevice)->getDeviceType() == PLL ) {
108  // Cast to retrieve appropriate description object
109  pllDescription* desc = dynamic_cast<pllDescription*>( *idevice );
110  if ( desc ) {
111 /*
112  // add 1 to aim at 1 and not 0 (just to avoid a special 0 value for security)
113  int delayCoarse = desc->getDelayCoarse() - 1;
114  delayCoarse = delayCoarse < 0 ? 0 : delayCoarse;
115  minCoarseDelay = minCoarseDelay < delayCoarse ? minCoarseDelay : delayCoarse;
116 */
117  int delayCoarse = desc->getDelayCoarse();
118  minCoarseDelay = minCoarseDelay < delayCoarse ? minCoarseDelay : delayCoarse;
119  }
120  }
121  }
122 
123  // Compute latency and PLL shift from the sampling measurement
124  SamplingAnalysis* anal = NULL;
125  for( CommissioningHistograms::Analysis it = data().begin(); it!=data().end();++it) {
126  if(dynamic_cast<SamplingAnalysis*>( it->second ) &&
127  dynamic_cast<SamplingAnalysis*>( it->second )->granularity()==sistrip::TRACKER)
128  anal = dynamic_cast<SamplingAnalysis*>( it->second );
129  }
130  if(!anal) return false;
131  uint16_t globalLatency = uint16_t(ceil(anal->maximum()/(-25.)));
132  float globalShift = anal->maximum()-(globalLatency*(-25));
133 
134  // Compute latency and PLL shift per partition... this is an option
135  uint16_t latency = globalLatency;
136  float shift[5] = {0.};
137  for( CommissioningHistograms::Analysis it = data().begin(); it!=data().end();++it) {
138  if(dynamic_cast<SamplingAnalysis*>( it->second ) &&
139  dynamic_cast<SamplingAnalysis*>( it->second )->granularity()==sistrip::PARTITION )
140  anal = dynamic_cast<SamplingAnalysis*>( it->second );
141  latency = uint16_t(ceil(anal->maximum()/(-25.)))>latency ? uint16_t(ceil(anal->maximum()/(-25.))) : latency;
142  }
143  for( CommissioningHistograms::Analysis it = data().begin(); it!=data().end();++it) {
144  if(dynamic_cast<SamplingAnalysis*>( it->second ) &&
145  dynamic_cast<SamplingAnalysis*>( it->second )->granularity()==sistrip::PARTITION )
146  anal = dynamic_cast<SamplingAnalysis*>( it->second );
147  shift[SiStripFecKey(anal->fecKey()).fecCrate()] = anal->maximum()-(latency*(-25));
148  }
149  if(!perPartition_) {
150  latency = globalLatency;
151  for(int i=0;i<5;i++) shift[i] = globalShift;
152  }
153 
154  // Take into account the minimum coarse delay to bring the coarse delay down
155  // the same quantity is subtracted to the coarse delay of each APV
156  latency -= minCoarseDelay;
157 
158  // Iterate through devices and update device descriptions
159  uint16_t updatedAPV = 0;
160  uint16_t updatedPLL = 0;
161  std::vector<SiStripFecKey> invalid;
162  for ( idevice = devices.begin(); idevice != devices.end(); idevice++ ) {
163  // Check device type
164  if ( (*idevice)->getDeviceType() != APV25 ) { continue; }
165  // Cast to retrieve appropriate description object
166  apvDescription* desc = dynamic_cast<apvDescription*>( *idevice );
167  if ( !desc ) { continue; }
168  // Retrieve device addresses from device description
169  const SiStripConfigDb::DeviceAddress& addr = db()->deviceAddress(*desc);
170  // Do it!
171  std::stringstream ss;
172  ss << "[LatencyHistosUsingDb::" << __func__ << "]"
173  << " Updating latency APV settings for crate/FEC/slot/ring/CCU/i2cAddr "
174  << addr.fecCrate_ << "/"
175  << addr.fecSlot_ << "/"
176  << addr.fecRing_ << "/"
177  << addr.ccuAddr_ << "/"
178  << addr.ccuChan_ << "/"
179  << addr.i2cAddr_
180  << " from "
181  << static_cast<uint16_t>(desc->getLatency());
182  desc->setLatency(latency);
183  ss << " to "
184  << static_cast<uint16_t>(desc->getLatency());
185  LogTrace(mlDqmClient_) << ss.str();
186  updatedAPV++;
187  }
188 
189  // Change also the PLL delay
190  for ( idevice = devices.begin(); idevice != devices.end(); idevice++ ) {
191  // Check device type
192  if ( (*idevice)->getDeviceType() != PLL ) { continue; }
193  // Cast to retrieve appropriate description object
194  pllDescription* desc = dynamic_cast<pllDescription*>( *idevice );
195  if ( !desc ) { continue; }
196  if ( desc->getDelayCoarse() >= 15 ) { continue; }
197  // Retrieve device addresses from device description
198  const SiStripConfigDb::DeviceAddress& addr = db()->deviceAddress(*desc);
199  // Construct key from device description
200  uint32_t fec_key = SiStripFecKey( addr.fecCrate_,
201  addr.fecSlot_,
202  addr.fecRing_,
203  addr.ccuAddr_,
204  addr.ccuChan_,
205  0 ).key();
206  SiStripFecKey fec_path = SiStripFecKey( fec_key );
207  // Do it!
208  float delay = desc->getDelayCoarse()*25+desc->getDelayFine()*25./24. + shift[addr.fecCrate_];
209  int delayCoarse = int(delay/25);
210  int delayFine = int(round((delay-25*delayCoarse)*24./25.));
211  if(delayFine==24) { delayFine=0; ++delayCoarse; }
212  delayCoarse -= minCoarseDelay;
213  // maximum coarse setting
214  if ( delayCoarse > 15 ) { invalid.push_back(fec_key); delayCoarse = sistrip::invalid_; }
215  // Update PLL settings
216  if ( delayCoarse != sistrip::invalid_ &&
217  delayFine != sistrip::invalid_ ) {
218  std::stringstream ss;
219  ss << "[LatencyHistosUsingDb::" << __func__ << "]"
220  << " Updating coarse/fine PLL settings"
221  << " for Crate/FEC/slot/ring/CCU "
222  << fec_path.fecCrate() << "/"
223  << fec_path.fecSlot() << "/"
224  << fec_path.fecRing() << "/"
225  << fec_path.ccuAddr() << "/"
226  << fec_path.ccuChan()
227  << " from "
228  << static_cast<uint16_t>( desc->getDelayCoarse() ) << "/"
229  << static_cast<uint16_t>( desc->getDelayFine() );
230  desc->setDelayCoarse(delayCoarse);
231  desc->setDelayFine(delayFine);
232  updatedPLL++;
233  ss << " to "
234  << static_cast<uint16_t>( desc->getDelayCoarse() ) << "/"
235  << static_cast<uint16_t>( desc->getDelayFine() );
236  LogTrace(mlDqmClient_) << ss.str();
237  }
238  }
239 
240  // Retrieve FED ids from cabling
241  auto ids = cabling()->fedIds() ;
242 
243  // loop over the FED ids to determine min and max values of coarse delay
244  uint16_t minDelay = 256;
245  uint16_t maxDelay = 0;
246  uint16_t fedDelayCoarse = 0;
247  for ( auto ifed = feds.begin(); ifed != feds.end(); ifed++ ) {
248  // If FED id not found in list (from cabling), then continue
249  if ( find( ids.begin(), ids.end(), (*ifed)->getFedId() ) == ids.end() ) { continue; }
250  auto conns = cabling()->fedConnections((*ifed)->getFedId());
251  // loop over the connections for that FED
252  for ( auto iconn = conns.begin(); iconn != conns.end(); iconn++ ) {
253  // check that this is a tracker module
254  if(DetId(iconn->detId()).det()!=DetId::Tracker) continue;
255  // build the Fed9UAddress for that channel. Used to update the description.
256  Fed9U::Fed9UAddress fedChannel = Fed9U::Fed9UAddress(iconn->fedCh());
257  // retreive the current value for the delays
258  fedDelayCoarse = (*ifed)->getCoarseDelay(fedChannel);
259  // update min and max
260  minDelay = minDelay<fedDelayCoarse ? minDelay : fedDelayCoarse;
261  maxDelay = maxDelay>fedDelayCoarse ? maxDelay : fedDelayCoarse;
262  }
263  }
264 
265  // compute the FED coarse global offset
266  int offset = (10-minDelay)*25; // try to ensure 10BX room for later fine delay scan
267  if(maxDelay+(offset/25)>MAXFEDCOARSE) offset = (MAXFEDCOARSE-maxDelay)*25; // otherwise, take the largest possible
268 
269  // loop over the FED ids
270  for ( SiStripConfigDb::FedDescriptionsV::const_iterator ifed = feds.begin(); ifed != feds.end(); ifed++ ) {
271  // If FED id not found in list (from cabling), then continue
272  if ( find( ids.begin(), ids.end(), (*ifed)->getFedId() ) == ids.end() ) { continue; }
273  auto conns = cabling()->fedConnections((*ifed)->getFedId());
274  // loop over the connections for that FED
275  for ( auto iconn = conns.begin(); iconn != conns.end(); iconn++ ) {
276  // check that this is a tracker module
277  if(DetId(iconn->detId()).det()!=DetId::Tracker) continue;
278  // build the Fed9UAddress for that channel. Used to update the description.
279  Fed9U::Fed9UAddress fedChannel = Fed9U::Fed9UAddress(iconn->fedCh());
280  // retreive the current value for the delays
281  int fedDelayCoarse = (*ifed)->getCoarseDelay(fedChannel);
282  int fedDelayFine = (*ifed)->getFineDelay(fedChannel);
283  // compute the FED delay
284  // this is done by substracting the best (PLL) delay to the present value (from the db)
285  int fedDelay = int(fedDelayCoarse*25. - fedDelayFine*24./25. - round(shift[iconn->fecCrate()]) + offset);
286  fedDelayCoarse = (fedDelay/25)+1;
287  fedDelayFine = fedDelayCoarse*25-fedDelay;
288  if(fedDelayFine==25) { fedDelayFine = 0; --fedDelayCoarse; }
289  // update the FED delay
290  std::stringstream ss;
291  ss << "[LatencyHistosUsingDb::" << __func__ << "]"
292  << " Updating the FED delay"
293  << " for loop FED id/ch "
294  << (*ifed)->getFedId() << "/" << iconn->fedCh()
295  << " from "
296  << (*ifed)->getCoarseDelay( fedChannel) << "/" << (*ifed)->getFineDelay( fedChannel)
297  << " to ";
298  (*ifed)->setDelay(fedChannel, fedDelayCoarse, fedDelayFine);
299  ss << (*ifed)->getCoarseDelay(fedChannel) << "/" << (*ifed)->getFineDelay( fedChannel);
300  LogTrace(mlDqmClient_) << ss.str();
301  }
302  }
303 
304  // Summary output
306  << "[LatencyHistosUsingDb::" << __func__ << "]"
307  << " Updated FED delays for " << ids.size() << " FEDs!";
308 
309  // Check if invalid settings were found
310  if ( !invalid.empty() ) {
311  std::stringstream ss;
312  ss << "[LatencyHistosUsingDb::" << __func__ << "]"
313  << " Found PLL coarse setting of 15"
314  << " (not allowed!) for following channels"
315  << " (Crate/FEC/slot/ring/CCU/LLD): ";
316  std::vector<SiStripFecKey>::iterator ikey = invalid.begin();
317  std::vector<SiStripFecKey>::iterator jkey = invalid.end();
318  for ( ; ikey != jkey; ++ikey ) {
319  ss << ikey->fecCrate() << "/"
320  << ikey->fecSlot() << "/"
321  << ikey->fecRing() << "/"
322  << ikey->ccuAddr() << "/"
323  << ikey->ccuChan() << ", ";
324  }
325  edm::LogWarning(mlDqmClient_) << ss.str();
326  return false;
327  }
328 
329  // Summary output
331  << "[LatencyHistosUsingDb::" << __func__ << "] "
332  << "Updated settings for " << updatedAPV << " APV devices and " << updatedPLL << " PLL devices.";
333  return true;
334 }
int i
Definition: DBlmapReader.cc:9
Analysis for latency run.
const uint16_t & fecRing() const
static const char mlDqmClient_[]
#define NULL
Definition: scimark2.h:8
const uint16_t & fecSlot() const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
const uint32_t & key() const
Definition: SiStripKey.h:125
Utility class that identifies a position within the strip tracker control structure, down to the level of an APV25.
Definition: SiStripFecKey.h:45
U second(std::pair< T, U > const &p)
#define MAXFEDCOARSE
FedsConstIterRange fedIds() const
const uint32_t & fecKey() const
DeviceAddress deviceAddress(const deviceDescription &)
#define LogTrace(id)
const uint16_t & fecCrate() const
Definition: DetId.h:18
const uint16_t & ccuAddr() const
static const uint16_t invalid_
Definition: Constants.h:16
ConnsConstIterRange fedConnections(uint16_t fed_id) const
#define begin
Definition: vmac.h:30
static unsigned int const shift
const uint16_t & ccuChan() const
const float & maximum() const
SiStripConfigDb *const db() const
SiStripFedCabling *const cabling() const
tuple size
Write out results.
void LatencyHistosUsingDb::uploadConfigurations ( )
virtual

Reimplemented from CommissioningHistosUsingDb.

Definition at line 42 of file LatencyHistosUsingDb.cc.

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

42  {
43 
44  if ( !db() ) {
46  << "[LatencyHistosUsingDb::" << __func__ << "]"
47  << " NULL pointer to SiStripConfigDb interface!"
48  << " Aborting upload...";
49  return;
50  }
51 
54  bool upload = update( devices, feds );
55  // Check if new PLL settings are valid
56  if ( !upload ) {
58  << "[LatencyHistosUsingDb::" << __func__ << "]"
59  << " Found invalid PLL settings (coarse > 15)"
60  << " Aborting update to database...";
61  return;
62  }
63 
64  if ( doUploadConf() ) {
65  // Update APV descriptions with new Latency settings
67  << "[LatencyHistosUsingDb::" << __func__ << "]"
68  << " Uploading APV settings to DB...";
71  << "[LatencyHistosUsingDb::" << __func__ << "]"
72  << " Upload of APV settings to DB finished!";
73  // Update FED descriptions
75  << "[LatencyHistosUsingDb::" << __func__ << "]"
76  << " Uploading FED delays to DB...";
79  << "[LatencyHistosUsingDb::" << __func__ << "]"
80  << " Upload of FED delays to DB finished!";
81  } else {
83  << "[LatencyHistosUsingDb::" << __func__ << "]"
84  << " TEST only! No APV settings will be uploaded to DB...";
85  }
86 
87 }
FedDescriptionsRange getFedDescriptions(std::string partition="")
bool update(SiStripConfigDb::DeviceDescriptionsRange, SiStripConfigDb::FedDescriptionsRange)
FedDescriptions::range FedDescriptionsRange
static const char mlDqmClient_[]
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 LatencyHistosUsingDb::perPartition_
private

Definition at line 33 of file LatencyHistosUsingDb.h.

Referenced by configure(), and update().