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

#include <BasicHistoCheckModuleStatus.h>

Inheritance diagram for dqm_algorithms::BasicHistoCheckModuleStatus:
Collaboration diagram for dqm_algorithms::BasicHistoCheckModuleStatus:

Public Member Functions

 BasicHistoCheckModuleStatus (const std::string &name)
 
BasicHistoCheckModuleStatusclone ()
 
dqm_core::Resultexecute (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 BasicHistoCheckModuleStatus.h.

Constructor & Destructor Documentation

◆ BasicHistoCheckModuleStatus()

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

Definition at line 26 of file BasicHistoCheckModuleStatus.cxx.

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

Member Function Documentation

◆ clone()

dqm_algorithms::BasicHistoCheckModuleStatus * dqm_algorithms::BasicHistoCheckModuleStatus::clone ( )

Definition at line 33 of file BasicHistoCheckModuleStatus.cxx.

34 {
35 
36  return new BasicHistoCheckModuleStatus( m_name );
37 }

◆ execute()

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

Definition at line 41 of file BasicHistoCheckModuleStatus.cxx.

44 {
45  const TH1 * histogram;
46 
47  if( object.IsA()->InheritsFrom( "TH1" ) ) {
48  histogram = static_cast<const TH1*>(&object);
49  if (histogram->GetDimension() > 3 ){
50  throw dqm_core::BadConfig( ERS_HERE, name, "dimension > 3 " );
51  }
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->GetEntries() < minstat ) {
60  result->tags_["InsufficientEntries"] = histogram->GetEntries();
61  return result;
62  }
63 
64 
65 
66  if ( m_name == "ModuleStatus_All_Bins_Filled" ) {
67  unsigned int nbinsX_filled = 0;
68  const unsigned int binsx = histogram->GetNbinsX();
69  //const unsigned int binsy = histogram->GetNbinsY();
70  //const unsigned int binsz = histogram->GetNbinsZ();
71  for ( unsigned int i(1); i <= binsx; ++i ) {
72  //for ( unsigned int j(1); j <= binsy; ++j ) {
73  //for ( unsigned int k(1); k<= binsz; ++k ) {
74  double content= histogram -> GetBinContent(i);
75  if ( content == 0) {
76  // ERS_DEBUG(1, "Histogram " <<histogram->GetName()<<" has empty bins");
77 // return new dqm_core::Result(dqm_core::Result::Red);
78 
79  nbinsX_filled++;
80  }
81 
82  }
83 
84  if(histogram->GetEffectiveEntries() == 0){
85 
86  ERS_DEBUG(1, "Histogram " <<histogram->GetName()<<" does not have all filled bins");
87  return new dqm_core::Result(dqm_core::Result::Disabled);
88 
89  }
90 
91 
92  if(nbinsX_filled >0 && nbinsX_filled < binsx){
93  ERS_DEBUG(1, "Histogram " <<histogram->GetName()<<" has empty bins");
95  }
96 
97 
98  ERS_DEBUG(1, "Histogram " <<histogram->GetName()<<" has all filled bins");
100 
101  }
102 
103  else {
104  return new dqm_core::Result();
105  }
106 
107 
108 }

◆ printDescription()

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

Definition at line 111 of file BasicHistoCheckModuleStatus.cxx.

112 {
113  if ( m_name == "All_Bins_Filled"){
114  out<<"All_Bins_Filled: Checks that all bins of histogram are filled\n"<<std::endl;
115  }
116 
117  out<<"Optional Parameter: MinStat: Minimum histogram statistics needed to perform Algorithm\n"<<std::endl;
118 }

Member Data Documentation

◆ m_name

std::string dqm_algorithms::BasicHistoCheckModuleStatus::m_name
private

Definition at line 29 of file BasicHistoCheckModuleStatus.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
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
grepfile.content
string content
Definition: grepfile.py:56
lumiFormat.i
int i
Definition: lumiFormat.py:85
Result
ICscStripFitter::Result Result
Definition: CalibCscStripFitter.cxx:13
python.handimod.Green
int Green
Definition: handimod.py:524
dqm_algorithms::BasicHistoCheckModuleStatus::m_name
std::string m_name
Definition: BasicHistoCheckModuleStatus.h:29
dqm_algorithms::BasicHistoCheckModuleStatus::BasicHistoCheckModuleStatus
BasicHistoCheckModuleStatus(const std::string &name)
Definition: BasicHistoCheckModuleStatus.cxx:26
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