ATLAS Offline Software
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"
6 #include "L1TopoEvent/eEmTOB.h"
7 
8 #include <cmath> //for abs
9 
10 namespace GlobalSim {
11 
13  const std::string& name,
14  const IInterface* parent):
16  }
17 
19  CHECK(m_eEmRoIKey.initialize());
20 
21  return StatusCode::SUCCESS;
22  }
23 
25  eFexRoIAlgTool::RoIs(std::vector<const xAOD::eFexEMRoI*>& selectedRoIs,
26  const EventContext& ctx) const {
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 
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
GlobalSim::eFexRoIAlgTool::eFexRoIAlgTool
eFexRoIAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: eFexRoIAlgTool.cxx:12
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
eEmTOB.h
GlobalSim
AlgTool that to test whether expected the TIP values generated by data supplied by eEmMultTestBench c...
Definition: CommonSelector.cxx:8
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
test_pyathena.parent
parent
Definition: test_pyathena.py:15
AnalysisUtils::copy_if
Out copy_if(In first, const In &last, Out res, const Pred &p)
Definition: IFilterUtils.h:30
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
python.SystemOfUnits.s
float s
Definition: SystemOfUnits.py:147
GlobalSim::eFexRoIAlgTool::RoIs
virtual StatusCode RoIs(std::vector< const xAOD::eFexEMRoI * > &, const EventContext &ctx) const
Definition: eFexRoIAlgTool.cxx:25
GlobalSim::eFexRoIAlgTool::m_eEmRoIKey
SG::ReadHandleKey< xAOD::eFexEMRoIContainer > m_eEmRoIKey
Definition: eFexRoIAlgTool.h:42
AthAlgTool
Definition: AthAlgTool.h:26
eFexRoIAlgTool.h
GlobalSim::eFexRoIAlgTool::initialize
StatusCode initialize() override
Definition: eFexRoIAlgTool.cxx:18
GlobalSim::eFexRoIAlgTool::m_etMin
Gaudi::Property< double > m_etMin
Definition: eFexRoIAlgTool.h:44
xAOD::eFexEMRoIContainer
eFexEMRoIContainer_v1 eFexEMRoIContainer
Definition: eFexEMRoIContainer.h:16
GlobalSim::eFexRoIAlgTool::toString
virtual std::string toString() const
Definition: eFexRoIAlgTool.cxx:68