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 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 ){profs.push_back(prof);}
77  if (!prof ){
78  TH1F* prof = ExtractTObject<TH1F>().extract((*ihis)->me_);
79  profs.push_back(prof);
80  }
81  }
82 
83  // Perform histo analysis
84  DaqScopeModeAnalysis* anal = new DaqScopeModeAnalysis( iter->first );
85  DaqScopeModeAlgorithm algo( this->pset(), anal );
86  algo.analysis( profs );
87  data()[iter->first] = anal;
88 
89  if ( anal->isValid() ) { valid++; }
90  if ( !anal->getErrorCodes().empty() ) {
91  errors[anal->getErrorCodes()[0]]++;
92  }
93  }
94 
95  if ( !histos().empty() ) {
97  << "[DaqScopeModeHistograms::" << __func__ << "]"
98  << " Analyzed histograms for " << histos().size()
99  << " FED channels, of which " << valid
100  << " (" << 100 * valid / histos().size()
101  << "%) are valid.";
102  if ( !errors.empty() ) {
103  uint16_t count = 0;
104  std::stringstream ss;
105  ss << std::endl;
106  std::map<std::string,uint16_t>::const_iterator ii;
107  for ( ii = errors.begin(); ii != errors.end(); ++ii ) {
108  ss << " " << ii->first << ": " << ii->second << std::endl;
109  count += ii->second;
110  }
112  << "[DaqScopeModeHistograms::" << __func__ << "]"
113  << " Found " << count << " errors ("
114  << 100 * count / histos().size() << "%): "
115  << ss.str();
116  }
117  } else {
119  << "[DaqScopeModeHistograms::" << __func__ << "]"
120  << " No histograms to analyze!";
121  }
122 }
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 125 of file DaqScopeModeHistograms.cc.

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

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