ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
Jet
JetSubStructureMomentTools
Root
SubjetMakerTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
JetSubStructureMomentTools/SubjetMakerTool.h
"
6
#include "
JetEDM/JetConstituentFiller.h
"
7
#include "fastjet/ClusterSequence.hh"
8
9
SubjetMakerTool::SubjetMakerTool
(
const
std::string& name) :
10
JetSubStructureMomentToolsBase
(name)
11
{
12
declareProperty
(
"type"
,
m_type
=
"AntiKt"
);
13
declareProperty
(
"R"
,
m_R
= 0.2);
14
declareProperty
(
"PtCut"
,
m_minPt
= 20e3);
15
}
16
17
int
SubjetMakerTool::modifyJet
(
xAOD::Jet
&
jet
)
const
{
18
if
(!
checkForConstituents
(
jet
))
return
1;
19
20
std::vector<float> s_e;
21
std::vector<float> s_px;
22
std::vector<float> s_py;
23
std::vector<float> s_pz;
24
25
std::vector<fastjet::PseudoJet> constit_pseudojets =
jet::JetConstituentFiller::constituentPseudoJets
(
jet
);
26
fastjet::PseudoJet pjet = fastjet::join(constit_pseudojets);
27
28
fastjet::JetAlgorithm jetalg = fastjet::antikt_algorithm;
29
if
(
m_type
==
"AntiKt"
) {
30
jetalg = fastjet::antikt_algorithm;
31
}
else
if
(
m_type
==
"Kt"
) {
32
jetalg = fastjet::kt_algorithm;
33
}
else
if
(
m_type
==
"CamKt"
) {
34
jetalg = fastjet::cambridge_algorithm;
35
}
36
37
fastjet::JetDefinition microjet_def(jetalg,
m_R
);
38
fastjet::ClusterSequence microjet_cs(pjet.constituents(), microjet_def);
39
std::vector<fastjet::PseudoJet> microjets = fastjet::sorted_by_pt(microjet_cs.inclusive_jets(
m_minPt
));
40
for
(
size_t
z
= 0;
z
< microjets.size(); ++
z
) {
41
s_e.push_back(microjets[
z
].e());
42
s_px.push_back(microjets[
z
].px());
43
s_py.push_back(microjets[
z
].py());
44
s_pz.push_back(microjets[
z
].pz());
45
}
46
47
std::stringstream
ss
;
48
ss
.str(
""
);
49
ss
<<
"Subjet"
<<
m_type
<< (int) (
m_R
*100) <<
"_e"
;
50
jet
.setAttribute(
ss
.str().c_str(), s_e);
51
ss
.str(
""
);
52
ss
<<
"Subjet"
<<
m_type
<< (int) (
m_R
*100) <<
"_px"
;
53
jet
.setAttribute(
ss
.str().c_str(), s_px);
54
ss
.str(
""
);
55
ss
<<
"Subjet"
<<
m_type
<< (int) (
m_R
*100) <<
"_py"
;
56
jet
.setAttribute(
ss
.str().c_str(), s_py);
57
ss
.str(
""
);
58
ss
<<
"Subjet"
<<
m_type
<< (int) (
m_R
*100) <<
"_pz"
;
59
jet
.setAttribute(
ss
.str().c_str(), s_pz);
60
61
return
0;
62
}
JetConstituentFiller.h
ss
static Double_t ss
Definition
LArPhysWaveHECTool.cxx:37
SubjetMakerTool.h
z
#define z
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
JetSubStructureMomentToolsBase::JetSubStructureMomentToolsBase
JetSubStructureMomentToolsBase(const std::string &name)
Definition
JetSubStructureMomentToolsBase.cxx:8
JetSubStructureMomentToolsBase::checkForConstituents
bool checkForConstituents(const xAOD::Jet &jet) const
Definition
JetSubStructureMomentToolsBase.h:33
SubjetMakerTool::m_minPt
float m_minPt
Definition
SubjetMakerTool.h:20
SubjetMakerTool::m_type
std::string m_type
Definition
SubjetMakerTool.h:18
SubjetMakerTool::modifyJet
int modifyJet(xAOD::Jet &jet) const
Modify a single jet. This is obsolete and set to be removed.
Definition
SubjetMakerTool.cxx:17
SubjetMakerTool::m_R
float m_R
Definition
SubjetMakerTool.h:19
SubjetMakerTool::SubjetMakerTool
SubjetMakerTool(const std::string &name)
Definition
SubjetMakerTool.cxx:9
jet::JetConstituentFiller::constituentPseudoJets
static PseudoJetVector constituentPseudoJets(const xAOD::Jet &jet, bool ignoreGhosts=true, bool requireJetStructure=false)
Returns the jet's constituents as a vector of PseudoJet if ignoreGhosts==true, ghost constituents are...
Definition
JetConstituentFiller.cxx:169
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
Generated on
for ATLAS Offline Software by
1.17.0