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

#include <SkewnessTest.h>

Inheritance diagram for dqm_algorithms::SkewnessTest:
Collaboration diagram for dqm_algorithms::SkewnessTest:

Public Member Functions

 SkewnessTest (const std::string &name)
 
SkewnessTestclone ()
 
dqm_core::Resultexecute (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 18 of file SkewnessTest.h.

Constructor & Destructor Documentation

◆ SkewnessTest()

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

Definition at line 30 of file SkewnessTest.cxx.

31  : m_name( name )
32 {
33  dqm_core::AlgorithmManager::instance().registerAlgorithm("SkewnessTest_"+name,this);
34 }

Member Function Documentation

◆ clone()

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

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 
)

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 
)

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 ) {
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 
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) ) {
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 }

◆ printDescription()

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

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
private

Definition at line 29 of file SkewnessTest.h.


The documentation for this struct was generated from the following files:
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
yodamerge_tmp.axis
list axis
Definition: yodamerge_tmp.py:241
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
athena.value
value
Definition: athena.py:122
config
Definition: PhysicsAnalysis/AnalysisCommon/AssociationUtils/python/config.py:1
instance
std::map< std::string, double > instance
Definition: Run_To_Get_Tags.h:8
Result
ICscStripFitter::Result Result
Definition: CalibCscStripFitter.cxx:13
python.handimod.Green
int Green
Definition: handimod.py:524
dqm_algorithms::SkewnessTest::m_name
std::string m_name
Definition: SkewnessTest.h:29
python.handimod.Red
Red
Definition: handimod.py:551
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
threshold
Definition: chainparser.cxx:74
dqm_algorithms::SkewnessTest::SkewnessTest
SkewnessTest(const std::string &name)
Definition: SkewnessTest.cxx:30
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TH1
Definition: rootspy.cxx:268
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::SkewnessTest::CompareSkewnessTest
bool CompareSkewnessTest(const std::string &type, double value, double threshold)
Definition: SkewnessTest.cxx:99
dqm_algorithms::tools::GetFirstFromMap
double GetFirstFromMap(const std::string &paramName, const std::map< std::string, double > &params)
Definition: AlgorithmHelper.cxx:339
histogram
std::string histogram
Definition: chains.cxx:52