ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
SUSYPhys
SUSYTools
util
check_syst.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
// $Id: check_syst.cxx tripiana $
6
7
// System include(s):
8
#include <string>
9
#include <iostream>
10
11
// ROOT include(s):
12
#include <TError.h>
13
#include <TString.h>
14
#include <TSystem.h>
15
16
// Infrastructure include(s):
17
#ifdef ROOTCORE
18
# include "
xAODRootAccess/Init.h
"
19
# include "
xAODRootAccess/TEvent.h
"
20
#endif
// ROOTCORE
21
22
// Local include(s):
23
#include "
SUSYTools/SUSYObjDef_xAOD.h
"
24
25
// Other includes
26
#include "
PATInterfaces/SystematicVariation.h
"
27
#include "
PATInterfaces/SystematicRegistry.h
"
28
#include "
AsgMessaging/StatusCode.h
"
29
#include "
PATInterfaces/CorrectionCode.h
"
30
31
std::string
getFW
(std::string in,
unsigned
int
width
=30){
32
for
(
unsigned
int
i=in.size() ; i <
width
; i++)
33
in+=
" "
;
34
return
in;
35
}
36
37
int
main
(
int
argc,
char
* argv[] ) {
38
39
using namespace
asg::msgUserCode;
40
ANA_CHECK_SET_TYPE
(
int
);
41
42
StatusCode::enableFailure();
43
StatusCode::enableFailure();
44
CP::CorrectionCode::enableFailure
();
45
46
// The application's name:
47
const
char
*
APP_NAME
= argv[0];
48
49
std::string config_file = getenv(
"ROOTCOREBIN"
);
50
config_file +=
"/data/SUSYTools/SUSYTools_Default.conf"
;
51
52
// Check if we received a config file
53
if
( argc > 1 ){
54
config_file = argv[1];
55
}
56
57
// Create the tool(s) to test:
58
ST::SUSYObjDef_xAOD
objTool(
"SUSYObjDef_xAOD"
);
59
61
// Configure the SUSYObjDef instance
62
ANA_CHECK
( objTool.setProperty(
"DataSource"
,
ST::ISUSYObjDef_xAODTool::FullSim
) );
63
if
(!config_file.empty())
64
ANA_CHECK
( objTool.setProperty(
"ConfigFile"
, config_file) );
65
66
std::vector<std::string> prw_conf;
67
prw_conf.push_back(
"dev/PileupReweighting/mc15ab_defaults.NotRecommended.prw.root"
);
68
prw_conf.push_back(
"dev/PileupReweighting/mc15c_v2_defaults.NotRecommended.prw.root"
);
69
70
ANA_CHECK
( objTool.setProperty(
"PRWConfigFiles"
, prw_conf) );
71
std::vector<std::string> prw_lumicalc;
72
prw_lumicalc.push_back(
"dev/SUSYTools/ilumicalc_histograms_None_276262-284154_IBLOFF.root"
);
73
prw_lumicalc.push_back(
"dev/SUSYTools/ilumicalc_histograms_None_297730-299243.root"
);
74
ANA_CHECK
( objTool.setProperty(
"PRWLumiCalcFiles"
, prw_lumicalc) );
76
77
objTool.
msg
().setLevel( MSG::FATAL );
78
79
if
( objTool.
initialize
() != StatusCode::SUCCESS) {
80
Error(
APP_NAME
,
"Cannot intialize SUSYObjDef_xAOD..."
);
81
Error(
APP_NAME
,
"Exiting... "
);
82
exit(-1);
83
}
else
{
84
Info(
APP_NAME
,
"SUSYObjDef_xAOD initialized... "
);
85
}
86
87
// Counter for cuts:
88
std::vector<ST::SystInfo> systInfoList;
89
systInfoList = objTool.
getSystInfoList
();
90
91
Info(
APP_NAME
,
"\n\n"
);
92
Info(
APP_NAME
,
"---- SYSTEMATICS LIST -----------------------------------------------------------------------------------------\n"
);
93
94
for
(
const
auto
& sysInfo : systInfoList) {
95
const
CP::SystematicSet
& sys = sysInfo.systset;
96
if
(sys.name()==
""
)
continue
;
97
Info(
APP_NAME
,
" %s\t Affects : %s (%s)"
,
98
getFW
(sys.name(),45).c_str(),
99
getFW
(
ST::testAffectsObject
(sysInfo.affectsType),12).c_str(),
100
sysInfo.affectsKinematics ?
"Kin."
:
"Weight"
);
101
//Info( APP_NAME, (" "+getFW(sys.name(),45)+"\t Affects : "+getFW(ST::testAffectsObject(sysInfo.affectsType),12)+" ("+(sysInfo.affectsKinematics ? "Kin.)" : "Weight)")).c_str() );
102
}
103
104
Info(
APP_NAME
,
"---------------------------------------------------------------------------------------------------------------\n"
);
105
106
// Return gracefully:
107
return
0;
108
}
APP_NAME
#define APP_NAME
Definition
BoostedXbbTag.cxx:25
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
ANA_CHECK_SET_TYPE
#define ANA_CHECK_SET_TYPE(TYPE)
set the type for ANA_CHECK to report failures
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:314
StatusCode.h
TEvent.h
CorrectionCode.h
Init.h
SUSYObjDef_xAOD.h
SystematicRegistry.h
SystematicVariation.h
width
const double width
Definition
TTileTripReader.cxx:24
getFW
std::string getFW(std::string in, unsigned int width=30)
Definition
check_syst.cxx:31
AthCommonMsg::msg
MsgStream & msg() const
Definition
AthCommonMsg.h:24
CP::CorrectionCode::enableFailure
static void enableFailure() noexcept
Definition
CorrectionCode.h:64
CP::SystematicSet
Class to wrap a set of SystematicVariations.
Definition
SystematicSet.h:31
ST::ISUSYObjDef_xAODTool::FullSim
@ FullSim
Definition
ISUSYObjDef_xAODTool.h:480
ST::SUSYObjDef_xAOD
Definition
SUSYObjDef_xAOD.h:142
ST::SUSYObjDef_xAOD::initialize
StatusCode initialize() override final
Dummy implementation of the initialisation function.
Definition
SUSYObjDef_xAOD.cxx:900
ST::SUSYObjDef_xAOD::getSystInfoList
std::vector< ST::SystInfo > getSystInfoList() const override final
Definition
SUSYObjDef_xAOD.cxx:2594
main
int main()
Definition
hello.cxx:18
ST::testAffectsObject
static bool testAffectsObject(xAOD::Type::ObjectType type, unsigned int test)
Definition
ISUSYObjDef_xAODTool.h:134
Generated on
for ATLAS Offline Software by
1.17.0