ATLAS Offline Software
JetWorstCaseSummary.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /* JetWorstCaseSummary.cxx file makes a WorstCaseSummary from the LAr & TileCal flags, while returns only yellow/green flags if the Jet or CaloMon flags are red/yellow/green.
6  */
7 
8 #include <dqm_core/AlgorithmManager.h>
9 
11 
12 #include <dqm_core/Result.h>
13 #include <dqm_core/Parameter.h>
14 
16 
18 {
19  dqm_core::AlgorithmManager::instance().registerSummaryMaker("JetWorstCaseSummary",this);
20 }
21 
23 {
24 }
25 
28 {
29  return new JetWorstCaseSummary();
30 }
31 
34  const dqm_core::Result &,
35  const dqm_core::ParametersMap & map)
36 {
37  dqm_core::ParametersMap::const_iterator iter;
38  unsigned int red=0;
39  unsigned int yellow=0;
40  unsigned int green=0;
41  unsigned int undefined = 0;
42  unsigned int skipped = 0;
43 
44  for (iter=map.begin();iter!=map.end();++iter){
45 
46  //If weight is 0 skip this result. Allow to "turn off"
47  // results in summary makers
48  if ( iter->second->getWeight() == 0 )
49  {
50  ERS_DEBUG(2,"Skip result (weight 0): "<<iter->first);
51  ++skipped;
52  continue;
53  }
54  dqm_core::Result::Status status=iter->second->getResult().get()->status_;
55 
56  if( (status==dqm_core::Result::Red && (iter->first == "JetBarrel" || iter->first == "JetASide" || iter->first == "JetCSide" ||iter->first == "CaloMonBAR" || iter->first == "CaloMonECA" || iter->first == "CaloMonECC" )) || status==dqm_core::Result::Yellow) {
57  ++yellow;
58 
59  } else if(status==dqm_core::Result::Red) {
60  ++red;
61  } else if (status==dqm_core::Result::Green) {
62  ++green;
63  } else {
64  ++undefined;
65  }
66  }
67 
68  dqm_core::Result *newresult = new dqm_core::Result();
69 
70 
71  if ( red > 0 ) {
72  newresult->status_=dqm_core::Result::Red;
73  } else if ( yellow > 0 ) {
74  newresult->status_=dqm_core::Result::Yellow;
75  } else if ( green > 0 ) {
76  newresult->status_=dqm_core::Result::Green;
77  } else {
78  newresult->status_=dqm_core::Result::Undefined;
79  }
80  newresult->tags_.insert(std::make_pair("NumRed",(double)red));
81  newresult->tags_.insert(std::make_pair("NumYellow",(double)yellow));
82  newresult->tags_.insert(std::make_pair("NumGreen",(double)green));
83  newresult->tags_.insert(std::make_pair("NumUndefined",(double)undefined));
84  newresult->tags_.insert(std::make_pair("NumExcluded",(double)skipped));
85  return newresult;
86 }
87 
Undefined
@ Undefined
Definition: MaterialTypes.h:8
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
dqm_algorithms::summary::JetWorstCaseSummary
A simple summary This summary maker calculates result for a region for Jet Monitoring as the worst re...
Definition: JetWorstCaseSummary.h:27
dqm_algorithms::summary::JetWorstCaseSummary::execute
dqm_core::Result * execute(const std::string &, const dqm_core::Result &, const dqm_core::ParametersMap &)
Definition: JetWorstCaseSummary.cxx:33
green
@ green
Definition: BinsDiffFromStripMedian.h:18
Athena::Status
Status
Athena specific StatusCode values.
Definition: AthStatusCode.h:22
dqm_algorithms::summary::JetWorstCaseSummary::JetWorstCaseSummary
JetWorstCaseSummary()
Definition: JetWorstCaseSummary.cxx:17
JetWorstCaseSummary.h
dqm_algorithms::summary::JetWorstCaseSummary::~JetWorstCaseSummary
~JetWorstCaseSummary()
Definition: JetWorstCaseSummary.cxx:22
merge.status
status
Definition: merge.py:17
dqm_algorithms::summary::JetWorstCaseSummary::clone
JetWorstCaseSummary * clone()
Definition: JetWorstCaseSummary.cxx:27
red
@ red
Definition: BinsDiffFromStripMedian.h:18