ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
DataQuality
dqm_algorithms
src
BlackBin1D.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
8
9
#include <dqm_core/AlgorithmConfig.h>
10
#include <
dqm_algorithms/BlackBin1D.h
>
11
#include <
dqm_algorithms/tools/AlgorithmHelper.h
>
12
#include <TH1.h>
13
#include <TH2.h>
14
#include <TF1.h>
15
#include <TClass.h>
16
#include <ers/ers.h>
17
18
19
#include <dqm_core/AlgorithmManager.h>
20
21
static
dqm_algorithms::BlackBin1D
myInstance
;
22
23
dqm_algorithms::BlackBin1D::BlackBin1D
()
24
25
{
26
dqm_core::AlgorithmManager::instance().registerAlgorithm(
"BlackBin1D"
,
this
);
27
}
28
29
dqm_algorithms::BlackBin1D
*
30
dqm_algorithms::BlackBin1D::clone
()
31
{
32
33
return
new
BlackBin1D
();
34
}
35
36
37
dqm_core::Result *
38
dqm_algorithms::BlackBin1D::execute
(
const
std::string & name,
39
const
TObject &
object
,
40
const
dqm_core::AlgorithmConfig & config)
41
{
42
const
TH1 *
histogram
;
43
44
if
(
object
.
IsA
()->InheritsFrom(
"TH1"
) ) {
45
histogram
=
static_cast<
const
TH1*
>
(&object);
46
if
(
histogram
->GetDimension() > 2 ){
47
throw
dqm_core::BadConfig( ERS_HERE, name,
"dimension > 2 "
);
48
}
49
}
else
{
50
throw
dqm_core::BadConfig( ERS_HERE, name,
"does not inherit from TH1"
);
51
}
52
53
//Unused so commented out:
54
//double bin_threshold;
55
//double gthreshold;
56
//double rthreshold;
57
int
xbin;
58
59
try
{
60
xbin = (int)
dqm_algorithms::tools::GetFirstFromMap
(
"XBin"
, config.getParameters());
61
62
}
63
catch
( dqm_core::Exception & ex ) {
64
//out << "Some of the parameters are missing!" << std::endl;
65
throw
dqm_core::BadConfig( ERS_HERE, name, ex.what(), ex );
66
}
67
68
//Get the bin content of the histogram
69
double
binContents=
histogram
-> GetBinContent(xbin);
70
71
dqm_core::Result* result =
new
dqm_core::Result();
72
result->tags_[
"BinContent"
] = binContents;
73
if
(binContents>0){
74
result->status_ = dqm_core::Result::Disabled;
75
}
76
else
{
77
result->status_ = dqm_core::Result::Green;
78
}
79
80
return
result;
81
}
82
83
void
84
dqm_algorithms::BlackBin1D::printDescription
(std::ostream& out)
85
{
86
87
out<<
"Black bin 1D: Returns status -1 (black) if bin has no contents\n"
<< std::endl;
88
89
out<<
"Mandatory parameter: XBin: The label of the X bin that you would like to check\n"
<<std::endl;
90
91
92
}
93
AlgorithmHelper.h
myInstance
static dqm_algorithms::AutoencoderExampleAlgorithm myInstance
Definition
AutoencoderExampleAlgorithm.cxx:30
BlackBin1D.h
histogram
std::string histogram
Definition
chains.cxx:52
dqm_algorithms::tools::GetFirstFromMap
double GetFirstFromMap(const std::string ¶mName, const std::map< std::string, double > ¶ms)
Definition
AlgorithmHelper.cxx:346
dqm_algorithms::BlackBin1D
Definition
BlackBin1D.h:19
dqm_algorithms::BlackBin1D::BlackBin1D
BlackBin1D()
Definition
BlackBin1D.cxx:23
dqm_algorithms::BlackBin1D::clone
BlackBin1D * clone()
Definition
BlackBin1D.cxx:30
dqm_algorithms::BlackBin1D::execute
dqm_core::Result * execute(const std::string &, const TObject &, const dqm_core::AlgorithmConfig &)
Definition
BlackBin1D.cxx:38
dqm_algorithms::BlackBin1D::printDescription
void printDescription(std::ostream &out)
Definition
BlackBin1D.cxx:84
IsA
#define IsA
Declare the TObject style functions.
Definition
xAODTEventBranch.h:59
Generated on
for ATLAS Offline Software by
1.17.0