CMS 3D CMS Logo

List of all members | Public Member Functions
PedsFullNoiseHistograms Class Reference

#include <PedsFullNoiseHistograms.h>

Inheritance diagram for PedsFullNoiseHistograms:
CommissioningHistograms PedsFullNoiseHistosUsingDb

Public Member Functions

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

Constructor & Destructor Documentation

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

Definition at line 18 of file PedsFullNoiseHistograms.cc.

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

20  pset.getParameter<edm::ParameterSet>("PedsFullNoiseParameters"), bei, sistrip::PEDS_FULL_NOISE) {
21  factory_ = unique_ptr<PedsFullNoiseSummaryFactory>(new PedsFullNoiseSummaryFactory);
22  LogTrace(mlDqmClient_) << "[PedsFullNoiseHistograms::" << __func__ << "]"
23  << " Constructing object...";
24 }
T getParameter(std::string const &) const
static const char mlDqmClient_[]
DQMStore *const bei() const
#define LogTrace(id)
std::unique_ptr< Factory > factory_
PedsFullNoiseHistograms::~PedsFullNoiseHistograms ( )
override

Definition at line 28 of file PedsFullNoiseHistograms.cc.

References LogTrace, and sistrip::mlDqmClient_.

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

Member Function Documentation

void PedsFullNoiseHistograms::histoAnalysis ( bool  debug)
overridevirtual

Reimplemented from CommissioningHistograms.

Definition at line 35 of file PedsFullNoiseHistograms.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(), compare::hists, cuy::ii, PedsFullNoiseAnalysis::isValid(), LogTrace, sistrip::mlDqmClient_, CommissioningHistograms::pset(), contentValuesCheck::ss, and validateGeometry_cfg::valid.

35  {
36  LogTrace(mlDqmClient_) << "[PedsFullNoiseHistograms::" << __func__ << "]";
37 
38  // Some initialisation
39  uint16_t valid = 0;
40  HistosMap::const_iterator iter;
41  Analyses::iterator ianal;
42  std::map<std::string, uint16_t> errors;
43 
44  // Clear map holding analysis objects
45  for (ianal = data().begin(); ianal != data().end(); ianal++) {
46  if (ianal->second) {
47  delete ianal->second;
48  }
49  }
50  data().clear();
51 
52  // Iterate through map containing histograms
53  long int ichannel = 0;
54  long int nchannel = histos().size();
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_) << "[PedsFullNoiseHistograms::" << __func__ << "]"
59  << " Zero histograms found!";
60  continue;
61  }
62 
63  // Retrieve pointers to peds and noise histos
64  std::vector<TH1*> hists;
65  Histos::const_iterator ihis = iter->second.begin();
66 
67  for (; ihis != iter->second.end(); ihis++) {
68  // pedestal and noise 1D profiles
69  TProfile* prof = ExtractTObject<TProfile>().extract((*ihis)->me_);
70  if (prof) {
71  hists.push_back(prof);
72  }
73  // 2D noise histograms
74  TH2S* his2D = ExtractTObject<TH2S>().extract((*ihis)->me_);
75  if (his2D) {
76  hists.push_back(his2D);
77  }
78  }
79 
80  if (ichannel % 100 == 0)
81  edm::LogVerbatim(mlDqmClient_) << "[PedsFullNoiseHistograms::" << __func__ << "]"
82  << " Analyzing channel " << ichannel << " out of " << nchannel;
83  ichannel++;
84 
85  // Perform histo analysis
87  PedsFullNoiseAlgorithm algo(this->pset(), anal);
88  algo.analysis(hists);
89 
90  data()[iter->first] = anal;
91  if (anal->isValid()) {
92  valid++;
93  }
94  if (!anal->getErrorCodes().empty()) {
95  errors[anal->getErrorCodes()[0]]++;
96  }
97  }
98 
99  if (!histos().empty()) {
100  edm::LogVerbatim(mlDqmClient_) << "[PedsFullNoiseHistograms::" << __func__ << "]"
101  << " Analyzed histograms for " << histos().size() << " FED channels, of which "
102  << valid << " (" << 100 * valid / histos().size() << "%) are valid.";
103  if (!errors.empty()) {
104  uint16_t count = 0;
105  std::stringstream ss;
106  ss << std::endl;
107  std::map<std::string, uint16_t>::const_iterator ii;
108  for (ii = errors.begin(); ii != errors.end(); ++ii) {
109  ss << " " << ii->first << ": " << ii->second << std::endl;
110  count += ii->second;
111  }
112  edm::LogWarning(mlDqmClient_) << "[PedsFullNoiseHistograms::" << __func__ << "]"
113  << " Found " << count << " errors (" << 100 * count / histos().size()
114  << "%): " << ss.str();
115  }
116  } else {
117  edm::LogWarning(mlDqmClient_) << "[PedsFullNoiseHistograms::" << __func__ << "]"
118  << " No histograms to analyze!";
119  }
120 }
Analyses & data(bool getMaskedData=false)
const edm::ParameterSet & pset() const
static const char mlDqmClient_[]
Histogram-based analysis for pedestal run.
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
const VString & getErrorCodes() const
bool isValid() const override
const HistosMap & histos() const
void PedsFullNoiseHistograms::printAnalyses ( )
overridevirtual

Reimplemented from CommissioningHistograms.

Definition at line 124 of file PedsFullNoiseHistograms.cc.

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

124  {
125  Analyses::iterator ianal = data().begin();
126  Analyses::iterator janal = data().end();
127  for (; ianal != janal; ++ianal) {
128  if (ianal->second) {
129  std::stringstream ss;
130  ianal->second->print(ss, 1);
131  ianal->second->print(ss, 2);
132  if (ianal->second->isValid()) {
133  LogTrace(mlDqmClient_) << ss.str();
134  } else {
135  edm::LogWarning(mlDqmClient_) << ss.str();
136  }
137  }
138  }
139 }
Analyses & data(bool getMaskedData=false)
static const char mlDqmClient_[]
#define LogTrace(id)