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

Private Member Functions

void create (SiStripConfigDb::AnalysisDescriptionsV &, Analysis)
 
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,
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 PedsOnlyHistosUsingDb.h.

Constructor & Destructor Documentation

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

Definition at line 15 of file PedsOnlyHistosUsingDb.cc.

References LogTrace, and sistrip::mlDqmClient_.

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

Definition at line 33 of file PedsOnlyHistosUsingDb.cc.

References LogTrace, and sistrip::mlDqmClient_.

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

Member Function Documentation

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

Reimplemented from CommissioningHistosUsingDb.

Definition at line 170 of file PedsOnlyHistosUsingDb.cc.

References CommissioningHistosUsingDb::db(), SiStripConfigDb::dbParams(), benchmark_cfg::errors, 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.

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

Definition at line 75 of file PedsOnlyHistosUsingDb.cc.

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

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

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

Reimplemented from CommissioningHistosUsingDb.

Definition at line 41 of file PedsOnlyHistosUsingDb.cc.

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

41  {
43  << "[PedsOnlyHistosUsingDb::" << __func__ << "]";
44 
45  if ( !db() ) {
47  << "[PedsOnlyHistosUsingDb::" << __func__ << "]"
48  << " NULL pointer to SiStripConfigDb interface!"
49  << " Aborting upload...";
50  return;
51  }
52 
53  // Update FED descriptions with new peds/noise values
55  update( feds );
56  if ( doUploadConf() ) {
58  << "[PedsOnlyHistosUsingDb::" << __func__ << "]"
59  << " Uploading pedestals/noise to DB...";
62  << "[PedsOnlyHistosUsingDb::" << __func__ << "]"
63  << " Completed database upload of " << feds.size()
64  << " FED descriptions!";
65  } else {
67  << "[PedsOnlyHistosUsingDb::" << __func__ << "]"
68  << " TEST only! No pedestals/noise values will be uploaded to DB...";
69  }
70 
71 }
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