ATLAS Offline Software
SimpleConeAlgTool.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 "SimpleConeAlgTool.h"
6 #include "SimpleCone.h"
7 
10 
11 
12 namespace GlobalSim {
14  const std::string& name,
15  const IInterface* parent) :
16  base_class(type, name, parent){
17  }
18 
20 
24 
25 
26  return StatusCode::SUCCESS;
27  }
28 
30  SimpleConeAlgTool::run(const EventContext& ctx) const {
33  m_MaxRSqr,
34  m_MinET,
35  m_MinSumET);
36 
37  auto tobArray_in =
39  ctx);
40  CHECK(tobArray_in.isValid());
41 
42  auto tobArrayVector_out =
43  std::make_unique<std::vector<GlobalSim::GenericTOBArray>>();
44 
45  auto decision = std::make_unique<GlobalSim::Decision>();
46 
47 
48  CHECK(alg.run(*tobArray_in,
49  *tobArrayVector_out,
50  *decision));
51 
53  h_tav_write(m_genericTOBArrayVectorWriteKey, ctx);
54  CHECK(h_tav_write.record(std::move(tobArrayVector_out)));
55 
56 
58  h_decision_write(m_decisionWriteKey, ctx);
59  CHECK(h_decision_write.record(std::move(decision)));
60 
61 
62  //monitoring
63 
64  auto nrb = m_MinSumET.size();
65  for (unsigned int i = 0; i < nrb; ++i) {
66  const auto& passValues = alg.ETPassByBit(i);
67  const auto& failValues = alg.ETFailByBit(i);
68 
69  std::string label_pass = m_algInstanceName +
70  "_pass_by_bit_" + std::to_string(i);
71 
72  std::string label_fail = m_algInstanceName +
73  "_fail_by_bit_" + std::to_string(i);
74 
75  auto pass = Monitored::Collection(std::move(label_pass), passValues);
76  auto fail = Monitored::Collection(std::move(label_fail), failValues);
77  auto group = Monitored::Group(m_monTool, pass, fail);
78  }
79 
80 
81  return StatusCode::SUCCESS;
82  }
83 
84  std::string SimpleConeAlgTool::toString() const {
85 
86  std::stringstream ss;
87  ss << "SimpleConeAlgTool. name: " << name() << '\n'
88  << m_genericTOBArrayReadKey << '\n'
90  << m_decisionWriteKey << "\nalg:\n"
93  m_MaxRSqr,
94  m_MinET,
96 
97  return ss.str();
98  }
99 }
100 
TrigDefs::Group
Group
Properties of a chain group.
Definition: GroupProperties.h:13
SGout2dot.alg
alg
Definition: SGout2dot.py:243
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
GlobalSim::SimpleConeAlgTool::m_genericTOBArrayReadKey
SG::ReadHandleKey< GlobalSim::GenericTOBArray > m_genericTOBArrayReadKey
Definition: SimpleConeAlgTool.h:81
GlobalSim::SimpleConeAlgTool::m_MinET
Gaudi::Property< unsigned int > m_MinET
Definition: SimpleConeAlgTool.h:57
GlobalSim::SimpleConeAlgTool::m_MaxRSqr
Gaudi::Property< unsigned int > m_MaxRSqr
Definition: SimpleConeAlgTool.h:70
SimpleConeAlgTool.h
Monitored::Collection
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
Definition: MonitoredCollection.h:38
GlobalSim::SimpleConeAlgTool::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: SimpleConeAlgTool.h:78
GlobalSim
AlgTool to obtain a selection of eFex RoIs read in from the event store.
Definition: dump.h:8
MonitoredCollection.h
lumiFormat.i
int i
Definition: lumiFormat.py:85
GlobalSim::SimpleConeAlgTool::toString
virtual std::string toString() const override
Definition: SimpleConeAlgTool.cxx:84
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
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
Monitored.h
Header file to be included by clients of the Monitored infrastructure.
SimpleCone.h
GlobalSim::SimpleCone::toString
std::string toString() const
Definition: Global/GlobalSimulation/src/L1TopoAlgs/SimpleCone.cxx:117
GlobalSim::SimpleConeAlgTool::m_MinSumET
Gaudi::Property< std::vector< unsigned int > > m_MinSumET
Definition: SimpleConeAlgTool.h:64
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
GlobalSim::SimpleConeAlgTool::m_InputWidth
Gaudi::Property< unsigned int > m_InputWidth
Definition: SimpleConeAlgTool.h:51
GlobalSim::SimpleConeAlgTool::m_decisionWriteKey
SG::WriteHandleKey< GlobalSim::Decision > m_decisionWriteKey
Definition: SimpleConeAlgTool.h:91
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
CaloLCW_tf.group
group
Definition: CaloLCW_tf.py:28
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
GlobalSim::SimpleConeAlgTool::m_algInstanceName
Gaudi::Property< std::string > m_algInstanceName
Definition: SimpleConeAlgTool.h:45
GlobalSim::SimpleConeAlgTool::SimpleConeAlgTool
SimpleConeAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: SimpleConeAlgTool.cxx:13
GlobalSim::SimpleConeAlgTool::m_genericTOBArrayVectorWriteKey
SG::WriteHandleKey< std::vector< GlobalSim::GenericTOBArray > > m_genericTOBArrayVectorWriteKey
Definition: SimpleConeAlgTool.h:85
GlobalSim::SimpleConeAlgTool::run
virtual StatusCode run(const EventContext &ctx) const override
Definition: SimpleConeAlgTool.cxx:30
GlobalSim::SimpleConeAlgTool::initialize
StatusCode initialize() override
Definition: SimpleConeAlgTool.cxx:19
GlobalSim::SimpleCone
Definition: Global/GlobalSimulation/src/L1TopoAlgs/SimpleCone.h:19
beamspotman.fail
def fail(message)
Definition: beamspotman.py:201