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
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,
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 PedsFullNoiseHistograms.h.

Constructor & Destructor Documentation

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

Definition at line 20 of file PedsFullNoiseHistograms.cc.

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

22  pset.getParameter<edm::ParameterSet>("PedsFullNoiseParameters"), bei, sistrip::PEDS_FULL_NOISE) {
23  factory_ = std::make_unique<PedsFullNoiseSummaryFactory>();
24  LogTrace(mlDqmClient_) << "[PedsFullNoiseHistograms::" << __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
PedsFullNoiseHistograms::~PedsFullNoiseHistograms ( )
override

Definition at line 30 of file PedsFullNoiseHistograms.cc.

References LogTrace, and sistrip::mlDqmClient_.

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

Member Function Documentation

void PedsFullNoiseHistograms::histoAnalysis ( bool  debug)
overridevirtual

Reimplemented from CommissioningHistograms.

Definition at line 37 of file PedsFullNoiseHistograms.cc.

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

37  {
38  LogTrace(mlDqmClient_) << "[PedsFullNoiseHistograms::" << __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  long int ichannel = 0;
56  long int nchannel = histos().size();
57  for (iter = histos().begin(); iter != histos().end(); iter++) {
58  // Check vector of histos is not empty
59  if (iter->second.empty()) {
60  edm::LogWarning(mlDqmClient_) << "[PedsFullNoiseHistograms::" << __func__ << "]"
61  << " Zero histograms found!";
62  continue;
63  }
64 
65  // Retrieve pointers to peds and noise histos
66  std::vector<TH1*> hists;
67  Histos::const_iterator ihis = iter->second.begin();
68 
69  for (; ihis != iter->second.end(); ihis++) {
70  // pedestal and noise 1D profiles
71  TProfile* prof = ExtractTObject<TProfile>().extract((*ihis)->me_);
72  if (prof) {
73  hists.push_back(prof);
74  }
75  // 2D noise histograms
76  TH2S* his2D = ExtractTObject<TH2S>().extract((*ihis)->me_);
77  if (his2D) {
78  hists.push_back(his2D);
79  }
80  }
81 
82  if (ichannel % 100 == 0)
83  edm::LogVerbatim(mlDqmClient_) << "[PedsFullNoiseHistograms::" << __func__ << "]"
84  << " Analyzing channel " << ichannel << " out of " << nchannel;
85  ichannel++;
86 
87  // Perform histo analysis
88  PedsFullNoiseAnalysis* anal = new PedsFullNoiseAnalysis(iter->first);
89  PedsFullNoiseAlgorithm algo(this->pset(), anal);
90  algo.analysis(hists);
91 
92  data()[iter->first] = anal;
93  if (anal->isValid()) {
94  valid++;
95  }
96  if (!anal->getErrorCodes().empty()) {
97  errors[anal->getErrorCodes()[0]]++;
98  }
99  }
100 
101  if (!histos().empty()) {
102  edm::LogVerbatim(mlDqmClient_) << "[PedsFullNoiseHistograms::" << __func__ << "]"
103  << " Analyzed histograms for " << histos().size() << " FED channels, of which "
104  << valid << " (" << 100 * valid / histos().size() << "%) are valid.";
105  if (!errors.empty()) {
106  uint16_t count = 0;
107  std::stringstream ss;
108  ss << std::endl;
109  std::map<std::string, uint16_t>::const_iterator ii;
110  for (ii = errors.begin(); ii != errors.end(); ++ii) {
111  ss << " " << ii->first << ": " << ii->second << std::endl;
112  count += ii->second;
113  }
114  edm::LogWarning(mlDqmClient_) << "[PedsFullNoiseHistograms::" << __func__ << "]"
115  << " Found " << count << " errors (" << 100 * count / histos().size()
116  << "%): " << ss.str();
117  }
118  } else {
119  edm::LogWarning(mlDqmClient_) << "[PedsFullNoiseHistograms::" << __func__ << "]"
120  << " No histograms to analyze!";
121  }
122 }
Log< level::Info, true > LogVerbatim
Analyses & data(bool getMaskedData=false)
const edm::ParameterSet & pset() const
bool isValid() const override
static const char mlDqmClient_[]
Histogram-based analysis for pedestal run.
int ii
Definition: cuy.py:589
#define LogTrace(id)
Histogram-based analysis for pedestal run.
int extract(std::vector< int > *output, const std::string &dati)
list hists
Definition: compare.py:318
Log< level::Warning, false > LogWarning
const VString & getErrorCodes() const
const HistosMap & histos() const
void PedsFullNoiseHistograms::printAnalyses ( )
overridevirtual

Reimplemented from CommissioningHistograms.

Definition at line 126 of file PedsFullNoiseHistograms.cc.

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

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