ATLAS Offline Software
Public Member Functions | List of all members
dqm_algorithms::summary::PercentSummary Struct Reference

#include <PercentSummary.h>

Inheritance diagram for dqm_algorithms::summary::PercentSummary:
Collaboration diagram for dqm_algorithms::summary::PercentSummary:

Public Member Functions

 PercentSummary ()
 
 ~PercentSummary ()
 
PercentSummaryclone ()
 
dqm_core::Resultexecute (const std::string &, const dqm_core::Result &result, const dqm_core::ParametersMap &)
 

Detailed Description

Definition at line 18 of file PercentSummary.h.

Constructor & Destructor Documentation

◆ PercentSummary()

dqm_algorithms::summary::PercentSummary::PercentSummary ( )

Definition at line 21 of file PercentSummary.cxx.

22 {
23  dqm_core::AlgorithmManager::instance().registerSummaryMaker( "PercentSummary", this );
24 }

◆ ~PercentSummary()

dqm_algorithms::summary::PercentSummary::~PercentSummary ( )

Definition at line 26 of file PercentSummary.cxx.

27 {
28 }

Member Function Documentation

◆ clone()

dqm_algorithms::summary::PercentSummary * dqm_algorithms::summary::PercentSummary::clone ( )

Definition at line 31 of file PercentSummary.cxx.

32 {
33  return new PercentSummary();
34 }

◆ execute()

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

Definition at line 37 of file PercentSummary.cxx.

40 {
41 
42  dqm_core::ParametersMap::const_iterator iter;
43  double rweight=0;
44  double yweight=0;
45  double gweight=0;
46 
47  double red=0;
48  double yellow=0;
49  double green=0;
50  double undefined=0;
51 
52  double weight=0;
53  double y_percent=0;
54  double r_percent=0;
55  double ry_percent=0;
56 
57  dqm_core::Result *newresult = new dqm_core::Result();
58 
59  for (iter=map.begin();iter!=map.end();++iter){
60  dqm_core::Result::Status status=iter->second->getResult().get()->status_;
62  rweight+=iter->second->getWeight();
63  red++;
64  } else if (status==dqm_core::Result::Yellow) {
65  yweight+=iter->second->getWeight();
66  yellow++;
67  } else if (status==dqm_core::Result::Green) {
68  gweight+=iter->second->getWeight();
69  green++;
70  } else{
71  undefined++;
72  }
73  }
74 
75  weight=rweight+yweight+gweight;
76 
77  if( red+green+yellow == 0){
78  newresult->status_=dqm_core::Result::Undefined;
79  return newresult;
80  } else{
81  if(weight==0){
82  y_percent=yellow/(red+green+yellow+undefined);
83  r_percent=red/(red+green+yellow+undefined);
84  ry_percent=(red+yellow)/(red+green+yellow+undefined);
85  } else{
86  y_percent=yweight/(red+green+yellow+undefined);
87  r_percent=rweight/(red+green+yellow+undefined);
88  ry_percent=(yweight+rweight)/(red+green+yellow+undefined);
89  }
90  }
91 
92 
93  if (r_percent>=0.50 || (ry_percent >= 0.50 && r_percent>0)) {
94  newresult->status_=dqm_core::Result::Red;
95  }else if (y_percent >= 0.50 || (r_percent>0.25 && r_percent<0.50)) {
96  newresult->status_=dqm_core::Result::Yellow;
97  }else {
98  newresult->status_=dqm_core::Result::Green;
99  }
100 
101  return newresult;
102 
103 }

The documentation for this struct was generated from the following files:
Undefined
@ Undefined
Definition: MaterialTypes.h:8
HitType::undefined
@ undefined
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
instance
std::map< std::string, double > instance
Definition: Run_To_Get_Tags.h:8
yellow
@ yellow
Definition: BinsDiffFromStripMedian.h:18
Result
ICscStripFitter::Result Result
Definition: CalibCscStripFitter.cxx:13
python.handimod.Green
int Green
Definition: handimod.py:524
python.handimod.Red
Red
Definition: handimod.py:551
green
@ green
Definition: BinsDiffFromStripMedian.h:18
Athena::Status
Status
Athena specific StatusCode values.
Definition: AthStatusCode.h:22
merge.status
status
Definition: merge.py:17
red
@ red
Definition: BinsDiffFromStripMedian.h:18
dqm_algorithms::summary::PercentSummary::PercentSummary
PercentSummary()
Definition: PercentSummary.cxx:21