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

Constructor & Destructor Documentation

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

Definition at line 13 of file OptoScanHistosUsingDb.cc.

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

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

Definition at line 36 of file OptoScanHistosUsingDb.cc.

References LogTrace, and sistrip::mlDqmClient_.

36  {
38  << "[OptoScanHistosUsingDb::" << __func__ << "]"
39  << " Destructing object...";
40 }
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 163 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().

164  {
165 
166  OptoScanAnalysis* anal = dynamic_cast<OptoScanAnalysis*>( analysis->second );
167  if ( !anal ) { return; }
168 
169  SiStripFecKey fec_key( anal->fecKey() );
170  SiStripFedKey fed_key( anal->fedKey() );
171 
172  for ( uint16_t iapv = 0; iapv < 2; ++iapv ) {
173 
174  // Create description
175  OptoScanAnalysisDescription* tmp;
176  tmp = new OptoScanAnalysisDescription( anal->baseSlope()[0],
177  anal->baseSlope()[1],
178  anal->baseSlope()[2],
179  anal->baseSlope()[3],
180  anal->gain(),
181  anal->bias()[0],
182  anal->bias()[1],
183  anal->bias()[2],
184  anal->bias()[3],
185  anal->measGain()[0],
186  anal->measGain()[1],
187  anal->measGain()[2],
188  anal->measGain()[3],
189  anal->zeroLight()[0],
190  anal->zeroLight()[1],
191  anal->zeroLight()[2],
192  anal->zeroLight()[3],
193  anal->linkNoise()[0],
194  anal->linkNoise()[1],
195  anal->linkNoise()[2],
196  anal->linkNoise()[3],
197  anal->liftOff()[0],
198  anal->liftOff()[1],
199  anal->liftOff()[2],
200  anal->liftOff()[3],
201  anal->threshold()[0],
202  anal->threshold()[1],
203  anal->threshold()[2],
204  anal->threshold()[3],
205  anal->tickHeight()[0],
206  anal->tickHeight()[1],
207  anal->tickHeight()[2],
208  anal->tickHeight()[3],
209  fec_key.fecCrate(),
210  fec_key.fecSlot(),
211  fec_key.fecRing(),
212  fec_key.ccuAddr(),
213  fec_key.ccuChan(),
214  SiStripFecKey::i2cAddr( fec_key.lldChan(), !iapv ),
215  db()->dbParams().partitions().begin()->second.partitionName(),
216  db()->dbParams().partitions().begin()->second.runNumber(),
217  anal->isValid(),
218  "",
219  fed_key.fedId(),
220  fed_key.feUnit(),
221  fed_key.feChan(),
222  fed_key.fedApv() );
223 
224  // Add comments
225  typedef std::vector<std::string> Strings;
226  Strings errors = anal->getErrorCodes();
227  Strings::const_iterator istr = errors.begin();
228  Strings::const_iterator jstr = errors.end();
229  for ( ; istr != jstr; ++istr ) { tmp->addComments( *istr ); }
230 
231  // Store description
232  desc.push_back( tmp );
233 
234  }
235 
236 }
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:56
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:45
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 77 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_, skipGainUpdate_, 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().

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

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

44  {
46  << "[OptoScanHistosUsingDb::" << __func__ << "]";
47 
48  if ( !db() ) {
50  << "[OptoScanHistosUsingDb::" << __func__ << "]"
51  << " NULL pointer to SiStripConfigDb interface!"
52  << " Aborting upload...";
53  return;
54  }
55 
56  // Update LLD descriptions with new bias/gain settings
58  update( devices );
59  if ( doUploadConf() ) {
61  << "[OptoScanHistosUsingDb::" << __func__ << "]"
62  << " Uploading LLD settings to DB...";
65  << "[OptoScanHistosUsingDb::" << __func__ << "]"
66  << " Upload of LLD settings to DB finished!";
67  } else {
69  << "[OptoScanHistosUsingDb::" << __func__ << "]"
70  << " TEST only! No LLD settings will be uploaded to DB...";
71  }
72 
73 }
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 27 of file OptoScanHistosUsingDb.h.

Referenced by OptoScanHistosUsingDb(), and update().