ATLAS Offline Software
Loading...
Searching...
No Matches
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
10
11#include <string>
12
13
18
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
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
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
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
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) {
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
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
Handle class for adding a decoration to an object.
SG::WriteDecorHandleKey< xAOD::JetContainer > m_ThrustMaj_Key
StatusCode modify(xAOD::JetContainer &jets) const override
Loop over calls to modifyJet.
SG::WriteDecorHandleKeyArray< xAOD::JetContainer > m_FoxWolfram_Keys
CenterOfMassShapesTool(const std::string &name)
SG::WriteDecorHandleKey< xAOD::JetContainer > m_ThrustMin_Key
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
SG::WriteDecorHandleKey< xAOD::JetContainer > m_Sphericity_Key
Gaudi::Property< std::string > m_jetContainerName
SG::WriteDecorHandleKey< xAOD::JetContainer > m_Aplanarity_Key
JetSubStructureMomentToolsBase(const std::string &name)
bool SetupDecoration(fastjet::PseudoJet &pseudojet, const xAOD::Jet &jet, bool requireJetStructure=false) const
virtual std::map< std::string, double > result(const fastjet::PseudoJet &jet) const
virtual std::map< std::string, double > result(const fastjet::PseudoJet &jet) const
Handle class for adding a decoration to an object.
Jet_v1 Jet
Definition of the current "jet version".
JetContainer_v1 JetContainer
Definition of the current "jet container version".