ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
dqm_algorithms::KurtosisTest_GreaterThanAbs Struct Reference

#include <KurtosisTest_GreaterThanAbs.h>

Inheritance diagram for dqm_algorithms::KurtosisTest_GreaterThanAbs:
Collaboration diagram for dqm_algorithms::KurtosisTest_GreaterThanAbs:

Public Member Functions

 KurtosisTest_GreaterThanAbs ()
 
KurtosisTestclone ()
 
dqm_core::Resultexecute (const std::string &, const TObject &, const dqm_core::AlgorithmConfig &)
 
void printDescription (std::ostream &out)
 
bool CompareKurtosisTest (const std::string &type, double value, double threshold)
 

Private Attributes

std::string m_name
 

Detailed Description

Definition at line 16 of file KurtosisTest_GreaterThanAbs.h.

Constructor & Destructor Documentation

◆ KurtosisTest_GreaterThanAbs()

dqm_algorithms::KurtosisTest_GreaterThanAbs::KurtosisTest_GreaterThanAbs ( )
inline

Definition at line 18 of file KurtosisTest_GreaterThanAbs.h.

18 : KurtosisTest("GreaterThanAbs") {};

Member Function Documentation

◆ clone()

dqm_algorithms::KurtosisTest * dqm_algorithms::KurtosisTest::clone ( )
inherited

Definition at line 36 of file KurtosisTest.cxx.

37 {
38  return new KurtosisTest( m_name );
39 }

◆ CompareKurtosisTest()

bool dqm_algorithms::KurtosisTest::CompareKurtosisTest ( const std::string &  type,
double  value,
double  threshold 
)
inherited

Definition at line 98 of file KurtosisTest.cxx.

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

◆ execute()

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

Definition at line 43 of file KurtosisTest.cxx.

46 {
47  const TH1 * histogram;
48 
49  if( object.IsA()->InheritsFrom( "TH1" ) ) {
50  histogram = static_cast<const TH1*>(&object);
51  } else {
52  throw dqm_core::BadConfig( ERS_HERE, name, "does not inherit from TH1" );
53  }
54 
55  const double minstat = dqm_algorithms::tools::GetFirstFromMap( "MinStat", config.getParameters(), -1);
56 
57  if (histogram->GetEffectiveEntries() < minstat ) {
59  result->tags_["InsufficientEffectiveEntries"] = histogram->GetEffectiveEntries();
60  return result;
61  }
62 
63  double gthreshold;
64  double rthreshold;
65 
66  int axis = (int) dqm_algorithms::tools::GetFirstFromMap( "Axis", config.getParameters(), 1);
67 
68  try {
69  rthreshold = dqm_algorithms::tools::GetFromMap( "K", config.getRedThresholds() );
70  gthreshold = dqm_algorithms::tools::GetFromMap( "K", config.getGreenThresholds() );
71  }
72  catch ( dqm_core::Exception & ex ) {
73  throw dqm_core::BadConfig( ERS_HERE, name, ex.what(), ex );
74  }
75  ERS_DEBUG(1,"Axis for kurtosis calculation:"<<axis);
76 
77  Double_t kurtosis = histogram->GetKurtosis( axis );
78  Double_t kurtosis_e = histogram->GetKurtosis( axis + 10 );
79 
81  ERS_DEBUG(1,"Kurtosis = "<<kurtosis<<" +- "<<kurtosis_e);
82  result->tags_["Kurtosis"] = kurtosis;
83  result->tags_["ApproxStandardError"]=kurtosis_e;
84 
85  if ( CompareKurtosisTest( m_name , kurtosis ,gthreshold) ) {
87  } else if ( CompareKurtosisTest( m_name, kurtosis, rthreshold) ) {
88  result->status_ = dqm_core::Result::Yellow;
89  } else {
90  result->status_ = dqm_core::Result::Red;
91  }
92 
93  return result;
94 
95 }

◆ printDescription()

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

Definition at line 109 of file KurtosisTest.cxx.

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

Member Data Documentation

◆ m_name

std::string dqm_algorithms::KurtosisTest::m_name
privateinherited

Definition at line 29 of file KurtosisTest.h.


The documentation for this struct was generated from the following file:
Undefined
@ Undefined
Definition: MaterialTypes.h:8
get_generator_info.result
result
Definition: get_generator_info.py:21
IsA
#define IsA
Declare the TObject style functions.
Definition: xAODTEventBranch.h:59
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
dqm_algorithms::KurtosisTest::CompareKurtosisTest
bool CompareKurtosisTest(const std::string &type, double value, double threshold)
Definition: KurtosisTest.cxx:98
yodamerge_tmp.axis
list axis
Definition: yodamerge_tmp.py:241
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
athena.value
value
Definition: athena.py:124
dqm_algorithms::KurtosisTest::KurtosisTest
KurtosisTest(const std::string &name)
Definition: KurtosisTest.cxx:29
config
Definition: PhysicsAnalysis/AnalysisCommon/AssociationUtils/python/config.py:1
Result
ICscStripFitter::Result Result
Definition: CalibCscStripFitter.cxx:13
python.handimod.Green
int Green
Definition: handimod.py:524
python.handimod.Red
Red
Definition: handimod.py:551
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
threshold
Definition: chainparser.cxx:74
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
dqm_algorithms::tools::GetFromMap
const T & GetFromMap(const std::string &pname, const std::map< std::string, T > &params)
Definition: AlgorithmHelper.h:114
pickleTool.object
object
Definition: pickleTool.py:30
dqm_algorithms::tools::GetFirstFromMap
double GetFirstFromMap(const std::string &paramName, const std::map< std::string, double > &params)
Definition: AlgorithmHelper.cxx:339
dqm_algorithms::KurtosisTest::m_name
std::string m_name
Definition: KurtosisTest.h:29
histogram
std::string histogram
Definition: chains.cxx:52