ATLAS Offline Software
Functions
DerivationFramework::ClustersInCone Namespace Reference

Functions

void select (const xAOD::IParticle *particle, const float coneSize, const xAOD::CaloClusterContainer *clusters, std::vector< bool > &mask)
 
void select (const xAOD::Egamma *particle, const float coneSize, const xAOD::CaloClusterContainer *clusters, std::vector< bool > &mask)
 
void select (const xAOD::Muon *particle, const float coneSize, const xAOD::CaloClusterContainer *clusters, std::vector< bool > &mask, MsgStream &msg)
 
bool GetExtrapEtaPhi (const xAOD::Muon *mu, float &eta, float &phi)
 

Function Documentation

◆ GetExtrapEtaPhi()

bool DerivationFramework::ClustersInCone::GetExtrapEtaPhi ( const xAOD::Muon mu,
float &  eta,
float &  phi 
)

Definition at line 60 of file ClustersInCone.cxx.

63 {
64  const auto* cluster = mu->cluster();
65  if (cluster) {
66  float etaT = 0, phiT = 0;
67  int nSample = 0;
68  for (unsigned int i = 0; i < CaloSampling::Unknown; i++) {
69  auto s = static_cast<CaloSampling::CaloSample>(i);
70  if (!cluster->hasSampling(s))
71  continue;
72  etaT += cluster->etaSample(s);
73  phiT += cluster->phiSample(s);
74  nSample++;
75  }
76  if (nSample > 0) {
77  eta = etaT / nSample;
78  phi = phiT / nSample;
79  } else {
80  return false;
81  }
82  } else {
83  return false;
84  }
85  return true;
86 }

◆ select() [1/3]

void DerivationFramework::ClustersInCone::select ( const xAOD::Egamma particle,
const float  coneSize,
const xAOD::CaloClusterContainer clusters,
std::vector< bool > &  mask 
)

Definition at line 37 of file ClustersInCone.cxx.

42 {
43  float particleEta = particle->caloCluster()->etaBE(2);
44  float particlePhi = particle->caloCluster()->phiBE(2);
45  unsigned int i(0);
47  clIt != clusters->end();
48  ++clIt, ++i) {
49  float deltaEta = (*clIt)->eta() - particleEta;
50  float deltaPhi = P4Helpers::deltaPhi((*clIt)->phi(), particlePhi);
51  float deltaR = sqrt(deltaEta * deltaEta + deltaPhi * deltaPhi);
52  if (deltaR < coneSize) {
53  mask[i] = true;
54  }
55  }
56  }

◆ select() [2/3]

void DerivationFramework::ClustersInCone::select ( const xAOD::IParticle particle,
const float  coneSize,
const xAOD::CaloClusterContainer clusters,
std::vector< bool > &  mask 
)

Definition at line 14 of file ClustersInCone.cxx.

19 {
20  float particleEta = particle->eta();
21  float particlePhi = particle->phi();
22  unsigned int i(0);
24  clIt != clusters->end();
25  ++clIt, ++i) {
26  float deltaEta = (*clIt)->eta() - particleEta;
27  float deltaPhi = P4Helpers::deltaPhi((*clIt)->phi(), particlePhi);
28  float deltaR = sqrt(deltaEta * deltaEta + deltaPhi * deltaPhi);
29  if (deltaR < coneSize) {
30  mask[i] = true;
31  }
32  }
33  }

◆ select() [3/3]

void DerivationFramework::ClustersInCone::select ( const xAOD::Muon particle,
const float  coneSize,
const xAOD::CaloClusterContainer clusters,
std::vector< bool > &  mask,
MsgStream &  msg 
)

Definition at line 90 of file ClustersInCone.cxx.

96 {
97  float particleEta = particle->eta();
98  float particlePhi = particle->phi();
99  if (!GetExtrapEtaPhi(particle, particleEta, particlePhi)) {
100  msg << MSG::WARNING
101  << "Failed to get the eta-phi of the muon calo extention " << endmsg;
102  }
103  unsigned int i(0);
104  float coneSize2 = coneSize * coneSize;
106  clIt != clusters->end();
107  ++clIt, ++i) {
108  float deltaEta = (*clIt)->eta() - particleEta;
109  float deltaPhi = P4Helpers::deltaPhi((*clIt)->phi(), particlePhi);
110  if (deltaEta * deltaEta + deltaPhi * deltaPhi < coneSize2) {
111  mask[i] = true;
112  }
113  }
114  }
GetLCDefs::Unknown
@ Unknown
Definition: GetLCDefs.h:21
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
xAOD::deltaPhi
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap setEtaBin setIsTgcFailure setDeltaPt deltaPhi
Definition: L2StandAloneMuon_v1.cxx:160
python.utils.AtlRunQueryLookup.mask
string mask
Definition: AtlRunQueryLookup.py:460
P4Helpers::deltaPhi
double deltaPhi(double phiA, double phiB)
delta Phi in range [-pi,pi[
Definition: P4Helpers.h:34
P4Helpers::deltaEta
double deltaEta(const I4Momentum &p1, const I4Momentum &p2)
Computes efficiently .
Definition: P4Helpers.h:66
lumiFormat.i
int i
Definition: lumiFormat.py:85
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
DerivationFramework::ClustersInCone::GetExtrapEtaPhi
bool GetExtrapEtaPhi(const xAOD::Muon *mu, float &eta, float &phi)
Definition: ClustersInCone.cxx:60
RunTileMonitoring.clusters
clusters
Definition: RunTileMonitoring.py:133
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:53
xAOD::Iso::coneSize
float coneSize(IsolationConeSize type)
convert Isolation Size into cone size
Definition: IsolationHelpers.h:27
makeComparison.deltaR
float deltaR
Definition: makeComparison.py:36
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7