CMS 3D CMS Logo

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 SummaryPlotFactory< CommissioningAnalysis * > Factory
 
typedef std::map< uint32_t, uint32_t > FedToFecMap
 
typedef std::vector< Histo * > Histos
 
typedef std::map< uint32_t, HistosHistosMap
 
- Static Public Member Functions inherited from CommissioningHistograms
static void copyCustomInformation (DQMStore *const, const std::vector< std::string > &)
 
static void getContents (DQMStore *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 8 of file DaqScopeModeHistograms.h.

Constructor & Destructor Documentation

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

Definition at line 18 of file DaqScopeModeHistograms.cc.

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

20  : CommissioningHistograms( pset.getParameter<edm::ParameterSet>("DaqScopeModeParameters"),
21  bei,
23 {
24 
25  factory_ = unique_ptr<DaqScopeModeSummaryFactory>( new DaqScopeModeSummaryFactory );
27  << "[DaqScopeModeHistograms::" << __func__ << "]"
28  << " Constructing object...";
29 
30 }
T getParameter(std::string const &) const
static const char mlDqmClient_[]
#define LogTrace(id)
std::unique_ptr< Factory > factory_
DQMStore *const bei() const
DaqScopeModeHistograms::~DaqScopeModeHistograms ( )
override

Definition at line 34 of file DaqScopeModeHistograms.cc.

References LogTrace, and sistrip::mlDqmClient_.

34  {
36  << "[DaqScopeModeHistograms::" << __func__ << "]"
37  << " Destructing object...";
38 }
static const char mlDqmClient_[]
#define LogTrace(id)

Member Function Documentation

void DaqScopeModeHistograms::histoAnalysis ( bool  debug)
overridevirtual

Reimplemented from CommissioningHistograms.

Definition at line 42 of file DaqScopeModeHistograms.cc.

References patPFMETCorrections_cff::algo, CommissioningAlgorithm::analysis(), begin, KineDebug3::count(), CommissioningHistograms::data(), relativeConstraints::empty, benchmark_cfg::errors, extract(), CommissioningAnalysis::getErrorCodes(), CommissioningHistograms::histos(), cuy::ii, DaqScopeModeAnalysis::isValid(), LogTrace, sistrip::mlDqmClient_, and CommissioningHistograms::pset().

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

Reimplemented from CommissioningHistograms.

Definition at line 122 of file DaqScopeModeHistograms.cc.

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

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