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

#include <SkewnessTest_GreaterThanAbs.h>

Inheritance diagram for dqm_algorithms::SkewnessTest_GreaterThanAbs:
Collaboration diagram for dqm_algorithms::SkewnessTest_GreaterThanAbs:

Public Member Functions

 SkewnessTest_GreaterThanAbs ()
SkewnessTestclone ()
dqm_core::Result * execute (const std::string &, const TObject &, const dqm_core::AlgorithmConfig &)
void printDescription (std::ostream &out)
bool CompareSkewnessTest (const std::string &type, double value, double threshold)

Private Attributes

std::string m_name

Detailed Description

Definition at line 16 of file SkewnessTest_GreaterThanAbs.h.

Constructor & Destructor Documentation

◆ SkewnessTest_GreaterThanAbs()

dqm_algorithms::SkewnessTest_GreaterThanAbs::SkewnessTest_GreaterThanAbs ( )
inline

Definition at line 18 of file SkewnessTest_GreaterThanAbs.h.

18: SkewnessTest("GreaterThanAbs") {};
SkewnessTest(const std::string &name)

Member Function Documentation

◆ clone()

dqm_algorithms::SkewnessTest * dqm_algorithms::SkewnessTest::clone ( )
inherited

Definition at line 37 of file SkewnessTest.cxx.

38{
39 return new SkewnessTest( m_name );
40}

◆ CompareSkewnessTest()

bool dqm_algorithms::SkewnessTest::CompareSkewnessTest ( const std::string & type,
double value,
double threshold )
inherited

Definition at line 99 of file SkewnessTest.cxx.

99 {
100
101 if (type == "GreaterThan") return (value > threshold);
102 if (type == "LessThan") return (value < threshold);
103 if (type == "GreaterThanAbs") return ( std::abs(value) > threshold );
104 if (type == "LessThanAbs") return ( std::abs(value) < threshold);
105 return 0;
106}

◆ execute()

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

Definition at line 44 of file SkewnessTest.cxx.

47{
48 const TH1 * histogram;
49
50 if( object.IsA()->InheritsFrom( "TH1" ) ) {
51 histogram = static_cast<const TH1*>(&object);
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->GetEffectiveEntries() < minstat ) {
59 dqm_core::Result *result = new dqm_core::Result(dqm_core::Result::Undefined);
60 result->tags_["InsufficientEffectiveEntries"] = histogram->GetEffectiveEntries();
61 return result;
62 }
63
64 double gthreshold;
65 double rthreshold;
66
67 const int axis = (int) dqm_algorithms::tools::GetFirstFromMap( "Axis", config.getParameters(), 1);
68
69 try {
70 rthreshold = dqm_algorithms::tools::GetFromMap( "S", config.getRedThresholds() );
71 gthreshold = dqm_algorithms::tools::GetFromMap( "S", config.getGreenThresholds() );
72 }
73 catch ( dqm_core::Exception & ex ) {
74 throw dqm_core::BadConfig( ERS_HERE, name, ex.what(), ex );
75 }
76 ERS_DEBUG(1,"Axis for skewness calculation:"<<axis);
77
78 Double_t skewness = histogram->GetSkewness( axis );
79 Double_t skewness_e = histogram->GetSkewness( axis + 10 );
80
81 dqm_core::Result* result = new dqm_core::Result();
82 ERS_DEBUG(1,"Skewness = "<<skewness<<" +- "<<skewness_e);
83 result->tags_["Skewness"] = skewness;
84 result->tags_["ApproxStandardError"]=skewness_e;
85
86 if ( CompareSkewnessTest( m_name , skewness ,gthreshold) ) {
87 result->status_ = dqm_core::Result::Green;
88 } else if ( CompareSkewnessTest( m_name, skewness, rthreshold) ) {
89 result->status_ = dqm_core::Result::Yellow;
90 } else {
91 result->status_ = dqm_core::Result::Red;
92 }
93
94 return result;
95
96}
std::string histogram
Definition chains.cxx:52
double GetFirstFromMap(const std::string &paramName, const std::map< std::string, double > &params)
const T & GetFromMap(const std::string &pname, const std::map< std::string, T > &params)
bool CompareSkewnessTest(const std::string &type, double value, double threshold)
#define IsA
Declare the TObject style functions.

◆ printDescription()

void dqm_algorithms::SkewnessTest::printDescription ( std::ostream & out)
inherited

Definition at line 110 of file SkewnessTest.cxx.

111{
112 out<<"SkewnessTest_"+m_name+" : Checks if the Skewness of the distribution is "+m_name+" threshold value\n"<<std::endl;
113
114 out<<"Mandatory Green/Red Threshold: S: Value of Skewness"<<std::endl;
115
116 out<<"Optional Parameter: MinStat: Minimum histogram statistics needed to perform Algorithm"<<std::endl;
117 out<<"Optional Parameter: Axis: Axis along which compute Skewness: 1=X, 2=Y, 3=Z"<<std::endl;
118
119}

Member Data Documentation

◆ m_name

std::string dqm_algorithms::SkewnessTest::m_name
privateinherited

Definition at line 29 of file SkewnessTest.h.


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