ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
DataQuality
DataQualityUtils
src
han_results_print.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include <cstdlib>
6
#include <filesystem>
7
#include <iostream>
8
#include <string>
9
10
#include "
CxxUtils/checker_macros.h
"
11
#include "
DataQualityUtils/HanOutputFile.h
"
12
13
namespace
14
{
15
int
usage
(
const
std::string& command_name,
int
exit_code);
16
17
class
CmdLineArgs
18
{
19
public
:
20
int
parse
(
int
argc,
char
* argv[]);
21
22
std::string command;
23
std::string hresults;
24
};
25
}
// unnamed namespace
26
27
int
main
ATLAS_NOT_THREAD_SAFE
(
int
argc,
char
* argv[]) {
28
CmdLineArgs arg;
29
int
rc
= arg.parse(argc, argv);
30
31
if
(
rc
!= 0)
return
rc
;
32
33
std::string resultsName(arg.hresults);
34
35
if
(!std::filesystem::exists(resultsName)) {
36
std::cerr <<
"File "
<< resultsName <<
" does not seem to exist. Exiting"
<< std::endl;
37
return
1;
38
}
39
40
dqutils::HanOutputFile
of(resultsName);
41
42
of.
printAllDQAssessments
();
43
return
0;
44
}
45
46
// ************************************************************
47
// Private Functions
48
// ************************************************************
49
50
namespace
51
{
52
int
usage
(
const
std::string& command_name,
int
exit_code) {
53
std::string
message
;
54
message
+=
"\n"
;
55
message
+=
"This program takes as an argument the name of a \'han\' results\n"
;
56
message
+=
"file and prints the statuses of all assessments to stdout.\n"
;
57
58
std::string::size_type
s
= command_name.size();
59
std::string::size_type
p
= command_name.rfind(
'/'
, s);
60
std::string short_name = command_name.substr(p + 1, s);
61
62
std::cout <<
"\n"
;
63
std::cout <<
"Usage: "
<< short_name <<
" <results_file>\n"
;
64
std::cout <<
message
<<
"\n"
;
65
return
exit_code;
66
}
67
68
int
CmdLineArgs::parse(
int
argc,
char
* argv[]) {
69
command =
argv
[0];
70
if
(argc > 2)
return
usage
(command, 1);
71
72
if
(argc < 2)
return
usage
(command, 0);
73
74
hresults =
argv
[1];
75
return
0;
76
}
77
}
// unnamed namespace
main
int main(int, char **)
Main class for all the CppUnit test classes.
Definition
CppUnit_SGtestdriver.cxx:141
HanOutputFile.h
rc
static Double_t rc
Definition
LArPhysWaveHECTool.cxx:37
checker_macros.h
Define macros for attributes used to control the static checker.
ATLAS_NOT_THREAD_SAFE
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
Definition
checker_macros.h:212
dqutils::HanOutputFile
Definition
HanOutputFile.h:32
dqutils::HanOutputFile::printAllDQAssessments
virtual void printAllDQAssessments()
Definition
HanOutputFile.cxx:715
parse
std::map< std::string, std::string, std::less<> > parse(const std::string &list)
Definition
egammaLayerRecalibTool.cxx:1180
usage
StatusCode usage()
Definition
fbtTestToyMC.cxx:1168
LArCellNtuple.argv
argv
Definition
LArCellNtuple.py:167
ReweightUtils.message
message
Definition
ReweightUtils.py:15
python.SystemOfUnits.s
float s
Definition
SystemOfUnits.py:147
python.utils.AtlRunQueryDQUtils.p
p
Definition
AtlRunQueryDQUtils.py:209
Generated on
for ATLAS Offline Software by
1.17.0