ATLAS Offline Software
Loading...
Searching...
No Matches
GlobalSim::GlobalJet1AlgTool Class Reference

#include <GlobalJet1AlgTool.h>

Inheritance diagram for GlobalSim::GlobalJet1AlgTool:
Collaboration diagram for GlobalSim::GlobalJet1AlgTool:

Public Member Functions

 GlobalJet1AlgTool (const std::string &type, const std::string &name, const IInterface *parent)
 Main constructor.
 ~GlobalJet1AlgTool () override=default
 Main destructor (explicitly defaulted).
virtual StatusCode initialize () override
 Initialize function running before first event.
virtual StatusCode run (const EventContext &ctx) const override
 Main functional block running for each event.
virtual std::string toString () const override
 Overriding toString function from base class.

Private Attributes

SG::ReadHandleKey< IOBitwise::CommonTOBContainerm_gblCellTowers
 Read key for the output cell towers as a GenericTobContainer.
SG::WriteHandleKey< IOBitwise::CommonTOBContainerm_gblJet1JetsContainerKey
 Write key for the output Jet1Jets as a GenericTobContainer.

Detailed Description

Definition at line 31 of file GlobalJet1AlgTool.h.

Constructor & Destructor Documentation

◆ GlobalJet1AlgTool()

GlobalSim::GlobalJet1AlgTool::GlobalJet1AlgTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

Main constructor.

Definition at line 15 of file GlobalJet1AlgTool.cxx.

15 :
16 base_class(type, name, parent) {
17 }

◆ ~GlobalJet1AlgTool()

GlobalSim::GlobalJet1AlgTool::~GlobalJet1AlgTool ( )
overridedefault

Main destructor (explicitly defaulted).

Member Function Documentation

◆ initialize()

StatusCode GlobalSim::GlobalJet1AlgTool::initialize ( )
overridevirtual

Initialize function running before first event.

Definition at line 21 of file GlobalJet1AlgTool.cxx.

21 {
22
23 CHECK(m_gblCellTowers.initialize());
24 CHECK(m_gblJet1JetsContainerKey.initialize());
25
26 return StatusCode::SUCCESS;
27 }
#define CHECK(...)
Evaluate an expression and check for errors.
SG::ReadHandleKey< IOBitwise::CommonTOBContainer > m_gblCellTowers
Read key for the output cell towers as a GenericTobContainer.
SG::WriteHandleKey< IOBitwise::CommonTOBContainer > m_gblJet1JetsContainerKey
Write key for the output Jet1Jets as a GenericTobContainer.

◆ run()

StatusCode GlobalSim::GlobalJet1AlgTool::run ( const EventContext & ctx) const
overridevirtual

Main functional block running for each event.

Definition at line 31 of file GlobalJet1AlgTool.cxx.

31 {
32
33 ATH_MSG_DEBUG("Building WTAConeJets");
34
35 // Read the GlobalCellTowers
36 auto h_towerTOBs = SG::makeHandle(m_gblCellTowers, ctx);
37 CHECK(h_towerTOBs.isValid());
38 const auto & towers = *h_towerTOBs;
39 const unsigned int inTopoTowersN = towers.size();
40 ATH_MSG_DEBUG("Reading " << inTopoTowersN << " cell towers as GenericTobs");
41
42 // Create bitwise towers
43 std::vector<WTATrigObj> input_towers;
44 for(unsigned int i = 0; i < inTopoTowersN; i++){
45 // Has constituent tracking feature
46 const IOBitwise::CommonTOB* tower = towers[i];
47 WTATrigObj this_tower(tower->et_bits().to_ulong(), tower->eta_bits().to_ulong(), tower->phi_bits().to_ulong(), 0, i);
48 input_towers.push_back(this_tower);
49 }
50
51 // Do the usual
52 std::unique_ptr<WTAConeMaker> MyWTAConeMaker = std::make_unique<WTACone2PassMaker>();
53 WTAParameters MyWTAParameters = WTAParameters(
54 8, // const_et_cut = 2 GeV
55 20, // seed_et_cut = 5 GeV
56 4 // jet_dR = 4
57 );
58 MyWTAConeMaker->m_WTAConeMakerParameter = MyWTAParameters; // Pass the WTAConeParameters
59 WTAConeParallelHelper wta_parallel_helper;
60 wta_parallel_helper.SetBlockN(4);
61 wta_parallel_helper.CreateBlocks(input_towers);
62 wta_parallel_helper.RunParallelWTA(MyWTAConeMaker);
63 wta_parallel_helper.CheckJetInCore();
64 std::vector<WTAJet> WTAJetList = wta_parallel_helper.GetAllJets(); // Bitwise Jets
65
66 auto h_Jet1TOBs = SG::makeHandle(m_gblJet1JetsContainerKey, ctx);
67 auto jets = std::make_unique<IOBitwise::CommonTOBContainer>();
68
69 for(const auto& WTAJet: WTAJetList){
70 int energyBits = std::clamp(static_cast<int>(WTAJet.pt()), 0, (1 << IOBitwise::CommonTOB::s_et_width) - 1);
71 int etaBits = std::clamp(static_cast<int>(WTAJet.eta()), 0, (1 << IOBitwise::CommonTOB::s_eta_width) - 1);
72 int phiBits = std::clamp(static_cast<int>(WTAJet.phi()), 0, (1 << IOBitwise::CommonTOB::s_phi_width) - 1);
73 jets->emplace_back(new IOBitwise::CommonTOB(std::bitset<IOBitwise::CommonTOB::s_et_width>(energyBits),
74 std::bitset<IOBitwise::CommonTOB::s_eta_width>(etaBits),
75 std::bitset<IOBitwise::CommonTOB::s_phi_width>(phiBits)));
76 // Print jet TOB
77 ATH_MSG_DEBUG("Returning Jet: " << jets->back()->to_string());
78 }
79
80 ATH_MSG_DEBUG("Built " << jets->size() << " WTAConeJets and stored them as GenericTobs");
81
82 CHECK(h_Jet1TOBs.record(std::move(jets)));
83
84
85 return StatusCode::SUCCESS;
86 }
#define ATH_MSG_DEBUG(x)
static constexpr std::size_t s_eta_width
Size of the eta bitset.
Definition CommonTOB.h:30
static constexpr std::size_t s_et_width
Size of the eT bitset.
Definition CommonTOB.h:28
static constexpr std::size_t s_phi_width
Size of the phi bitset.
Definition CommonTOB.h:32
std::vector< WTAJet > GetAllJets()
void RunParallelWTA(std::unique_ptr< WTAClassType > &AnyWTAClass)
void CreateBlocks(const std::vector< WTATrigObj > &all_towers)
void SetBlockN(unsigned int block_n)
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())

◆ toString()

std::string GlobalSim::GlobalJet1AlgTool::toString ( ) const
overridevirtual

Overriding toString function from base class.

Definition at line 89 of file GlobalJet1AlgTool.cxx.

89 {
90 return {};
91 }

Member Data Documentation

◆ m_gblCellTowers

SG::ReadHandleKey<IOBitwise::CommonTOBContainer> GlobalSim::GlobalJet1AlgTool::m_gblCellTowers
private
Initial value:
{
this,
"GlobalCellTowersKey",
"GlobalCellTowers",
"Key to the container of generic TOBS containing the cell towers"}

Read key for the output cell towers as a GenericTobContainer.

Definition at line 54 of file GlobalJet1AlgTool.h.

54 {
55 this,
56 "GlobalCellTowersKey",
57 "GlobalCellTowers",
58 "Key to the container of generic TOBS containing the cell towers"};

◆ m_gblJet1JetsContainerKey

SG::WriteHandleKey<IOBitwise::CommonTOBContainer> GlobalSim::GlobalJet1AlgTool::m_gblJet1JetsContainerKey
private
Initial value:
{
this,
"GlobalJet1JetsKey",
"GlobalJet1Jets",
"Key to the container of generic TOBS containing the Jet1Jets"}

Write key for the output Jet1Jets as a GenericTobContainer.

Definition at line 62 of file GlobalJet1AlgTool.h.

62 {
63 this,
64 "GlobalJet1JetsKey",
65 "GlobalJet1Jets",
66 "Key to the container of generic TOBS containing the Jet1Jets"};

The documentation for this class was generated from the following files: