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

#include <TRTHistogramHasNonZeroEntries.h>

Inheritance diagram for dqm_algorithms::TRTHistogramHasNonZeroEntries:
Collaboration diagram for dqm_algorithms::TRTHistogramHasNonZeroEntries:

Public Member Functions

 TRTHistogramHasNonZeroEntries ()
 
virtual ~TRTHistogramHasNonZeroEntries ()
 
virtual dqm_core::Algorithm * clone ()
 
virtual dqm_core::Resultexecute (const std::string &, const TObject &, const dqm_core::AlgorithmConfig &)
 
virtual void printDescription (std::ostream &out)
 

Private Attributes

std::string m_name
 

Detailed Description

Definition at line 20 of file TRTHistogramHasNonZeroEntries.h.

Constructor & Destructor Documentation

◆ TRTHistogramHasNonZeroEntries()

dqm_algorithms::TRTHistogramHasNonZeroEntries::TRTHistogramHasNonZeroEntries ( )

Definition at line 30 of file TRTHistogramHasNonZeroEntries.cxx.

30  : m_name("TRTHistogram_Has_NonZero_Entries")
31 {
32  dqm_core::AlgorithmManager::instance().registerAlgorithm(m_name, this);
33 }

◆ ~TRTHistogramHasNonZeroEntries()

dqm_algorithms::TRTHistogramHasNonZeroEntries::~TRTHistogramHasNonZeroEntries ( )
virtual

Definition at line 35 of file TRTHistogramHasNonZeroEntries.cxx.

36 {
37 }

Member Function Documentation

◆ clone()

dqm_core::Algorithm * dqm_algorithms::TRTHistogramHasNonZeroEntries::clone ( )
virtual

Definition at line 39 of file TRTHistogramHasNonZeroEntries.cxx.

40 {
41  return new TRTHistogramHasNonZeroEntries(*this);
42 }

◆ execute()

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

Definition at line 44 of file TRTHistogramHasNonZeroEntries.cxx.

45 {
46  const TH1 *histogram;
47 
48  if (object.IsA()->InheritsFrom("TH1")) {
49  histogram = static_cast<const TH1*>(&object);
50  if (histogram->GetDimension() > 3) {
51  throw dqm_core::BadConfig(ERS_HERE, name, "dimension > 3 ");
52  }
53  } else {
54  throw dqm_core::BadConfig(ERS_HERE, name, "does not inherit from TH1");
55  }
56 
57  const double minstat = dqm_algorithms::tools::GetFirstFromMap("MinStat", config.getParameters(), -1);
58 
59  if (histogram->GetEntries() < minstat) {
60  // ERS_INFO("Histogram does not satisfy MinStat requirement " << histogram->GetName());
62  result->tags_["InsufficientEntries"] = histogram->GetEntries();
63  return result;
64  }
65 
67 
68  if (histogram->GetEntries() == 0 || histogram->Integral() == 0) {
69  ERS_DEBUG(1, "Histogram " << histogram->GetName() << " is Empty");
70  result->status_ = dqm_core::Result::Red;
71  result->tags_["Integral"] = histogram->Integral();
72  } else {
73  ERS_DEBUG(1, "Histogram " << histogram->GetName() << " is Not Empty");
75  result->tags_["Integral"] = histogram->Integral();
76  }
77  return result;
78 }

◆ printDescription()

void dqm_algorithms::TRTHistogramHasNonZeroEntries::printDescription ( std::ostream &  out)
virtual

Definition at line 80 of file TRTHistogramHasNonZeroEntries.cxx.

81 {
82  out << m_name << ": Checks if histogram has entries that are not zero." << std::endl;
83 }

Member Data Documentation

◆ m_name

std::string dqm_algorithms::TRTHistogramHasNonZeroEntries::m_name
private

Definition at line 32 of file TRTHistogramHasNonZeroEntries.h.


The documentation for this class 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
dqm_algorithms::TRTHistogramHasNonZeroEntries::TRTHistogramHasNonZeroEntries
TRTHistogramHasNonZeroEntries()
Definition: TRTHistogramHasNonZeroEntries.cxx:30
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
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::TRTHistogramHasNonZeroEntries::m_name
std::string m_name
Definition: TRTHistogramHasNonZeroEntries.h:32
python.handimod.Red
Red
Definition: handimod.py:551
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
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
histogram
std::string histogram
Definition: chains.cxx:52