ATLAS Offline Software
Loading...
Searching...
No Matches
Trk::CaloCellSelectorNearestdR Class Reference

#include <CaloCellSelectorNearestdR.h>

Inheritance diagram for Trk::CaloCellSelectorNearestdR:
Collaboration diagram for Trk::CaloCellSelectorNearestdR:

Public Member Functions

 CaloCellSelectorNearestdR (double coneSize)
 ~CaloCellSelectorNearestdR ()
bool preSelectAction (const Trk::CaloExtension &caloExtension)
 Initialize selector wtih CaloExtension, returns false if the selection cannot be performed for the given input.
bool select (const CaloCell &cell) const
 Method to determine if a cell is to be selected or not.
virtual bool preSelectActionCells (const Rec::ParticleCellAssociation &cellAssociation)
 Initialize selector wtih ParticleCellAssociation, returns false if the selection cannot be performed for the given input.

Private Attributes

const Trk::CaloExtensionm_caloExtension
double m_coneSize2

Detailed Description

Definition at line 22 of file CaloCellSelectorNearestdR.h.

Constructor & Destructor Documentation

◆ CaloCellSelectorNearestdR()

Trk::CaloCellSelectorNearestdR::CaloCellSelectorNearestdR ( double coneSize)

Definition at line 17 of file CaloCellSelectorNearestdR.cxx.

17: m_caloExtension(nullptr), m_coneSize2(coneSize * coneSize) {}
const Trk::CaloExtension * m_caloExtension

◆ ~CaloCellSelectorNearestdR()

Trk::CaloCellSelectorNearestdR::~CaloCellSelectorNearestdR ( )
default

Member Function Documentation

◆ preSelectAction()

bool Trk::CaloCellSelectorNearestdR::preSelectAction ( const Trk::CaloExtension & caloExtension)
virtual

Initialize selector wtih CaloExtension, returns false if the selection cannot be performed for the given input.

Reimplemented from Trk::ICaloCellSelector.

Definition at line 21 of file CaloCellSelectorNearestdR.cxx.

21 {
22 m_caloExtension = &caloExtension;
23 return true;
24 }

◆ preSelectActionCells()

bool ICaloCellSelector::preSelectActionCells ( const Rec::ParticleCellAssociation & cellAssociation)
inlinevirtualinherited

Initialize selector wtih ParticleCellAssociation, returns false if the selection cannot be performed for the given input.

Definition at line 44 of file Reconstruction/RecoTools/RecoToolInterfaces/RecoToolInterfaces/ICaloCellSelector.h.

44 {
45 return preSelectAction(cellAssociation.caloExtension());
46 }
const Trk::CaloExtension & caloExtension() const
return calo extension
virtual bool preSelectAction(const Trk::CaloExtension &caloExtension)
Initialize selector wtih CaloExtension, returns false if the selection cannot be performed for the gi...

◆ select()

bool Trk::CaloCellSelectorNearestdR::select ( const CaloCell & cell) const
virtual

Method to determine if a cell is to be selected or not.

Parameters
CaloCell
Returns
bool

Implements Trk::ICaloCellSelector.

Definition at line 26 of file CaloCellSelectorNearestdR.cxx.

26 {
27 if (!m_caloExtension) return false;
28
29 const CaloDetDescrElement* dde = cell.caloDDE();
30 if (!dde) return false;
31
32 Amg::Vector3D cellPos(dde->x(), dde->y(), dde->z());
33
34 int nearestIdx;
35 Amg::Vector3D nearestPos, nearestMom;
36 Utils::findNearestPoint(cellPos, m_caloExtension, nearestIdx, nearestPos, nearestMom);
37
38 return Utils::deltaR2(nearestPos.eta(), dde->eta(), nearestPos.phi(), dde->phi()) < m_coneSize2;
39 }
Eigen::Matrix< double, 3, 1 > Vector3D
double deltaR2(double eta1, double eta2, double phi1, double phi2)
void findNearestPoint(const Amg::Vector3D &inputPos, const Trk::CaloExtension *caloExtension, int &nearestIdx, Amg::Vector3D &nearestPos, Amg::Vector3D &nearestMom)

Member Data Documentation

◆ m_caloExtension

const Trk::CaloExtension* Trk::CaloCellSelectorNearestdR::m_caloExtension
private

Definition at line 32 of file CaloCellSelectorNearestdR.h.

◆ m_coneSize2

double Trk::CaloCellSelectorNearestdR::m_coneSize2
private

Definition at line 33 of file CaloCellSelectorNearestdR.h.


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