CMS 3D CMS Logo

List of all members | Public Member Functions
VpspScanHistograms Class Reference

#include <VpspScanHistograms.h>

Inheritance diagram for VpspScanHistograms:
CommissioningHistograms VpspScanHistosUsingDb

Public Member Functions

void histoAnalysis (bool debug) override
 
void printAnalyses () override
 
 VpspScanHistograms (const edm::ParameterSet &pset, DQMStore *)
 
 ~VpspScanHistograms () override
 
- 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, 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 VpspScanHistograms.h.

Constructor & Destructor Documentation

◆ VpspScanHistograms()

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

Definition at line 20 of file VpspScanHistograms.cc.

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

22  factory_ = std::make_unique<VpspScanSummaryFactory>();
23  LogTrace(mlDqmClient_) << "[VpspScanHistograms::" << __func__ << "]"
24  << " Constructing object...";
25 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
static const char mlDqmClient_[]
#define LogTrace(id)
std::unique_ptr< Factory > factory_
const edm::ParameterSet & pset() const
DQMStore *const bei() const

◆ ~VpspScanHistograms()

VpspScanHistograms::~VpspScanHistograms ( )
override

Definition at line 29 of file VpspScanHistograms.cc.

References LogTrace, and sistrip::mlDqmClient_.

29  {
30  LogTrace(mlDqmClient_) << "[VpspScanHistograms::" << __func__ << "]"
31  << " Denstructing object...";
32 }
static const char mlDqmClient_[]
#define LogTrace(id)

Member Function Documentation

◆ histoAnalysis()

void VpspScanHistograms::histoAnalysis ( bool  debug)
overridevirtual

Reimplemented from CommissioningHistograms.

Definition at line 36 of file VpspScanHistograms.cc.

References conversion_template_cfg::anal, submitPVResolutionJobs::count, CommissioningHistograms::data(), relativeConstraints::empty, nano_mu_digi_cff::errors, extract(), CommissioningHistograms::histos(), cuy::ii, LogTrace, sistrip::mlDqmClient_, CommissioningHistograms::pset(), contentValuesCheck::ss, and validateGeometry_cfg::valid.

36  {
37  LogTrace(mlDqmClient_) << "[VpspScanHistograms::" << __func__ << "]";
38 
39  // Some initialisation
40  uint16_t valid = 0;
41  HistosMap::const_iterator iter;
42  Analyses::iterator ianal;
43  std::map<std::string, uint16_t> errors;
44 
45  // Clear map holding analysis objects
46  for (ianal = data().begin(); ianal != data().end(); ianal++) {
47  if (ianal->second) {
48  delete ianal->second;
49  }
50  }
51  data().clear();
52 
53  // Iterate through map containing histograms
54  for (iter = histos().begin(); iter != histos().end(); iter++) {
55  // Check vector of histos is not empty
56  if (iter->second.empty()) {
57  edm::LogWarning(mlDqmClient_) << "[VpspScanHistograms::" << __func__ << "]"
58  << " Zero histograms found!" << endl;
59  continue;
60  }
61 
62  // Retrieve pointers to profile histos for this FED channel
63  std::vector<TH1*> profs;
64  Histos::const_iterator ihis = iter->second.begin();
65  for (; ihis != iter->second.end(); ihis++) {
66  TProfile* prof = ExtractTObject<TProfile>().extract((*ihis)->me_);
67  if (prof) {
68  profs.push_back(prof);
69  }
70  }
71 
72  // Perform histo analysis
73  VpspScanAnalysis* anal = new VpspScanAnalysis(iter->first);
74  VpspScanAlgorithm algo(this->pset(), anal);
75  algo.analysis(profs);
76  data()[iter->first] = anal;
77  if (anal->isValid()) {
78  valid++;
79  }
80  if (!anal->getErrorCodes().empty()) {
81  errors[anal->getErrorCodes()[0]]++;
82  }
83  }
84 
85  if (!histos().empty()) {
86  edm::LogVerbatim(mlDqmClient_) << "[VpspScanHistograms::" << __func__ << "]"
87  << " Analyzed histograms for " << histos().size() << " FED channels, of which "
88  << valid << " (" << 100 * valid / histos().size() << "%) are valid.";
89  if (!errors.empty()) {
90  uint16_t count = 0;
91  std::stringstream ss;
92  ss << std::endl;
93  std::map<std::string, uint16_t>::const_iterator ii;
94  for (ii = errors.begin(); ii != errors.end(); ++ii) {
95  ss << " " << ii->first << ": " << ii->second << std::endl;
96  count += ii->second;
97  }
98  edm::LogWarning(mlDqmClient_) << "[VpspScanHistograms::" << __func__ << "]"
99  << " Found " << count << " errors (" << 100 * count / histos().size()
100  << "%): " << ss.str();
101  }
102  } else {
103  edm::LogWarning(mlDqmClient_) << "[VpspScanHistograms::" << __func__ << "]"
104  << " No histograms to analyze!";
105  }
106 }
Log< level::Info, true > LogVerbatim
const HistosMap & histos() const
Analyses & data(bool getMaskedData=false)
static const char mlDqmClient_[]
#define LogTrace(id)
ii
Definition: cuy.py:589
Histogram-based analysis for VPSP scan.
int extract(std::vector< int > *output, const std::string &dati)
Histogram-based analysis for VPSP scan.
const edm::ParameterSet & pset() const
Definition: errors.py:1
Log< level::Warning, false > LogWarning

◆ printAnalyses()

void VpspScanHistograms::printAnalyses ( )
overridevirtual

Reimplemented from CommissioningHistograms.

Definition at line 110 of file VpspScanHistograms.cc.

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

110  {
111  Analyses::iterator ianal = data().begin();
112  Analyses::iterator janal = data().end();
113  for (; ianal != janal; ++ianal) {
114  if (ianal->second) {
115  std::stringstream ss;
116  ianal->second->print(ss, 1);
117  ianal->second->print(ss, 2);
118  if (ianal->second->isValid()) {
119  LogTrace(mlDqmClient_) << ss.str();
120  } else {
121  edm::LogWarning(mlDqmClient_) << ss.str();
122  }
123  }
124  }
125 }
Analyses & data(bool getMaskedData=false)
static const char mlDqmClient_[]
#define LogTrace(id)
Log< level::Warning, false > LogWarning