CMS 3D CMS Logo

List of all members | Public Member Functions
PedestalsHistograms Class Reference

#include <PedestalsHistograms.h>

Inheritance diagram for PedestalsHistograms:
CommissioningHistograms PedestalsHistosUsingDb

Public Member Functions

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

Constructor & Destructor Documentation

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

Definition at line 18 of file PedestalsHistograms.cc.

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

20  factory_ = unique_ptr<PedestalsSummaryFactory>(new PedestalsSummaryFactory);
21  LogTrace(mlDqmClient_) << "[PedestalsHistograms::" << __func__ << "]"
22  << " Constructing object...";
23 }
T getParameter(std::string const &) const
static const char mlDqmClient_[]
DQMStore *const bei() const
#define LogTrace(id)
std::unique_ptr< Factory > factory_
PedestalsHistograms::~PedestalsHistograms ( )
override

Definition at line 27 of file PedestalsHistograms.cc.

References LogTrace, and sistrip::mlDqmClient_.

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

Member Function Documentation

void PedestalsHistograms::histoAnalysis ( bool  debug)
overridevirtual

Reimplemented from CommissioningHistograms.

Definition at line 34 of file PedestalsHistograms.cc.

References ecalcalib_dqm_sourceclient-live_cfg::algo, conversion_template_cfg::anal, CommissioningAlgorithm::analysis(), begin, KineDebug3::count(), CommissioningHistograms::data(), relativeConstraints::empty, MessageLogger_cfi::errors, extract(), CommissioningAnalysis::getErrorCodes(), CommissioningHistograms::histos(), cuy::ii, PedestalsAnalysis::isValid(), LogTrace, sistrip::mlDqmClient_, CommissioningHistograms::pset(), contentValuesCheck::ss, and validateGeometry_cfg::valid.

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

Reimplemented from CommissioningHistograms.

Definition at line 111 of file PedestalsHistograms.cc.

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

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