ATLAS Offline Software
MDTSummary.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
9 #include <dqm_core/AlgorithmManager.h>
10 
11 
12 static dqm_algorithms::summary::MDTSummary myInstance;
14 {
15  m_thresholdRed = 10;
17  dqm_core::AlgorithmManager::instance().registerSummaryMaker("MDTSummary",this);
18 }
19 
22 {
23  return new MDTSummary();
24 }
25 
28  const dqm_core::Result&,
29  const dqm_core::ParametersMap& map)
30 {
31  int y = 0 , r = 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::Red) { ++r; }
37  else if (mystatus == dqm_core::Result::Yellow) { ++y; }
38  }
39  const double n_problems = (double)r + 0.5*(double)y;
40 
42  result->tags_["NYellows"] = y;
43  result->tags_["NReds"] = r;
44  result->tags_["RedThresh"] = m_thresholdRed;
45  result->tags_["YellowThresh"] = m_thresholdYellow;
46  if ( n_problems > m_thresholdRed)
47  {
48  result->status_ = dqm_core::Result::Red;
49  }
50  else if (n_problems > m_thresholdYellow)
51  {
52  result->status_ = dqm_core::Result::Yellow;
53  }
54  else
55  {
57  }
58  // otherwise the status remains undefined, as constructed above
59  return result;
60 }
beamspotman.r
def r
Definition: beamspotman.py:676
dqm_algorithms::summary::MDTSummary::execute
virtual dqm_core::Result * execute(const std::string &, const dqm_core::Result &, const dqm_core::ParametersMap &map)
Definition: MDTSummary.cxx:27
Undefined
@ Undefined
Definition: MaterialTypes.h:8
get_generator_info.result
result
Definition: get_generator_info.py:21
dqm_algorithms::summary::MDTSummary::clone
MDTSummary * clone()
Definition: MDTSummary.cxx:21
instance
std::map< std::string, double > instance
Definition: Run_To_Get_Tags.h:8
Result
ICscStripFitter::Result Result
Definition: CalibCscStripFitter.cxx:13
dqm_algorithms::summary::MDTSummary::m_thresholdYellow
float m_thresholdYellow
Definition: MDTSummary.h:34
dqm_algorithms::summary::MDTSummary
Definition: MDTSummary.h:27
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
MDTSummary.h
dqm_algorithms::summary::MDTSummary::MDTSummary
MDTSummary()
Definition: MDTSummary.cxx:13
y
#define y
Athena::Status
Status
Athena specific StatusCode values.
Definition: AthStatusCode.h:22
dqm_algorithms::summary::MDTSummary::m_thresholdRed
float m_thresholdRed
Definition: MDTSummary.h:33