ATLAS Offline Software
CandidateMatchHelpers.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 #include <cmath>
8 
11  const Amg::Vector3D& point,
12  const bool isEndCap)
13 {
14 
15  return approxXYZwrtATLAS(cluster, isEndCap) - point;
16 }
17 
20  const bool isEndCap)
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 }
54 
55 double
57  const double Eta,
58  const int charge,
59  const double r_first,
60  const bool isEndCap)
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 }
78 
CandidateMatchHelpers::approxXYZwrtPoint
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)
Definition: CandidateMatchHelpers.cxx:10
xAOD::CaloCluster_v1::phi
virtual double phi() const
The azimuthal angle ( ) of the particle.
Definition: CaloCluster_v1.cxx:256
CandidateMatchHelpers::PhiROT
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.
Definition: CandidateMatchHelpers.cxx:56
CandidateMatchHelpers.h
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
drawFromPickle.exp
exp
Definition: drawFromPickle.py:36
drawFromPickle.atan
atan
Definition: drawFromPickle.py:36
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
xAOD::CaloCluster_v1::eta
virtual double eta() const
The pseudorapidity ( ) of the particle.
Definition: CaloCluster_v1.cxx:251
CaloCluster.h
charge
double charge(const T &p)
Definition: AtlasPID.h:756
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
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