ATLAS Offline Software
cTauMultiplicityAlgTool.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 "cTauMultiplicity.h"
7 
8 #include "../dump.h"
9 #include "../dump.icc"
10 
11 #include "TrigConfData/L1Menu.h"
12 
15 
16 #include <sstream>
17 
18 
19 namespace GlobalSim {
21  const std::string& name,
22  const IInterface* parent) :
23  base_class(type, name, parent){
24  }
25 
27 
28  if (m_nbits == 0u) {
29  ATH_MSG_ERROR("m_nbits == 0");
30  return StatusCode::FAILURE;
31  }
32 
33  const TrigConf::L1Menu* l1menu = nullptr;
35  ATH_MSG_INFO("L1Menu name " << l1menu->getAttribute("name"));
37  std::make_unique<L1MenuResources>(*l1menu,
39  "MULTTOPO");
40 
43 
44 
45  return StatusCode::SUCCESS;
46  }
47 
49  cTauMultiplicityAlgTool::run(const EventContext& ctx) const {
50 
52  CHECK(cTaus.isValid());
53 
54  auto count = std::make_unique<GlobalSim::Count>();
55 
56  const auto & threshold =
57  dynamic_cast<const TrigConf::L1Threshold_cTAU&>(m_l1MenuResources->threshold());
58 
59  auto alg =
61  m_nbits,
62  threshold,
63  m_l1MenuResources->isolationFW_CTAU(),
64  m_l1MenuResources->isolationFW_CTAU_jTAUCoreScale());
65 
66 
67  CHECK(alg.run(*cTaus, *count));
69  ctx);
70  if (m_doDump) {
71  dump(name() + '_' + std::to_string(ctx.evt()), *count);
72  }
73 
74  CHECK(h_write.record(std::move(count)));
75 
76  CHECK(monitor(alg));
77 
78 
79  return StatusCode::SUCCESS;
80  }
81 
84 
85  const auto & accept_eta_data = alg.accept_eta();
86 
87  auto accept_eta_moncol = Monitored::Collection("accept_eta",
88  accept_eta_data);
89  const auto & accept_et_data = alg.accept_et();
90  auto accept_et_moncol = Monitored::Collection("accept_et",
91  accept_et_data);
92 
93  const auto & counts_data = alg.counts();
94  auto counts_moncol = Monitored::Collection("counts", counts_data);
95 
96  const auto & TOBet_data = alg.TOB_et();
97  auto TOBet_moncol = Monitored::Collection("Et", TOBet_data);
98 
99 
100  const auto & TOBeta_data = alg.TOB_eta();
101  auto TOBeta_moncol = Monitored::Collection("eta", TOBeta_data);
102 
103 
104  const auto & TOBphi_data = alg.TOB_phi();
105  auto TOBphi_moncol = Monitored::Collection("phi", TOBphi_data);
106 
107  const auto & TOBisolation_partial_loose_data = alg.TOB_isolation_partial_loose();
108  auto TOBisolation_partial_loose_moncol =
109  Monitored::Collection("iso_loose", TOBisolation_partial_loose_data);
110 
111  const auto & TOBisolation_partial_medium_data = alg.TOB_isolation_partial_medium();
112  auto TOBisolation_partial_medium_moncol =
113  Monitored::Collection("iso_medium", TOBisolation_partial_medium_data);
114 
115  const auto & TOBisolation_partial_tight_data = alg.TOB_isolation_partial_tight();
116  auto TOBisolation_partial_tight_moncol =
117  Monitored::Collection("iso_tight", TOBisolation_partial_tight_data);
118 
119 
121  accept_eta_moncol,
122  accept_et_moncol,
123  TOBet_moncol,
124  TOBphi_moncol,
125  TOBeta_moncol,
126  TOBisolation_partial_loose_moncol,
127  TOBisolation_partial_medium_moncol,
128  TOBisolation_partial_tight_moncol
129  );
130 
131  return StatusCode::SUCCESS;
132  }
133 
134  std::string cTauMultiplicityAlgTool::toString() const {
135 
136  std::stringstream ss;
137  const auto & threshold =
138  dynamic_cast<const TrigConf::L1Threshold_cTAU&>(m_l1MenuResources->threshold());
139  ss << "cTauMultiplicityAlgTool. name: " << name() << '\n'
140  << m_cTauTOBArrayReadKey << '\n'
141  << m_CountWriteKey << '\n'
143  m_nbits,
144  threshold,
145  m_l1MenuResources->isolationFW_CTAU(),
146  m_l1MenuResources->isolationFW_CTAU_jTAUCoreScale()).toString()
147  << '\n';
148  return ss.str();
149  }
150 
151 
152 
153 }
154 
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
TrigConf::L1Threshold_cTAU
Definition: L1Threshold.h:255
TrigDefs::Group
Group
Properties of a chain group.
Definition: GroupProperties.h:13
GlobalSim::cTauMultiplicity
Definition: Global/GlobalSimulation/src/L1TopoAlgs/cTauMultiplicity.h:29
SGout2dot.alg
alg
Definition: SGout2dot.py:243
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
GlobalSim::cTauMultiplicityAlgTool::m_l1MenuResources
std::unique_ptr< L1MenuResources > m_l1MenuResources
Definition: cTauMultiplicityAlgTool.h:64
GlobalSim::cTauMultiplicityAlgTool::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: cTauMultiplicityAlgTool.h:76
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
GlobalSim::cTauMultiplicityAlgTool::initialize
StatusCode initialize() override
Definition: cTauMultiplicityAlgTool.cxx:26
GlobalSim::cTauMultiplicityAlgTool::m_CountWriteKey
SG::WriteHandleKey< GlobalSim::Count > m_CountWriteKey
Definition: cTauMultiplicityAlgTool.h:71
TrigConf::L1Menu
L1 menu configuration.
Definition: L1Menu.h:28
GlobalSim::cTauMultiplicityAlgTool::run
virtual StatusCode run(const EventContext &ctx) const override
Definition: cTauMultiplicityAlgTool.cxx:49
GlobalSim::cTauMultiplicityAlgTool::toString
virtual std::string toString() const override
Definition: cTauMultiplicityAlgTool.cxx:134
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
Monitored::Collection
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
Definition: MonitoredCollection.h:38
GlobalSim::cTauMultiplicity::toString
std::string toString() const
Definition: Global/GlobalSimulation/src/L1TopoAlgs/cTauMultiplicity.cxx:259
GlobalSim
AlgTool to obtain a selection of eFex RoIs read in from the event store.
Definition: dump.h:8
MonitoredCollection.h
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
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
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
cTauMultiplicity.h
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.
GlobalSim::cTauMultiplicityAlgTool::monitor
StatusCode monitor(const cTauMultiplicity &) const
Definition: cTauMultiplicityAlgTool.cxx:83
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
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
threshold
Definition: chainparser.cxx:74
GlobalSim::dump
void dump(const std::string &fn, const T &t)
GlobalSim::cTauMultiplicityAlgTool::m_nbits
Gaudi::Property< unsigned int > m_nbits
Definition: cTauMultiplicityAlgTool.h:52
GlobalSim::cTauMultiplicityAlgTool::m_cTauTOBArrayReadKey
SG::ReadHandleKey< GlobalSim::cTauTOBArray > m_cTauTOBArrayReadKey
Definition: cTauMultiplicityAlgTool.h:67
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
CaloLCW_tf.group
group
Definition: CaloLCW_tf.py:28
GlobalSim::cTauMultiplicityAlgTool::m_doDump
Gaudi::Property< bool > m_doDump
Definition: cTauMultiplicityAlgTool.h:58
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::cTauMultiplicityAlgTool::m_algInstanceName
Gaudi::Property< std::string > m_algInstanceName
Definition: cTauMultiplicityAlgTool.h:45
python.XMLReader.l1menu
l1menu
Definition: XMLReader.py:73
L1Menu.h
cTauMultiplicityAlgTool.h
GlobalSim::cTauMultiplicityAlgTool::cTauMultiplicityAlgTool
cTauMultiplicityAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: cTauMultiplicityAlgTool.cxx:20