CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions
PedsOnlyHistosUsingDb Class Reference

#include <PedsOnlyHistosUsingDb.h>

Inheritance diagram for PedsOnlyHistosUsingDb:
CommissioningHistosUsingDb PedsOnlyHistograms CommissioningHistograms CommissioningHistograms

Public Member Functions

 PedsOnlyHistosUsingDb (const edm::ParameterSet &pset, DQMStore *, SiStripConfigDb *const )
 
void uploadConfigurations () override
 
 ~PedsOnlyHistosUsingDb () override
 
- Public Member Functions inherited from CommissioningHistosUsingDb
 CommissioningHistosUsingDb (SiStripConfigDb *const, sistrip::RunType=sistrip::UNDEFINED_RUN_TYPE)
 
void configure (const edm::ParameterSet &, const edm::EventSetup &) override
 
bool doUploadAnal () const
 
void doUploadAnal (bool)
 
bool doUploadConf () const
 
void doUploadConf (bool)
 
void uploadToConfigDb ()
 
 ~CommissioningHistosUsingDb () override
 
- 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 printSummary ()
 
void remove (std::string pattern="")
 
void save (std::string &filename, uint32_t run_number=0, std::string partitionName="")
 
virtual ~CommissioningHistograms ()
 
- Public Member Functions inherited from PedsOnlyHistograms
void histoAnalysis (bool debug) override
 
 PedsOnlyHistograms (const edm::ParameterSet &pset, DQMStore *)
 
void printAnalyses () override
 
 ~PedsOnlyHistograms () override
 

Private Member Functions

void create (SiStripConfigDb::AnalysisDescriptionsV &, Analysis) override
 
void update (SiStripConfigDb::FedDescriptionsRange)
 

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, HistosHistosMap
 
- 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 (bool getMaskedData=false)
 
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 PedsOnlyHistosUsingDb.h.

Constructor & Destructor Documentation

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

Definition at line 14 of file PedsOnlyHistosUsingDb.cc.

References LogTrace, and sistrip::mlDqmClient_.

17  : CommissioningHistograms( pset.getParameter<edm::ParameterSet>("PedsOnlyParameters"),
18  bei,
22  PedsOnlyHistograms( pset.getParameter<edm::ParameterSet>("PedsOnlyParameters"),
23  bei )
24 {
26  << "[PedsOnlyHistosUsingDb::" << __func__ << "]"
27  << " Constructing object...";
28 }
T getParameter(std::string const &) const
static const char mlDqmClient_[]
PedsOnlyHistograms(const edm::ParameterSet &pset, DQMStore *)
#define LogTrace(id)
DQMStore *const bei() const
PedsOnlyHistosUsingDb::~PedsOnlyHistosUsingDb ( )
override

Definition at line 32 of file PedsOnlyHistosUsingDb.cc.

References LogTrace, and sistrip::mlDqmClient_.

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

Member Function Documentation

void PedsOnlyHistosUsingDb::create ( SiStripConfigDb::AnalysisDescriptionsV desc,
Analysis  analysis 
)
overrideprivatevirtual

Reimplemented from CommissioningHistosUsingDb.

Definition at line 169 of file PedsOnlyHistosUsingDb.cc.

References CommissioningHistosUsingDb::db(), SiStripConfigDb::dbParams(), CommissioningAnalysis::fecKey(), CommissioningAnalysis::fedKey(), CommissioningAnalysis::getErrorCodes(), SiStripFecKey::i2cAddr(), sistrip::invalid_, PedsOnlyAnalysis::isValid(), SiStripDbParams::partitions(), PedsOnlyAnalysis::pedsMax(), PedsOnlyAnalysis::pedsMean(), PedsOnlyAnalysis::pedsMin(), PedsOnlyAnalysis::pedsSpread(), PedsOnlyAnalysis::rawMax(), PedsOnlyAnalysis::rawMean(), PedsOnlyAnalysis::rawMin(), PedsOnlyAnalysis::rawSpread(), and tmp.

170  {
171 
172  PedsOnlyAnalysis* anal = dynamic_cast<PedsOnlyAnalysis*>( analysis->second );
173  if ( !anal ) { return; }
174 
175  SiStripFecKey fec_key( anal->fecKey() );
176  SiStripFedKey fed_key( anal->fedKey() );
177 
178  for ( uint16_t iapv = 0; iapv < 2; ++iapv ) {
179 
180  // Create description
181  PedestalsAnalysisDescription* tmp;
182  tmp = new PedestalsAnalysisDescription( std::vector<uint16_t>(0,0), //@@
183  std::vector<uint16_t>(0,0), //@@
184  anal->pedsMean()[iapv],
185  anal->pedsSpread()[iapv],
186  1.*sistrip::invalid_, //@@
187  1.*sistrip::invalid_, //@@
188  anal->rawMean()[iapv],
189  anal->rawSpread()[iapv],
190  anal->pedsMax()[iapv],
191  anal->pedsMin()[iapv],
192  1.*sistrip::invalid_, //@@
193  1.*sistrip::invalid_, //@@
194  anal->rawMax()[iapv],
195  anal->rawMin()[iapv],
196  fec_key.fecCrate(),
197  fec_key.fecSlot(),
198  fec_key.fecRing(),
199  fec_key.ccuAddr(),
200  fec_key.ccuChan(),
201  SiStripFecKey::i2cAddr( fec_key.lldChan(), !iapv ),
202  db()->dbParams().partitions().begin()->second.partitionName(),
203  db()->dbParams().partitions().begin()->second.runNumber(),
204  anal->isValid(),
205  "",
206  fed_key.fedId(),
207  fed_key.feUnit(),
208  fed_key.feChan(),
209  fed_key.fedApv() );
210 
211  // Add comments
212  typedef std::vector<std::string> Strings;
213  Strings errors = anal->getErrorCodes();
214  Strings::const_iterator istr = errors.begin();
215  Strings::const_iterator jstr = errors.end();
216  for ( ; istr != jstr; ++istr ) { tmp->addComments( *istr ); }
217 
218  // Store description
219  desc.push_back( tmp );
220 
221  }
222 
223 }
Histogram-based analysis for pedestal 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
std::vector< std::string > Strings
Definition: MsgTools.h:18
bool isValid() const override
const uint16_t & i2cAddr() const
const VFloat & rawSpread() 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 & rawMin() const
const VFloat & pedsMin() const
const VFloat & pedsMax() const
const uint32_t & fecKey() const
const VFloat & rawMax() const
const SiStripDbParams & dbParams() const
static const uint16_t invalid_
Definition: Constants.h:16
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
const VFloat & pedsSpread() const
const VFloat & pedsMean() const
Definition: errors.py:1
SiStripConfigDb *const db() const
const VString & getErrorCodes() const
const VFloat & rawMean() const
void PedsOnlyHistosUsingDb::update ( SiStripConfigDb::FedDescriptionsRange  feds)
private

Definition at line 74 of file PedsOnlyHistosUsingDb.cc.

References sistrip::APVS_PER_FEDCH, CommissioningHistosUsingDb::cabling(), FedChannelConnection::ccuAddr(), FedChannelConnection::ccuChan(), constexpr, CommissioningHistograms::data(), TauDecayModes::dec, FedChannelConnection::fecCrate(), SiStripFedKey::feChan(), FedChannelConnection::fecRing(), FedChannelConnection::fecSlot(), FedChannelConnection::fedCh(), sistrip::FEDCH_PER_FED, SiStripFedCabling::fedConnection(), FedChannelConnection::fedId(), SiStripFedKey::feUnit(), sistrip::invalid_, SiStripKey::key(), FedChannelConnection::lldChannel(), sistrip::mlDqmClient_, PedsOnlyAnalysis::peds(), PedsOnlyAnalysis::pedsMin(), and PedsOnlyAnalysis::raw().

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

74  {
75 
76  // Iterate through feds and update fed descriptions
77  uint16_t updated = 0;
78  SiStripConfigDb::FedDescriptionsV::const_iterator ifed;
79  for ( ifed = feds.begin(); ifed != feds.end(); ifed++ ) {
80 
81  for ( uint16_t ichan = 0; ichan < sistrip::FEDCH_PER_FED; ichan++ ) {
82 
83  // Build FED and FEC keys
84  const FedChannelConnection& conn = cabling()->fedConnection( (*ifed)->getFedId(), ichan );
85  if ( conn.fecCrate() == sistrip::invalid_ ||
86  conn.fecSlot() == sistrip::invalid_ ||
87  conn.fecRing() == sistrip::invalid_ ||
88  conn.ccuAddr() == sistrip::invalid_ ||
89  conn.ccuChan() == sistrip::invalid_ ||
90  conn.lldChannel() == sistrip::invalid_ ) { continue; }
91  SiStripFedKey fed_key( conn.fedId(),
92  SiStripFedKey::feUnit( conn.fedCh() ),
93  SiStripFedKey::feChan( conn.fedCh() ) );
94  SiStripFecKey fec_key( conn.fecCrate(),
95  conn.fecSlot(),
96  conn.fecRing(),
97  conn.ccuAddr(),
98  conn.ccuChan(),
99  conn.lldChannel() );
100 
101  // Locate appropriate analysis object
102  Analyses::const_iterator iter = data().find( fec_key.key() );
103  if ( iter != data().end() ) {
104 
105  // Check if analysis is valid
106  if ( !iter->second->isValid() ) { continue; }
107 
108  PedsOnlyAnalysis* anal = dynamic_cast<PedsOnlyAnalysis*>( iter->second );
109  if ( !anal ) {
111  << "[PedsOnlyHistosUsingDb::" << __func__ << "]"
112  << " NULL pointer to analysis object!";
113  continue;
114  }
115 
116  // Determine the pedestal shift to apply
117  uint32_t pedshift = 127;
118  for ( uint16_t iapv = 0; iapv < sistrip::APVS_PER_FEDCH; iapv++ ) {
119  uint32_t pedmin = (uint32_t) anal->pedsMin()[iapv];
120  pedshift = pedmin < pedshift ? pedmin : pedshift;
121  }
122 
123  // Iterate through APVs and strips
124  for ( uint16_t iapv = 0; iapv < sistrip::APVS_PER_FEDCH; iapv++ ) {
125  for ( uint16_t istr = 0; istr < anal->peds()[iapv].size(); istr++ ) {
126 
127  constexpr float high_threshold = 5.;
128  constexpr float low_threshold = 2.;
129  constexpr bool disable_strip = false;
130  Fed9U::Fed9UStripDescription data( static_cast<uint32_t>( anal->peds()[iapv][istr]-pedshift ),
131  high_threshold,
132  low_threshold,
133  anal->raw()[iapv][istr], //@@ raw noise!
134  disable_strip );
135  Fed9U::Fed9UAddress addr( ichan, iapv, istr );
136  (*ifed)->getFedStrips().setStrip( addr, data );
137 
138  }
139  }
140  updated++;
141 
142  } else {
144  << "[PedsOnlyHistosUsingDb::" << __func__ << "]"
145  << " Unable to find pedestals/noise for FedKey/Id/Ch: "
146  << hex << setw(8) << setfill('0') << fed_key.key() << dec << "/"
147  << (*ifed)->getFedId() << "/"
148  << ichan
149  << " and device with FEC/slot/ring/CCU/LLD "
150  << fec_key.fecCrate() << "/"
151  << fec_key.fecSlot() << "/"
152  << fec_key.fecRing() << "/"
153  << fec_key.ccuAddr() << "/"
154  << fec_key.ccuChan() << "/"
155  << fec_key.channel();
156  }
157  }
158  }
159 
161  << "[PedsOnlyHistosUsingDb::" << __func__ << "]"
162  << " Updated FED pedestals/noise for "
163  << updated << " channels";
164 
165 }
const uint16_t & fecSlot() const
const uint16_t & fecCrate() const
Histogram-based analysis for pedestal run.
Analyses & data(bool getMaskedData=false)
FedChannelConnection fedConnection(uint16_t fed_id, uint16_t fed_ch) const
A container class for generic run and event-related info, information required by the commissioning a...
Definition: SiStripFedKey.h:56
const uint16_t & fedCh() const
static const char mlDqmClient_[]
uint16_t lldChannel() const
const uint16_t & fedId() const
#define constexpr
Utility class that identifies a position within the strip tracker control structure, down to the level of an APV25.
Definition: SiStripFecKey.h:45
const VVFloat & raw() const
const uint16_t & fecRing() const
Class containning control, module, detector and connection information, at the level of a FED channel...
const VFloat & pedsMin() const
const uint16_t & ccuChan() const
const uint16_t & ccuAddr() const
const uint16_t & feUnit() const
static const uint16_t invalid_
Definition: Constants.h:16
const VVFloat & peds() const
static const uint16_t FEDCH_PER_FED
const uint16_t & feChan() const
SiStripFedCabling *const cabling() const
static const uint16_t APVS_PER_FEDCH
void PedsOnlyHistosUsingDb::uploadConfigurations ( )
overridevirtual

Reimplemented from CommissioningHistosUsingDb.

Definition at line 40 of file PedsOnlyHistosUsingDb.cc.

References CommissioningHistosUsingDb::db(), CommissioningHistosUsingDb::doUploadConf(), SiStripConfigDb::getFedDescriptions(), LogTrace, sistrip::mlDqmClient_, update(), and SiStripConfigDb::uploadFedDescriptions().

40  {
42  << "[PedsOnlyHistosUsingDb::" << __func__ << "]";
43 
44  if ( !db() ) {
46  << "[PedsOnlyHistosUsingDb::" << __func__ << "]"
47  << " NULL pointer to SiStripConfigDb interface!"
48  << " Aborting upload...";
49  return;
50  }
51 
52  // Update FED descriptions with new peds/noise values
54  update( feds );
55  if ( doUploadConf() ) {
57  << "[PedsOnlyHistosUsingDb::" << __func__ << "]"
58  << " Uploading pedestals/noise to DB...";
61  << "[PedsOnlyHistosUsingDb::" << __func__ << "]"
62  << " Completed database upload of " << feds.size()
63  << " FED descriptions!";
64  } else {
66  << "[PedsOnlyHistosUsingDb::" << __func__ << "]"
67  << " TEST only! No pedestals/noise values will be uploaded to DB...";
68  }
69 
70 }
FedDescriptionsRange getFedDescriptions(std::string partition="")
FedDescriptions::range FedDescriptionsRange
static const char mlDqmClient_[]
void update(SiStripConfigDb::FedDescriptionsRange)
#define LogTrace(id)
void uploadFedDescriptions(std::string partition="")
SiStripConfigDb *const db() const