CMS 3D CMS Logo

List of all members | Public Member Functions
OptoScanHistograms Class Reference

#include <OptoScanHistograms.h>

Inheritance diagram for OptoScanHistograms:
CommissioningHistograms OptoScanHistosUsingDb

Public Member Functions

void histoAnalysis (bool debug) override
 
 OptoScanHistograms (const edm::ParameterSet &pset, DQMStore *)
 
void printAnalyses () override
 
 ~OptoScanHistograms () override
 
- Public Member Functions inherited from CommissioningHistograms
 CommissioningHistograms ()
 
 CommissioningHistograms (const edm::ParameterSet &pset, DQMStore *const, const sistrip::RunType &)
 
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, std::string partitionName="")
 
virtual ~CommissioningHistograms ()
 

Additional Inherited Members

- Public Types inherited from CommissioningHistograms
typedef std::map< uint32_t, CommissioningAnalysis * > Analyses
 
typedef Analyses::iterator Analysis
 
typedef dqm::harvesting::DQMStore DQMStore
 
typedef SummaryPlotFactory< CommissioningAnalysis * > Factory
 
typedef std::map< uint32_t, uint32_t > FedToFecMap
 
typedef std::vector< Histo * > Histos
 
typedef std::map< uint32_t, HistosHistosMap
 
typedef dqm::harvesting::MonitorElement MonitorElement
 
- Static Public Member Functions inherited from CommissioningHistograms
static void copyCustomInformation (DQMStore *const, 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 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::unique_ptr< Factoryfactory_
 

Detailed Description

Definition at line 7 of file OptoScanHistograms.h.

Constructor & Destructor Documentation

◆ OptoScanHistograms()

OptoScanHistograms::OptoScanHistograms ( const edm::ParameterSet pset,
DQMStore bei 
)

Definition at line 18 of file OptoScanHistograms.cc.

20  factory_ = unique_ptr<OptoScanSummaryFactory>(new OptoScanSummaryFactory);
21  LogTrace(mlDqmClient_) << "[OptoScanHistograms::" << __func__ << "]"
22  << " Constructing object...";
23 }

References CommissioningHistograms::factory_, LogTrace, and sistrip::mlDqmClient_.

◆ ~OptoScanHistograms()

OptoScanHistograms::~OptoScanHistograms ( )
override

Definition at line 27 of file OptoScanHistograms.cc.

27  {
28  LogTrace(mlDqmClient_) << "[OptoScanHistograms::" << __func__ << "]"
29  << " Denstructing object...";
30 }

References LogTrace, and sistrip::mlDqmClient_.

Member Function Documentation

◆ histoAnalysis()

void OptoScanHistograms::histoAnalysis ( bool  debug)
overridevirtual

Reimplemented from CommissioningHistograms.

Definition at line 34 of file OptoScanHistograms.cc.

34  {
35  LogTrace(mlDqmClient_) << "[OptoScanHistograms::" << __func__ << "]";
36 
37  // Some initialisation
38  uint16_t valid = 0;
39  HistosMap::const_iterator iter;
40  Analyses::iterator ianal;
41  std::map<std::string, uint16_t> errors;
42 
43  // Clear map holding analysis objects
44  for (ianal = data().begin(); ianal != data().end(); ianal++) {
45  if (ianal->second) {
46  delete ianal->second;
47  }
48  }
49  data().clear();
50 
51  // Iterate through map containing histograms
52  for (iter = histos().begin(); iter != histos().end(); iter++) {
53  // Check vector of histos is not empty
54  if (iter->second.empty()) {
55  edm::LogWarning(mlDqmClient_) << "[OptoScanHistograms::" << __func__ << "]"
56  << " Zero histograms found!";
57  continue;
58  }
59 
60  // Retrieve pointers to histos
61  std::vector<TH1*> profs;
62  Histos::const_iterator ihis = iter->second.begin();
63  for (; ihis != iter->second.end(); ihis++) {
64  TProfile* prof = ExtractTObject<TProfile>().extract((*ihis)->me_);
65  if (prof) {
66  profs.push_back(prof);
67  }
68  }
69 
70  // Perform histo analysis
71  OptoScanAnalysis* anal = new OptoScanAnalysis(iter->first);
72  OptoScanAlgorithm algo(this->pset(), anal);
73  algo.analysis(profs);
74  data()[iter->first] = anal;
75  if (anal->isValid()) {
76  valid++;
77  }
78  if (!anal->getErrorCodes().empty()) {
79  errors[anal->getErrorCodes()[0]]++;
80  }
81  }
82 
83  if (!histos().empty()) {
84  edm::LogVerbatim(mlDqmClient_) << "[OptoScanHistograms::" << __func__ << "]"
85  << " Analyzed histograms for " << histos().size() << " FED channels, of which "
86  << valid << " (" << 100 * valid / histos().size() << "%) are valid.";
87  } else {
88  edm::LogWarning(mlDqmClient_) << "[OptoScanHistograms::" << __func__ << "]"
89  << " No histograms to analyze!";
90  }
91 
92  if (!histos().empty()) {
93  edm::LogVerbatim(mlDqmClient_) << "[OptoScanHistograms::" << __func__ << "]"
94  << " Analyzed histograms for " << histos().size() << " FED channels, of which "
95  << valid << " (" << 100 * valid / histos().size() << "%) are valid.";
96  if (!errors.empty()) {
97  uint16_t count = 0;
98  std::stringstream ss;
99  ss << std::endl;
100  std::map<std::string, uint16_t>::const_iterator ii;
101  for (ii = errors.begin(); ii != errors.end(); ++ii) {
102  ss << " " << ii->first << ": " << ii->second << std::endl;
103  count += ii->second;
104  }
105  edm::LogWarning(mlDqmClient_) << "[OptoScanHistograms::" << __func__ << "]"
106  << " Found " << count << " errors (" << 100 * count / histos().size()
107  << "%): " << ss.str();
108  }
109  } else {
110  edm::LogWarning(mlDqmClient_) << "[OptoScanHistograms::" << __func__ << "]"
111  << " No histograms to analyze!";
112  }
113 }

References conversion_template_cfg::anal, begin, KineDebug3::count(), CommissioningHistograms::data(), relativeConstraints::empty, MessageLogger_cfi::errors, ExtractTObject< T >::extract(), CommissioningHistograms::histos(), cuy::ii, LogTrace, sistrip::mlDqmClient_, CommissioningHistograms::pset(), contentValuesCheck::ss, and validateGeometry_cfg::valid.

◆ printAnalyses()

void OptoScanHistograms::printAnalyses ( )
overridevirtual

Reimplemented from CommissioningHistograms.

Definition at line 117 of file OptoScanHistograms.cc.

117  {
118  Analyses::iterator ianal = data().begin();
119  Analyses::iterator janal = data().end();
120  for (; ianal != janal; ++ianal) {
121  if (ianal->second) {
122  std::stringstream ss;
123  if (ianal->second->isValid()) {
124  ianal->second->print(ss);
125  LogTrace(mlDqmClient_) << ss.str();
126  } else {
127  ianal->second->print(ss, 0);
128  ianal->second->print(ss, 1);
129  ianal->second->print(ss, 2);
130  ianal->second->print(ss, 3);
131  edm::LogWarning(mlDqmClient_) << ss.str();
132  }
133  }
134  }
135 }

References CommissioningHistograms::data(), LogTrace, sistrip::mlDqmClient_, and contentValuesCheck::ss.

CommissioningHistograms::pset
const edm::ParameterSet & pset() const
Definition: CommissioningHistograms.h:163
CommissioningHistograms::bei
DQMStore *const bei() const
Definition: CommissioningHistograms.h:159
sistrip::OPTO_SCAN
Definition: ConstantsForRunType.h:74
MessageLogger_cfi.errors
errors
Definition: MessageLogger_cfi.py:18
CommissioningHistograms::data
Analyses & data(bool getMaskedData=false)
Definition: CommissioningHistograms.cc:718
ExtractTObject
Definition: ExtractTObject.h:9
sistrip::mlDqmClient_
static const char mlDqmClient_[]
Definition: ConstantsForLogger.h:19
validateGeometry_cfg.valid
valid
Definition: validateGeometry_cfg.py:21
CommissioningHistograms::CommissioningHistograms
CommissioningHistograms()
Definition: CommissioningHistograms.cc:60
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
cmsdt::algo
algo
Definition: constants.h:164
errors
Definition: errors.py:1
CommissioningHistograms::factory_
std::unique_ptr< Factory > factory_
Definition: CommissioningHistograms.h:129
edm::LogWarning
Definition: MessageLogger.h:141
edm::ParameterSet
Definition: ParameterSet.h:36
KineDebug3::count
void count()
Definition: KinematicConstrainedVertexUpdatorT.h:21
edm::LogVerbatim
Definition: MessageLogger.h:297
ExtractTObject::extract
static T * extract(MonitorElement *me)
Definition: ExtractTObject.cc:21
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
OptoScanSummaryFactory
Definition: OptoScanSummaryFactory.h:6
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
CommissioningHistograms::histos
const HistosMap & histos() const
Definition: CommissioningHistograms.h:161
OptoScanAnalysis
Histogram-based analysis for opto bias/gain scan.
Definition: OptoScanAnalysis.h:15
OptoScanAlgorithm
Definition: OptoScanAlgorithm.h:18
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
conversion_template_cfg.anal
anal
Definition: conversion_template_cfg.py:16
cuy.ii
ii
Definition: cuy.py:590
begin
#define begin
Definition: vmac.h:32