ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
RecoTools
TrackToCalo
src
CaloCellSelectorNearestdR.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
// CaloCellSelectorNearestdR.cxx, (c) ATLAS Detector software
8
9
#include "
TrackToCalo/CaloCellSelectorNearestdR.h
"
10
11
#include "
CaloEvent/CaloCell.h
"
12
#include "
TrackToCalo/CaloCellSelectorUtils.h
"
13
#include "
TrkCaloExtension/CaloExtension.h
"
14
15
namespace
Trk
{
16
17
CaloCellSelectorNearestdR::CaloCellSelectorNearestdR
(
double
coneSize) :
m_caloExtension
(nullptr),
m_coneSize2
(coneSize * coneSize) {}
18
19
CaloCellSelectorNearestdR::~CaloCellSelectorNearestdR
() =
default
;
20
21
bool
CaloCellSelectorNearestdR::preSelectAction
(
const
Trk::CaloExtension
& caloExtension) {
22
m_caloExtension
= &caloExtension;
23
return
true
;
24
}
25
26
bool
CaloCellSelectorNearestdR::select
(
const
CaloCell
& cell)
const
{
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
}
40
41
}
// namespace Trk
CaloCellSelectorNearestdR.h
CaloCellSelectorUtils.h
CaloCell.h
CaloExtension.h
CaloCell
Data object for each calorimeter readout cell.
Definition
CaloCell.h:57
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell.
Definition
Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
CaloDetDescrElement::y
float y() const
cell y
Definition
Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:365
CaloDetDescrElement::eta
float eta() const
cell eta
Definition
Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:344
CaloDetDescrElement::phi
float phi() const
cell phi
Definition
Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:346
CaloDetDescrElement::x
float x() const
cell x
Definition
Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:363
CaloDetDescrElement::z
float z() const
cell z
Definition
Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:367
Trk::CaloCellSelectorNearestdR::preSelectAction
bool preSelectAction(const Trk::CaloExtension &caloExtension)
Initialize selector wtih CaloExtension, returns false if the selection cannot be performed for the gi...
Definition
CaloCellSelectorNearestdR.cxx:21
Trk::CaloCellSelectorNearestdR::m_caloExtension
const Trk::CaloExtension * m_caloExtension
Definition
CaloCellSelectorNearestdR.h:32
Trk::CaloCellSelectorNearestdR::m_coneSize2
double m_coneSize2
Definition
CaloCellSelectorNearestdR.h:33
Trk::CaloCellSelectorNearestdR::~CaloCellSelectorNearestdR
~CaloCellSelectorNearestdR()
Trk::CaloCellSelectorNearestdR::select
bool select(const CaloCell &cell) const
Method to determine if a cell is to be selected or not.
Definition
CaloCellSelectorNearestdR.cxx:26
Trk::CaloCellSelectorNearestdR::CaloCellSelectorNearestdR
CaloCellSelectorNearestdR(double coneSize)
Definition
CaloCellSelectorNearestdR.cxx:17
Trk::CaloExtension
Tracking class to hold the extrapolation through calorimeter Layers Both the caloEntryLayerIntersecti...
Definition
TrkEvent/TrkCaloExtension/TrkCaloExtension/CaloExtension.h:19
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition
GeoPrimitives.h:47
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition
FakeTrackBuilder.h:9
Utils::deltaR2
double deltaR2(double eta1, double eta2, double phi1, double phi2)
Definition
CaloCellSelectorUtils.cxx:17
Utils::findNearestPoint
void findNearestPoint(const Amg::Vector3D &inputPos, const Trk::CaloExtension *caloExtension, int &nearestIdx, Amg::Vector3D &nearestPos, Amg::Vector3D &nearestMom)
Definition
CaloCellSelectorUtils.cxx:25
Generated on
for ATLAS Offline Software by
1.17.0