ATLAS Offline Software
Loading...
Searching...
No Matches
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
10
11#include "CaloEvent/CaloCell.h"
14
15namespace Trk {
16
17 CaloCellSelectorNearestdR::CaloCellSelectorNearestdR(double coneSize) : m_caloExtension(nullptr), m_coneSize2(coneSize * coneSize) {}
18
20
22 m_caloExtension = &caloExtension;
23 return true;
24 }
25
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
Data object for each calorimeter readout cell.
Definition CaloCell.h:57
This class groups all DetDescr information related to a CaloCell.
bool preSelectAction(const Trk::CaloExtension &caloExtension)
Initialize selector wtih CaloExtension, returns false if the selection cannot be performed for the gi...
const Trk::CaloExtension * m_caloExtension
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...
Eigen::Matrix< double, 3, 1 > Vector3D
Ensure that the ATLAS eigen extensions are properly loaded.
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)