ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
DataQuality
dqm_algorithms
summary
SimpleSummary.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
9
#include <iostream>
10
11
#include <dqm_core/AlgorithmManager.h>
12
13
#include <
dqm_algorithms/summary/SimpleSummary.h
>
14
#include <dqm_core/Result.h>
15
#include <dqm_core/Parameter.h>
16
17
using namespace
std
;
18
19
static
dqm_algorithms::summary::SimpleSummary
myInstance
;
20
21
dqm_algorithms::summary::SimpleSummary::SimpleSummary
(){
22
dqm_core::AlgorithmManager::instance().registerSummaryMaker(
"SimpleSummary"
,
this
);
23
}
24
25
dqm_algorithms::summary::SimpleSummary::~SimpleSummary
(){
26
}
27
28
dqm_algorithms::summary::SimpleSummary
*
29
dqm_algorithms::summary::SimpleSummary::clone
(){
30
return
new
SimpleSummary
();
31
}
32
33
dqm_core::Result *
34
dqm_algorithms::summary::SimpleSummary::execute
(
const
std::string & ,
35
const
dqm_core::Result & ,
36
const
dqm_core::ParametersMap & map){
37
38
dqm_core::ParametersMap::const_iterator iter;
39
40
float
rweight = 0;
41
float
yweight = 0;
42
float
gweight = 0;
43
44
float
ngrey = 0;
45
float
nblack = 0;
46
47
for
(iter=map.begin();iter!=map.end();++iter){
48
49
dqm_core::Result::Status status=iter->second->getResult().get()->status_;
50
51
if
( status == dqm_core::Result::Red ) {
52
rweight+=iter->second->getWeight();
53
}
else
if
( status == dqm_core::Result::Yellow ) {
54
yweight+=iter->second->getWeight();
55
}
else
if
( status == dqm_core::Result::Green ) {
56
gweight+=iter->second->getWeight();
57
}
else
if
( status == dqm_core::Result::Undefined ) {
58
++ngrey;
59
}
else
if
( status==dqm_core::Result::Disabled ) {
60
++nblack;
61
}
62
}
63
64
65
dqm_core::Result *newresult =
new
dqm_core::Result();
66
67
if
( nblack == map.size() ) {
68
newresult->status_=dqm_core::Result::Disabled;
69
return
newresult;
70
}
71
if
( ( ngrey + nblack ) == map.size() ) {
72
newresult->status_=dqm_core::Result::Undefined;
73
return
newresult;
74
}
75
76
float
weight = gweight > ((rweight >= yweight) ? rweight : yweight) ? gweight : ((rweight >= yweight) ? rweight : yweight);
77
78
if
( weight == 0 ) {
79
newresult->status_=dqm_core::Result::Undefined;
80
return
newresult;
81
}
82
83
if
( weight == rweight ) {
84
newresult->status_=dqm_core::Result::Red;
85
}
else
if
( weight == yweight ) {
86
newresult->status_=dqm_core::Result::Yellow;
87
}
else
{
88
newresult->status_=dqm_core::Result::Green;
89
}
90
91
return
newresult;
92
93
}
myInstance
static dqm_algorithms::AutoencoderExampleAlgorithm myInstance
Definition
AutoencoderExampleAlgorithm.cxx:30
SimpleSummary.h
file declares the dqm_algorithms::summary::SimpleSummary class.
std
STL namespace.
dqm_algorithms::summary::SimpleSummary
Definition
SimpleSummary.h:20
dqm_algorithms::summary::SimpleSummary::execute
dqm_core::Result * execute(const std::string &, const dqm_core::Result &result, const dqm_core::ParametersMap &)
Definition
SimpleSummary.cxx:34
dqm_algorithms::summary::SimpleSummary::~SimpleSummary
~SimpleSummary()
Definition
SimpleSummary.cxx:25
dqm_algorithms::summary::SimpleSummary::SimpleSummary
SimpleSummary()
Definition
SimpleSummary.cxx:21
dqm_algorithms::summary::SimpleSummary::clone
SimpleSummary * clone()
Definition
SimpleSummary.cxx:29
Generated on
for ATLAS Offline Software by
1.17.0