CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
FineDelayHistosUsingDb Class Reference

#include <FineDelayHistosUsingDb.h>

Inheritance diagram for FineDelayHistosUsingDb:
CommissioningHistosUsingDb SamplingHistograms CommissioningHistograms CommissioningHistograms

Public Member Functions

void configure (const edm::ParameterSet &, const edm::EventSetup &) override
 
 FineDelayHistosUsingDb (const edm::ParameterSet &pset, DQMStore *, SiStripConfigDb *const)
 
void uploadConfigurations () override
 
 ~FineDelayHistosUsingDb () override
 
- 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 ()
 
 ~CommissioningHistosUsingDb () override
 
- 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, std::string partitionName="")
 
virtual ~CommissioningHistograms ()
 
- Public Member Functions inherited from SamplingHistograms
void histoAnalysis (bool debug) override
 
 SamplingHistograms (const edm::ParameterSet &pset, DQMStore *, const sistrip::RunType &task=sistrip::APV_LATENCY)
 
 ~SamplingHistograms () override
 

Private Member Functions

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

Private Attributes

bool cosmic_
 
std::map< unsigned int, float > delays_
 
const TrackerGeometrytracker_
 

Additional Inherited Members

- Public Types inherited from CommissioningHistograms
typedef std::map< uint32_t, CommissioningAnalysis * > Analyses
 
typedef Analyses::iterator Analysis
 
typedef dqm::harvesting::DQMStore DQMStore
 
typedef SummaryPlotFactory< CommissioningAnalysis * > Factory
 
typedef std::map< uint32_t, uint32_t > FedToFecMap
 
typedef std::vector< Histo * > Histos
 
typedef std::map< uint32_t, HistosHistosMap
 
typedef dqm::harvesting::MonitorElement MonitorElement
 
- Static Public Member Functions inherited from CommissioningHistograms
static void copyCustomInformation (DQMStore *const, 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 (bool getMaskedData=false)
 
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::unique_ptr< Factoryfactory_
 

Detailed Description

Definition at line 13 of file FineDelayHistosUsingDb.h.

Constructor & Destructor Documentation

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

Definition at line 23 of file FineDelayHistosUsingDb.cc.

References delays_, LogTrace, and sistrip::mlDqmClient_.

27  tracker_(nullptr) {
28  LogTrace(mlDqmClient_) << "[FineDelayHistosUsingDb::" << __func__ << "]"
29  << " Constructing object...";
30  delays_.clear();
31 }
T getParameter(std::string const &) const
SamplingHistograms(const edm::ParameterSet &pset, DQMStore *, const sistrip::RunType &task=sistrip::APV_LATENCY)
std::map< unsigned int, float > delays_
static const char mlDqmClient_[]
DQMStore *const bei() const
#define LogTrace(id)
const TrackerGeometry * tracker_
FineDelayHistosUsingDb::~FineDelayHistosUsingDb ( )
override

Definition at line 35 of file FineDelayHistosUsingDb.cc.

References LogTrace, and sistrip::mlDqmClient_.

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

Member Function Documentation

void FineDelayHistosUsingDb::computeDelays ( )
private

Definition at line 105 of file FineDelayHistosUsingDb.cc.

References HltBtagPostValidation_cff::c, CommissioningHistosUsingDb::cabling(), cosmic_, CommissioningHistograms::data(), delays_, relativeConstraints::empty, SiStripFedCabling::fedConnections(), SiStripFedCabling::fedIds(), photons_cff::ids, TrackerGeometry::idToDetUnit(), crabWrapper::key, PV3DBase< T, PVType, FrameType >::mag(), sistrip::mlDqmClient_, GeomDet::toLocal(), DetId::Tracker, tracker_, x, y, and z.

Referenced by update().

105  {
106  // do nothing if delays_ map is already filled
107  if (!delays_.empty())
108  return;
109 
110  // the point from which track should originate
111  float x = 0.;
112  float y = 0.;
113  float z = 0.;
114  if (cosmic_) {
115  y = 385.;
116  z = 20.;
117  } // mean entry point of cosmics
118  GlobalPoint referenceP_ = GlobalPoint(x, y, z);
119  const double c = 30; // cm/ns
120 
121  // the reference parameters (best delay in ns, initial Latency)
122  float bestDelay_ = 0.;
123  if (!data().empty()) {
124  Analyses::const_iterator iter = data().begin();
125  bestDelay_ = dynamic_cast<SamplingAnalysis*>(iter->second)->maximum();
126  }
127 
128  // Retrieve FED ids from cabling
129  auto ids = cabling()->fedIds();
130 
131  // loop over the FED ids
132  for (auto ifed = ids.begin(); ifed != ids.end(); ++ifed) {
133  auto conns = cabling()->fedConnections(*ifed);
134  // loop over the connections for that FED
135  for (auto iconn = conns.begin(); iconn != conns.end(); ++iconn) {
136  // check that this is a tracker module
137  if (DetId(iconn->detId()).det() != DetId::Tracker)
138  continue;
139  // retrieve the position of that module in the tracker using the geometry
140  // and use it to compute the distance to the reference point set in the configuration
141  if (tracker_) {
142  float dist = tracker_->idToDetUnit(DetId(iconn->detId()))->toLocal(referenceP_).mag();
143  float tof = dist / c;
144  // compute the PLL delay shift for the module as delay + tof
145  float delay = bestDelay_ + tof;
146  // store that in the map
148  iconn->fecCrate(), iconn->fecSlot(), iconn->fecRing(), iconn->ccuAddr(), iconn->ccuChan(), 0)
149  .key()] = delay;
150  edm::LogVerbatim(mlDqmClient_) << "[FineDelayHistosUsingDb::" << __func__
151  << "] Computed Delay to be added to PLL: " << bestDelay_ << " " << tof << " "
152  << delay << std::endl;
153  } else {
154  edm::LogError(mlDqmClient_) << "[FineDelayHistosUsingDb::" << __func__ << "]"
155  << " Tracker geometry not initialized. Impossible to compute the delays.";
156  }
157  }
158  }
159 }
Analysis for latency run.
Analyses & data(bool getMaskedData=false)
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
std::map< unsigned int, float > delays_
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:58
static const char mlDqmClient_[]
Utility class that identifies a position within the strip tracker control structure, down to the level of an APV25.
Definition: SiStripFecKey.h:45
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
T mag() const
Definition: PV3DBase.h:64
FedsConstIterRange fedIds() const
Definition: DetId.h:17
ConnsConstIterRange fedConnections(uint16_t fed_id) const
const TrackerGeometry * tracker_
SiStripFedCabling *const cabling() const
void FineDelayHistosUsingDb::configure ( const edm::ParameterSet pset,
const edm::EventSetup setup 
)
overridevirtual

Reimplemented from SamplingHistograms.

Definition at line 42 of file FineDelayHistosUsingDb.cc.

References SamplingHistograms::configure(), CommissioningHistosUsingDb::configure(), cosmic_, edm::EventSetup::get(), edm::ParameterSet::getParameter(), CommissioningHistograms::pset(), and tracker_.

42  {
44  // get geometry
46  setup.get<TrackerDigiGeometryRecord>().get(estracker);
47  tracker_ = &(*estracker);
48  SamplingHistograms::configure(pset, setup);
49  cosmic_ = this->pset().getParameter<bool>("cosmic");
50 }
T getParameter(std::string const &) const
const edm::ParameterSet & pset() const
void configure(const edm::ParameterSet &, const edm::EventSetup &) override
void configure(const edm::ParameterSet &, const edm::EventSetup &) override
const TrackerGeometry * tracker_
T get() const
Definition: EventSetup.h:73
void FineDelayHistosUsingDb::create ( SiStripConfigDb::AnalysisDescriptionsV desc,
Analysis  analysis 
)
overrideprivatevirtual

Reimplemented from CommissioningHistosUsingDb.

Definition at line 309 of file FineDelayHistosUsingDb.cc.

References conversion_template_cfg::anal, CommissioningHistosUsingDb::db(), SiStripConfigDb::dbParams(), SamplingAnalysis::error(), CommissioningAnalysis::fecKey(), CommissioningAnalysis::fedKey(), CommissioningAnalysis::getErrorCodes(), CommissioningAnalysis::isValid(), SamplingAnalysis::maximum(), SiStripDbParams::partitions(), and createJobs::tmp.

309  {
310  SamplingAnalysis* anal = dynamic_cast<SamplingAnalysis*>(analysis->second);
311  if (!anal) {
312  return;
313  }
314 
315  SiStripFecKey fec_key(anal->fecKey()); //@@ analysis->first
316  SiStripFedKey fed_key(anal->fedKey());
317 
318  FineDelayAnalysisDescription* tmp;
319  tmp = new FineDelayAnalysisDescription(anal->maximum(),
320  anal->error(),
321  0,
322  0,
323  0,
324  0,
325  0,
326  0,
327  db()->dbParams().partitions().begin()->second.partitionName(),
328  db()->dbParams().partitions().begin()->second.runNumber(),
329  anal->isValid(),
330  "",
331  fed_key.fedId(),
332  fed_key.feUnit(),
333  fed_key.feChan(),
334  fed_key.fedApv());
335 
336  // Add comments
337  typedef std::vector<std::string> Strings;
338  Strings errors = anal->getErrorCodes();
339  Strings::const_iterator istr = errors.begin();
340  Strings::const_iterator jstr = errors.end();
341  for (; istr != jstr; ++istr) {
342  tmp->addComments(*istr);
343  }
344 
345  // Store description
346  desc.push_back(tmp);
347 }
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
const_iterator_range partitions() const
const float & error() const
const uint32_t & fecKey() const
const SiStripDbParams & dbParams() const
const float & maximum() const
Definition: errors.py:1
SiStripConfigDb *const db() const
tmp
align.sh
Definition: createJobs.py:716
const VString & getErrorCodes() const
bool FineDelayHistosUsingDb::update ( SiStripConfigDb::DeviceDescriptionsRange  devices)
private

Definition at line 163 of file FineDelayHistosUsingDb.cc.

References generateTowerEtThresholdLUT::addr, SiStripFecKey::ccuAddr(), SiStripConfigDb::DeviceAddress::ccuAddr_, SiStripFecKey::ccuChan(), SiStripConfigDb::DeviceAddress::ccuChan_, computeDelays(), CommissioningHistosUsingDb::db(), delays_, SiStripConfigDb::deviceAddress(), SiStripFecKey::fecCrate(), SiStripConfigDb::DeviceAddress::fecCrate_, SiStripFecKey::fecRing(), SiStripConfigDb::DeviceAddress::fecRing_, SiStripFecKey::fecSlot(), SiStripConfigDb::DeviceAddress::fecSlot_, createfilelist::int, invalid, sistrip::invalid_, SiStripKey::key(), LogTrace, sistrip::mlDqmClient_, and contentValuesCheck::ss.

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.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(), dqm-mbProfile.Profile::finish(), 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(), MatrixUtil.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().

163  {
164  // do the core computation of delays per FED connection
165  computeDelays();
166 
167  // Iterate through devices and update device descriptions
168  uint16_t updated = 0;
169  std::vector<SiStripFecKey> invalid;
170  SiStripConfigDb::DeviceDescriptionsV::const_iterator idevice;
171  for (idevice = devices.begin(); idevice != devices.end(); idevice++) {
172  // Check device type
173  if ((*idevice)->getDeviceType() != PLL) {
174  continue;
175  }
176 
177  // Cast to retrieve appropriate description object
178  pllDescription* desc = dynamic_cast<pllDescription*>(*idevice);
179  if (!desc) {
180  continue;
181  }
182 
183  // Retrieve device addresses from device description
185 
186  // Construct key from device description
187  uint32_t fec_key =
188  SiStripFecKey(addr.fecCrate_, addr.fecSlot_, addr.fecRing_, addr.ccuAddr_, addr.ccuChan_, 0).key();
189  SiStripFecKey fec_path = SiStripFecKey(fec_key);
190 
191  // extract the delay from the map
192  float delay = desc->getDelayCoarse() * 25 + desc->getDelayFine() * 25. / 24. + delays_[fec_key];
193  int delayCoarse = int(delay / 25);
194  int delayFine = int(round((delay - 25 * delayCoarse) * 24. / 25.));
195  if (delayFine == 24) {
196  delayFine = 0;
197  ++delayCoarse;
198  }
199  // maximum coarse setting
200  if (delayCoarse > 15) {
201  invalid.push_back(fec_key);
202  delayCoarse = sistrip::invalid_;
203  }
204 
205  // Update PLL settings
206  if (delayCoarse != sistrip::invalid_ && delayFine != sistrip::invalid_) {
207  std::stringstream ss;
208  ss << "[FineDelayHistosUsingDb::" << __func__ << "]"
209  << " Updating coarse/fine PLL settings"
210  << " for Crate/FEC/slot/ring/CCU " << fec_path.fecCrate() << "/" << fec_path.fecSlot() << "/"
211  << fec_path.fecRing() << "/" << fec_path.ccuAddr() << "/" << fec_path.ccuChan() << " from "
212  << static_cast<uint16_t>(desc->getDelayCoarse()) << "/" << static_cast<uint16_t>(desc->getDelayFine());
213  desc->setDelayCoarse(delayCoarse);
214  desc->setDelayFine(delayFine);
215  updated++;
216  ss << " to " << static_cast<uint16_t>(desc->getDelayCoarse()) << "/"
217  << static_cast<uint16_t>(desc->getDelayFine());
218  LogTrace(mlDqmClient_) << ss.str();
219 
220  } else {
221  LogTrace(mlDqmClient_) << "[FineDelayHistosUsingDb::" << __func__ << "]"
222  << " Unexpected PLL delay settings for Crate/FEC/slot/ring/CCU " << fec_path.fecCrate()
223  << "/" << fec_path.fecSlot() << "/" << fec_path.fecRing() << "/" << fec_path.ccuAddr()
224  << "/" << fec_path.ccuChan();
225  }
226  }
227 
228  // Check if invalid settings were found
229  if (!invalid.empty()) {
230  std::stringstream ss;
231  ss << "[FineDelayHistosUsingDb::" << __func__ << "]"
232  << " Found PLL coarse setting of 15"
233  << " (not allowed!) for following channels"
234  << " (Crate/FEC/slot/ring/CCU/LLD): ";
235  std::vector<SiStripFecKey>::iterator ikey = invalid.begin();
236  std::vector<SiStripFecKey>::iterator jkey = invalid.end();
237  for (; ikey != jkey; ++ikey) {
238  ss << ikey->fecCrate() << "/" << ikey->fecSlot() << "/" << ikey->fecRing() << "/" << ikey->ccuAddr() << "/"
239  << ikey->ccuChan() << ", ";
240  }
241  edm::LogWarning(mlDqmClient_) << ss.str();
242  return false;
243  }
244 
245  edm::LogVerbatim(mlDqmClient_) << "[FineDelayHistosUsingDb::" << __func__ << "]"
246  << " Updated PLL settings for " << updated << " modules";
247  return true;
248 }
const uint16_t & fecRing() const
std::map< unsigned int, float > delays_
static const char mlDqmClient_[]
const uint16_t & fecSlot() const
const uint32_t & key() const
Definition: SiStripKey.h:120
Utility class that identifies a position within the strip tracker control structure, down to the level of an APV25.
Definition: SiStripFecKey.h:45
DeviceAddress deviceAddress(const deviceDescription &)
#define LogTrace(id)
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
void FineDelayHistosUsingDb::update ( SiStripConfigDb::FedDescriptionsRange  feds)
private

Definition at line 252 of file FineDelayHistosUsingDb.cc.

References CommissioningHistosUsingDb::cabling(), computeDelays(), delays_, SiStripFedCabling::fedConnections(), SiStripFedCabling::fedIds(), spr::find(), photons_cff::ids, createfilelist::int, crabWrapper::key, LogTrace, sistrip::mlDqmClient_, contentValuesCheck::ss, and DetId::Tracker.

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.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(), dqm-mbProfile.Profile::finish(), 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(), MatrixUtil.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().

252  {
253  // do the core computation of delays per FED connection
254  computeDelays();
255 
256  // Retrieve FED ids from cabling
257  auto ids = cabling()->fedIds();
258 
259  // loop over the FED ids
260  for (SiStripConfigDb::FedDescriptionsV::const_iterator ifed = feds.begin(); ifed != feds.end(); ifed++) {
261  // If FED id not found in list (from cabling), then continue
262  if (find(ids.begin(), ids.end(), (*ifed)->getFedId()) == ids.end()) {
263  continue;
264  }
265  auto conns = cabling()->fedConnections((*ifed)->getFedId());
266  // loop over the connections for that FED
267  for (auto iconn = conns.begin(); iconn != conns.end(); iconn++) {
268  // check that this is a tracker module
269  if (DetId(iconn->detId()).det() != DetId::Tracker)
270  continue;
271  // build the Fed9UAddress for that channel. Used to update the description.
272  Fed9U::Fed9UAddress fedChannel = Fed9U::Fed9UAddress(iconn->fedCh());
273  // retreive the current value for the delays
274  int fedDelayCoarse = (*ifed)->getCoarseDelay(fedChannel);
275  int fedDelayFine = (*ifed)->getFineDelay(fedChannel);
276  int fedDelay = int(fedDelayCoarse * 25. - fedDelayFine * 24. / 25.);
277  // extract the delay from the map
278  int delay = int(round(
280  iconn->fecCrate(), iconn->fecSlot(), iconn->fecRing(), iconn->ccuAddr(), iconn->ccuChan(), 0)
281  .key()]));
282  // compute the FED delay
283  // this is done by substracting the best (PLL) delay to the present value (from the db)
284  fedDelay -= delay;
285  fedDelayCoarse = (fedDelay / 25) + 1;
286  fedDelayFine = fedDelayCoarse * 25 - fedDelay;
287  if (fedDelayFine == 25) {
288  fedDelayFine = 0;
289  --fedDelayCoarse;
290  }
291  // update the FED delay
292  std::stringstream ss;
293  ss << "[FineDelayHistosUsingDb::" << __func__ << "]"
294  << " Updating the FED delay"
295  << " for loop FED id/ch " << (*ifed)->getFedId() << "/" << iconn->fedCh() << " from "
296  << (*ifed)->getCoarseDelay(fedChannel) << "/" << (*ifed)->getFineDelay(fedChannel) << " to ";
297  (*ifed)->setDelay(fedChannel, fedDelayCoarse, fedDelayFine);
298  ss << (*ifed)->getCoarseDelay(fedChannel) << "/" << (*ifed)->getFineDelay(fedChannel) << std::endl;
299  LogTrace(mlDqmClient_) << ss.str();
300  }
301  }
302 
303  edm::LogVerbatim(mlDqmClient_) << "[FineDelayHistosUsingDb::" << __func__ << "]"
304  << " Updated FED delay for " << ids.size() << " FEDs!";
305 }
std::map< unsigned int, float > delays_
static const char mlDqmClient_[]
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
Utility class that identifies a position within the strip tracker control structure, down to the level of an APV25.
Definition: SiStripFecKey.h:45
FedsConstIterRange fedIds() const
#define LogTrace(id)
Definition: DetId.h:17
ConnsConstIterRange fedConnections(uint16_t fed_id) const
SiStripFedCabling *const cabling() const
void FineDelayHistosUsingDb::uploadConfigurations ( )
overridevirtual

Reimplemented from CommissioningHistosUsingDb.

Definition at line 54 of file FineDelayHistosUsingDb.cc.

References SiStripConfigDb::clearDeviceDescriptions(), SiStripConfigDb::clearFedDescriptions(), CommissioningHistosUsingDb::db(), CommissioningHistosUsingDb::doUploadConf(), l1tstage2emulator_dqm_sourceclient-live_cfg::feds, SiStripConfigDb::getDeviceDescriptions(), SiStripConfigDb::getFedDescriptions(), LogTrace, sistrip::mlDqmClient_, update(), alcaDQMUpload::upload(), SiStripConfigDb::uploadDeviceDescriptions(), and SiStripConfigDb::uploadFedDescriptions().

54  {
55  if (!db()) {
56  edm::LogWarning(mlDqmClient_) << "[FineDelayHistosUsingDb::" << __func__ << "]"
57  << " NULL pointer to SiStripConfigDb interface!"
58  << " Aborting upload...";
59  return;
60  }
61 
62  // Retrieve and update PLL device descriptions
65  bool upload = update(devices);
66 
67  // Check if new PLL settings are valid
68  if (!upload) {
69  edm::LogWarning(mlDqmClient_) << "[FineDelayHistosUsingDb::" << __func__ << "]"
70  << " Found invalid PLL settings (coarse > 15)"
71  << " Aborting update to database...";
72  return;
73  }
74 
75  // Upload PLL device descriptions
76  if (doUploadConf()) {
77  LogTrace(mlDqmClient_) << "[FineDelayHistosUsingDb::" << __func__ << "]"
78  << " Uploading PLL settings to DB...";
80  LogTrace(mlDqmClient_) << "[FineDelayHistosUsingDb::" << __func__ << "]"
81  << " Upload of PLL settings to DB finished!";
82  } else {
83  edm::LogWarning(mlDqmClient_) << "[FineDelayHistosUsingDb::" << __func__ << "]"
84  << " TEST only! No PLL settings will be uploaded to DB...";
85  }
86 
87  // Update FED descriptions with new ticker thresholds
90  update(feds);
91 
92  // Update FED descriptions with new ticker thresholds
93  if (doUploadConf()) {
94  LogTrace(mlDqmClient_) << "[FineDelayHistosUsingDb::" << __func__ << "]"
95  << " Uploading FED ticker thresholds to DB...";
97  LogTrace(mlDqmClient_) << "[FineDelayHistosUsingDb::" << __func__ << "]"
98  << " Upload of FED ticker thresholds to DB finished!";
99  } else {
100  edm::LogWarning(mlDqmClient_) << "[FineDelayHistosUsingDb::" << __func__ << "]"
101  << " TEST only! No FED ticker thresholds will be uploaded to DB...";
102  }
103 }
def upload(url, args, files)
FedDescriptionsRange getFedDescriptions(std::string partition="")
FedDescriptions::range FedDescriptionsRange
static const char mlDqmClient_[]
void clearDeviceDescriptions(std::string partition="")
DeviceDescriptions::range DeviceDescriptionsRange
#define LogTrace(id)
bool update(SiStripConfigDb::DeviceDescriptionsRange)
void uploadFedDescriptions(std::string partition="")
SiStripConfigDb *const db() const
void clearFedDescriptions(std::string partition="")
DeviceDescriptionsRange getDeviceDescriptions(std::string partition="")
void uploadDeviceDescriptions(std::string partition="")

Member Data Documentation

bool FineDelayHistosUsingDb::cosmic_
private

Definition at line 36 of file FineDelayHistosUsingDb.h.

Referenced by computeDelays(), and configure().

std::map<unsigned int, float> FineDelayHistosUsingDb::delays_
private

Definition at line 32 of file FineDelayHistosUsingDb.h.

Referenced by computeDelays(), FineDelayHistosUsingDb(), and update().

const TrackerGeometry* FineDelayHistosUsingDb::tracker_
private

Definition at line 34 of file FineDelayHistosUsingDb.h.

Referenced by computeDelays(), and configure().