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

#include <VpspScanHistosUsingDb.h>

Inheritance diagram for VpspScanHistosUsingDb:
CommissioningHistosUsingDb VpspScanHistograms CommissioningHistograms CommissioningHistograms

Public Member Functions

virtual void uploadConfigurations ()
 
 VpspScanHistosUsingDb (const edm::ParameterSet &pset, DQMStore *, SiStripConfigDb *const )
 
virtual ~VpspScanHistosUsingDb ()
 
- 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 VpspScanHistograms
void histoAnalysis (bool debug)
 
void printAnalyses ()
 
 VpspScanHistograms (const edm::ParameterSet &pset, DQMStore *)
 
virtual ~VpspScanHistograms ()
 

Private Member Functions

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

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 VpspScanHistosUsingDb.h.

Constructor & Destructor Documentation

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

Definition at line 13 of file VpspScanHistosUsingDb.cc.

References LogTrace, and sistrip::mlDqmClient_.

16  : CommissioningHistograms( pset.getParameter<edm::ParameterSet>("VpspScanParameters"),
17  bei,
21  VpspScanHistograms( pset.getParameter<edm::ParameterSet>("VpspScanParameters"),
22  bei )
23 {
25  << "[VpspScanHistosUsingDb::" << __func__ << "]"
26  << " Constructing object...";
27 }
T getParameter(std::string const &) const
static const char mlDqmClient_[]
#define LogTrace(id)
DQMStore *const bei() const
VpspScanHistograms(const edm::ParameterSet &pset, DQMStore *)
VpspScanHistosUsingDb::~VpspScanHistosUsingDb ( )
virtual

Definition at line 31 of file VpspScanHistosUsingDb.cc.

References LogTrace, and sistrip::mlDqmClient_.

31  {
33  << "[VpspScanHistosUsingDb::" << __func__ << "]"
34  << " Destructing object...";
35 }
static const char mlDqmClient_[]
#define LogTrace(id)

Member Function Documentation

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

Reimplemented from CommissioningHistosUsingDb.

Definition at line 152 of file VpspScanHistosUsingDb.cc.

References VpspScanAnalysis::adcLevel(), VpspScanAnalysis::bottomEdge(), VpspScanAnalysis::bottomLevel(), CommissioningHistosUsingDb::db(), SiStripConfigDb::dbParams(), benchmark_cfg::errors, CommissioningAnalysis::fecKey(), CommissioningAnalysis::fedKey(), VpspScanAnalysis::fraction(), CommissioningAnalysis::getErrorCodes(), SiStripFecKey::i2cAddr(), VpspScanAnalysis::isValid(), SiStripDbParams::partitions(), tmp, VpspScanAnalysis::topEdge(), VpspScanAnalysis::topLevel(), and VpspScanAnalysis::vpsp().

153  {
154 
155  VpspScanAnalysis* anal = dynamic_cast<VpspScanAnalysis*>( analysis->second );
156  if ( !anal ) { return; }
157 
158  SiStripFecKey fec_key( anal->fecKey() );
159  SiStripFedKey fed_key( anal->fedKey() );
160 
161  for ( uint16_t iapv = 0; iapv < 2; ++iapv ) {
162 
163  // Create description
164  VpspScanAnalysisDescription* tmp;
165  tmp = new VpspScanAnalysisDescription( anal->vpsp()[iapv],
166  anal->adcLevel()[iapv],
167  anal->fraction()[iapv],
168  anal->topEdge()[iapv],
169  anal->bottomEdge()[iapv],
170  anal->topLevel()[iapv],
171  anal->bottomLevel()[iapv],
172  fec_key.fecCrate(),
173  fec_key.fecSlot(),
174  fec_key.fecRing(),
175  fec_key.ccuAddr(),
176  fec_key.ccuChan(),
177  SiStripFecKey::i2cAddr( fec_key.lldChan(), !iapv ),
178  db()->dbParams().partitions().begin()->second.partitionName(),
179  db()->dbParams().partitions().begin()->second.runNumber(),
180  anal->isValid(),
181  "",
182  fed_key.fedId(),
183  fed_key.feUnit(),
184  fed_key.feChan(),
185  fed_key.fedApv() );
186 
187  // Add comments
188  typedef std::vector<std::string> Strings;
189  Strings errors = anal->getErrorCodes();
190  Strings::const_iterator istr = errors.begin();
191  Strings::const_iterator jstr = errors.end();
192  for ( ; istr != jstr; ++istr ) { tmp->addComments( *istr ); }
193 
194  // Store description
195  desc.push_back( tmp );
196 
197  }
198 
199 }
const uint32_t & fedKey() const
const VInt & bottomEdge() const
A container class for generic run and event-related info, information required by the commissioning a...
Definition: SiStripFedKey.h:56
std::vector< std::string > Strings
Definition: MsgTools.h:18
const uint16_t & i2cAddr() 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 VInt & topLevel() const
const VInt & fraction() const
const uint32_t & fecKey() const
const VInt & vpsp() const
Histogram-based analysis for VPSP scan.
const VInt & adcLevel() const
const SiStripDbParams & dbParams() const
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
SiStripConfigDb *const db() const
bool isValid() const
const VString & getErrorCodes() const
const VInt & topEdge() const
const VInt & bottomLevel() const
void VpspScanHistosUsingDb::update ( SiStripConfigDb::DeviceDescriptionsRange  devices)
private

Definition at line 75 of file VpspScanHistosUsingDb.cc.

References SiStripFecKey::ccuAddr(), SiStripConfigDb::DeviceAddress::ccuAddr_, SiStripFecKey::ccuChan(), SiStripConfigDb::DeviceAddress::ccuChan_, SiStripKey::channel(), CommissioningHistograms::data(), CommissioningHistosUsingDb::db(), SiStripConfigDb::deviceAddress(), CommissioningHistosUsingDb::deviceIsPresent(), SiStripFecKey::fecCrate(), SiStripConfigDb::DeviceAddress::fecCrate_, SiStripFecKey::fecRing(), SiStripConfigDb::DeviceAddress::fecRing_, SiStripFecKey::fecSlot(), SiStripConfigDb::DeviceAddress::fecSlot_, SiStripKey::key(), LogTrace, sistrip::mlDqmClient_, contentValuesCheck::ss, and VpspScanAnalysis::vpsp().

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

75  {
76 
77  // Iterate through devices and update device descriptions
78  SiStripConfigDb::DeviceDescriptionsV::const_iterator idevice;
79  for ( idevice = devices.begin(); idevice != devices.end(); idevice++ ) {
80 
81  // Check device type
82  if ( (*idevice)->getDeviceType() != APV25 ) { continue; }
83 
84  // Cast to retrieve appropriate description object
85  apvDescription* desc = dynamic_cast<apvDescription*>( *idevice );
86  if ( !desc ) { continue; }
87 
88  // Retrieve device addresses from device description
89  const SiStripConfigDb::DeviceAddress& addr = db()->deviceAddress(*desc);
90 
91  // Retrieve LLD channel and APV numbers
92  uint16_t ichan = ( desc->getAddress() - 0x20 ) / 2;
93  uint16_t iapv = ( desc->getAddress() - 0x20 ) % 2;
94 
95  // Construct key from device description
96  SiStripFecKey fec_key( addr.fecCrate_,
97  addr.fecSlot_,
98  addr.fecRing_,
99  addr.ccuAddr_,
100  addr.ccuChan_,
101  ichan+1 );
102 
103  // Iterate through all channels and extract LLD settings
104  Analyses::const_iterator iter = data().find( fec_key.key() );
105  if ( iter != data().end() ) {
106 
107  VpspScanAnalysis* anal = dynamic_cast<VpspScanAnalysis*>( iter->second );
108  if ( !anal ) {
110  << "[VpspScanHistosUsingDb::" << __func__ << "]"
111  << " NULL pointer to analysis object!";
112  continue;
113  }
114 
115  std::stringstream ss;
116  ss << "[VpspScanHistosUsingDb::" << __func__ << "]"
117  << " Updating VPSP setting for crate/FEC/slot/ring/CCU/LLD/APV "
118  << fec_key.fecCrate() << "/"
119  << fec_key.fecSlot() << "/"
120  << fec_key.fecRing() << "/"
121  << fec_key.ccuAddr() << "/"
122  << fec_key.ccuChan() << "/"
123  << fec_key.channel()
124  << iapv
125  << " from "
126  << static_cast<uint16_t>(desc->getVpsp());
127  if ( iapv == 0 ) { desc->setVpsp( anal->vpsp()[0] ); }
128  if ( iapv == 1 ) { desc->setVpsp( anal->vpsp()[1] ); }
129  ss << " to " << static_cast<uint16_t>(desc->getVpsp());
130  LogTrace(mlDqmClient_) << ss.str();
131 
132  } else {
133  if ( deviceIsPresent(fec_key) ) {
135  << "[VpspScanHistosUsingDb::" << __func__ << "]"
136  << " Unable to find FEC key with params FEC/slot/ring/CCU/LLDchan/APV: "
137  << fec_key.fecCrate() << "/"
138  << fec_key.fecSlot() << "/"
139  << fec_key.fecRing() << "/"
140  << fec_key.ccuAddr() << "/"
141  << fec_key.ccuChan() << "/"
142  << fec_key.channel() << "/"
143  << iapv+1;
144  }
145  }
146  }
147 
148 }
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
DeviceAddress deviceAddress(const deviceDescription &)
const VInt & vpsp() const
#define LogTrace(id)
Histogram-based analysis for VPSP scan.
SiStripConfigDb *const db() const
void VpspScanHistosUsingDb::uploadConfigurations ( )
virtual

Reimplemented from CommissioningHistosUsingDb.

Definition at line 39 of file VpspScanHistosUsingDb.cc.

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

39  {
41  << "[VpspScanHistosUsingDb::" << __func__ << "]";
42 
43  if ( !db() ) {
45  << "[VpspScanHistosUsingDb::" << __func__ << "]"
46  << " NULL pointer to SiStripConfigDb interface!"
47  << " Aborting upload...";
48  return;
49  }
50 
51  // Update all APV device descriptions with new VPSP settings
53  update( devices );
54  if ( doUploadConf() ) {
56  << "[VpspScanHistosUsingDb::" << __func__ << "]"
57  << " Uploading VPSP settings to DB...";
60  << "[VpspScanHistosUsingDb::" << __func__ << "]"
61  << " Uploaded VPSP settings to DB!";
62  } else {
64  << "[VpspScanHistosUsingDb::" << __func__ << "]"
65  << " TEST only! No VPSP settings will be uploaded to DB...";
66  }
68  << "[VpspScanHistosUsingDb::" << __func__ << "]"
69  << " Upload of VPSP settings to DB finished!";
70 
71 }
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="")