ATLAS Offline Software
eFexCvtrAlgTool.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 "./eFexCvtrAlgTool.h"
6 #include "../IO/eEmTOB.h"
7 
8 namespace GlobalSim {
9 
11  const std::string& name,
12  const IInterface* parent):
13  base_class(type, name, parent){
14  }
15 
17  CHECK(m_eEmRoIKey.initialize());
18  CHECK( m_eEmTOBContainerKey.initialize());
19 
20  return StatusCode::SUCCESS;
21  }
22 
24  eFexCvtrAlgTool::run(const EventContext& ctx) const {
25 
27  CHECK(inContainer.isValid());
28 
29  ATH_MSG_DEBUG("Number of eFexROIs read in " << inContainer->size());
30 
31  using OutContainer=GlobalSim::IOBitwise::IeEmTOBContainer;
32 
33  auto outContainer = std::make_unique<OutContainer>();
34 
35  outContainer->reserve(inContainer->size());
36 
37 
38  using ConcTOB=GlobalSim::IOBitwise::eEmTOB;
39  std::transform(std::cbegin(*inContainer),
40  std::cend(*inContainer),
41  std::back_inserter(*outContainer),
42  [](const auto& inTob){
43  return new ConcTOB(*inTob);});
44 
46  ctx);
47  CHECK(h_write.record(std::move(outContainer)));
48 
49  return StatusCode::SUCCESS;
50  }
51 
52  std::string eFexCvtrAlgTool::toString() const {
53  return "eFexRoI to eEmTOB converter";
54  }
55 }
56 
GlobalSim::eFexCvtrAlgTool::eFexCvtrAlgTool
eFexCvtrAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: eFexCvtrAlgTool.cxx:10
GlobalSim::IOBitwise::eEmTOB
Class to hold eFexROI TOB bits.
Definition: Global/GlobalSimulation/src/IO/eEmTOB.h:23
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
GlobalSim::eFexCvtrAlgTool::m_eEmTOBContainerKey
SG::WriteHandleKey< GlobalSim::IOBitwise::IeEmTOBContainer > m_eEmTOBContainerKey
Definition: eFexCvtrAlgTool.h:48
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
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
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
GlobalSim::eFexCvtrAlgTool::run
virtual StatusCode run(const EventContext &ctx) const override
Main functional block running for each event.
Definition: eFexCvtrAlgTool.cxx:24
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
GlobalSim::eFexCvtrAlgTool::m_eEmRoIKey
SG::ReadHandleKey< xAOD::eFexEMRoIContainer > m_eEmRoIKey
Definition: eFexCvtrAlgTool.h:44
GlobalSim::eFexCvtrAlgTool::initialize
virtual StatusCode initialize() override
Initialize function running before first event.
Definition: eFexCvtrAlgTool.cxx:16
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
GlobalSim::eFexCvtrAlgTool::toString
virtual std::string toString() const override
Definition: eFexCvtrAlgTool.cxx:52
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:73
eFexCvtrAlgTool.h
GlobalSim::IOBitwise::IeEmTOBContainer
DataVector< GlobalSim::IOBitwise::IeEmTOB > IeEmTOBContainer
Property: Container to hold IeEmTOB objects.
Definition: IeEmTOBContainer.h:23
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.