ATLAS Offline Software
Loading...
Searching...
No Matches
ViewCreatorJetSuperROITool Class Reference

Creates a new (super)-ROI combining windows centred on jets passing eta/pt selection criteria, extracted from a single decision object (which would normally link the FSRoI). More...

#include <ViewCreatorJetSuperROITool.h>

Inheritance diagram for ViewCreatorJetSuperROITool:
Collaboration diagram for ViewCreatorJetSuperROITool:

Public Member Functions

 ViewCreatorJetSuperROITool (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~ViewCreatorJetSuperROITool ()=default
virtual StatusCode initialize () override
virtual StatusCode attachROILinks (TrigCompositeUtils::DecisionContainer &decisions, const EventContext &ctx) const override
 Tool interface method.

Public Attributes

SG::WriteHandleKey< TrigRoiDescriptorCollectionm_roisWriteHandleKey
Gaudi::Property< std::string > m_featureLinkName
Gaudi::Property< double > m_jetMinPt
Gaudi::Property< double > m_jetMaxAbsEta
Gaudi::Property< double > m_roiEtaWidth
Gaudi::Property< double > m_roiPhiWidth
Gaudi::Property< double > m_roiZWidth

Detailed Description

Creates a new (super)-ROI combining windows centred on jets passing eta/pt selection criteria, extracted from a single decision object (which would normally link the FSRoI).

Stores this new ROI in the output container, and links it to the Decision Object

The new EventView spawned by the parent EventViewCreatorAlgorithm of this tool will process in this new ROI.

This tool is mainly intended to create a view for fast tracking preselection operations, beginning from the jets used for pure calorimeter-based preselection.

Definition at line 26 of file ViewCreatorJetSuperROITool.h.

Constructor & Destructor Documentation

◆ ViewCreatorJetSuperROITool()

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

Definition at line 13 of file ViewCreatorJetSuperROITool.cxx.

16 : base_class(type, name, parent)
17{}

◆ ~ViewCreatorJetSuperROITool()

virtual ViewCreatorJetSuperROITool::~ViewCreatorJetSuperROITool ( )
virtualdefault

Member Function Documentation

◆ attachROILinks()

StatusCode ViewCreatorJetSuperROITool::attachROILinks ( TrigCompositeUtils::DecisionContainer & decisions,
const EventContext & ctx ) const
overridevirtual

Tool interface method.

not really composite until a constituent has been added so whether setting here or only when adding a constituent, depends on how it should be used in the future - if we want it to be treated as empty with no constituents, then setComposite should be true even with no constituents, otherwise, with no constituantes it will be treated as a normal fullscan Roi which may not be what is intended

don't mess about with unique_ptr here as the pointer management is done by the Roi itself

only set this to true here, just in case. It will still be false, if there are no constituents, but it doesn;t really matter one way or another in that case

why is the superRoi a unique pointer if it is just going to be released ?

Definition at line 27 of file ViewCreatorJetSuperROITool.cxx.

28 {
29
30 // ===================================================================================== //
31 // ===================================================================================== //
32 // Create output RoI collection
33
34 SG::WriteHandle<TrigRoiDescriptorCollection> roisWriteHandle = TrigCompositeUtils::createAndStoreNoAux(m_roisWriteHandleKey, ctx);
35 // ===================================================================================== //
36
37 // Only expect one object in container
38 if(decisions.size()!=1) {
39 ATH_MSG_ERROR("Did not find exactly one decision object in decision container containing " << decisions.size() << " decisions");
40 return StatusCode::FAILURE;
41 }
42 TrigCompositeUtils::Decision* outputDecision = decisions[0];
43
44 // Link name should probably be configurable
45 const TrigCompositeUtils::LinkInfo< xAOD::JetContainer> leadingjetlink = TrigCompositeUtils::findLink< xAOD::JetContainer >(outputDecision, "LeadingPreselJet", TrigDefs::lastFeatureOfType);
46 if(!leadingjetlink.link.isValid()) {
47 ATH_MSG_ERROR("Received invalid jet link from decision object! " << leadingjetlink.link);
48 return StatusCode::FAILURE;
49 }
50
51 const xAOD::JetContainer* jetCont = static_cast<const xAOD::JetContainer*>((*leadingjetlink.link)->container());
52 ATH_MSG_DEBUG("Found " << jetCont->size() << " presel jets linked from decision object.");
53
54 // This is needed to merge the RoIs from each jet
55 std::unique_ptr<TrigRoiDescriptor> superRoI = std::make_unique<TrigRoiDescriptor>();
56
63 superRoI->setComposite(true);
64 superRoI->manageConstituents(false);
65
66 for(const xAOD::Jet* jet : *jetCont) {
67 if(jet->pt()>m_jetMinPt && std::abs(jet->eta())<m_jetMaxAbsEta) {
68 double jetEta{jet->eta()}, jetPhi{jet->phi()};
69
70 ATH_MSG_DEBUG("JET -- pt=" << jet->pt() <<
71 " eta=" << jet->eta() <<
72 " phi=" << jet->phi() );
73
74 // create ROIs
75 ATH_MSG_DEBUG("Adding RoI to RoI container");
76 ATH_MSG_DEBUG( " ** Imposing Z constraint while building RoI" );
77 double etaMinus = jetEta - m_roiEtaWidth;
78 double etaPlus = jetEta + m_roiEtaWidth;
79
80 double phiMinus = CxxUtils::wrapToPi( jetPhi - m_roiPhiWidth );
81 double phiPlus = CxxUtils::wrapToPi( jetPhi + m_roiPhiWidth );
82
83
84 if ( m_roiZWidth > 0 ) {
85 // Should retrieve beamspot offset from somewhere
86 double zMinus = -1. * m_roiZWidth;
87 double zPlus = m_roiZWidth;
88
91 superRoI->push_back( new TrigRoiDescriptor( jetEta, etaMinus, etaPlus,
92 jetPhi, phiMinus, phiPlus,
93 0.,zMinus,zPlus ) );
94 }
95 else {
96 superRoI->push_back( new TrigRoiDescriptor( jetEta, etaMinus, etaPlus,
97 jetPhi, phiMinus, phiPlus ) );
98 }
99
100
104 superRoI->manageConstituents(true);
105 }
106 }
107
108 roisWriteHandle->push_back(superRoI.release());
109 const ElementLink< TrigRoiDescriptorCollection > roiEL = ElementLink< TrigRoiDescriptorCollection >( *roisWriteHandle, 0, ctx );
110 outputDecision->setObjectLink( TrigCompositeUtils::roiString(), roiEL );
111
112 ATH_MSG_DEBUG("PRINTING DECISION");
113 ATH_MSG_DEBUG( *outputDecision );
114
115 return StatusCode::SUCCESS;
116}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
Athena::TPCnvVers::Current TrigRoiDescriptor
size_type size() const noexcept
Returns the number of elements in the collection.
Gaudi::Property< double > m_roiEtaWidth
Gaudi::Property< double > m_roiPhiWidth
Gaudi::Property< double > m_jetMinPt
SG::WriteHandleKey< TrigRoiDescriptorCollection > m_roisWriteHandleKey
Gaudi::Property< double > m_roiZWidth
Gaudi::Property< double > m_jetMaxAbsEta
bool setObjectLink(const std::string &name, const ElementLink< CONTAINER > &link)
Set the link to an object.
T wrapToPi(T phi)
Wrap angle in radians to [-pi, pi].
Definition phihelper.h:24
SG::WriteHandle< CONT > createAndStoreNoAux(const SG::WriteHandleKey< CONT > &key, const EventContext &ctx)
Creates and right away records the Container CONT with the key.
const std::string & roiString()
LinkInfo< T > findLink(const Decision *start, const std::string &linkName, const bool suppressMultipleLinksWarning=false)
Perform a recursive search for ElementLinks of type T and name 'linkName', starting from Decision obj...
static const unsigned int lastFeatureOfType
Run 3 "enum". Only return the final feature along each route through the navigation.
Jet_v1 Jet
Definition of the current "jet version".
JetContainer_v1 JetContainer
Definition of the current "jet container version".
ElementLink< T > link
Link to the feature.
Definition LinkInfo.h:55

◆ initialize()

StatusCode ViewCreatorJetSuperROITool::initialize ( )
overridevirtual

Definition at line 20 of file ViewCreatorJetSuperROITool.cxx.

20 {
21 ATH_CHECK( m_roisWriteHandleKey.initialize() );
22
23 return StatusCode::SUCCESS;
24}
#define ATH_CHECK
Evaluate an expression and check for errors.

Member Data Documentation

◆ m_featureLinkName

Gaudi::Property< std::string > ViewCreatorJetSuperROITool::m_featureLinkName
Initial value:
{this,"FeatureLinkName","PreselJets",
"The name of the decoration holding the list of jets used for preselection"}

Definition at line 47 of file ViewCreatorJetSuperROITool.h.

47 {this,"FeatureLinkName","PreselJets",
48 "The name of the decoration holding the list of jets used for preselection"};

◆ m_jetMaxAbsEta

Gaudi::Property< double > ViewCreatorJetSuperROITool::m_jetMaxAbsEta
Initial value:
{this,"JetMaxAbsEta",2.5,
"Maximum absolute jet pseudorapidity used for RoI creation"}

Definition at line 54 of file ViewCreatorJetSuperROITool.h.

54 {this,"JetMaxAbsEta",2.5,
55 "Maximum absolute jet pseudorapidity used for RoI creation"};

◆ m_jetMinPt

Gaudi::Property< double > ViewCreatorJetSuperROITool::m_jetMinPt
Initial value:
{this,"JetMinPt",20*Gaudi::Units::GeV,
"Minimum jet pT used for RoI creation"}

Definition at line 50 of file ViewCreatorJetSuperROITool.h.

50 {this,"JetMinPt",20*Gaudi::Units::GeV,
51 "Minimum jet pT used for RoI creation"};

◆ m_roiEtaWidth

Gaudi::Property< double > ViewCreatorJetSuperROITool::m_roiEtaWidth
Initial value:
{this,"RoIEtaWidth",0.4,
"Extent of the ROI in eta from its centre"}

Definition at line 57 of file ViewCreatorJetSuperROITool.h.

57 {this,"RoIEtaWidth",0.4,
58 "Extent of the ROI in eta from its centre"};

◆ m_roiPhiWidth

Gaudi::Property< double > ViewCreatorJetSuperROITool::m_roiPhiWidth
Initial value:
{this,"RoIPhiWidth",0.4,
"Extent of the ROI in phi from its centre"}

Definition at line 60 of file ViewCreatorJetSuperROITool.h.

60 {this,"RoIPhiWidth",0.4,
61 "Extent of the ROI in phi from its centre"};

◆ m_roisWriteHandleKey

SG::WriteHandleKey< TrigRoiDescriptorCollection > ViewCreatorJetSuperROITool::m_roisWriteHandleKey
Initial value:
{this,"RoisWriteHandleKey","",
"Name of the ROI collection produced by this tool."}

Definition at line 44 of file ViewCreatorJetSuperROITool.h.

44 {this,"RoisWriteHandleKey","",
45 "Name of the ROI collection produced by this tool."};

◆ m_roiZWidth

Gaudi::Property< double > ViewCreatorJetSuperROITool::m_roiZWidth
Initial value:
{this,"RoIZWidth",-999,
"Z Half Width in mm"}

Definition at line 64 of file ViewCreatorJetSuperROITool.h.

64 {this,"RoIZWidth",-999,
65 "Z Half Width in mm"};

The documentation for this class was generated from the following files: