CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Attributes
FedCablingHistograms Class Reference

#include <FedCablingHistograms.h>

Inheritance diagram for FedCablingHistograms:
CommissioningHistograms

Public Types

typedef std::map< uint32_t, FedCablingAnalysis * > Analyses
 
typedef SummaryPlotFactory< FedCablingAnalysis * > Factory
 
- 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
 

Public Member Functions

void createSummaryHisto (const sistrip::Monitorable &, const sistrip::Presentation &, const std::string &top_level_dir, const sistrip::Granularity &) override
 
 FedCablingHistograms (const edm::ParameterSet &pset, DQMStore *)
 
void histoAnalysis (bool debug) override
 
void printAnalyses () override
 
 ~FedCablingHistograms () 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 > &)
 
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 ()
 

Protected Attributes

Analyses data_
 
std::unique_ptr< Factoryfactory_
 
- Protected Attributes inherited from CommissioningHistograms
std::unique_ptr< Factoryfactory_
 

Additional Inherited Members

- 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
 

Detailed Description

Definition at line 9 of file FedCablingHistograms.h.

Member Typedef Documentation

◆ Analyses

typedef std::map<uint32_t, FedCablingAnalysis*> FedCablingHistograms::Analyses

Definition at line 15 of file FedCablingHistograms.h.

◆ Factory

Definition at line 14 of file FedCablingHistograms.h.

Constructor & Destructor Documentation

◆ FedCablingHistograms()

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

Definition at line 19 of file FedCablingHistograms.cc.

References LogTrace, and sistrip::mlDqmClient_.

21  factory_(new Factory) {
22  LogTrace(mlDqmClient_) << "[FedCablingHistograms::" << __func__ << "]"
23  << " Constructing object...";
24 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
static const char mlDqmClient_[]
std::unique_ptr< Factory > factory_
#define LogTrace(id)
SummaryPlotFactory< FedCablingAnalysis * > Factory
const edm::ParameterSet & pset() const
DQMStore *const bei() const

◆ ~FedCablingHistograms()

FedCablingHistograms::~FedCablingHistograms ( )
override

Definition at line 28 of file FedCablingHistograms.cc.

References LogTrace, and sistrip::mlDqmClient_.

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

Member Function Documentation

◆ createSummaryHisto()

void FedCablingHistograms::createSummaryHisto ( const sistrip::Monitorable histo,
const sistrip::Presentation type,
const std::string &  top_level_dir,
const sistrip::Granularity gran 
)
overridevirtual

Reimplemented from CommissioningHistograms.

Definition at line 109 of file FedCablingHistograms.cc.

References data_, DeadROC_duringRun::dir, factory_, timingPdfMaker::histo, histoAnalysis(), CommissioningHistograms::histogram(), LogTrace, sistrip::mlDqmClient_, edmLumisInFiles::summary, sistrip::UNKNOWN_VIEW, SiStripEnumsAndStrings::view(), and fw3dlego::xbins.

112  {
113  LogTrace(mlDqmClient_) << "[FedCablingHistograms::" << __func__ << "]";
114 
115  // Check view
117  if (view == sistrip::UNKNOWN_VIEW) {
118  return;
119  }
120 
121  // Analyze histograms if not done already
122  if (data_.empty()) {
123  histoAnalysis(false);
124  }
125 
126  // Extract data to be histogrammed
127  uint32_t xbins = factory_->init(histo, type, view, dir, gran, data_);
128 
129  // Create summary histogram (if it doesn't already exist)
130  TH1* summary = histogram(histo, type, view, dir, xbins);
131 
132  // Fill histogram with data
133  factory_->fill(*summary);
134 }
const double xbins[]
static const char mlDqmClient_[]
std::unique_ptr< Factory > factory_
#define LogTrace(id)
static std::string view(const sistrip::View &)
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_)
void histoAnalysis(bool debug) override

◆ histoAnalysis()

void FedCablingHistograms::histoAnalysis ( bool  debug)
overridevirtual

Reimplemented from CommissioningHistograms.

Definition at line 35 of file FedCablingHistograms.cc.

References conversion_template_cfg::anal, SplitLinear::begin, data_, extract(), CommissioningHistograms::histos(), LogTrace, sistrip::mlDqmClient_, CommissioningHistograms::pset(), and validateGeometry_cfg::valid.

Referenced by createSummaryHisto().

35  {
36  LogTrace(mlDqmClient_) << "[FedCablingHistograms::" << __func__ << "]";
37 
38  uint16_t valid = 0;
39  HistosMap::const_iterator iter;
40  Analyses::iterator ianal;
41 
42  // Clear map holding analysis objects
43  for (ianal = data_.begin(); ianal != data_.end(); ianal++) {
44  if (ianal->second) {
45  delete ianal->second;
46  }
47  }
48  data_.clear();
49 
50  // Iterate through map containing histograms
51  for (iter = histos().begin(); iter != histos().end(); iter++) {
52  // Check vector of histos is not empty
53  if (iter->second.empty()) {
54  edm::LogWarning(mlDqmClient_) << "[FedCablingHistograms::" << __func__ << "]"
55  << " Zero histograms found!";
56  continue;
57  }
58 
59  // Retrieve pointers to histos
60  std::vector<TH1*> profs;
61  Histos::const_iterator ihis = iter->second.begin();
62  for (; ihis != iter->second.end(); ihis++) {
63  TProfile* prof = ExtractTObject<TProfile>().extract((*ihis)->me_);
64  if (prof) {
65  profs.push_back(prof);
66  }
67  }
68 
69  // Perform histo analysis
70  FedCablingAnalysis* anal = new FedCablingAnalysis(iter->first);
71  FedCablingAlgorithm algo(this->pset(), anal);
72  algo.analysis(profs);
73  data_[iter->first] = anal;
74  if (anal->isValid()) {
75  valid++;
76  }
77  }
78 
79  if (!histos().empty()) {
80  edm::LogVerbatim(mlDqmClient_) << "[FedCablingHistograms::" << __func__ << "]"
81  << " Analyzed histograms for " << histos().size() << " FED channels, of which "
82  << valid << " (" << 100 * valid / histos().size() << "%) are valid.";
83  } else {
84  edm::LogWarning(mlDqmClient_) << "[FedCablingHistograms::" << __func__ << "]"
85  << " No histograms to analyze!";
86  }
87 }
Log< level::Info, true > LogVerbatim
const HistosMap & histos() const
Histogram-based analysis for connection loop.
static const char mlDqmClient_[]
#define LogTrace(id)
int extract(std::vector< int > *output, const std::string &dati)
const edm::ParameterSet & pset() const
Log< level::Warning, false > LogWarning
Histogram-based analysis for connection loop.

◆ printAnalyses()

void FedCablingHistograms::printAnalyses ( )
overridevirtual

Reimplemented from CommissioningHistograms.

Definition at line 91 of file FedCablingHistograms.cc.

References data_, LogTrace, sistrip::mlDqmClient_, and contentValuesCheck::ss.

91  {
92  Analyses::iterator ianal = data_.begin();
93  Analyses::iterator janal = data_.end();
94  for (; ianal != janal; ++ianal) {
95  if (ianal->second) {
96  std::stringstream ss;
97  ianal->second->print(ss);
98  if (ianal->second->isValid()) {
99  LogTrace(mlDqmClient_) << ss.str();
100  } else {
101  edm::LogWarning(mlDqmClient_) << ss.str();
102  }
103  }
104  }
105 }
static const char mlDqmClient_[]
#define LogTrace(id)
Log< level::Warning, false > LogWarning

Member Data Documentation

◆ data_

Analyses FedCablingHistograms::data_
protected

Definition at line 30 of file FedCablingHistograms.h.

Referenced by createSummaryHisto(), histoAnalysis(), and printAnalyses().

◆ factory_

std::unique_ptr<Factory> FedCablingHistograms::factory_
protected

Definition at line 32 of file FedCablingHistograms.h.

Referenced by createSummaryHisto().