ATLAS Offline Software
WorstCaseYellow.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
8 #include <dqm_core/AlgorithmManager.h>
9 #include <dqm_core/Result.h>
10 #include <dqm_core/Parameter.h>
12 
14 
16 {
17  dqm_core::AlgorithmManager::instance().registerSummaryMaker("WorstCaseYellow",this);
18 }
19 
21 {
22 }
23 
26 {
27  return new WorstCaseYellow();
28 }
29 
32  const dqm_core::Result &,
33  const dqm_core::ParametersMap & map)
34 {
35  dqm_core::ParametersMap::const_iterator iter;
36  unsigned int black=0;
37  unsigned int red=0;
38  unsigned int yellow=0;
39  unsigned int green=0;
40  unsigned int undefined = 0;
41  unsigned int skipped = 0;
42 
43  for (iter=map.begin();iter!=map.end();++iter){
44  //If weight is 0 skip this result. Allow to "turn off"
45  // results in summary makers
46  if ( iter->second->getWeight() == 0 )
47  {
48  ERS_DEBUG(2,"Skip result (weight 0): "<<iter->first);
49  ++skipped;
50  continue;
51  }
52  dqm_core::Result::Status status=iter->second->getResult().get()->status_;
54  ++red;
55  } else if (status==dqm_core::Result::Yellow) {
56  ++yellow;
57  } else if (status==dqm_core::Result::Green) {
58  ++green;
59  } else if (status==dqm_core::Result::Disabled) {
60  ++black;
61  } else {
62  ++undefined;
63  }
64  }
65 
66  dqm_core::Result *newresult = new dqm_core::Result();
67 
68  if (black == map.size() ) {
69  newresult->status_=dqm_core::Result::Disabled;
70  return newresult;
71  }
72 
73 
74  if ( red > 0 ) {
75  newresult->status_=dqm_core::Result::Yellow; //ONLY change from WorstCaseSummary
76  } else if ( yellow > 0 ) {
77  newresult->status_=dqm_core::Result::Yellow;
78  } else if ( green > 0 ) {
79  newresult->status_=dqm_core::Result::Green;
80  } else {
81  newresult->status_=dqm_core::Result::Undefined;
82  }
83  newresult->tags_.insert(std::make_pair("NumRed",(double)red));
84  newresult->tags_.insert(std::make_pair("NumYellow",(double)yellow));
85  newresult->tags_.insert(std::make_pair("NumGreen",(double)green));
86  newresult->tags_.insert(std::make_pair("NumUndefined",(double)undefined));
87  newresult->tags_.insert(std::make_pair("NumDisabled",(double)black));
88  newresult->tags_.insert(std::make_pair("NumExcluded",(double)skipped));
89  return newresult;
90 }
91 
Undefined
@ Undefined
Definition: MaterialTypes.h:8
dqm_algorithms::summary::WorstCaseYellow::WorstCaseYellow
WorstCaseYellow()
Definition: WorstCaseYellow.cxx:15
instance
std::map< std::string, double > instance
Definition: Run_To_Get_Tags.h:8
dqm_algorithms::summary::WorstCaseYellow
Restricted summary.
Definition: WorstCaseYellow.h:23
yellow
@ yellow
Definition: BinsDiffFromStripMedian.h:18
Result
ICscStripFitter::Result Result
Definition: CalibCscStripFitter.cxx:13
python.handimod.Green
int Green
Definition: handimod.py:524
dqm_algorithms::summary::WorstCaseYellow::execute
dqm_core::Result * execute(const std::string &, const dqm_core::Result &, const dqm_core::ParametersMap &)
Definition: WorstCaseYellow.cxx:31
python.handimod.Red
Red
Definition: handimod.py:551
dqm_algorithms::summary::WorstCaseYellow::clone
WorstCaseYellow * clone()
Definition: WorstCaseYellow.cxx:25
green
@ green
Definition: BinsDiffFromStripMedian.h:18
Athena::Status
Status
Athena specific StatusCode values.
Definition: AthStatusCode.h:22
dqm_algorithms::summary::WorstCaseYellow::~WorstCaseYellow
~WorstCaseYellow()
Definition: WorstCaseYellow.cxx:20
WorstCaseYellow.h
merge.status
status
Definition: merge.py:17
red
@ red
Definition: BinsDiffFromStripMedian.h:18