ATLAS Offline Software
MDTWorstCaseSummary.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 /* MDTWorstCaseSummary.cxx file makes a WorstCaseSummary from the LowStat MDT flags. This loops over all results in MDT[BA][BC][EA][EC] and determines looks at ML Coverage plots, it
6 then computes the region coverage as a percentage of NBinsOn/TotalBins.
7  */
8 
9 #include <dqm_core/AlgorithmManager.h>
10 
12 
13 #include <string>
14 
15 #include <dqm_core/Result.h>
16 #include <dqm_core/Parameter.h>
17 
19 
21 {
22  dqm_core::AlgorithmManager::instance().registerSummaryMaker("MDTWorstCaseSummary",this);
23 }
24 
26 {
27 }
28 
31 {
32  return new MDTWorstCaseSummary();
33 }
34 
37  const dqm_core::Result &,
38  const dqm_core::ParametersMap & map)
39 {
40  dqm_core::ParametersMap::const_iterator iter;
41 
42  double TotalBins = 0;
43  int NBins = 0;
44 
45  for (iter=map.begin();iter!=map.end();++iter){
46 
47  std::string name = (*iter).first;
48  if(name.find("NumberOfHitsIn") == std::string::npos) continue;
49 
50  std::map<std::string,double> theTags = (*iter).second->getResult()->tags_;
51 
52  int nBins = 0;
53  double ratio = 1.;
54  double effCut = 1.;
55  for(std::map<std::string,double>::const_iterator mitr = theTags.begin(); mitr != theTags.end(); ++mitr){
56  std::string parameter = (*mitr).first;
57  if(parameter == "NBins") {
58  nBins = (*mitr).second;
59  }
60  if(parameter == "NBins_%"){
61  ratio = (*mitr).second;
62  }
63  if(parameter == "Effective_BinThreshold") effCut = (*mitr).second;
64  }
65 
66  if(ratio > 0 && effCut > 1.1) {
67  TotalBins += nBins/ratio*100;
68  NBins += nBins;
69  }
70 
71  }
72 
73  dqm_core::Result *newresult = new dqm_core::Result();
74 
75 
76  if( TotalBins < 100) newresult->status_ = dqm_core::Result::Undefined;
77  else if( NBins*1./TotalBins < 0.9) newresult->status_ = dqm_core::Result::Red;
78  else newresult->status_ = dqm_core::Result::Green;
79 
80  return newresult;
81 
82 }
83 
Undefined
@ Undefined
Definition: MaterialTypes.h:8
dqm_algorithms::summary::MDTWorstCaseSummary::~MDTWorstCaseSummary
~MDTWorstCaseSummary()
Definition: MDTWorstCaseSummary.cxx:25
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::MDTWorstCaseSummary::execute
dqm_core::Result * execute(const std::string &, const dqm_core::Result &, const dqm_core::ParametersMap &)
Definition: MDTWorstCaseSummary.cxx:36
dqm_algorithms::summary::MDTWorstCaseSummary::clone
MDTWorstCaseSummary * clone()
Definition: MDTWorstCaseSummary.cxx:30
python.handimod.Green
int Green
Definition: handimod.py:524
python.handimod.Red
Red
Definition: handimod.py:551
dumpTgcDigiJitter.nBins
list nBins
Definition: dumpTgcDigiJitter.py:29
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
python.compareTCTs.ratio
ratio
Definition: compareTCTs.py:295
MDTWorstCaseSummary.h
dqm_algorithms::summary::MDTWorstCaseSummary
A simple summary Compute the MDT Coverage to ML Granularity per region (BA,BC,EA,EC) based on four se...
Definition: MDTWorstCaseSummary.h:25
dqm_algorithms::summary::MDTWorstCaseSummary::MDTWorstCaseSummary
MDTWorstCaseSummary()
Definition: MDTWorstCaseSummary.cxx:20