|
ATLAS Offline Software
|
Go to the documentation of this file.
17 #include "GaudiKernel/SystemOfUnits.h"
26 phiVariance(
double clusterE,
double absEta)
29 const double EinGeV = clusterE * 1
e-3;
37 return (0.14 * 0.14) / (EinGeV * EinGeV) + 0.001 * 0.001;
40 return (0.15 * 0.15) / (EinGeV * EinGeV) + 0.001 * 0.001;
43 return (0.19 * 0.19) / (EinGeV * EinGeV) + 0.001 * 0.001;
46 return (0.26 * 0.26) / (EinGeV * EinGeV) + 0.001 * 0.001;
49 return (0.36 * 0.36) / (EinGeV * EinGeV) + 0.001 * 0.001;
52 return (0.52 * 0.52) / (EinGeV * EinGeV) + 0.003 * 0.003;
55 return (0.46 * 0.46) / (EinGeV * EinGeV) + 0.004 * 0.004;
58 return (0.35 * 0.35) / (EinGeV * EinGeV) + 0.004 * 0.004;
61 return (0.38 * 0.38) / (EinGeV * EinGeV) + 0.005 * 0.005;
63 return (0.47 * 0.47) / (EinGeV * EinGeV) + 0.006 * 0.006;
72 declareInterface<ICaloCluster_OnTrackBuilder>(
this);
78 m_eg_resol = std::make_unique<eg_resolution>(
"run2_R21_v1");
81 return StatusCode::SUCCESS;
87 return StatusCode::SUCCESS;
90 std::unique_ptr<Trk::CaloCluster_OnTrack>
92 const EventContext& ctx,
100 ATH_MSG_WARNING(
"CaloCluster_OnTrackBuilder is configured incorrectly");
110 std::unique_ptr<Trk::Surface> surface =
getCaloSurface(cluster, caloDDMgr);
121 return std::make_unique<Trk::CaloCluster_OnTrack>(std::move(lp), std::move(em), *surface);
125 std::unique_ptr<Trk::Surface>
131 std::unique_ptr<Trk::Surface> destinationSurface =
nullptr;
137 destinationSurface.reset(
m_calosurf->CreateUserSurface(
140 destinationSurface.reset(
m_calosurf->CreateUserSurface(
143 return destinationSurface;
154 double eta = cluster->
eta();
155 double phi = cluster->
phi();
156 double clusterQoverE = cluster->
e() != 0 ? (
double)
charge / cluster->
e() : 0;
162 double r = surfRefPoint.perp();
163 std::vector<Trk::DefinedParameter> defPar;
171 double z = tantheta == 0 ? 0. :
r / tantheta;
173 defPar.push_back(
locZ);
184 double z = surfRefPoint.z();
185 std::vector<Trk::DefinedParameter> defPar;
189 double r =
z * tantheta;
191 defPar.push_back(
locR);
217 const double clusterE = cluster->
e();
218 const double clusterEta = cluster->
eta();
221 double phivariance = phiVariance(clusterE, std::abs(clusterEta));
222 if (phivariance < 1
e-5) {
228 const double sigmaP_over_P =
m_eg_resol->getResolution(0,
233 const double qOverP = 1. / clusterE;
234 const double qOverP_variance =
241 constexpr
double zvariance = 400;
248 double r = surfRefPoint.perp();
252 covMatrix(indexCount, indexCount) = phivariance * r2;
256 covMatrix(indexCount, indexCount) = zvariance;
260 covMatrix(indexCount, indexCount) = qOverP_variance;
270 covMatrix(indexCount, indexCount) = zvariance;
274 covMatrix(indexCount, indexCount) = phivariance;
278 covMatrix(indexCount, indexCount) = qOverP_variance;
Trk::LocalParameters getClusterLocalParameters(const xAOD::CaloCluster *cluster, const Trk::Surface *surf, int charge) const
virtual double phi() const
The azimuthal angle ( ) of the particle.
Gaudi::Property< bool > m_useClusterEta
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Scalar phi() const
phi method
CaloCluster_OnTrackBuilder()
Scalar eta() const
pseudorapidity method
Scalar theta() const
theta method
virtual StatusCode initialize() override final
std::unique_ptr< Trk::Surface > getCaloSurface(const xAOD::CaloCluster *cluster, const CaloDetDescrManager *caloDDMgr) const
virtual StatusCode finalize() override final
virtual const Amg::Vector3D & globalReferencePoint() const
Returns a global reference point on the surface, for PlaneSurface, StraightLineSurface,...
std::unique_ptr< eg_resolution > m_eg_resol
helper for returning energy resolution
Gaudi::Property< bool > m_useClusterPhi
Amg::MatrixX getClusterErrorMatrix(const xAOD::CaloCluster *cluster, const Trk::Surface &surf, int charge) const
std::pair< double, ParamDefs > DefinedParameter
bool isBarrel(const xAOD::Egamma *eg)
return true if the cluster is in the barrel
virtual std::unique_ptr< Trk::CaloCluster_OnTrack > buildClusterOnTrack(const EventContext &ctx, const xAOD::CaloCluster *cl, int charge=0) const override final
Description of a calorimeter cluster.
virtual double eta() const
The pseudorapidity ( ) of the particle.
ToolHandle< ICaloSurfaceBuilder > m_calosurf
Tool to build calorimeter layer surfaces.
::StatusCode StatusCode
StatusCode definition for legacy code.
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
double charge(const T &p)
StatusCode initialize(bool used=true)
Eigen::Matrix< double, 3, 1 > Vector3D
This class provides the client interface for accessing the detector description information common to...
#define ATH_MSG_WARNING(x)
bool absEta(const xAOD::TauJet &tau, double &out)
Handle class for reading from StoreGate.
Gaudi::Property< bool > m_useClusterEnergy
Which cluster measurements to use in order to add constraints by default we are interested in the one...
virtual double e() const
The total energy of the particle.
Calculate total energy, position, etc. for a given layer of a cluster.