CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions
DaqScopeModeHistograms Class Reference

#include <DaqScopeModeHistograms.h>

Inheritance diagram for DaqScopeModeHistograms:
CommissioningHistograms DaqScopeModeHistosUsingDb

Public Member Functions

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

Constructor & Destructor Documentation

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

Definition at line 20 of file DaqScopeModeHistograms.cc.

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

22  pset.getParameter<edm::ParameterSet>("DaqScopeModeParameters"), bei, sistrip::DAQ_SCOPE_MODE) {
23  factory_ = std::make_unique<DaqScopeModeSummaryFactory>();
24  LogTrace(mlDqmClient_) << "[DaqScopeModeHistograms::" << __func__ << "]"
25  << " Constructing object...";
26 }
static const char mlDqmClient_[]
#define LogTrace(id)
std::unique_ptr< Factory > factory_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
DaqScopeModeHistograms::~DaqScopeModeHistograms ( )
override

Definition at line 30 of file DaqScopeModeHistograms.cc.

References LogTrace, and sistrip::mlDqmClient_.

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

Member Function Documentation

void DaqScopeModeHistograms::histoAnalysis ( bool  debug)
overridevirtual

Reimplemented from CommissioningHistograms.

Definition at line 37 of file DaqScopeModeHistograms.cc.

References CommissioningAlgorithm::analysis(), SplitLinear::begin, submitPVResolutionJobs::count, CommissioningHistograms::data(), relativeConstraints::empty, extract(), CommissioningAnalysis::getErrorCodes(), CommissioningHistograms::histos(), cuy::ii, DaqScopeModeAnalysis::isValid(), LogTrace, sistrip::mlDqmClient_, CommissioningHistograms::pset(), and contentValuesCheck::ss.

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

Reimplemented from CommissioningHistograms.

Definition at line 115 of file DaqScopeModeHistograms.cc.

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

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