ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
Jet
JetSubStructureMomentTools
Root
CenterOfMassShapesTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
JetSubStructureMomentTools/CenterOfMassShapesTool.h
"
6
#include "
JetSubStructureUtils/Thrust.h
"
7
#include "
JetSubStructureUtils/FoxWolfram.h
"
8
#include "
JetSubStructureUtils/SphericityTensor.h
"
9
#include "
AsgDataHandles/WriteDecorHandle.h
"
10
11
#include <string>
12
13
14
CenterOfMassShapesTool::CenterOfMassShapesTool
(
const
std::string& name) :
15
JetSubStructureMomentToolsBase
(name)
16
{
17
}
18
19
StatusCode
CenterOfMassShapesTool::initialize
() {
20
if
(
m_jetContainerName
.empty()){
21
ATH_MSG_ERROR
(
"NSubjettinessTool needs to have its input jet container name configured!"
);
22
return
StatusCode::FAILURE;
23
}
24
25
m_ThrustMin_Key
=
m_jetContainerName
+
"."
+
m_prefix
+
m_ThrustMin_Key
.key();
26
m_ThrustMaj_Key
=
m_jetContainerName
+
"."
+
m_prefix
+
m_ThrustMaj_Key
.key();
27
28
for
(
unsigned
int
i=0; i<5; i++)
29
m_FoxWolfram_Keys
.emplace_back(
m_jetContainerName
+
"."
+
m_prefix
+
30
"FoxWolfram"
+ std::to_string(i));
31
32
m_Sphericity_Key
=
m_jetContainerName
+
"."
+
m_prefix
+
m_Sphericity_Key
.key();
33
m_Aplanarity_Key
=
m_jetContainerName
+
"."
+
m_prefix
+
m_Aplanarity_Key
.key();
34
35
ATH_CHECK
(
m_ThrustMin_Key
.initialize());
36
ATH_CHECK
(
m_ThrustMaj_Key
.initialize());
37
ATH_CHECK
(
m_FoxWolfram_Keys
.initialize());
38
ATH_CHECK
(
m_Sphericity_Key
.initialize());
39
ATH_CHECK
(
m_Aplanarity_Key
.initialize());
40
41
return
StatusCode::SUCCESS;
42
}
43
44
StatusCode
CenterOfMassShapesTool::modify
(
xAOD::JetContainer
& jets)
const
{
45
SG::WriteDecorHandle<xAOD::JetContainer, float>
wdh_ThrustMin(
m_ThrustMin_Key
);
46
SG::WriteDecorHandle<xAOD::JetContainer, float>
wdh_ThrustMaj(
m_ThrustMaj_Key
);
47
48
std::vector<SG::WriteDecorHandle<xAOD::JetContainer, float>> wdhs_FoxWolfram;
49
for
(
const
auto
& key :
m_FoxWolfram_Keys
)
50
wdhs_FoxWolfram.emplace_back(key);
51
52
SG::WriteDecorHandle<xAOD::JetContainer, float>
wdh_Sphericity(
m_Sphericity_Key
);
53
SG::WriteDecorHandle<xAOD::JetContainer, float>
wdh_Aplanarity(
m_Aplanarity_Key
);
54
55
for
(
const
xAOD::Jet
* injet : jets){
56
57
fastjet::PseudoJet
jet
;
58
bool
decorate =
SetupDecoration
(
jet
, *injet);
59
60
std::map<std::string, double> res_t, res_fox, res_s;
61
62
res_t[
"ThrustMin"
] = -999;
63
res_t[
"ThrustMaj"
] = -999;
64
res_fox[
"FoxWolfram0"
] = -999;
65
res_fox[
"FoxWolfram1"
] = -999;
66
res_fox[
"FoxWolfram2"
] = -999;
67
res_fox[
"FoxWolfram3"
] = -999;
68
res_fox[
"FoxWolfram4"
] = -999;
69
res_s[
"Sphericity"
] = -999;
70
res_s[
"Aplanarity"
] = -999;
71
72
if
(decorate) {
73
JetSubStructureUtils::Thrust
t;
74
JetSubStructureUtils::FoxWolfram
foxwolfram;
75
JetSubStructureUtils::SphericityTensor
sphericity;
76
res_t = t.result(
jet
);
77
res_fox = foxwolfram.
result
(
jet
);
78
res_s = sphericity.
result
(
jet
);
79
}
80
81
wdh_ThrustMin(*injet) = res_t[
"ThrustMin"
];
82
wdh_ThrustMaj(*injet) = res_t[
"ThrustMaj"
];
83
84
for
(
unsigned
int
i=0; i<5; i++)
85
wdhs_FoxWolfram[i](*injet) = res_fox[
"FoxWolfram"
+std::to_string(i)];
86
87
wdh_Sphericity(*injet) = res_s[
"Sphericity"
];
88
wdh_Aplanarity(*injet) = res_s[
"Aplanarity"
];
89
}
90
91
return
StatusCode::SUCCESS;
92
}
93
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x,...)
Definition
AthMsgStreamMacros.h:47
WriteDecorHandle.h
Handle class for adding a decoration to an object.
CenterOfMassShapesTool.h
FoxWolfram.h
Thrust.h
SphericityTensor.h
CenterOfMassShapesTool::m_ThrustMaj_Key
SG::WriteDecorHandleKey< xAOD::JetContainer > m_ThrustMaj_Key
Definition
CenterOfMassShapesTool.h:32
CenterOfMassShapesTool::modify
StatusCode modify(xAOD::JetContainer &jets) const override
Loop over calls to modifyJet.
Definition
CenterOfMassShapesTool.cxx:44
CenterOfMassShapesTool::m_FoxWolfram_Keys
SG::WriteDecorHandleKeyArray< xAOD::JetContainer > m_FoxWolfram_Keys
Definition
CenterOfMassShapesTool.h:35
CenterOfMassShapesTool::CenterOfMassShapesTool
CenterOfMassShapesTool(const std::string &name)
Definition
CenterOfMassShapesTool.cxx:14
CenterOfMassShapesTool::m_ThrustMin_Key
SG::WriteDecorHandleKey< xAOD::JetContainer > m_ThrustMin_Key
Definition
CenterOfMassShapesTool.h:30
CenterOfMassShapesTool::initialize
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition
CenterOfMassShapesTool.cxx:19
CenterOfMassShapesTool::m_Sphericity_Key
SG::WriteDecorHandleKey< xAOD::JetContainer > m_Sphericity_Key
Definition
CenterOfMassShapesTool.h:38
CenterOfMassShapesTool::m_jetContainerName
Gaudi::Property< std::string > m_jetContainerName
Definition
CenterOfMassShapesTool.h:27
CenterOfMassShapesTool::m_Aplanarity_Key
SG::WriteDecorHandleKey< xAOD::JetContainer > m_Aplanarity_Key
Definition
CenterOfMassShapesTool.h:40
JetSubStructureMomentToolsBase::JetSubStructureMomentToolsBase
JetSubStructureMomentToolsBase(const std::string &name)
Definition
JetSubStructureMomentToolsBase.cxx:8
JetSubStructureMomentToolsBase::SetupDecoration
bool SetupDecoration(fastjet::PseudoJet &pseudojet, const xAOD::Jet &jet, bool requireJetStructure=false) const
Definition
JetSubStructureMomentToolsBase.cxx:30
JetSubStructureMomentToolsBase::m_prefix
std::string m_prefix
Definition
JetSubStructureMomentToolsBase.h:30
JetSubStructureUtils::FoxWolfram
Definition
Reconstruction/Jet/JetSubStructureUtils/JetSubStructureUtils/FoxWolfram.h:11
JetSubStructureUtils::FoxWolfram::result
virtual std::map< std::string, double > result(const fastjet::PseudoJet &jet) const
Definition
Reconstruction/Jet/JetSubStructureUtils/Root/FoxWolfram.cxx:12
JetSubStructureUtils::SphericityTensor
Definition
SphericityTensor.h:11
JetSubStructureUtils::SphericityTensor::result
virtual std::map< std::string, double > result(const fastjet::PseudoJet &jet) const
Definition
SphericityTensor.cxx:15
JetSubStructureUtils::Thrust
Definition
Reconstruction/Jet/JetSubStructureUtils/JetSubStructureUtils/Thrust.h:11
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition
StoreGate/StoreGate/WriteDecorHandle.h:100
jet
Definition
JetCalibTools_PlotJESFactors.cxx:23
xAOD::Jet
Jet_v1 Jet
Definition of the current "jet version".
Definition
Event/xAOD/xAODJet/xAODJet/Jet.h:17
xAOD::JetContainer
JetContainer_v1 JetContainer
Definition of the current "jet container version".
Definition
JetContainer.h:17
Generated on
for ATLAS Offline Software by
1.17.0