ATLAS Offline Software
eFexRoIAlgTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "./eFexRoIAlgTool.h"
6 #include "L1TopoEvent/eEmTOB.h"
7 
8 #include <numbers>
9 
10 #include <sstream>
11 
12 namespace GlobalSim {
13 
15  const std::string& name,
16  const IInterface* parent):
18  }
19 
21  CHECK(m_eEmRoIKey.initialize());
22 
23  return StatusCode::SUCCESS;
24  }
25 
27  eFexRoIAlgTool::RoIs(std::vector<const xAOD::eFexEMRoI*>& selectedRoIs,
28  const EventContext& ctx) const {
31 
32  CHECK(eFexEMRoIContainer.isValid());
33 
34 
35 
36  /*
37  * eFexNumber() : 8 bit unsigned integer eFEX number
38  * et() : et value of the EM cluster in MeV
39  * etTOB() : et value of the EM cluster in units of 100 MeV
40  * eta() : floating point global eta
41  * phi() : floating point global phi
42  * iEtaTopo() : 40 x eta (custom function for L1Topo)
43  * iPhiTopo() : 20 x phi (custom function for L1Topo)
44  * RetaThresholds() : jet disc 1
45  * RhadThresholds() : jet disc 2
46  * WstotThresholds() : jet disc 3
47  */
48 
49 
50  auto roiSelector = [etMin=m_etMin](const auto& roi) {
51 
52  // fiducial cut values
53  constexpr double eta_out_fid{1.4};
54  constexpr double eta_in_fid{0.2};
55 
56  auto abs_eta = abs(roi->eta());
57  return (eta_in_fid <= abs_eta) and
58  (abs_eta < eta_out_fid) and
59  (roi->et() > etMin);
60  };
61 
62  std::copy_if((*eFexEMRoIContainer).begin(),
63  (*eFexEMRoIContainer).end(),
64  std::back_inserter(selectedRoIs),
65  roiSelector);
66 
67  return StatusCode::SUCCESS;
68  }
69 
70  std::string eFexRoIAlgTool::toString() const {
71  std::stringstream ss;
72  ss << "eFexRoIAlgTool: name" << name() << '\n'
73  << m_eEmRoIKey << '\n';
74  return ss.str();
75  }
76 }
77 
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
GlobalSim::eFexRoIAlgTool::eFexRoIAlgTool
eFexRoIAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: eFexRoIAlgTool.cxx:14
GlobalSim
AlgTool to obtain a selection of eFex RoIs read in from the event store.
Definition: dump.h: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
eEmTOB.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
GlobalSim::eFexRoIAlgTool::RoIs
virtual StatusCode RoIs(std::vector< const xAOD::eFexEMRoI * > &, const EventContext &ctx) const
Definition: eFexRoIAlgTool.cxx:27
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:20
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:70