10#include <ecl/modules/eclTrackBremFinder/BremFindingMatchCompute.h>
13#include <framework/geometry/VectorUtil.h>
14#include <framework/utilities/Angle.h>
15#include <mdst/dataobjects/ECLCluster.h>
18#include <genfit/MeasuredStateOnPlane.h>
21#include <Math/Vector3D.h>
32 TVector3 position = fitted_state.getPos();
33 ROOT::Math::XYZVector positionDifference(
34 clusterPosition.X() - position.X(),
35 clusterPosition.Y() - position.Y(),
36 clusterPosition.Z() - position.Z());
37 TVector3 momentum = fitted_state.getMom();
38 ROOT::Math::XYZVector fitted_mom(momentum.X(), momentum.Y(), momentum.Z());
40 auto cov = fitted_state.get6DCov();
41 const double err_px = cov[3][3];
42 const double err_py = cov[4][4];
43 const double err_pz = cov[5][5];
44 const double px = fitted_mom.X();
45 const double py = fitted_mom.Y();
46 const double pz = fitted_mom.Z();
48 const double square_perp = px * px + py * py ;
49 const double perp = std::sqrt(square_perp);
50 const double square_sum = square_perp + pz * pz;
52 const double err_phi = std::sqrt(pow((py / square_perp), 2) * err_px + pow((px / square_perp), 2) * err_py +
53 (py / square_perp) * (px / square_perp) * cov[3][4]);
54 const double err_theta = std::sqrt(pow(((px * pz) / (square_sum * perp)), 2) * err_px +
55 pow(((py * pz) / (square_sum * perp)), 2) * err_py +
56 pow((perp / square_sum), 2) * err_pz +
57 ((px * pz) / (square_sum * perp)) * ((py * pz) / (square_sum * perp)) * cov[3][4] +
58 ((px * pz) / (square_sum * perp)) * (perp / square_sum) * cov[3][5] +
59 ((py * pz) / (square_sum * perp)) * (perp / square_sum) * cov[4][5]);
61 PhiAngle hitPhi(fitted_mom.Phi(), err_phi);
62 ThetaAngle hitTheta(fitted_mom.Theta(), err_theta);
70 ROOT::Math::XYZVector hitV;
71 VectorUtil::setMagThetaPhi(
73 ROOT::Math::XYZVector clusterV;
74 VectorUtil::setMagThetaPhi(
77 ROOT::Math::XYZVector distV = hitV - clusterV;
82 double deltaTheta = abs(hitV.Y() - clusterV.Y());
84 double deltaPhi = abs(hitV.Z() - clusterV.Z());
double getAngle() const
Getter for the angle.
bool isMatch()
Check if the angles of the cluster position and the extrapolation match.
const ECLCluster * m_eclCluster
Bremsstrahlung cluster candidate gets stored here.
float m_clusterAcceptanceFactor
Factor which is multiplied onto the cluster position error to check for matches.
double m_distanceHitCluster
Difference between the angles of extrapolation and cluster position.
genfit::MeasuredStateOnPlane const & m_measuredStateOnPlane
VXD hit.
double m_effAcceptanceFactor
The effective acceptance factor, needed to assign the radiation.
double getUncertaintyTheta() const
Return Uncertainty on Theta of Shower.
ROOT::Math::XYZVector getClusterPosition() const
Return ROOT::Math::XYZVector on cluster position (x,y,z)
double getUncertaintyPhi() const
Return Uncertainty on Phi of Shower.
bool containsIn(const PhiAngle &angle, double sigma) const
Check if two angles are compatible.
bool containsIn(const ThetaAngle &angle, double sigma) const
Check if two angles are compatible.
Abstract base class for different kinds of events.