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

#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. More...
 

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 
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());
110  outputDecision->setObjectLink( TrigCompositeUtils::roiString(), roiEL );
111 
112  ATH_MSG_DEBUG("PRINTING DECISION");
113  ATH_MSG_DEBUG( *outputDecision );
114 
115  return StatusCode::SUCCESS;
116 }

◆ initialize()

StatusCode ViewCreatorJetSuperROITool::initialize ( )
overridevirtual

Definition at line 20 of file ViewCreatorJetSuperROITool.cxx.

20  {
22 
23  return StatusCode::SUCCESS;
24 }

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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.


The documentation for this class was generated from the following files:
TrigCompositeUtils::LinkInfo::link
ElementLink< T > link
Link to the feature.
Definition: LinkInfo.h:61
CxxUtils::wrapToPi
T wrapToPi(T phi)
Wrap angle in radians to [-pi, pi].
Definition: phihelper.h:24
ViewCreatorJetSuperROITool::m_roiEtaWidth
Gaudi::Property< double > m_roiEtaWidth
Definition: ViewCreatorJetSuperROITool.h:57
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
RoiDescriptor::push_back
void push_back(const IRoiDescriptor *roi)
add a RoiDescriptor
Definition: RoiDescriptor.h:157
ViewCreatorJetSuperROITool::m_jetMinPt
Gaudi::Property< double > m_jetMinPt
Definition: ViewCreatorJetSuperROITool.h:50
xAOD::TrigComposite_v1::setObjectLink
bool setObjectLink(const std::string &name, const ElementLink< CONTAINER > &link)
Set the link to an object.
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ViewCreatorJetSuperROITool::m_roiZWidth
Gaudi::Property< double > m_roiZWidth
Definition: ViewCreatorJetSuperROITool.h:64
ViewCreatorJetSuperROITool::m_jetMaxAbsEta
Gaudi::Property< double > m_jetMaxAbsEta
Definition: ViewCreatorJetSuperROITool.h:54
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
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
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
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
xAOD::decisions
decisions
Definition: TrigComposite_v1.cxx:81
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.
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
SG::WriteHandle< TrigRoiDescriptorCollection >
TrigCompositeUtils::LinkInfo
Helper to keep a Decision object, ElementLink and ActiveState (with respect to some requested ChainGr...
Definition: LinkInfo.h:28
ViewCreatorJetSuperROITool::m_roisWriteHandleKey
SG::WriteHandleKey< TrigRoiDescriptorCollection > m_roisWriteHandleKey
Definition: ViewCreatorJetSuperROITool.h:44
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
RoiDescriptor::setComposite
void setComposite(bool b=true)
Definition: RoiDescriptor.h:138
TrigCompositeUtils::roiString
const std::string & roiString()
Definition: TrigCompositeUtilsRoot.cxx:878
TrigRoiDescriptor
Athena::TPCnvVers::Current TrigRoiDescriptor
Definition: TrigSteeringEventTPCnv.cxx:68
RoiDescriptor::manageConstituents
bool manageConstituents() const
always manage constituents ???
Definition: RoiDescriptor.h:141
GeV
#define GeV
Definition: CaloTransverseBalanceVecMon.cxx:30
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
ViewCreatorJetSuperROITool::m_roiPhiWidth
Gaudi::Property< double > m_roiPhiWidth
Definition: ViewCreatorJetSuperROITool.h:60