ATLAS Offline Software
Loading...
Searching...
No Matches
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
10
11#include "CaloEvent/CaloCell.h"
14namespace Trk {
15
16 CaloCellSelectorLayerdR::CaloCellSelectorLayerdR(double coneSize) : m_coneSize2(coneSize * coneSize) {}
17
19
21 if (caloExtension.caloLayerIntersections().empty()) return false;
23 return true;
24 }
25
27 m_midPoints.clear();
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
Data object for each calorimeter readout cell.
Definition CaloCell.h:57
This class groups all DetDescr information related to a CaloCell.
CaloCell_ID::CaloSample getSampling() const
cell sampling
static constexpr unsigned int getNumberOfSamplings()
Get number of available samplings.
bool preSelectAction(const Trk::CaloExtension &caloExtension)
Initialize selector wtih CaloExtension, returns false if the selection cannot be performed for the gi...
CaloExtensionHelpers::EtaPhiHashLookupVector m_midPoints
bool select(const CaloCell &cell) const
Method to determine if a cell is to be selected or not.
Tracking class to hold the extrapolation through calorimeter Layers Both the caloEntryLayerIntersecti...
const std::vector< CurvilinearParameters > & caloLayerIntersections() const
access to the intersections with the calorimeter layers.
float phiSample(const CaloSample sampling) const
Retrieve barycenter in a given sample.
float etaSample(const CaloSample sampling) const
Retrieve barycenter in a given sample.
bool hasSampling(const CaloSample s) const
Checks if certain smapling contributes to cluster.
void midPointEtaPhiHashLookupVector(const Trk::CaloExtension &extension, EtaPhiHashLookupVector &result)
Ensure that the ATLAS eigen extensions are properly loaded.
double deltaR2(double eta1, double eta2, double phi1, double phi2)
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.