ATLAS Offline Software
ERatioAlgTool.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 "ERatioAlgTool.h"
6 #include "ERatio.h"
7 #include "../dump.h"
8 #include "../dump.icc"
11 
12 
13 namespace GlobalSim {
14  ERatioAlgTool::ERatioAlgTool(const std::string& type,
15  const std::string& name,
16  const IInterface* parent) :
17  base_class(type, name, parent){
18  }
19 
21 
22  CHECK(m_nbhdContainerReadKey.initialize());
23 
24  return StatusCode::SUCCESS;
25  }
26 
28  ERatioAlgTool::run(const EventContext& ctx) const {
29  ATH_MSG_DEBUG("run()");
30 
31  // instantiate Algorithm object
33 
34  // read in LArStrip neighborhoods from the event store
35  // there is one neighborhood per EFex RoI
36  auto in =
38  ctx);
39  CHECK(in.isValid());
40 
41  ATH_MSG_DEBUG("read in " << (*in).size() << " neighborhoods");
42 
43 
44  if (m_enableDump) {
45  dump(name() + "_" + std::to_string(ctx.evt()), alg);
46  }
47 
48  std::vector<bool> found(in->size(), false);
49 
50  // check for the presence of a pi0 candidate in each neighborhood.
51  std::size_t inbhd{0};
52  for (const auto& nbhd : *in) {
53  bool result{false};
54  CHECK(alg.run(*nbhd, result));
55  found.at(inbhd++) = result;
56  }
57 
58 
59  for (const auto res : found) {
60  ATH_MSG_DEBUG("neighborhood result: " <<std::boolalpha << res);
61  }
62 
63 
64  return StatusCode::SUCCESS;
65  }
66 
67  std::string ERatioAlgTool::toString() const {
68 
69  std::stringstream ss;
70  ss << "ERatioAlgTool. name: " << name() << '\n'
71  << m_nbhdContainerReadKey << '\n'
73  << '\n';
74  return ss.str();
75  }
76 }
77 
GlobalSim::ERatioAlgTool::ERatioAlgTool
ERatioAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: ERatioAlgTool.cxx:14
GlobalSim::ERatio::toString
std::string toString() const
Definition: ERatio.cxx:136
SGout2dot.alg
alg
Definition: SGout2dot.py:243
get_generator_info.result
result
Definition: get_generator_info.py:21
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
ERatioAlgTool.h
GlobalSim::ERatioAlgTool::m_maxERCut
Gaudi::Property< double > m_maxERCut
Definition: ERatioAlgTool.h:61
GlobalSim::ERatioAlgTool::m_nbhdContainerReadKey
SG::ReadHandleKey< LArStripNeighborhoodContainer > m_nbhdContainerReadKey
Definition: ERatioAlgTool.h:69
GlobalSim
AlgTool to obtain a selection of eFex RoIs read in from the event store.
Definition: dump.h:8
MonitoredCollection.h
GlobalSim::ERatioAlgTool::m_minDeltaE
Gaudi::Property< double > m_minDeltaE
Definition: ERatioAlgTool.h:53
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
res
std::pair< std::vector< unsigned int >, bool > res
Definition: JetGroupProductTest.cxx:14
ERatio.h
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::ERatioAlgTool::run
virtual StatusCode run(const EventContext &ctx) const override
Definition: ERatioAlgTool.cxx:28
GlobalSim::ERatioAlgTool::toString
virtual std::string toString() const override
Definition: ERatioAlgTool.cxx:67
Monitored.h
Header file to be included by clients of the Monitored infrastructure.
GlobalSim::ERatio
Definition: ERatio.h:25
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
GlobalSim::ERatioAlgTool::m_enableDump
Gaudi::Property< bool > m_enableDump
Definition: ERatioAlgTool.h:46
GlobalSim::dump
void dump(const std::string &fn, const T &t)
CondAlgsOpts.found
int found
Definition: CondAlgsOpts.py:101
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
GlobalSim::ERatioAlgTool::m_algInstanceName
Gaudi::Property< std::string > m_algInstanceName
Definition: ERatioAlgTool.h:39
GlobalSim::ERatioAlgTool::initialize
StatusCode initialize() override
Definition: ERatioAlgTool.cxx:20