ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
RoIsUnpackingToolPhase1 Class Reference

#include <HLTSeedingRoIToolDefs.h>

Inherited by cTauRoIsUnpackingTool, eFexEMRoIsUnpackingTool, eFexTauRoIsUnpackingTool, gFexLRJetRoIsUnpackingTool, gFexSRJetRoIsUnpackingTool, jFexFwdElRoIsUnpackingTool, jFexLRJetRoIsUnpackingTool, jFexSRJetRoIsUnpackingTool, jFexTauRoIsUnpackingTool, and MuonRoIsUnpackingTool.

Collaboration diagram for RoIsUnpackingToolPhase1:

Public Member Functions

 RoIsUnpackingToolPhase1 (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual StatusCode initialize () override
 
virtual StatusCode start () override
 
virtual StatusCode unpack (const EventContext &ctx, const xAOD::TrigComposite &l1TriggerResult, const HLT::IDSet &activeChains) const override
 
virtual StatusCode unpack (const EventContext &, const ROIB::RoIBResult &, const HLT::IDSet &) const override
 
virtual StatusCode unpack (const EventContext &, const xAOD::TrigComposite &, const HLT::IDSet &) const override
 

Private Attributes

Gaudi::Property< std::string > m_l1RoILinkName
 
SG::ReadDecorHandleKey< T_RoIContainer > m_thresholdPatternsKey
 
Gaudi::Property< float > m_roiHalfWidthEta
 
Gaudi::Property< float > m_roiHalfWidthPhi
 

Detailed Description

Class template for all phase-1 L1 RoI unpacking tools

Definition at line 24 of file HLTSeedingRoIToolDefs.h.

Constructor & Destructor Documentation

◆ RoIsUnpackingToolPhase1()

RoIsUnpackingToolPhase1::RoIsUnpackingToolPhase1 ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)
inline

Definition at line 39 of file RoIsUnpackingToolPhase1.h.

Member Function Documentation

◆ initialize()

virtual StatusCode RoIsUnpackingToolPhase1::initialize ( )
inlineoverridevirtual

Definition at line 43 of file RoIsUnpackingToolPhase1.h.

43  {
45  ATH_CHECK(m_l1MenuKey.initialize());
46  ATH_CHECK(m_trigRoIsKey.initialize());
48  return StatusCode::SUCCESS;
49  }

◆ start()

virtual StatusCode RoIsUnpackingToolPhase1::start ( )
inlineoverridevirtual

Definition at line 52 of file RoIsUnpackingToolPhase1.h.

52  {
53  ATH_CHECK(decodeMapping([](const std::string& name){
54  return name.find(N_ThresholdType)==0 or name.find(getProbeThresholdName(N_ThresholdType))==0;
55  }));
56  return StatusCode::SUCCESS;
57  }

◆ unpack() [1/3]

virtual StatusCode RoIsUnpackingToolBase::unpack
inlineoverride

Definition at line 40 of file RoIsUnpackingToolBase.h.

42  { return StatusCode::SUCCESS; }

◆ unpack() [2/3]

virtual StatusCode RoIsUnpackingToolBase::unpack
inlineoverride

Definition at line 44 of file RoIsUnpackingToolBase.h.

46  { return StatusCode::SUCCESS; }

◆ unpack() [3/3]

virtual StatusCode RoIsUnpackingToolPhase1::unpack ( const EventContext &  ctx,
const xAOD::TrigComposite l1TriggerResult,
const HLT::IDSet activeChains 
) const
inlineoverridevirtual

Definition at line 61 of file RoIsUnpackingToolPhase1.h.

63  {
64  using namespace TrigCompositeUtils;
65  const bool doProbe = !m_decisionsKeyProbe.empty();
66 
67  // Create and record RoI descriptor and decision containers
68  SG::WriteHandle<TrigRoiDescriptorCollection> roiDescriptors = createAndStoreNoAux(m_trigRoIsKey, ctx);
69  SG::WriteHandle<DecisionContainer> decisionsMain = createAndStore(m_decisionsKey, ctx);
71  if (doProbe) decisionsProbe = createAndStore(m_decisionsKeyProbe, ctx);
72 
73  // Retrieve the xAOD RoI container from L1TriggerResult
75  ATH_MSG_DEBUG("No " << N_ThresholdType << " RoIs in this event");
76  auto monRoIsCount = Monitored::Scalar("count", 0);
77  Monitored::Group(m_monTool, monRoIsCount);
78  return StatusCode::SUCCESS;
79  }
81  ATH_CHECK(roisLink.isValid());
82  const T_RoIContainer& rois = roisLink.getStorableObjectRef();
83 
84  // Create threshold patterns decoration accessor
85  auto thrPatternAcc = SG::makeHandle<uint64_t>(m_thresholdPatternsKey, ctx);
86  ATH_CHECK(thrPatternAcc.isPresent());
87 
88  // Retrieve the L1 menu configuration
89  SG::ReadHandle<TrigConf::L1Menu> l1Menu = SG::makeHandle(m_l1MenuKey, ctx);
90  ATH_CHECK(l1Menu.isValid());
91  std::optional<ThrVecRef> thresholds;
92  ATH_CHECK(getL1Thresholds(*l1Menu, N_ThresholdType, thresholds));
93 
94  size_t linkIndex{0};
95  for (const T_RoI* roi : rois) {
96  // Create new RoI descriptor
97  roiDescriptors->push_back(std::make_unique<TrigRoiDescriptor>(
98  static_cast<unsigned int>((roi->*F_RoIWordGetter)()), 0u, 0u,
99  roi->eta(), roi->eta()-m_roiHalfWidthEta, roi->eta()+m_roiHalfWidthEta,
100  roi->phi(), roi->phi()-m_roiHalfWidthPhi, roi->phi()+m_roiHalfWidthPhi
101  ));
102 
103  // Create new decision and link the RoI objects
104  Decision* decisionMain = TrigCompositeUtils::newDecisionIn(decisionsMain.ptr(), hltSeedingNodeName());
105  decisionMain->setObjectLink(initialRoIString(),
106  ElementLink<TrigRoiDescriptorCollection>(m_trigRoIsKey.key(), linkIndex, ctx));
107  decisionMain->setObjectLink(initialRecRoIString(),
109 
110  Decision* decisionProbe{nullptr};
111  if (doProbe) {
112  decisionProbe = TrigCompositeUtils::newDecisionIn(decisionsProbe.ptr(), hltSeedingNodeName());
113  decisionProbe->setObjectLink(initialRoIString(),
114  ElementLink<TrigRoiDescriptorCollection>(m_trigRoIsKey.key(), linkIndex, ctx));
115  decisionProbe->setObjectLink(initialRecRoIString(),
117  }
118 
119  std::vector<TrigCompositeUtils::DecisionID> passedThresholdIDs;
120 
121  // Add positive decisions for chains to be activated by this RoI object
122  uint64_t thresholdPattern = thrPatternAcc(*roi);
123  ATH_MSG_DEBUG("RoI #" << linkIndex << " threshold pattern: " << thresholdPattern);
124  for (const std::shared_ptr<TrigConf::L1Threshold>& thr : thresholds.value().get()) {
125  if ((thresholdPattern & (1 << thr->mapping())) == 0u) {continue;}
126  passedThresholdIDs.push_back(HLT::Identifier(thr->name()));
127  ATH_MSG_DEBUG("RoI #" << linkIndex << " passed threshold number " << thr->mapping()
128  << " name" << (doProbe ? "s " : " ") << thr->name()
129  << (doProbe ? " and "+getProbeThresholdName(thr->name()) : ""));
130  addChainsToDecision(HLT::Identifier(thr->name()), decisionMain, activeChains);
131  if (doProbe) addChainsToDecision(HLT::Identifier(getProbeThresholdName(thr->name())), decisionProbe, activeChains);
132  }
133 
134  decisionMain->setDetail("thresholds", passedThresholdIDs);
135  if (doProbe) decisionProbe->setDetail("thresholds", passedThresholdIDs);
136 
137  ++linkIndex;
138  }
139 
140  // Monitor the TrigRoiDescriptorCollection
141  {
142  auto monRoIsCount = Monitored::Scalar("count", roiDescriptors->size());
143  auto monRoIsEta = Monitored::Collection("eta", *roiDescriptors, &TrigRoiDescriptor::eta);
144  auto monRoIsPhi = Monitored::Collection("phi", *roiDescriptors, &TrigRoiDescriptor::phi);
145  Monitored::Group(m_monTool, monRoIsCount, monRoIsEta, monRoIsPhi);
146  }
147 
148  return StatusCode::SUCCESS;
149  }

Member Data Documentation

◆ m_l1RoILinkName

Gaudi::Property<std::string> RoIsUnpackingToolPhase1::m_l1RoILinkName
private
Initial value:
{
this, "L1RoILinkName", N_RoIContainer,
"Name of the link to read from L1TriggerResult for L1 xAOD RoI container"}

Definition at line 23 of file RoIsUnpackingToolPhase1.h.

◆ m_roiHalfWidthEta

Gaudi::Property<float> RoIsUnpackingToolPhase1::m_roiHalfWidthEta
private
Initial value:
{
this, "RoIHalfWidthEta", 0.1, "Size of RoI in eta"}

Definition at line 31 of file RoIsUnpackingToolPhase1.h.

◆ m_roiHalfWidthPhi

Gaudi::Property<float> RoIsUnpackingToolPhase1::m_roiHalfWidthPhi
private
Initial value:
{
this, "RoIHalfWidthPhi", 0.1, "Size of RoI in phi"}

Definition at line 34 of file RoIsUnpackingToolPhase1.h.

◆ m_thresholdPatternsKey

SG::ReadDecorHandleKey<T_RoIContainer> RoIsUnpackingToolPhase1::m_thresholdPatternsKey
private
Initial value:
{
this, "L1RoIThresholdPatternsKey", std::string(N_RoIContainer)+".thresholdPatterns",
"Name of the L1 xAOD RoI container decoration for the threshold patterns"}

Definition at line 27 of file RoIsUnpackingToolPhase1.h.


The documentation for this class was generated from the following files:
HLTSeedingRoIToolDefs::eFexEM::T_RoI
xAOD::eFexEMRoI T_RoI
Definition: HLTSeedingRoIToolDefs.h:40
xAOD::TrigComposite_v1::setDetail
bool setDetail(const std::string &name, const TYPE &value)
Set an TYPE detail on the object.
TrigDefs::Group
Group
Properties of a chain group.
Definition: GroupProperties.h:13
RoIsUnpackingToolBase
Base class for RoI unpackers.
Definition: RoIsUnpackingToolBase.h:32
TrigCompositeUtils::hltSeedingNodeName
const std::string & hltSeedingNodeName()
Definition: TrigCompositeUtilsRoot.cxx:894
xAOD::TrigComposite_v1::objectLink
ElementLink< CONTAINER > objectLink(const std::string &name) const
Get the link with the requested name.
TrigCompositeUtils::newDecisionIn
Decision * newDecisionIn(DecisionContainer *dc, const std::string &name)
Helper method to create a Decision object, place it in the container and return a pointer to it.
Definition: TrigCompositeUtilsRoot.cxx:46
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
xAOD::TrigComposite_v1::hasObjectLink
bool hasObjectLink(const std::string &name, const CLID clid=CLID_NULL) const
Check if a link to an object with a given name and type exists. CLID_NULL to not check type.
Definition: TrigComposite_v1.cxx:226
HLTSeedingRoIToolDefs::eFexEM::F_RoIWordGetter
constexpr auto F_RoIWordGetter
Definition: HLTSeedingRoIToolDefs.h:42
RoIsUnpackingToolPhase1::m_l1RoILinkName
Gaudi::Property< std::string > m_l1RoILinkName
Definition: RoIsUnpackingToolPhase1.h:23
TrigCompositeUtils::createAndStore
SG::WriteHandle< DecisionContainer > createAndStore(const SG::WriteHandleKey< DecisionContainer > &key, const EventContext &ctx)
Creates and right away records the DecisionContainer with the key.
Definition: TrigCompositeUtilsRoot.cxx:30
RoIsUnpackingToolPhase1::m_thresholdPatternsKey
SG::ReadDecorHandleKey< T_RoIContainer > m_thresholdPatternsKey
Definition: RoIsUnpackingToolPhase1.h:27
TrigCompositeUtils::initialRecRoIString
const std::string & initialRecRoIString()
Definition: TrigCompositeUtilsRoot.cxx:874
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:83
Monitored::Collection
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
Definition: MonitoredCollection.h:38
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:269
xAOD::TrigComposite_v1::setObjectLink
bool setObjectLink(const std::string &name, const ElementLink< CONTAINER > &link)
Set the link to an object.
TrigCompositeUtils::initialRoIString
const std::string & initialRoIString()
Definition: TrigCompositeUtilsRoot.cxx:870
SG::ReadDecorHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
SG::WriteHandle::ptr
pointer_type ptr()
Dereference the pointer.
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ClassID_traits
Default, invalid implementation of ClassID_traits.
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:40
test_pyathena.parent
parent
Definition: test_pyathena.py:15
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
TrigCompositeUtils::createAndStoreNoAux
SG::WriteHandle< CONT > createAndStoreNoAux(const SG::WriteHandleKey< CONT > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Creates and right away records the Container CONT with the key.
xAOD::TrigComposite_v1
Class used to describe composite objects in the HLT.
Definition: TrigComposite_v1.h:52
HLT::Identifier
Definition: TrigCompositeUtils/TrigCompositeUtils/HLTIdentifier.h:20
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
RoIsUnpackingToolPhase1::m_roiHalfWidthPhi
Gaudi::Property< float > m_roiHalfWidthPhi
Definition: RoIsUnpackingToolPhase1.h:34
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
SG::WriteHandle< TrigRoiDescriptorCollection >
RoiDescriptor::phi
virtual double phi() const override final
Methods to retrieve data members.
Definition: RoiDescriptor.h:100
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TriggerTest.rois
rois
Definition: TriggerTest.py:23
RoIsUnpackingToolBase::initialize
virtual StatusCode initialize() override
Definition: RoIsUnpackingToolBase.cxx:16
RoiDescriptor::eta
virtual double eta() const override final
Definition: RoiDescriptor.h:101
TrigCompositeUtils
Definition: Event/xAOD/xAODTrigger/xAODTrigger/TrigComposite.h:19
HLTSeedingRoIToolDefs::eFexEM::T_RoIContainer
xAOD::eFexEMRoIContainer T_RoIContainer
Definition: HLTSeedingRoIToolDefs.h:41
egammaParameters::linkIndex
@ linkIndex
link index for multiple track and vertex matches
Definition: egammaParamDefs.h:574
RoIsUnpackingToolPhase1::m_roiHalfWidthEta
Gaudi::Property< float > m_roiHalfWidthEta
Definition: RoIsUnpackingToolPhase1.h:31
Monitored::Scalar
Declare a monitored scalar variable.
Definition: MonitoredScalar.h:34
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.