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

#include <ViewCreatorDVROITool.h>

Inheritance diagram for ViewCreatorDVROITool:
Collaboration diagram for ViewCreatorDVROITool:

Public Member Functions

 ViewCreatorDVROITool (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~ViewCreatorDVROITool ()=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_roiEtaWidth
 
Gaudi::Property< double > m_roiPhiWidth
 
Gaudi::Property< double > m_roiZWidth
 

Detailed Description

Creates a new (super)-ROI combining windows centred on HitDV seed 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 27 of file ViewCreatorDVROITool.h.

Constructor & Destructor Documentation

◆ ViewCreatorDVROITool()

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

Definition at line 13 of file ViewCreatorDVROITool.cxx.

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

◆ ~ViewCreatorDVROITool()

virtual ViewCreatorDVROITool::~ViewCreatorDVROITool ( )
virtualdefault

Member Function Documentation

◆ attachROILinks()

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

Tool interface method.

Definition at line 27 of file ViewCreatorDVROITool.cxx.

29 {
30  ATH_MSG_DEBUG("ViewCreatorDVROITool::attachROILinks");
31  // ===================================================================================== //
32  // ===================================================================================== //
33  // Create output RoI collection
34 
36  // ===================================================================================== //
37  ATH_MSG_DEBUG("Create output RoI collection");
38 
39  // Only expect one object in container
40  if(decisions.size()!=1) {
41  ATH_MSG_DEBUG("Did not find exactly one decision object in decision container containing " << decisions.size() << " decisions");
42  }
43 
44  for (TrigCompositeUtils::Decision* outputDecision : decisions) {
45 
46  ATH_MSG_DEBUG("Loop over decisions");
47 
48  const std::vector< TrigCompositeUtils::LinkInfo<xAOD::TrigCompositeContainer> > dvSeedLinks = TrigCompositeUtils::findLinks< xAOD::TrigCompositeContainer >(outputDecision, TrigCompositeUtils::featureString(), TrigDefs::lastFeatureOfType);
49 
50  if (dvSeedLinks.size() != 1) {
51  ATH_MSG_DEBUG("Did not find exactly one most-recent " << m_featureLinkName << " for Decision object index "
52  << outputDecision->index() << ", found " << dvSeedLinks.size());
53  }
54 
55  for (const auto& dvLink : dvSeedLinks) {
56  // This is needed to merge the RoIs from each dv
57  std::unique_ptr<TrigRoiDescriptor> superRoI = std::make_unique<TrigRoiDescriptor>();
58  superRoI->setComposite(true);
59  superRoI->manageConstituents(true);
60 
61  if(!dvLink.link.isValid()) {
62  ATH_MSG_DEBUG("Received invalid hitDV link from decision object! " << m_featureLinkName << " : " << dvLink.link);
63  continue;
64  }
65 
66  ATH_MSG_DEBUG(" --- Find Link");
67  const xAOD::TrigCompositeContainer* dvCont = static_cast<const xAOD::TrigCompositeContainer*> ( (*dvLink.link)->container() );
68  ATH_MSG_DEBUG(" --- Found " << dvCont->size() << " presel DV seeds linked from decision object.");
69  ATH_MSG_DEBUG(" ");
70 
71  static const SG::ConstAccessor<float> hitDV_seed_etaAcc("hitDV_seed_eta");
72  static const SG::ConstAccessor<float> hitDV_seed_phiAcc("hitDV_seed_phi");
73  for(const xAOD::TrigComposite* dv : *dvCont) {
74  if ( !(hitDV_seed_etaAcc.isAvailable( *dv ) &&
75  hitDV_seed_etaAcc.isAvailable( *dv ) ) ) continue;
76 
77  float dvEta = hitDV_seed_etaAcc( *dv );
78  float dvPhi = hitDV_seed_phiAcc( *dv );
79 
80  ATH_MSG_DEBUG( "DV seed eta = " << dvEta <<
81  " phi = " << dvPhi );
82 
83  // create ROIs
84  ATH_MSG_DEBUG("Adding RoI to RoI container");
85  ATH_MSG_DEBUG( " ** Imposing Z constraint while building RoI" );
86  double etaMinus = dvEta - m_roiEtaWidth;
87  double etaPlus = dvEta + m_roiEtaWidth;
88 
89  double phiMinus = CxxUtils::wrapToPi( dvPhi - m_roiPhiWidth );
90  double phiPlus = CxxUtils::wrapToPi( dvPhi + m_roiPhiWidth );
91 
92  // Should retrieve beamspot offset from somewhere
93  double zMinus = -1. * m_roiZWidth;
94  double zPlus = m_roiZWidth;
95 
96  std::unique_ptr<TrigRoiDescriptor> newROI =
97  std::make_unique<TrigRoiDescriptor>( dvEta, etaMinus, etaPlus,
98  dvPhi, phiMinus, phiPlus,
99  0.,zMinus,zPlus );
100 
101  superRoI->push_back( newROI.release() );
102  }
103 
104 
105  roisWriteHandle->push_back(superRoI.release());
106  const ElementLink< TrigRoiDescriptorCollection > roiEL = ElementLink< TrigRoiDescriptorCollection >( *roisWriteHandle, roisWriteHandle->size() - 1, ctx );
107  outputDecision->setObjectLink( TrigCompositeUtils::roiString(), roiEL );
108 
109  ATH_MSG_DEBUG("PRINTING DECISION");
110  ATH_MSG_DEBUG( *outputDecision );
111  }
112  }
113 
114  ATH_MSG_DEBUG("return StatusCode::SUCCESS");
115  return StatusCode::SUCCESS;
116 }

◆ initialize()

StatusCode ViewCreatorDVROITool::initialize ( )
overridevirtual

Definition at line 20 of file ViewCreatorDVROITool.cxx.

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

Member Data Documentation

◆ m_featureLinkName

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

Definition at line 45 of file ViewCreatorDVROITool.h.

◆ m_roiEtaWidth

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

Definition at line 48 of file ViewCreatorDVROITool.h.

◆ m_roiPhiWidth

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

Definition at line 51 of file ViewCreatorDVROITool.h.

◆ m_roisWriteHandleKey

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

Definition at line 42 of file ViewCreatorDVROITool.h.

◆ m_roiZWidth

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

Definition at line 55 of file ViewCreatorDVROITool.h.


The documentation for this class was generated from the following files:
PlotCalibFromCool.dv
dv
Definition: PlotCalibFromCool.py:762
ViewCreatorDVROITool::m_roiEtaWidth
Gaudi::Property< double > m_roiEtaWidth
Definition: ViewCreatorDVROITool.h:48
CxxUtils::wrapToPi
T wrapToPi(T phi)
Wrap angle in radians to [-pi, pi].
Definition: phihelper.h:24
SG::ConstAccessor< float >
ViewCreatorDVROITool::m_roisWriteHandleKey
SG::WriteHandleKey< TrigRoiDescriptorCollection > m_roisWriteHandleKey
Definition: ViewCreatorDVROITool.h:42
RoiDescriptor::push_back
void push_back(const IRoiDescriptor *roi)
add a RoiDescriptor
Definition: RoiDescriptor.h:157
ViewCreatorDVROITool::m_roiZWidth
Gaudi::Property< double > m_roiZWidth
Definition: ViewCreatorDVROITool.h:55
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
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:794
xAOD::decisions
decisions
Definition: TrigComposite_v1.cxx:101
TrigCompositeUtils::featureString
const std::string & featureString()
Definition: TrigCompositeUtilsRoot.cxx:884
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
SG::WriteHandle< TrigRoiDescriptorCollection >
ViewCreatorDVROITool::m_roiPhiWidth
Gaudi::Property< double > m_roiPhiWidth
Definition: ViewCreatorDVROITool.h:51
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:876
RoiDescriptor::manageConstituents
bool manageConstituents() const
always manage constituents ???
Definition: RoiDescriptor.h:141
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
ViewCreatorDVROITool::m_featureLinkName
Gaudi::Property< std::string > m_featureLinkName
Definition: ViewCreatorDVROITool.h:45