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

#include <OptoScanHistosUsingDb.h>

Inheritance diagram for OptoScanHistosUsingDb:
CommissioningHistosUsingDb OptoScanHistograms CommissioningHistograms CommissioningHistograms

Public Member Functions

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

Private Member Functions

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

Private Attributes

bool skipGainUpdate_
 

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 9 of file OptoScanHistosUsingDb.h.

Constructor & Destructor Documentation

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

Definition at line 14 of file OptoScanHistosUsingDb.cc.

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

17  : CommissioningHistograms( pset.getParameter<edm::ParameterSet>("OptoScanParameters"),
18  bei,
22  OptoScanHistograms( pset.getParameter<edm::ParameterSet>("OptoScanParameters"),
23  bei )
24 {
26  << "[OptoScanHistosUsingDb::" << __func__ << "]"
27  << " Constructing object...";
28  skipGainUpdate_ = this->pset().getParameter<bool>("SkipGainUpdate");
29  if (skipGainUpdate_)
31  << "[OptoScanHistosUsingDb::" << __func__ << "]"
32  << " Skipping db update of gain parameters.";
33 }
T getParameter(std::string const &) const
const edm::ParameterSet & pset() const
OptoScanHistograms(const edm::ParameterSet &pset, DQMStore *)
static const char mlDqmClient_[]
#define LogTrace(id)
OptoScanHistosUsingDb::~OptoScanHistosUsingDb ( )
virtual

Definition at line 37 of file OptoScanHistosUsingDb.cc.

References LogTrace, and sistrip::mlDqmClient_.

37  {
39  << "[OptoScanHistosUsingDb::" << __func__ << "]"
40  << " Destructing object...";
41 }
static const char mlDqmClient_[]
#define LogTrace(id)

Member Function Documentation

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

Reimplemented from CommissioningHistosUsingDb.

Definition at line 164 of file OptoScanHistosUsingDb.cc.

References OptoScanAnalysis::baseSlope(), OptoScanAnalysis::bias(), CommissioningHistosUsingDb::db(), SiStripConfigDb::dbParams(), benchmark_cfg::errors, CommissioningAnalysis::fecKey(), CommissioningAnalysis::fedKey(), OptoScanAnalysis::gain(), CommissioningAnalysis::getErrorCodes(), SiStripFecKey::i2cAddr(), OptoScanAnalysis::isValid(), OptoScanAnalysis::liftOff(), OptoScanAnalysis::linkNoise(), OptoScanAnalysis::measGain(), SiStripDbParams::partitions(), OptoScanAnalysis::threshold(), OptoScanAnalysis::tickHeight(), tmp, and OptoScanAnalysis::zeroLight().

165  {
166 
167  OptoScanAnalysis* anal = dynamic_cast<OptoScanAnalysis*>( analysis->second );
168  if ( !anal ) { return; }
169 
170  SiStripFecKey fec_key( anal->fecKey() );
171  SiStripFedKey fed_key( anal->fedKey() );
172 
173  for ( uint16_t iapv = 0; iapv < 2; ++iapv ) {
174 
175  // Create description
176  OptoScanAnalysisDescription* tmp;
177  tmp = new OptoScanAnalysisDescription( anal->baseSlope()[0],
178  anal->baseSlope()[1],
179  anal->baseSlope()[2],
180  anal->baseSlope()[3],
181  anal->gain(),
182  anal->bias()[0],
183  anal->bias()[1],
184  anal->bias()[2],
185  anal->bias()[3],
186  anal->measGain()[0],
187  anal->measGain()[1],
188  anal->measGain()[2],
189  anal->measGain()[3],
190  anal->zeroLight()[0],
191  anal->zeroLight()[1],
192  anal->zeroLight()[2],
193  anal->zeroLight()[3],
194  anal->linkNoise()[0],
195  anal->linkNoise()[1],
196  anal->linkNoise()[2],
197  anal->linkNoise()[3],
198  anal->liftOff()[0],
199  anal->liftOff()[1],
200  anal->liftOff()[2],
201  anal->liftOff()[3],
202  anal->threshold()[0],
203  anal->threshold()[1],
204  anal->threshold()[2],
205  anal->threshold()[3],
206  anal->tickHeight()[0],
207  anal->tickHeight()[1],
208  anal->tickHeight()[2],
209  anal->tickHeight()[3],
210  fec_key.fecCrate(),
211  fec_key.fecSlot(),
212  fec_key.fecRing(),
213  fec_key.ccuAddr(),
214  fec_key.ccuChan(),
215  SiStripFecKey::i2cAddr( fec_key.lldChan(), !iapv ),
216  db()->dbParams().partitions().begin()->second.partitionName(),
217  db()->dbParams().partitions().begin()->second.runNumber(),
218  anal->isValid(),
219  "",
220  fed_key.fedId(),
221  fed_key.feUnit(),
222  fed_key.feChan(),
223  fed_key.fedApv() );
224 
225  // Add comments
226  typedef std::vector<std::string> Strings;
227  Strings errors = anal->getErrorCodes();
228  Strings::const_iterator istr = errors.begin();
229  Strings::const_iterator jstr = errors.end();
230  for ( ; istr != jstr; ++istr ) { tmp->addComments( *istr ); }
231 
232  // Store description
233  desc.push_back( tmp );
234 
235  }
236 
237 }
Histogram-based analysis for opto bias/gain scan.
const uint16_t & gain() const
const uint32_t & fedKey() const
const VFloat & baseSlope() const
bool isValid() const
A container class for generic run and event-related info, information required by the commissioning a...
Definition: SiStripFedKey.h:57
const VFloat & liftOff() const
std::vector< std::string > Strings
Definition: MsgTools.h:18
const VFloat & linkNoise() const
const uint16_t & i2cAddr() const
const VFloat & measGain() const
const VFloat & tickHeight() const
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 VFloat & zeroLight() const
const uint32_t & fecKey() const
const VInt & bias() const
const SiStripDbParams & dbParams() const
const VFloat & threshold() const
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
SiStripConfigDb *const db() const
const VString & getErrorCodes() const
void OptoScanHistosUsingDb::update ( SiStripConfigDb::DeviceDescriptionsRange  devices)
private

Definition at line 78 of file OptoScanHistosUsingDb.cc.

References OptoScanAnalysis::bias(), SiStripFecKey::ccuAddr(), SiStripConfigDb::DeviceAddress::ccuAddr_, SiStripFecKey::ccuChan(), SiStripConfigDb::DeviceAddress::ccuChan_, SiStripKey::channel(), sistrip::CHANS_PER_LLD, CommissioningHistograms::data(), CommissioningHistosUsingDb::db(), SiStripConfigDb::deviceAddress(), CommissioningHistosUsingDb::deviceIsPresent(), SiStripFecKey::fecCrate(), SiStripConfigDb::DeviceAddress::fecCrate_, SiStripFecKey::fecRing(), SiStripConfigDb::DeviceAddress::fecRing_, SiStripFecKey::fecSlot(), SiStripConfigDb::DeviceAddress::fecSlot_, OptoScanAnalysis::gain(), SiStripKey::key(), LogTrace, sistrip::mlDqmClient_, and skipGainUpdate_.

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

78  {
79 
80  // Iterate through devices and update device descriptions
81  uint16_t updated = 0;
82  SiStripConfigDb::DeviceDescriptionsV::const_iterator idevice;
83  for ( idevice = devices.begin(); idevice != devices.end(); idevice++ ) {
84 
85  if ( (*idevice)->getDeviceType() != LASERDRIVER ) { continue; }
86 
87  // Cast to retrieve appropriate description object
88  laserdriverDescription* desc = dynamic_cast<laserdriverDescription*>( *idevice );
89  if ( !desc ) { continue; }
90 
91  // Retrieve device addresses from device description
92  const SiStripConfigDb::DeviceAddress& addr = db()->deviceAddress(*desc);
93 
94  // Iterate through LLD channels
95  for ( uint16_t ichan = 0; ichan < sistrip::CHANS_PER_LLD; ichan++ ) {
96 
97  // Construct key from device description
98  SiStripFecKey fec_key( addr.fecCrate_,
99  addr.fecSlot_,
100  addr.fecRing_,
101  addr.ccuAddr_,
102  addr.ccuChan_,
103  ichan+1 );
104 
105  // Iterate through all channels and extract LLD settings
106  Analyses::const_iterator iter = data().find( fec_key.key() );
107  if ( iter != data().end() ) {
108 
109  OptoScanAnalysis* anal = dynamic_cast<OptoScanAnalysis*>( iter->second );
110  if ( !anal ) {
112  << "[OptoScanHistosUsingDb::" << __func__ << "]"
113  << " NULL pointer to analysis object!";
114  continue;
115  }
116 
117  uint16_t gain = anal->gain();
118  std::stringstream ss;
119  ss << "[OptoScanHistosUsingDb::" << __func__ << "]"
120  << " Updating LLD gain/bias settings for crate/crate/FEC/ring/CCU/module/LLD "
121  << fec_key.fecCrate() << "/"
122  << fec_key.fecSlot() << "/"
123  << fec_key.fecRing() << "/"
124  << fec_key.ccuAddr() << "/"
125  << fec_key.ccuChan() << "/"
126  << fec_key.channel()
127  << " from "
128  << static_cast<uint16_t>( desc->getGain(ichan) ) << "/"
129  << static_cast<uint16_t>( desc->getBias(ichan) );
130  if (!skipGainUpdate_) desc->setGain( ichan, gain );
131  desc->setBias( ichan, anal->bias()[gain] );
132  updated++;
133  ss << " to "
134  << static_cast<uint16_t>(desc->getGain(ichan)) << "/"
135  << static_cast<uint16_t>(desc->getBias(ichan));
136  LogTrace(mlDqmClient_) << ss.str();
137 
138  } else {
139  if ( deviceIsPresent(fec_key) ) {
141  << "[OptoScanHistosUsingDb::" << __func__ << "]"
142  << " Unable to find FEC key with params crate/FEC/ring/CCU/module/LLD "
143  << fec_key.fecCrate() << "/"
144  << fec_key.fecSlot() << "/"
145  << fec_key.fecRing() << "/"
146  << fec_key.ccuAddr() << "/"
147  << fec_key.ccuChan() << "/"
148  << fec_key.channel();
149  }
150  }
151  }
152  }
153 
155  << "[OptoScanHistosUsingDb::" << __func__ << "]"
156  << " Updated LLD bias/gain settings for "
157  << updated << " modules";
158 
159 
160 }
Histogram-based analysis for opto bias/gain scan.
const uint16_t & gain() const
bool deviceIsPresent(const SiStripFecKey &)
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:46
static const uint16_t CHANS_PER_LLD
DeviceAddress deviceAddress(const deviceDescription &)
#define LogTrace(id)
const VInt & bias() const
SiStripConfigDb *const db() const
void OptoScanHistosUsingDb::uploadConfigurations ( )
virtual

Reimplemented from CommissioningHistosUsingDb.

Definition at line 45 of file OptoScanHistosUsingDb.cc.

References CommissioningHistosUsingDb::db(), CommissioningHistosUsingDb::doUploadConf(), SiStripConfigDb::getDeviceDescriptions(), LogTrace, sistrip::mlDqmClient_, update(), and SiStripConfigDb::uploadDeviceDescriptions().

45  {
47  << "[OptoScanHistosUsingDb::" << __func__ << "]";
48 
49  if ( !db() ) {
51  << "[OptoScanHistosUsingDb::" << __func__ << "]"
52  << " NULL pointer to SiStripConfigDb interface!"
53  << " Aborting upload...";
54  return;
55  }
56 
57  // Update LLD descriptions with new bias/gain settings
59  update( devices );
60  if ( doUploadConf() ) {
62  << "[OptoScanHistosUsingDb::" << __func__ << "]"
63  << " Uploading LLD settings to DB...";
66  << "[OptoScanHistosUsingDb::" << __func__ << "]"
67  << " Upload of LLD settings to DB finished!";
68  } else {
70  << "[OptoScanHistosUsingDb::" << __func__ << "]"
71  << " TEST only! No LLD settings will be uploaded to DB...";
72  }
73 
74 }
static const char mlDqmClient_[]
void update(SiStripConfigDb::DeviceDescriptionsRange)
DeviceDescriptions::range DeviceDescriptionsRange
#define LogTrace(id)
SiStripConfigDb *const db() const
DeviceDescriptionsRange getDeviceDescriptions(std::string partition="")
void uploadDeviceDescriptions(std::string partition="")

Member Data Documentation

bool OptoScanHistosUsingDb::skipGainUpdate_
private

Definition at line 28 of file OptoScanHistosUsingDb.h.

Referenced by OptoScanHistosUsingDb(), and update().