ATLAS Offline Software
Functions
CandidateMatchHelpers Namespace Reference

Functions

Amg::Vector3D approxXYZwrtPoint (const xAOD::CaloCluster &cluster, const Amg::Vector3D &point, const bool isEndCap)
 Function to get the (x,y,z) of the cluster wrt to a point (x0,y0,z0) More...
 
Amg::Vector3D approxXYZwrtATLAS (const xAOD::CaloCluster &clusterEta, const bool isEndCap)
 Function to get the (x,y,z) of the cluster in the ATLAS frame origin (0,0,0) More...
 
double PhiROT (const double pt, const double eta, const int charge, const double r_start, const bool isEndCap)
 Function to calculate the approximate rotation in phi/bending of a track until it reaches the calo. More...
 

Function Documentation

◆ approxXYZwrtATLAS()

Amg::Vector3D CandidateMatchHelpers::approxXYZwrtATLAS ( const xAOD::CaloCluster clusterEta,
const bool  isEndCap 
)

Function to get the (x,y,z) of the cluster in the ATLAS frame origin (0,0,0)

Definition at line 19 of file CandidateMatchHelpers.cxx.

21 {
22  // These are at the face of the calorimeter
23  const double RfaceCalo = 1500;
24  const double ZfaceCalo = 3700;
25  // Get the Rclus , Zclus given the cluster eta
26  double Rclus = RfaceCalo;
27  double Zclus = ZfaceCalo;
28  const double clusterEta = cluster.eta();
29  if (clusterEta != 0) {
30  /*
31  * tahn(eta) == cos(theta)
32  * 1/cosh(clusterEta) == sin(theta)
33  * tan =sin/cos
34  */
35  const double tanthetaclus = (1.0 / std::cosh(clusterEta)) / std::tanh(clusterEta);
36  if (isEndCap) {
37  Rclus = std::abs(ZfaceCalo * (tanthetaclus));
38  // Negative Eta ---> negative Z
39  if (clusterEta < 0) {
40  Zclus = -Zclus;
41  }
42  } else {
43  if (tanthetaclus != 0) {
44  Zclus = RfaceCalo / (tanthetaclus);
45  }
46  }
47  } else { // when eta ==0
48  Zclus = 0;
49  }
50 
51  const double clusterPhi = cluster.phi();
52  return { Rclus * std::cos(clusterPhi), Rclus * std::sin(clusterPhi), Zclus };
53 }

◆ approxXYZwrtPoint()

Amg::Vector3D CandidateMatchHelpers::approxXYZwrtPoint ( const xAOD::CaloCluster cluster,
const Amg::Vector3D point,
const bool  isEndCap 
)

Function to get the (x,y,z) of the cluster wrt to a point (x0,y0,z0)

Definition at line 10 of file CandidateMatchHelpers.cxx.

13 {
14 
15  return approxXYZwrtATLAS(cluster, isEndCap) - point;
16 }

◆ PhiROT()

double CandidateMatchHelpers::PhiROT ( const double  pt,
const double  eta,
const int  charge,
const double  r_start,
const bool  isEndCap 
)

Function to calculate the approximate rotation in phi/bending of a track until it reaches the calo.

Definition at line 56 of file CandidateMatchHelpers.cxx.

61 {
62  // Used in order to derive the formula below
63  const double Rcalo = 1200;
64 
65  // correct phi for extrapolation to calo
66  double phiRot = 0.0;
67  double ecCorr = 1.0;
68  if (isEndCap) {
69  const double ecFactor = 1.0 / (0.8 * std::atan(15.0 / 34.0));
70  const double sinTheta0 = 2.0 * std::atan(std::exp(-std::abs(Eta)));
71  ecCorr = sinTheta0 * std::sqrt(sinTheta0) * ecFactor;
72  }
74  const double Rscaled = (Rcalo - r_first) * (1. / Rcalo);
75  phiRot = Rscaled * ecCorr * charge * 430. / (Et);
76  return phiRot;
77 }
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
drawFromPickle.exp
exp
Definition: drawFromPickle.py:36
drawFromPickle.atan
atan
Definition: drawFromPickle.py:36
xAOD::CaloCluster_v1::eta
virtual double eta() const
The pseudorapidity ( ) of the particle.
Definition: CaloCluster_v1.cxx:251
charge
double charge(const T &p)
Definition: AtlasPID.h:538
CandidateMatchHelpers::approxXYZwrtATLAS
Amg::Vector3D approxXYZwrtATLAS(const xAOD::CaloCluster &clusterEta, const bool isEndCap)
Function to get the (x,y,z) of the cluster in the ATLAS frame origin (0,0,0)
Definition: CandidateMatchHelpers.cxx:19
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
Eta
@ Eta
Definition: RPCdef.h:8