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

#include <FineDelayHistosUsingDb.h>

Inheritance diagram for FineDelayHistosUsingDb:
CommissioningHistosUsingDb SamplingHistograms CommissioningHistograms CommissioningHistograms

Public Member Functions

virtual void configure (const edm::ParameterSet &, const edm::EventSetup &)
 
 FineDelayHistosUsingDb (const edm::ParameterSet &pset, DQMStore *, SiStripConfigDb *const )
 
virtual void uploadConfigurations ()
 
virtual ~FineDelayHistosUsingDb ()
 
- 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 computeDelays ()
 
void create (SiStripConfigDb::AnalysisDescriptionsV &, Analysis)
 
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 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 15 of file FineDelayHistosUsingDb.h.

Constructor & Destructor Documentation

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

Definition at line 24 of file FineDelayHistosUsingDb.cc.

References delays_, LogTrace, and sistrip::mlDqmClient_.

27  : CommissioningHistograms( pset.getParameter<edm::ParameterSet>("FineDelayParameters"),
28  bei,
32  SamplingHistograms( pset.getParameter<edm::ParameterSet>("FineDelayParameters"),
33  bei,
35  tracker_(0)
36 {
38  << "[FineDelayHistosUsingDb::" << __func__ << "]"
39  << " Constructing object...";
40  delays_.clear();
41 }
T getParameter(std::string const &) const
SamplingHistograms(const edm::ParameterSet &pset, DQMStore *, const sistrip::RunType &task=sistrip::APV_LATENCY)
static const char mlDqmClient_[]
std::map< unsigned int, float > delays_
#define LogTrace(id)
const TrackerGeometry * tracker_
FineDelayHistosUsingDb::~FineDelayHistosUsingDb ( )
virtual

Definition at line 45 of file FineDelayHistosUsingDb.cc.

References LogTrace, and sistrip::mlDqmClient_.

45  {
47  << "[FineDelayHistosUsingDb::" << __func__ << "]"
48  << " Destructing object...";
49 }
static const char mlDqmClient_[]
#define LogTrace(id)

Member Function Documentation

void FineDelayHistosUsingDb::computeDelays ( )
private

Definition at line 126 of file FineDelayHistosUsingDb.cc.

References trackerHits::c, CommissioningHistosUsingDb::cabling(), SiStripFedCabling::connections(), cosmic_, CommissioningHistograms::data(), delays_, SiStripFedCabling::feds(), TrackerGeometry::idToDetUnit(), combine::key, PV3DBase< T, PVType, FrameType >::mag(), sistrip::mlDqmClient_, findQualityFiles::size, GeomDet::toLocal(), DetId::Tracker, tracker_, x, detailsBasic3DVector::y, and detailsBasic3DVector::z.

Referenced by update().

126  {
127  // do nothing if delays_ map is already filled
128  if(delays_.size()>0) return;
129 
130  // the point from which track should originate
131  float x = 0.; float y = 0.; float z = 0.;
132  if(cosmic_) { y = 385.; z=20.; } // mean entry point of cosmics
133  GlobalPoint referenceP_ = GlobalPoint(x,y,z);
134  const double c = 30; // cm/ns
135 
136  // the reference parameters (best delay in ns, initial Latency)
137  float bestDelay_ = 0.;
138  if(data().size()) {
139  Analyses::const_iterator iter = data().begin();
140  bestDelay_ = dynamic_cast<SamplingAnalysis*>(iter->second)->maximum();
141  }
142 
143  // Retrieve FED ids from cabling
144  std::vector<uint16_t> ids = cabling()->feds() ;
145 
146  // loop over the FED ids
147  for (std::vector<uint16_t>::const_iterator ifed = ids.begin(); ifed != ids.end(); ++ifed) {
148  const std::vector<FedChannelConnection>& conns = cabling()->connections(*ifed);
149  // loop over the connections for that FED
150  for ( std::vector<FedChannelConnection>::const_iterator iconn = conns.begin(); iconn != conns.end(); iconn++ ) {
151  // check that this is a tracker module
152  if(DetId(iconn->detId()).det()!=DetId::Tracker) continue;
153  // retrieve the position of that module in the tracker using the geometry
154  // and use it to compute the distance to the reference point set in the configuration
155  if(tracker_) {
156  float dist = tracker_->idToDetUnit(DetId(iconn->detId()))->toLocal(referenceP_).mag();
157  float tof = dist/c ;
158  // compute the PLL delay shift for the module as delay + tof
159  float delay = bestDelay_+tof;
160  // store that in the map
161  delays_[SiStripFecKey( iconn->fecCrate(),
162  iconn->fecSlot(),
163  iconn->fecRing(),
164  iconn->ccuAddr(),
165  iconn->ccuChan(), 0 ).key()] = delay;
167  << "[FineDelayHistosUsingDb::" << __func__ << "] Computed Delay to be added to PLL: "
168  << bestDelay_ << " " << tof << " " << delay << std::endl;
169  } else {
171  << "[FineDelayHistosUsingDb::" << __func__ << "]"
172  << " Tracker geometry not initialized. Impossible to compute the delays.";
173  }
174  }
175  }
176 }
Analysis for latency run.
const std::vector< uint16_t > & feds() const
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:62
static const char mlDqmClient_[]
float float float z
Utility class that identifies a position within the strip tracker control structure, down to the level of an APV25.
Definition: SiStripFecKey.h:46
T mag() const
Definition: PV3DBase.h:67
std::map< unsigned int, float > delays_
Definition: DetId.h:20
virtual const GeomDetUnit * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
const TrackerGeometry * tracker_
list key
Definition: combine.py:13
Definition: DDAxes.h:10
SiStripFedCabling *const cabling() const
tuple size
Write out results.
const std::vector< FedChannelConnection > & connections(uint16_t fed_id) const
void FineDelayHistosUsingDb::configure ( const edm::ParameterSet pset,
const edm::EventSetup setup 
)
virtual

Reimplemented from SamplingHistograms.

Definition at line 53 of file FineDelayHistosUsingDb.cc.

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

54  {
55  // get geometry
57  setup.get<TrackerDigiGeometryRecord>().get(estracker);
58  tracker_=&(* estracker);
60  cosmic_ = this->pset().getParameter<bool>("cosmic");
61 }
T getParameter(std::string const &) const
const edm::ParameterSet & pset() const
const T & get() const
Definition: EventSetup.h:55
const TrackerGeometry * tracker_
virtual void configure(const edm::ParameterSet &, const edm::EventSetup &)
void FineDelayHistosUsingDb::create ( SiStripConfigDb::AnalysisDescriptionsV desc,
Analysis  analysis 
)
privatevirtual

Reimplemented from CommissioningHistosUsingDb.

Definition at line 342 of file FineDelayHistosUsingDb.cc.

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

343  {
344 
345  SamplingAnalysis* anal = dynamic_cast<SamplingAnalysis*>( analysis->second );
346  if ( !anal ) { return; }
347 
348  SiStripFecKey fec_key( anal->fecKey() ); //@@ analysis->first
349  SiStripFedKey fed_key( anal->fedKey() );
350 
351  FineDelayAnalysisDescription* tmp;
352  tmp = new FineDelayAnalysisDescription( anal->maximum(),
353  anal->error(),
354  0,
355  0,
356  0,
357  0,
358  0,
359  0,
360  db()->dbParams().partitions().begin()->second.partitionName(),
361  db()->dbParams().partitions().begin()->second.runNumber(),
362  anal->isValid(),
363  "",
364  fed_key.fedId(),
365  fed_key.feUnit(),
366  fed_key.feChan(),
367  fed_key.fedApv() );
368 
369  // Add comments
370  typedef std::vector<std::string> Strings;
371  Strings errors = anal->getErrorCodes();
372  Strings::const_iterator istr = errors.begin();
373  Strings::const_iterator jstr = errors.end();
374  for ( ; istr != jstr; ++istr ) { tmp->addComments( *istr ); }
375 
376  // Store description
377  desc.push_back( tmp );
378 
379 }
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:57
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:46
const_iterator_range partitions() const
const float & error() const
const uint32_t & fecKey() const
const SiStripDbParams & dbParams() const
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
const float & maximum() const
SiStripConfigDb *const db() const
const VString & getErrorCodes() const
bool FineDelayHistosUsingDb::update ( SiStripConfigDb::DeviceDescriptionsRange  devices)
private

Definition at line 180 of file FineDelayHistosUsingDb.cc.

References 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_, align::invalid, sistrip::invalid_, SiStripKey::key(), LogTrace, and sistrip::mlDqmClient_.

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

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

Definition at line 284 of file FineDelayHistosUsingDb.cc.

References CommissioningHistosUsingDb::cabling(), computeDelays(), SiStripFedCabling::connections(), delays_, SiStripFedCabling::feds(), spr::find(), combine::key, LogTrace, sistrip::mlDqmClient_, and DetId::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(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

284  {
285 
286  // do the core computation of delays per FED connection
287  computeDelays();
288 
289  // Retrieve FED ids from cabling
290  std::vector<uint16_t> ids = cabling()->feds() ;
291 
292  // loop over the FED ids
293  for ( SiStripConfigDb::FedDescriptionsV::const_iterator ifed = feds.begin(); ifed != feds.end(); ifed++ ) {
294  // If FED id not found in list (from cabling), then continue
295  if ( find( ids.begin(), ids.end(), (*ifed)->getFedId() ) == ids.end() ) { continue; }
296  const std::vector<FedChannelConnection>& conns = cabling()->connections((*ifed)->getFedId());
297  // loop over the connections for that FED
298  for ( std::vector<FedChannelConnection>::const_iterator iconn = conns.begin(); iconn != conns.end(); iconn++ ) {
299  // check that this is a tracker module
300  if(DetId(iconn->detId()).det()!=DetId::Tracker) continue;
301  // build the Fed9UAddress for that channel. Used to update the description.
302  Fed9U::Fed9UAddress fedChannel = Fed9U::Fed9UAddress(iconn->fedCh());
303  // retreive the current value for the delays
304  int fedDelayCoarse = (*ifed)->getCoarseDelay(fedChannel);
305  int fedDelayFine = (*ifed)->getFineDelay(fedChannel);
306  int fedDelay = int(fedDelayCoarse*25. - fedDelayFine*24./25.);
307  // extract the delay from the map
308  int delay = int(round( delays_[SiStripFecKey( iconn->fecCrate(),
309  iconn->fecSlot(),
310  iconn->fecRing(),
311  iconn->ccuAddr(),
312  iconn->ccuChan(), 0 ).key()]));
313  // compute the FED delay
314  // this is done by substracting the best (PLL) delay to the present value (from the db)
315  fedDelay -= delay;
316  fedDelayCoarse = (fedDelay/25)+1;
317  fedDelayFine = fedDelayCoarse*25-fedDelay;
318  if(fedDelayFine==25) { fedDelayFine = 0; --fedDelayCoarse; }
319  // update the FED delay
320  std::stringstream ss;
321  ss << "[FineDelayHistosUsingDb::" << __func__ << "]"
322  << " Updating the FED delay"
323  << " for loop FED id/ch "
324  << (*ifed)->getFedId() << "/" << iconn->fedCh()
325  << " from "
326  << (*ifed)->getCoarseDelay( fedChannel) << "/" << (*ifed)->getFineDelay( fedChannel)
327  << " to ";
328  (*ifed)->setDelay(fedChannel, fedDelayCoarse, fedDelayFine);
329  ss << (*ifed)->getCoarseDelay(fedChannel) << "/" << (*ifed)->getFineDelay( fedChannel) << std::endl;
330  LogTrace(mlDqmClient_) << ss.str();
331  }
332  }
333 
335  << "[FineDelayHistosUsingDb::" << __func__ << "]"
336  << " Updated FED delay for " << ids.size() << " FEDs!";
337 
338 }
const std::vector< uint16_t > & feds() const
static const char mlDqmClient_[]
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
Utility class that identifies a position within the strip tracker control structure, down to the level of an APV25.
Definition: SiStripFecKey.h:46
std::map< unsigned int, float > delays_
#define LogTrace(id)
Definition: DetId.h:20
list key
Definition: combine.py:13
SiStripFedCabling *const cabling() const
const std::vector< FedChannelConnection > & connections(uint16_t fed_id) const
void FineDelayHistosUsingDb::uploadConfigurations ( )
virtual

Reimplemented from CommissioningHistosUsingDb.

Definition at line 65 of file FineDelayHistosUsingDb.cc.

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

65  {
66 
67  if ( !db() ) {
69  << "[FineDelayHistosUsingDb::" << __func__ << "]"
70  << " NULL pointer to SiStripConfigDb interface!"
71  << " Aborting upload...";
72  return;
73  }
74 
75  // Retrieve and update PLL device descriptions
78  bool upload = update( devices );
79 
80  // Check if new PLL settings are valid
81  if ( !upload ) {
83  << "[FineDelayHistosUsingDb::" << __func__ << "]"
84  << " Found invalid PLL settings (coarse > 15)"
85  << " Aborting update to database...";
86  return;
87  }
88 
89  // Upload PLL device descriptions
90  if ( doUploadConf() ) {
92  << "[FineDelayHistosUsingDb::" << __func__ << "]"
93  << " Uploading PLL settings to DB...";
96  << "[FineDelayHistosUsingDb::" << __func__ << "]"
97  << " Upload of PLL settings to DB finished!";
98  } else {
100  << "[FineDelayHistosUsingDb::" << __func__ << "]"
101  << " TEST only! No PLL settings will be uploaded to DB...";
102  }
103 
104  // Update FED descriptions with new ticker thresholds
105  db()->clearFedDescriptions();
107  update( feds );
108 
109  // Update FED descriptions with new ticker thresholds
110  if ( doUploadConf() ) {
112  << "[FineDelayHistosUsingDb::" << __func__ << "]"
113  << " Uploading FED ticker thresholds to DB...";
116  << "[FineDelayHistosUsingDb::" << __func__ << "]"
117  << " Upload of FED ticker thresholds to DB finished!";
118  } else {
120  << "[FineDelayHistosUsingDb::" << __func__ << "]"
121  << " TEST only! No FED ticker thresholds will be uploaded to DB...";
122  }
123 
124 }
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 44 of file FineDelayHistosUsingDb.h.

Referenced by computeDelays(), and configure().

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

Definition at line 40 of file FineDelayHistosUsingDb.h.

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

const TrackerGeometry* FineDelayHistosUsingDb::tracker_
private

Definition at line 42 of file FineDelayHistosUsingDb.h.

Referenced by computeDelays(), and configure().