ATLAS Offline Software
Loading...
Searching...
No Matches
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
25
31
32dqm_core::Result*
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
static dqm_algorithms::BinContentComp myInstance
file declares the dqm_algorithms::summary::JetWorstCaseSummary class.
STL class.
A simple summary This summary maker calculates result for a region for Jet Monitoring as the worst re...
dqm_core::Result * execute(const std::string &, const dqm_core::Result &, const dqm_core::ParametersMap &)