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 14 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_.

26  : CommissioningHistograms( pset.getParameter<edm::ParameterSet>("FineDelayParameters"),
27  bei,
31  SamplingHistograms( pset.getParameter<edm::ParameterSet>("FineDelayParameters"),
32  bei,
34  tracker_(0)
35 {
37  << "[FineDelayHistosUsingDb::" << __func__ << "]"
38  << " Constructing object...";
39  delays_.clear();
40 }
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_
DQMStore *const bei() const
FineDelayHistosUsingDb::~FineDelayHistosUsingDb ( )
virtual

Definition at line 44 of file FineDelayHistosUsingDb.cc.

References LogTrace, and sistrip::mlDqmClient_.

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

Member Function Documentation

void FineDelayHistosUsingDb::computeDelays ( )
private

Definition at line 125 of file FineDelayHistosUsingDb.cc.

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

Referenced by update().

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

Reimplemented from SamplingHistograms.

Definition at line 52 of file FineDelayHistosUsingDb.cc.

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

53  {
54  // get geometry
56  setup.get<TrackerDigiGeometryRecord>().get(estracker);
57  tracker_=&(* estracker);
59  cosmic_ = this->pset().getParameter<bool>("cosmic");
60 }
T getParameter(std::string const &) const
const edm::ParameterSet & pset() const
const T & get() const
Definition: EventSetup.h:56
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 341 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.

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

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

Definition at line 283 of file FineDelayHistosUsingDb.cc.

References CommissioningHistosUsingDb::cabling(), computeDelays(), delays_, SiStripFedCabling::fedConnections(), SiStripFedCabling::fedIds(), spr::find(), relval_steps::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().

283  {
284 
285  // do the core computation of delays per FED connection
286  computeDelays();
287 
288  // Retrieve FED ids from cabling
289  auto ids = cabling()->fedIds() ;
290 
291  // loop over the FED ids
292  for ( SiStripConfigDb::FedDescriptionsV::const_iterator ifed = feds.begin(); ifed != feds.end(); ifed++ ) {
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  auto conns = cabling()->fedConnections((*ifed)->getFedId());
296  // loop over the connections for that FED
297  for ( auto iconn = conns.begin(); iconn != conns.end(); iconn++ ) {
298  // check that this is a tracker module
299  if(DetId(iconn->detId()).det()!=DetId::Tracker) continue;
300  // build the Fed9UAddress for that channel. Used to update the description.
301  Fed9U::Fed9UAddress fedChannel = Fed9U::Fed9UAddress(iconn->fedCh());
302  // retreive the current value for the delays
303  int fedDelayCoarse = (*ifed)->getCoarseDelay(fedChannel);
304  int fedDelayFine = (*ifed)->getFineDelay(fedChannel);
305  int fedDelay = int(fedDelayCoarse*25. - fedDelayFine*24./25.);
306  // extract the delay from the map
307  int delay = int(round( delays_[SiStripFecKey( iconn->fecCrate(),
308  iconn->fecSlot(),
309  iconn->fecRing(),
310  iconn->ccuAddr(),
311  iconn->ccuChan(), 0 ).key()]));
312  // compute the FED delay
313  // this is done by substracting the best (PLL) delay to the present value (from the db)
314  fedDelay -= delay;
315  fedDelayCoarse = (fedDelay/25)+1;
316  fedDelayFine = fedDelayCoarse*25-fedDelay;
317  if(fedDelayFine==25) { fedDelayFine = 0; --fedDelayCoarse; }
318  // update the FED delay
319  std::stringstream ss;
320  ss << "[FineDelayHistosUsingDb::" << __func__ << "]"
321  << " Updating the FED delay"
322  << " for loop FED id/ch "
323  << (*ifed)->getFedId() << "/" << iconn->fedCh()
324  << " from "
325  << (*ifed)->getCoarseDelay( fedChannel) << "/" << (*ifed)->getFineDelay( fedChannel)
326  << " to ";
327  (*ifed)->setDelay(fedChannel, fedDelayCoarse, fedDelayFine);
328  ss << (*ifed)->getCoarseDelay(fedChannel) << "/" << (*ifed)->getFineDelay( fedChannel) << std::endl;
329  LogTrace(mlDqmClient_) << ss.str();
330  }
331  }
332 
334  << "[FineDelayHistosUsingDb::" << __func__ << "]"
335  << " Updated FED delay for " << ids.size() << " FEDs!";
336 
337 }
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:45
FedsConstIterRange fedIds() const
std::map< unsigned int, float > delays_
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
#define LogTrace(id)
Definition: DetId.h:18
ConnsConstIterRange fedConnections(uint16_t fed_id) const
SiStripFedCabling *const cabling() const
void FineDelayHistosUsingDb::uploadConfigurations ( )
virtual

Reimplemented from CommissioningHistosUsingDb.

Definition at line 64 of file FineDelayHistosUsingDb.cc.

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

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

Referenced by computeDelays(), and configure().

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

Definition at line 39 of file FineDelayHistosUsingDb.h.

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

const TrackerGeometry* FineDelayHistosUsingDb::tracker_
private

Definition at line 41 of file FineDelayHistosUsingDb.h.

Referenced by computeDelays(), and configure().