ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
RecoTools
TrackToCalo
src
CaloCellSelectorLayerdR.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
// CaloCellSelectorLayerdR.cxx, (c) ATLAS Detector software
8
9
#include "
TrackToCalo/CaloCellSelectorLayerdR.h
"
10
11
#include "
CaloEvent/CaloCell.h
"
12
#include "
TrackToCalo/CaloCellSelectorUtils.h
"
13
#include "
TrkCaloExtension/CaloExtension.h
"
14
namespace
Trk
{
15
16
CaloCellSelectorLayerdR::CaloCellSelectorLayerdR
(
double
coneSize) :
m_coneSize2
(coneSize * coneSize) {}
17
18
CaloCellSelectorLayerdR::~CaloCellSelectorLayerdR
() =
default
;
19
20
bool
CaloCellSelectorLayerdR::preSelectAction
(
const
Trk::CaloExtension
& caloExtension) {
21
if
(caloExtension.
caloLayerIntersections
().empty())
return
false
;
22
CaloExtensionHelpers::midPointEtaPhiHashLookupVector
(caloExtension,
m_midPoints
);
23
return
true
;
24
}
25
26
bool
CaloCellSelectorLayerdR::preSelectAction
(
const
xAOD::CaloCluster
& caloCluster) {
27
m_midPoints
.clear();
28
m_midPoints
.resize(
CaloSampling::getNumberOfSamplings
());
29
for
(
unsigned
int
i = 0; i < CaloSampling::Unknown; i++) {
30
auto
s =
static_cast<
CaloSampling::CaloSample
>
(i);
31
if
(!caloCluster.
hasSampling
(s))
32
m_midPoints
.emplace_back(
false
, 0., 0.);
33
else
34
m_midPoints
.emplace_back(
true
, caloCluster.
etaSample
(s), caloCluster.
phiSample
(s));
35
}
36
return
true
;
37
}
38
39
bool
CaloCellSelectorLayerdR::select
(
const
CaloCell
& cell)
const
{
40
// select cell within dR from the midPoint of the same calo layer
41
const
CaloDetDescrElement
* dde = cell.caloDDE();
42
if
(!dde)
return
false
;
43
44
int
samplingID = dde->
getSampling
();
45
if
(!std::get<0>(
m_midPoints
[samplingID]))
return
false
;
46
double
dr =
Utils::deltaR2
(std::get<1>(
m_midPoints
[samplingID]), dde->
eta
(), std::get<2>(
m_midPoints
[samplingID]), dde->
phi
());
47
return
dr <
m_coneSize2
;
48
}
49
50
}
// namespace Trk
CaloCellSelectorLayerdR.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::getSampling
CaloCell_ID::CaloSample getSampling() const
cell sampling
Definition
Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:395
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
CaloSampling::CaloSample
CaloSample
Definition
Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
CaloSampling::getNumberOfSamplings
static constexpr unsigned int getNumberOfSamplings()
Get number of available samplings.
Definition
Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:30
Trk::CaloCellSelectorLayerdR::~CaloCellSelectorLayerdR
~CaloCellSelectorLayerdR()
Trk::CaloCellSelectorLayerdR::preSelectAction
bool preSelectAction(const Trk::CaloExtension &caloExtension)
Initialize selector wtih CaloExtension, returns false if the selection cannot be performed for the gi...
Definition
CaloCellSelectorLayerdR.cxx:20
Trk::CaloCellSelectorLayerdR::m_coneSize2
double m_coneSize2
Definition
CaloCellSelectorLayerdR.h:39
Trk::CaloCellSelectorLayerdR::CaloCellSelectorLayerdR
CaloCellSelectorLayerdR(double coneSize)
Definition
CaloCellSelectorLayerdR.cxx:16
Trk::CaloCellSelectorLayerdR::m_midPoints
CaloExtensionHelpers::EtaPhiHashLookupVector m_midPoints
Definition
CaloCellSelectorLayerdR.h:38
Trk::CaloCellSelectorLayerdR::select
bool select(const CaloCell &cell) const
Method to determine if a cell is to be selected or not.
Definition
CaloCellSelectorLayerdR.cxx:39
Trk::CaloExtension
Tracking class to hold the extrapolation through calorimeter Layers Both the caloEntryLayerIntersecti...
Definition
TrkEvent/TrkCaloExtension/TrkCaloExtension/CaloExtension.h:19
Trk::CaloExtension::caloLayerIntersections
const std::vector< CurvilinearParameters > & caloLayerIntersections() const
access to the intersections with the calorimeter layers.
Definition
TrkEvent/TrkCaloExtension/TrkCaloExtension/CaloExtension.h:59
xAOD::CaloCluster_v1::phiSample
float phiSample(const CaloSample sampling) const
Retrieve barycenter in a given sample.
Definition
CaloCluster_v1.cxx:540
xAOD::CaloCluster_v1::etaSample
float etaSample(const CaloSample sampling) const
Retrieve barycenter in a given sample.
Definition
CaloCluster_v1.cxx:525
xAOD::CaloCluster_v1::hasSampling
bool hasSampling(const CaloSample s) const
Checks if certain smapling contributes to cluster.
Definition
CaloCluster_v1.h:882
CaloExtensionHelpers::midPointEtaPhiHashLookupVector
void midPointEtaPhiHashLookupVector(const Trk::CaloExtension &extension, EtaPhiHashLookupVector &result)
Definition
CaloExtensionHelpers.h:256
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
xAOD::CaloCluster
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Definition
Event/xAOD/xAODCaloEvent/xAODCaloEvent/CaloCluster.h:19
Generated on
for ATLAS Offline Software by
1.17.0