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

#include <ViewCreatorMuonSuperROITool.h>

Inheritance diagram for ViewCreatorMuonSuperROITool:
Collaboration diagram for ViewCreatorMuonSuperROITool:

Public Member Functions

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

Detailed Description

Creates a new (super)-ROI combining windows centred on muons 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 bmumux tracking operations, beginning from muons.

Definition at line 25 of file ViewCreatorMuonSuperROITool.h.

Constructor & Destructor Documentation

◆ ViewCreatorMuonSuperROITool()

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

Definition at line 14 of file ViewCreatorMuonSuperROITool.cxx.

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

◆ ~ViewCreatorMuonSuperROITool()

virtual ViewCreatorMuonSuperROITool::~ViewCreatorMuonSuperROITool ( )
virtualdefault

Member Function Documentation

◆ attachROILinks()

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

Tool interface method.

Definition at line 28 of file ViewCreatorMuonSuperROITool.cxx.

29  {
30 
31  // ===================================================================================== //
32  // Create output RoI collection
33 
35  // ===================================================================================== //
36 
37  // Only expect one object in container
38  ATH_MSG_DEBUG("In MuonSuperROITool - got decisions, size: " << decisions.size());
39 
40 
41  // Create SuperRoI to merge the RoIs from each muon
42  std::unique_ptr<TrigRoiDescriptor> superRoI = std::make_unique<TrigRoiDescriptor>();
43  superRoI->setComposite(true);
44  superRoI->manageConstituents(false);
45 
46  // loop over decision objects
47  for (TrigCompositeUtils::Decision* decision : decisions) {
48  ATH_MSG_DEBUG(" Check decisions object ");
49 
50  ATH_MSG_DEBUG("PRINTING DECISION");
51  ATH_MSG_DEBUG( *decision );
52 
53 
54  // find the iParticle for this decision
55  const std::vector<TrigCompositeUtils::LinkInfo<xAOD::IParticleContainer>> myFeature = TrigCompositeUtils::findLinks<xAOD::IParticleContainer>(decision, m_iParticleLinkName, TrigDefs::lastFeatureOfType);
56 
57  // there should be only one
58  if (myFeature.size() != 1) {
59  ATH_MSG_ERROR("Did not find exactly one most-recent xAOD::IParticle '" << m_iParticleLinkName << "' for Decision object index " << decision->index()
60  << ", found " << myFeature.size());
61  return StatusCode::FAILURE;
62  }
63 
64  ATH_CHECK(myFeature.at(0).isValid());
65 
66  // find the muon
67  const ElementLink<xAOD::IParticleContainer> p4EL = myFeature.at(0).link;
68  const xAOD::Muon* muon = dynamic_cast< const xAOD::Muon*>(*p4EL); //get muon of this found object
69 
70  if (!( muon && muon->primaryTrackParticle()) ) {
71  ATH_MSG_ERROR("NO PRIMARY muon from decision object! " << myFeature.at(0).link);
72  return StatusCode::FAILURE;
73  }
74 
75  ATH_MSG_DEBUG("MUON -- pt=" << muon->pt() <<
76  " eta=" << muon->eta() <<
77  " phi=" << muon->phi() );
78 
79 
80  double muonEta{muon->eta()}, muonPhi{muon->phi()};
81 
82  double etaMinus = muonEta - m_roiEtaWidth;
83  double etaPlus = muonEta + m_roiEtaWidth;
84 
85  double phiMinus = CxxUtils::wrapToPi( muonPhi - m_roiPhiWidth );
86  double phiPlus = CxxUtils::wrapToPi( muonPhi + m_roiPhiWidth );
87 
88  double muonZed=0.;
89 
90  std::unique_ptr<TrigRoiDescriptor> newROI = nullptr;
91 
92  if ( muon->primaryTrackParticle() ) {
93  muonZed = muon->primaryTrackParticle()->z0() + muon->primaryTrackParticle()->vz();
94 
95  // create ROIs
96  ATH_MSG_DEBUG("Adding RoI to RoI container");
97  ATH_MSG_DEBUG( "eta " << muonEta << " +/-" << m_roiEtaWidth << " phi " << muonPhi << " +/- " << m_roiPhiWidth << " zed " << muonZed << " +/- " << m_roiZedWidth);
98 
99 
100  double zMinus = muonZed - m_roiZedWidth;
101  double zPlus = muonZed + m_roiZedWidth;
102 
103  zMinus = zMinus < -225. ? -225. : zMinus;
104  zPlus = zPlus > 225. ? 225. : zPlus;
105 
106  ATH_MSG_DEBUG( "eta- " << etaMinus << " eta+ " << etaPlus << " phi- " << phiMinus << " phi+ " << phiPlus << " zed- " << zMinus << " zed+ " << zPlus);
107 
108  superRoI->push_back( new TrigRoiDescriptor( muonEta, etaMinus, etaPlus,
109  muonPhi, phiMinus, phiPlus,
110  muonZed, zMinus, zPlus ) );
111 
112  superRoI->manageConstituents(true);
113 
114  } else {
115  ATH_MSG_DEBUG("Adding RoI to RoI container");
116  ATH_MSG_DEBUG( "eta " << muonEta << " +/-" << m_roiEtaWidth << " phi " << muonPhi << " +/- " << m_roiPhiWidth);
117  ATH_MSG_DEBUG( "eta- " << etaMinus << " eta+ " << etaPlus << " phi- " << phiMinus << " phi+ " << phiPlus);
118 
119  superRoI->push_back( new TrigRoiDescriptor( muonEta, etaMinus, etaPlus,
120  muonPhi, phiMinus, phiPlus) );
121 
122  superRoI->manageConstituents(true);
123 
124  }
125 
126 
127  } //end loop over decisions
128 
129 
130 
131  roisWriteHandle->push_back(superRoI.release());
133 
134 
135  for (TrigCompositeUtils::Decision* decision : decisions) {
136  decision->setObjectLink( TrigCompositeUtils::roiString(), roiEL );
137 
138  ATH_MSG_DEBUG("PRINTING DECISION");
139  ATH_MSG_DEBUG( *decision );
140  }
141  return StatusCode::SUCCESS;
142 }

◆ initialize()

StatusCode ViewCreatorMuonSuperROITool::initialize ( )
overridevirtual

Definition at line 21 of file ViewCreatorMuonSuperROITool.cxx.

21  {
23 
24  return StatusCode::SUCCESS;
25 }

Member Data Documentation

◆ m_iParticleLinkName

Gaudi::Property< std::string > ViewCreatorMuonSuperROITool::m_iParticleLinkName
Initial value:
{this,"IParticleLinkName","feature",
"Name of linked IParticle object to centre the new ROI on. Normally the 'feature' from the previous Step."}

Definition at line 48 of file ViewCreatorMuonSuperROITool.h.

◆ m_roiEtaWidth

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

Definition at line 59 of file ViewCreatorMuonSuperROITool.h.

◆ m_roiPhiWidth

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

Definition at line 62 of file ViewCreatorMuonSuperROITool.h.

◆ m_roisWriteHandleKey

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

Definition at line 41 of file ViewCreatorMuonSuperROITool.h.

◆ m_roiZedWidth

Gaudi::Property< double > ViewCreatorMuonSuperROITool::m_roiZedWidth
Initial value:
{this,"RoIZedWidth",50.0,
"Z Half Width in mm"}

Definition at line 66 of file ViewCreatorMuonSuperROITool.h.


The documentation for this class was generated from the following files:
xAOD::muon
@ muon
Definition: TrackingPrimitives.h:195
CxxUtils::wrapToPi
T wrapToPi(T phi)
Wrap angle in radians to [-pi, pi].
Definition: phihelper.h:24
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
ViewCreatorMuonSuperROITool::m_roiZedWidth
Gaudi::Property< double > m_roiZedWidth
Definition: ViewCreatorMuonSuperROITool.h:66
ViewCreatorMuonSuperROITool::m_roiPhiWidth
Gaudi::Property< double > m_roiPhiWidth
Definition: ViewCreatorMuonSuperROITool.h:62
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
ViewCreatorMuonSuperROITool::m_roisWriteHandleKey
SG::WriteHandleKey< TrigRoiDescriptorCollection > m_roisWriteHandleKey
Definition: ViewCreatorMuonSuperROITool.h:41
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
xAOD::decisions
decisions
Definition: TrigComposite_v1.cxx:101
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
ViewCreatorMuonSuperROITool::m_iParticleLinkName
Gaudi::Property< std::string > m_iParticleLinkName
Definition: ViewCreatorMuonSuperROITool.h:48
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
SG::WriteHandle< TrigRoiDescriptorCollection >
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
ViewCreatorMuonSuperROITool::m_roiEtaWidth
Gaudi::Property< double > m_roiEtaWidth
Definition: ViewCreatorMuonSuperROITool.h:59
RoiDescriptor::setComposite
void setComposite(bool b=true)
Definition: RoiDescriptor.h:138
TrigCompositeUtils::roiString
const std::string & roiString()
Definition: TrigCompositeUtilsRoot.cxx:876
TrigRoiDescriptor
Athena::TPCnvVers::Current TrigRoiDescriptor
Definition: TrigSteeringEventTPCnv.cxx:68
RoiDescriptor::manageConstituents
bool manageConstituents() const
always manage constituents ???
Definition: RoiDescriptor.h:141