ATLAS Offline Software
DeltaRSqrIncl2AlgTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 #include "DeltaRSqrIncl2.h"
7 #include "../dump.h"
8 #include "../dump.icc"
11 
12 
13 namespace GlobalSim {
15  const std::string& name,
16  const IInterface* parent) :
17  base_class(type, name, parent){
18  }
19 
21 
26 
27 
28  return StatusCode::SUCCESS;
29  }
30 
32  DeltaRSqrIncl2AlgTool::run(const EventContext& ctx) const {
33 
35  m_MaxTOB1,
36  m_MaxTOB2,
37  m_MinET1,
38  m_MinET2,
42 
43  auto in0 =
45  ctx);
46  CHECK(in0.isValid());
47 
48 
49  auto in1 =
51  ctx);
52  CHECK(in1.isValid());
53 
54  auto tobArrayVector_out =
55  std::make_unique<std::vector<GlobalSim::GenericTOBArray>>();
56 
57  auto decision = std::make_unique<GlobalSim::Decision>();
58 
59  CHECK(alg.run(*in0,
60  *in1,
61  *tobArrayVector_out,
62  *decision));
63 
64  if (m_doDump) {
65  dump(name() + "_" + std::to_string(ctx.evt()), *decision);
66  }
67 
69  h_tav_write(m_genericTOBArrayVectorWriteKey, ctx);
70  CHECK(h_tav_write.record(std::move(tobArrayVector_out)));
71 
72 
74  h_decision_write(m_decisionWriteKey, ctx);
75  CHECK(h_decision_write.record(std::move(decision)));
76 
77 
78  // monitor
79 
80  auto nrb = alg.numResultBits();
81 
82  for (unsigned int i = 0; i < nrb; ++i) {
83  const auto& passValues = alg.deltaRSqPassByBit(i);
84  const auto& failValues = alg.deltaRSqFailByBit(i);
85  std::string label_pass =
86  m_algInstanceName + "_pass_by_bit_" + std::to_string(i);
87 
88  std::string label_fail = m_algInstanceName +
89  "_fail_by_bit_" + std::to_string(i);
90  auto pass = Monitored::Collection(std::move(label_pass), passValues);
91  auto fail = Monitored::Collection(std::move(label_fail), failValues);
92  auto group = Monitored::Group(m_monTool, pass, fail);
93  }
94 
95  return StatusCode::SUCCESS;
96  }
97 
98  std::string DeltaRSqrIncl2AlgTool::toString() const {
99 
100  std::stringstream ss;
101  ss << "DeltaRSqrIncl2AlgTool. name: " << name() << '\n'
102  << m_genericTOBArrayReadKey0 << '\n'
103  << m_genericTOBArrayReadKey1 << '\n'
105  << m_decisionWriteKey << "\n alg:\n"
107  m_MaxTOB1,
108  m_MaxTOB2,
109  m_MinET1,
110  m_MinET2,
111  m_DeltaRMin,
112  m_DeltaRMax,
114  << '\n';
115  return ss.str();
116  }
117 }
118 
GlobalSim::DeltaRSqrIncl2AlgTool::m_algInstanceName
Gaudi::Property< std::string > m_algInstanceName
Definition: DeltaRSqrIncl2AlgTool.h:41
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
GlobalSim::DeltaRSqrIncl2AlgTool::m_decisionWriteKey
SG::WriteHandleKey< GlobalSim::Decision > m_decisionWriteKey
Definition: DeltaRSqrIncl2AlgTool.h:126
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
GlobalSim::DeltaRSqrIncl2
Definition: Global/GlobalSimulation/src/L1TopoAlgs/DeltaRSqrIncl2.h:21
GlobalSim::DeltaRSqrIncl2AlgTool::m_DeltaRMax
Gaudi::Property< std::vector< unsigned int > > m_DeltaRMax
Definition: DeltaRSqrIncl2AlgTool.h:84
GlobalSim::DeltaRSqrIncl2AlgTool::m_MinET2
Gaudi::Property< std::vector< unsigned int > > m_MinET2
Definition: DeltaRSqrIncl2AlgTool.h:68
GlobalSim::DeltaRSqrIncl2::toString
std::string toString() const
Definition: Global/GlobalSimulation/src/L1TopoAlgs/DeltaRSqrIncl2.cxx:133
Monitored::Collection
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
Definition: MonitoredCollection.h:38
GlobalSim::DeltaRSqrIncl2AlgTool::DeltaRSqrIncl2AlgTool
DeltaRSqrIncl2AlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: DeltaRSqrIncl2AlgTool.cxx:14
GlobalSim::DeltaRSqrIncl2AlgTool::m_DeltaRMin
Gaudi::Property< std::vector< unsigned int > > m_DeltaRMin
Definition: DeltaRSqrIncl2AlgTool.h:76
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
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.
DeltaRSqrIncl2.h
GlobalSim::DeltaRSqrIncl2AlgTool::run
virtual StatusCode run(const EventContext &ctx) const override
Definition: DeltaRSqrIncl2AlgTool.cxx:32
DeltaRSqrIncl2AlgTool.h
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::DeltaRSqrIncl2AlgTool::m_doDump
Gaudi::Property< bool > m_doDump
Definition: DeltaRSqrIncl2AlgTool.h:100
GlobalSim::DeltaRSqrIncl2AlgTool::toString
virtual std::string toString() const override
Definition: DeltaRSqrIncl2AlgTool.cxx:98
GlobalSim::DeltaRSqrIncl2AlgTool::m_genericTOBArrayVectorWriteKey
SG::WriteHandleKey< std::vector< GlobalSim::GenericTOBArray > > m_genericTOBArrayVectorWriteKey
Definition: DeltaRSqrIncl2AlgTool.h:120
GlobalSim::dump
void dump(const std::string &fn, const T &t)
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
GlobalSim::DeltaRSqrIncl2AlgTool::m_MinET1
Gaudi::Property< std::vector< unsigned int > > m_MinET1
Definition: DeltaRSqrIncl2AlgTool.h:60
GlobalSim::DeltaRSqrIncl2AlgTool::m_MaxTOB2
Gaudi::Property< unsigned int > m_MaxTOB2
Definition: DeltaRSqrIncl2AlgTool.h:53
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.
GlobalSim::DeltaRSqrIncl2AlgTool::initialize
StatusCode initialize() override
Definition: DeltaRSqrIncl2AlgTool.cxx:20
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
GlobalSim::DeltaRSqrIncl2AlgTool::m_NumResultBits
Gaudi::Property< unsigned int > m_NumResultBits
Definition: DeltaRSqrIncl2AlgTool.h:92
GlobalSim::DeltaRSqrIncl2AlgTool::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: DeltaRSqrIncl2AlgTool.h:106
GlobalSim::DeltaRSqrIncl2AlgTool::m_genericTOBArrayReadKey0
SG::ReadHandleKey< GlobalSim::GenericTOBArray > m_genericTOBArrayReadKey0
Definition: DeltaRSqrIncl2AlgTool.h:110
GlobalSim::DeltaRSqrIncl2AlgTool::m_genericTOBArrayReadKey1
SG::ReadHandleKey< GlobalSim::GenericTOBArray > m_genericTOBArrayReadKey1
Definition: DeltaRSqrIncl2AlgTool.h:115
beamspotman.fail
def fail(message)
Definition: beamspotman.py:201
GlobalSim::DeltaRSqrIncl2AlgTool::m_MaxTOB1
Gaudi::Property< unsigned int > m_MaxTOB1
Definition: DeltaRSqrIncl2AlgTool.h:47