ATLAS Offline Software
Loading...
Searching...
No Matches
dqm_algorithms::BasicHistoCheckModuleStatus Struct Reference

#include <BasicHistoCheckModuleStatus.h>

Inheritance diagram for dqm_algorithms::BasicHistoCheckModuleStatus:
Collaboration diagram for dqm_algorithms::BasicHistoCheckModuleStatus:

Public Member Functions

 BasicHistoCheckModuleStatus (const std::string &name)
BasicHistoCheckModuleStatusclone ()
dqm_core::Result * execute (const std::string &, const TObject &, const dqm_core::AlgorithmConfig &)
void printDescription (std::ostream &out)

Private Attributes

std::string m_name

Detailed Description

Definition at line 18 of file BasicHistoCheckModuleStatus.h.

Constructor & Destructor Documentation

◆ BasicHistoCheckModuleStatus()

dqm_algorithms::BasicHistoCheckModuleStatus::BasicHistoCheckModuleStatus ( const std::string & name)

Definition at line 26 of file BasicHistoCheckModuleStatus.cxx.

27 : m_name( name )
28{
29 dqm_core::AlgorithmManager::instance().registerAlgorithm(name, this);
30}

Member Function Documentation

◆ clone()

dqm_algorithms::BasicHistoCheckModuleStatus * dqm_algorithms::BasicHistoCheckModuleStatus::clone ( )

Definition at line 33 of file BasicHistoCheckModuleStatus.cxx.

34{
35
37}

◆ execute()

dqm_core::Result * dqm_algorithms::BasicHistoCheckModuleStatus::execute ( const std::string & name,
const TObject & object,
const dqm_core::AlgorithmConfig & config )

Definition at line 41 of file BasicHistoCheckModuleStatus.cxx.

44{
45 const TH1 * histogram;
46
47 if( object.IsA()->InheritsFrom( "TH1" ) ) {
48 histogram = static_cast<const TH1*>(&object);
49 if (histogram->GetDimension() > 3 ){
50 throw dqm_core::BadConfig( ERS_HERE, name, "dimension > 3 " );
51 }
52 } else {
53 throw dqm_core::BadConfig( ERS_HERE, name, "does not inherit from TH1" );
54 }
55
56 const double minstat = dqm_algorithms::tools::GetFirstFromMap( "MinStat", config.getParameters(), -1);
57
58 if (histogram->GetEntries() < minstat ) {
59 dqm_core::Result *result = new dqm_core::Result(dqm_core::Result::Undefined);
60 result->tags_["InsufficientEntries"] = histogram->GetEntries();
61 return result;
62 }
63
64
65
66 if ( m_name == "ModuleStatus_All_Bins_Filled" ) {
67 unsigned int nbinsX_filled = 0;
68 const unsigned int binsx = histogram->GetNbinsX();
69 //const unsigned int binsy = histogram->GetNbinsY();
70 //const unsigned int binsz = histogram->GetNbinsZ();
71 for ( unsigned int i(1); i <= binsx; ++i ) {
72 //for ( unsigned int j(1); j <= binsy; ++j ) {
73 //for ( unsigned int k(1); k<= binsz; ++k ) {
74 double content= histogram -> GetBinContent(i);
75 if ( content == 0) {
76 // ERS_DEBUG(1, "Histogram " <<histogram->GetName()<<" has empty bins");
77// return new dqm_core::Result(dqm_core::Result::Red);
78
79 nbinsX_filled++;
80 }
81
82 }
83
84 if(histogram->GetEffectiveEntries() == 0){
85
86 ERS_DEBUG(1, "Histogram " <<histogram->GetName()<<" does not have all filled bins");
87 return new dqm_core::Result(dqm_core::Result::Disabled);
88
89 }
90
91
92 if(nbinsX_filled >0 && nbinsX_filled < binsx){
93 ERS_DEBUG(1, "Histogram " <<histogram->GetName()<<" has empty bins");
94 return new dqm_core::Result(dqm_core::Result::Red);
95 }
96
97
98 ERS_DEBUG(1, "Histogram " <<histogram->GetName()<<" has all filled bins");
99 return new dqm_core::Result(dqm_core::Result::Green);
100
101 }
102
103 else {
104 return new dqm_core::Result();
105 }
106
107
108}
std::string histogram
Definition chains.cxx:52
double GetFirstFromMap(const std::string &paramName, const std::map< std::string, double > &params)
str content
Definition grepfile.py:56
#define IsA
Declare the TObject style functions.

◆ printDescription()

void dqm_algorithms::BasicHistoCheckModuleStatus::printDescription ( std::ostream & out)

Definition at line 111 of file BasicHistoCheckModuleStatus.cxx.

112{
113 if ( m_name == "All_Bins_Filled"){
114 out<<"All_Bins_Filled: Checks that all bins of histogram are filled\n"<<std::endl;
115 }
116
117 out<<"Optional Parameter: MinStat: Minimum histogram statistics needed to perform Algorithm\n"<<std::endl;
118}

Member Data Documentation

◆ m_name

std::string dqm_algorithms::BasicHistoCheckModuleStatus::m_name
private

Definition at line 29 of file BasicHistoCheckModuleStatus.h.


The documentation for this struct was generated from the following files: