ATLAS Offline Software
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"
14 namespace Trk {
15 
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 
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
GetLCDefs::Unknown
@ Unknown
Definition: GetLCDefs.h:21
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
CaloExtensionHelpers::midPointEtaPhiHashLookupVector
void midPointEtaPhiHashLookupVector(const Trk::CaloExtension &extension, EtaPhiHashLookupVector &result)
Definition: CaloExtensionHelpers.h:256
CaloCellSelectorLayerdR.h
Trk::CaloExtension
Tracking class to hold the extrapolation from a particle from the ID to the muon system (or the other...
Definition: CaloExtension.h:18
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
CaloExtension.h
CaloCell.h
Trk::CaloCellSelectorLayerdR::m_coneSize2
double m_coneSize2
Definition: CaloCellSelectorLayerdR.h:39
python.TurnDataReader.dr
dr
Definition: TurnDataReader.py:112
CaloCellSelectorUtils.h
xAOD::CaloCluster_v1::etaSample
float etaSample(const CaloSample sampling) const
Retrieve barycenter in a given sample.
Definition: CaloCluster_v1.cxx:532
Trk::CaloCellSelectorLayerdR::m_midPoints
CaloExtensionHelpers::EtaPhiHashLookupVector m_midPoints
Definition: CaloCellSelectorLayerdR.h:38
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
lumiFormat.i
int i
Definition: lumiFormat.py:92
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
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
xAOD::CaloCluster_v1::phiSample
float phiSample(const CaloSample sampling) const
Retrieve barycenter in a given sample.
Definition: CaloCluster_v1.cxx:547
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
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
CaloSampling::getNumberOfSamplings
static constexpr unsigned int getNumberOfSamplings()
Get number of available samplings.
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:30
Trk::CaloCellSelectorLayerdR::CaloCellSelectorLayerdR
CaloCellSelectorLayerdR(double coneSize)
Definition: CaloCellSelectorLayerdR.cxx:16
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
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
Trk::CaloExtension::caloLayerIntersections
const std::vector< CurvilinearParameters > & caloLayerIntersections() const
access to the intersections with the calorimeter layers.
Definition: CaloExtension.h:76
xAOD::CaloCluster_v1::hasSampling
bool hasSampling(const CaloSample s) const
Checks if certain smapling contributes to cluster.
Definition: CaloCluster_v1.h:890
Trk::CaloCellSelectorLayerdR::~CaloCellSelectorLayerdR
~CaloCellSelectorLayerdR()
xAOD::Iso::coneSize
float coneSize(IsolationConeSize type)
convert Isolation Size into cone size
Definition: IsolationHelpers.h:27
Utils::deltaR2
double deltaR2(double eta1, double eta2, double phi1, double phi2)
Definition: CaloCellSelectorUtils.cxx:17