ATLAS Offline Software
Loading...
Searching...
No Matches
eFexRoIAlgTool.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 "./eFexRoIAlgTool.h"
7
8#include <cmath> //for abs
9
10namespace GlobalSim {
11
13 const std::string& name,
14 const IInterface* parent):
15 AthAlgTool(type, name, parent){
16 }
17
19 CHECK(m_eEmRoIKey.initialize());
20
21 return StatusCode::SUCCESS;
22 }
23
24 StatusCode
25 eFexRoIAlgTool::RoIs(std::vector<const xAOD::eFexEMRoI*>& selectedRoIs,
26 const EventContext& ctx) const {
28 eFexEMRoIContainer(m_eEmRoIKey, ctx);
29
30 CHECK(eFexEMRoIContainer.isValid());
31
32
33
34 /*
35 * eFexNumber() : 8 bit unsigned integer eFEX number
36 * et() : et value of the EM cluster in MeV
37 * etTOB() : et value of the EM cluster in units of 100 MeV
38 * eta() : floating point global eta
39 * phi() : floating point global phi
40 * iEtaTopo() : 40 x eta (custom function for L1Topo)
41 * iPhiTopo() : 20 x phi (custom function for L1Topo)
42 * RetaThresholds() : jet disc 1
43 * RhadThresholds() : jet disc 2
44 * WstotThresholds() : jet disc 3
45 */
46
47
48 auto roiSelector = [&etMin=m_etMin](const auto& roi) {
49
50 // fiducial cut values
51 constexpr double eta_out_fid{1.4};
52 constexpr double eta_in_fid{0.2};
53
54 auto abs_eta = std::abs(roi->eta());
55 return (eta_in_fid <= abs_eta) and
56 (abs_eta < eta_out_fid) and
57 (roi->et() > etMin);
58 };
59
60 std::copy_if((*eFexEMRoIContainer).begin(),
61 (*eFexEMRoIContainer).end(),
62 std::back_inserter(selectedRoIs),
63 std::move(roiSelector));
64
65 return StatusCode::SUCCESS;
66 }
67
68 std::string eFexRoIAlgTool::toString() const {
69 std::string s = "eFexRoIAlgTool: name" + name() + '\n'
70 + m_eEmRoIKey.key() + '\n';
71 return s;
72 }
73}
74
#define CHECK(...)
Evaluate an expression and check for errors.
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
virtual std::string toString() const
SG::ReadHandleKey< xAOD::eFexEMRoIContainer > m_eEmRoIKey
StatusCode initialize() override
virtual StatusCode RoIs(std::vector< const xAOD::eFexEMRoI * > &, const EventContext &ctx) const
eFexRoIAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Gaudi::Property< double > m_etMin
AlgTool that to test whether expected the TIP values generated by data supplied by eEmMultTestBench c...