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

#include <FractionSummary.h>

Inheritance diagram for dqm_algorithms::summary::FractionSummary:
Collaboration diagram for dqm_algorithms::summary::FractionSummary:

Public Member Functions

 FractionSummary ()
 
FractionSummaryclone ()
 
virtual dqm_core::Resultexecute (const std::string &, const dqm_core::Result &, const dqm_core::ParametersMap &map)
 

Private Attributes

float m_fractionRed
 
float m_fractionYellow
 

Detailed Description

Declares the FractionSummary SummaryMaker. Information about number of Red/Green/Yellow is attached to tags of the result

Definition at line 26 of file FractionSummary.h.

Constructor & Destructor Documentation

◆ FractionSummary()

dqm_algorithms::summary::FractionSummary::FractionSummary ( )

Definition at line 13 of file FractionSummary.cxx.

14 {
15  m_fractionRed = 0.1;
16  m_fractionYellow = 0.1;
17  dqm_core::AlgorithmManager::instance().registerSummaryMaker("FractionSummary",this);
18 }

Member Function Documentation

◆ clone()

dqm_algorithms::summary::FractionSummary * dqm_algorithms::summary::FractionSummary::clone ( )

Definition at line 21 of file FractionSummary.cxx.

22 {
23  return new FractionSummary();
24 }

◆ execute()

dqm_core::Result * dqm_algorithms::summary::FractionSummary::execute ( const std::string &  ,
const dqm_core::Result ,
const dqm_core::ParametersMap &  map 
)
virtual

Definition at line 27 of file FractionSummary.cxx.

30 {
31  int g = 0 , y = 0 , r = 0 , u = 0;
32  dqm_core::ParametersMap::const_iterator iter = map.begin();
33  for ( ; iter != map.end() ; ++iter)
34  {
35  dqm_core::Result::Status mystatus = iter->second->getResult().get()->status_;
36  if (mystatus == dqm_core::Result::Green) { ++g; }
37  else if (mystatus == dqm_core::Result::Yellow) { ++y; }
38  else if (mystatus == dqm_core::Result::Red) { ++r; }
39  else { ++u; }
40  }
41  const int total = g + y + r + u;
42  const double RedFraction = total ? ((double)r / total) : 0; // avoid to divide by zero (should never happen)
43  const double YellowFraction = total ? ((double)y / total) : 0; // avoid to divide by zero (should never happen)
44 
46  result->tags_["NGreens"] = g;
47  result->tags_["NYellows"] = y;
48  result->tags_["NReds"] = r;
49  result->tags_["NUndefineds"] = u;
50  result->tags_["RedThresh"] = m_fractionRed;
51  result->tags_["YellowThresh"] = m_fractionYellow;
52  if (RedFraction > m_fractionRed)
53  {
54  result->status_ = dqm_core::Result::Red;
55  }
56  else if (YellowFraction > m_fractionYellow)
57  {
58  result->status_ = dqm_core::Result::Yellow;
59  }
60  else if (g > u)
61  {
63  }
64  // otherwise the status remains undefined, as constructed above
65  return result;
66 }

Member Data Documentation

◆ m_fractionRed

float dqm_algorithms::summary::FractionSummary::m_fractionRed
private

Definition at line 33 of file FractionSummary.h.

◆ m_fractionYellow

float dqm_algorithms::summary::FractionSummary::m_fractionYellow
private

Definition at line 34 of file FractionSummary.h.


The documentation for this class was generated from the following files:
beamspotman.r
def r
Definition: beamspotman.py:676
Undefined
@ Undefined
Definition: MaterialTypes.h:8
get_generator_info.result
result
Definition: get_generator_info.py:21
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
instance
std::map< std::string, double > instance
Definition: Run_To_Get_Tags.h:8
python.CaloCondTools.g
g
Definition: CaloCondTools.py:15
Result
ICscStripFitter::Result Result
Definition: CalibCscStripFitter.cxx:13
python.handimod.Green
int Green
Definition: handimod.py:524
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
python.handimod.Red
Red
Definition: handimod.py:551
y
#define y
Athena::Status
Status
Athena specific StatusCode values.
Definition: AthStatusCode.h:22
dqm_algorithms::summary::FractionSummary::m_fractionRed
float m_fractionRed
Definition: FractionSummary.h:33
dqm_algorithms::summary::FractionSummary::FractionSummary
FractionSummary()
Definition: FractionSummary.cxx:13
dqm_algorithms::summary::FractionSummary::m_fractionYellow
float m_fractionYellow
Definition: FractionSummary.h:34