CMS 3D CMS Logo

List of all members | Public Member Functions
NoiseHistograms Class Reference

#include <NoiseHistograms.h>

Inheritance diagram for NoiseHistograms:
CommissioningHistograms NoiseHistosUsingDb

Public Member Functions

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

Constructor & Destructor Documentation

◆ NoiseHistograms()

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

Definition at line 20 of file NoiseHistograms.cc.

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

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

◆ ~NoiseHistograms()

NoiseHistograms::~NoiseHistograms ( )
override

Definition at line 29 of file NoiseHistograms.cc.

References LogTrace, and sistrip::mlDqmClient_.

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

Member Function Documentation

◆ histoAnalysis()

void NoiseHistograms::histoAnalysis ( bool  debug)
overridevirtual

Reimplemented from CommissioningHistograms.

Definition at line 36 of file NoiseHistograms.cc.

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

36  {
37  LogTrace(mlDqmClient_) << "[NoiseHistograms::" << __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_) << "[NoiseHistograms::" << __func__ << "]"
58  << " Zero histograms found!";
59  continue;
60  }
61 
62  // Retrieve pointers to profile histos
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  //@@ Common mode histos?...
71  //TH1F* his = ExtractTObject<TH1F>().extract( (*ihis)->me_ );
72  //if ( his ) { profs.push_back(his); }
73  }
74 
75  // Perform histo analysis
76  NoiseAnalysis* anal = new NoiseAnalysis(iter->first);
77  NoiseAlgorithm algo(this->pset(), anal);
78  algo.analysis(profs);
79  data()[iter->first] = anal;
80  if (anal->isValid()) {
81  valid++;
82  }
83  if (!anal->getErrorCodes().empty()) {
84  errors[anal->getErrorCodes()[0]]++;
85  }
86  }
87 
88  if (!histos().empty()) {
89  edm::LogVerbatim(mlDqmClient_) << "[NoiseHistograms::" << __func__ << "]"
90  << " Analyzed histograms for " << histos().size() << " FED channels, of which "
91  << valid << " (" << 100 * valid / histos().size() << "%) are valid.";
92  if (!errors.empty()) {
93  uint16_t count = 0;
94  std::stringstream ss;
95  ss << std::endl;
96  std::map<std::string, uint16_t>::const_iterator ii;
97  for (ii = errors.begin(); ii != errors.end(); ++ii) {
98  ss << " " << ii->first << ": " << ii->second << std::endl;
99  count += ii->second;
100  }
101  edm::LogWarning(mlDqmClient_) << "[NoiseHistograms::" << __func__ << "]"
102  << " Found " << count << " errors (" << 100 * count / histos().size()
103  << "%): " << ss.str();
104  }
105  } else {
106  edm::LogWarning(mlDqmClient_) << "[NoiseHistograms::" << __func__ << "]"
107  << " No histograms to analyze!";
108  }
109 }
Log< level::Info, true > LogVerbatim
const HistosMap & histos() const
Analyses & data(bool getMaskedData=false)
Histogram-based analysis for pedestal run.
static const char mlDqmClient_[]
#define LogTrace(id)
ii
Definition: cuy.py:589
int extract(std::vector< int > *output, const std::string &dati)
Histogram-based analysis for pedestal run.
Definition: NoiseAnalysis.h:15
const edm::ParameterSet & pset() const
Definition: errors.py:1
Log< level::Warning, false > LogWarning

◆ printAnalyses()

void NoiseHistograms::printAnalyses ( )
overridevirtual

Reimplemented from CommissioningHistograms.

Definition at line 113 of file NoiseHistograms.cc.

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

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