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

#include <BasicGraphCheck.h>

Inheritance diagram for dqm_algorithms::BasicGraphCheck:
Collaboration diagram for dqm_algorithms::BasicGraphCheck:

Public Member Functions

 BasicGraphCheck (const std::string &name)
BasicGraphCheckclone ()
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 BasicGraphCheck.h.

Constructor & Destructor Documentation

◆ BasicGraphCheck()

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

Definition at line 26 of file BasicGraphCheck.cxx.

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

Member Function Documentation

◆ clone()

dqm_algorithms::BasicGraphCheck * dqm_algorithms::BasicGraphCheck::clone ( )

Definition at line 33 of file BasicGraphCheck.cxx.

34{
35
36 return new BasicGraphCheck( m_name );
37}
BasicGraphCheck(const std::string &name)

◆ execute()

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

Definition at line 41 of file BasicGraphCheck.cxx.

44{
45 const TGraph * graph;
46
47 if( object.IsA()->InheritsFrom( "TGraph" ) ) {
48 graph = static_cast<const TGraph*>(&object);
49 } else {
50 throw dqm_core::BadConfig( ERS_HERE, name, "does not inherit from TGraph" );
51 }
52
53 double minstat = dqm_algorithms::tools::GetFirstFromMap( "MinStat", config.getParameters(), -1 );
54
55 if (graph->GetN() < minstat ) {
56 dqm_core::Result *result = new dqm_core::Result(dqm_core::Result::Undefined);
57 result->tags_["InsufficientN"] = graph->GetN();
58 return result;
59 }
60
61 if (m_name == "Graph_Not_Empty") {
62 if (graph->GetN() != 0) {
63 ERS_DEBUG(1, "Graph " <<graph->GetName()<<" is Not Empty");
64 return new dqm_core::Result(dqm_core::Result::Green);
65 }else {
66 ERS_DEBUG(1, "Graph " <<graph->GetName()<<" is Empty");
67 return new dqm_core::Result(dqm_core::Result::Red);
68 }
69 } else if (m_name == "Graph_Empty") {
70 if (graph->GetN() == 0) {
71 ERS_DEBUG(1, "Graph " <<graph->GetName()<<" is Empty");
72 return new dqm_core::Result(dqm_core::Result::Green);
73 }else {
74 ERS_DEBUG(1, "Graph " <<graph->GetName()<<" is Not Empty");
75 return new dqm_core::Result(dqm_core::Result::Red);
76 }
77 } else {
78 return new dqm_core::Result();
79 }
80
81
82}
double GetFirstFromMap(const std::string &paramName, const std::map< std::string, double > &params)
#define IsA
Declare the TObject style functions.

◆ printDescription()

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

Definition at line 85 of file BasicGraphCheck.cxx.

86{
87 if ( m_name == "Graph_Not_Empty"){
88 out<<"Graph_Not_Empty: Checks that graph is not empty\n"<<std::endl;
89 } else if ( m_name == "Graph_Empty"){
90 out<<"Graph_Empty: Checks that graph is empty\n"<<std::endl;
91 }
92
93 out<<"Optional Parameter: MinStat: Minimum graph statistics needed to perform Algorithm\n"<<std::endl;
94}

Member Data Documentation

◆ m_name

std::string dqm_algorithms::BasicGraphCheck::m_name
private

Definition at line 29 of file BasicGraphCheck.h.


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