Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Functions | Variables
MuonR4::CombinatorialSeedSolver Namespace Reference

Functions

template<typename spacePointContainer >
requires acceptedContainer< spacePointContainer > &&hasPointerValues< spacePointContainer > AmgSymMatrix (2) betaMatrix(const spacePointContainer &spacePoints)
 defines the betaMatrix calculated from the combinatoric hits More...
 
template<typename spacePointContainer >
requires acceptedContainer< spacePointContainer > &&hasPointerValues< spacePointContainer > std::array< double, 4 > defineParameters (AmgSymMatrix(2) betaMatrix, const spacePointContainer &spacePoints)
 calculates the parameters lamda,alpha,gamma,kappa of the system More...
 
template<typename spacePointContainer >
requires acceptedContainer< spacePointContainer > &&hasPointerValues< spacePointContainer > std::pair< Amg::Vector3D, Amg::Vector3DseedSolution (const spacePointContainer &spacePoints, const std::array< double, 4 > &parameters)
 solves the equation system to calculate the seed More...
 

Variables

template<typename Container >
concept hasPositionAndDirection
 
template<typename Container >
concept hasPointerValues
 
template<typename Container >
concept acceptedContainer
 

Function Documentation

◆ AmgSymMatrix()

template<typename spacePointContainer >
requires acceptedContainer<spacePointContainer>&& hasPointerValues<spacePointContainer> MuonR4::CombinatorialSeedSolver::AmgSymMatrix ( ) const &

defines the betaMatrix calculated from the combinatoric hits

Template Parameters
spacePointContainerthe space point container
Parameters
spacePointsthe space points of the combinatorics
Returns
the 2x2 beta matrix

Definition at line 66 of file CombinatorialSeedSolver.h.

66  {
67 
68  AmgSymMatrix(2) bMatrix{AmgSymMatrix(2)::Identity()};
69  Amg::Vector3D b1Aterm = (spacePoints[3]->directionInChamber().dot(spacePoints[1]->directionInChamber()))*spacePoints[1]->directionInChamber()-spacePoints[3]->directionInChamber();
70  Amg::Vector3D b1Gterm = (spacePoints[3]->directionInChamber().dot(spacePoints[0]->directionInChamber()))*spacePoints[0]->directionInChamber() - (spacePoints[3]->directionInChamber().dot(spacePoints[1]->directionInChamber()))*spacePoints[1]->directionInChamber();
71 
72  Amg::Vector3D b2Aterm = spacePoints[2]->directionInChamber()- (spacePoints[2]->directionInChamber().dot(spacePoints[1]->directionInChamber()))*spacePoints[1]->directionInChamber();
73  Amg::Vector3D b2Kterm = (spacePoints[2]->directionInChamber().dot(spacePoints[1]->directionInChamber()))*spacePoints[1]->directionInChamber() - (spacePoints[2]->directionInChamber().dot(spacePoints[0]->directionInChamber()))*spacePoints[0]->directionInChamber();
74 
75  //get the distances of the layers along z direction
76  double A = (spacePoints[0]->positionInChamber().z() - spacePoints[1]->positionInChamber().z());
77  double G = (spacePoints[0]->positionInChamber().z() - spacePoints[2]->positionInChamber().z());
78  double K = (spacePoints[0]->positionInChamber().z() - spacePoints[3]->positionInChamber().z());
79 
80  //define B matrix
81  Amg::Vector3D b1 = A*b1Aterm + G*b1Gterm;
82  Amg::Vector3D b2 = K*b2Kterm + A*b2Aterm;
83 
84  bMatrix.col(0) = Amg::Vector2D(b1.x(), b1.y());
85  bMatrix.col(1) = Amg::Vector2D(b2.x(), b2.y());
86 
87  return bMatrix;
88  };

◆ defineParameters()

template<typename spacePointContainer >
requires acceptedContainer<spacePointContainer>&& hasPointerValues<spacePointContainer> std::array<double,4> MuonR4::CombinatorialSeedSolver::defineParameters ( AmgSymMatrix(2)  betaMatrix,
const spacePointContainer &  spacePoints 
)

calculates the parameters lamda,alpha,gamma,kappa of the system

Template Parameters
spacePointContainerthe space point container
Parameters
betaMatrixthe betaMatrix for the system
spacePointsthe space points of the combinatorics
Returns
an array of the calculated parameters

Definition at line 97 of file CombinatorialSeedSolver.h.

97  {
98 
99  double A = (spacePoints[0]->positionInChamber().z() - spacePoints[1]->positionInChamber().z());
100  double G = (spacePoints[0]->positionInChamber().z() - spacePoints[2]->positionInChamber().z());
101  double K = (spacePoints[0]->positionInChamber().z() - spacePoints[3]->positionInChamber().z());
102 
103  //Define y2 for the linear system
104  Amg::Vector3D y0 = K*(spacePoints[2]->positionInChamber()- spacePoints[0]->positionInChamber()) + G*(spacePoints[0]->positionInChamber()- spacePoints[3]->positionInChamber());
105  Amg::Vector3D y1 = A*(spacePoints[3]->positionInChamber() - spacePoints[2]->positionInChamber()) + G*(spacePoints[1]->positionInChamber() - spacePoints[3]->positionInChamber()) + K*(spacePoints[2]->positionInChamber()-spacePoints[1]->positionInChamber());
106  Amg::Vector3D y2 = (K-G)*(spacePoints[0]->positionInChamber()- spacePoints[1]->positionInChamber()) - (y1.dot(spacePoints[1]->directionInChamber()))*spacePoints[1]->directionInChamber() + (y0.dot(spacePoints[0]->directionInChamber()))*spacePoints[0]->directionInChamber() +A*(spacePoints[3]->positionInChamber()- spacePoints[2]->positionInChamber());
107 
108  Amg::Vector2D solution = betaMatrix.inverse()*y2.block<2,1>(0,0);
109  double kappa = solution.x();
110  double gamma = solution.y();
111 
112  double lamda = (y0.dot(spacePoints[0]->directionInChamber()) + K*gamma*(spacePoints[0]->directionInChamber().dot(spacePoints[2]->directionInChamber())) -G*kappa*(spacePoints[0]->directionInChamber().dot(spacePoints[3]->directionInChamber())))/(K-G);
113  double alpha = (y1.dot(spacePoints[1]->directionInChamber())+(A-G)*kappa*spacePoints[3]->directionInChamber().dot(spacePoints[1]->directionInChamber()) + (K-A)*gamma*spacePoints[2]->directionInChamber().dot(spacePoints[1]->directionInChamber()))/(K-G);
114 
115  return std::array<double,4>({lamda,alpha,gamma,kappa});
116 
117  };

◆ seedSolution()

template<typename spacePointContainer >
requires acceptedContainer<spacePointContainer>&& hasPointerValues<spacePointContainer> std::pair<Amg::Vector3D, Amg::Vector3D> MuonR4::CombinatorialSeedSolver::seedSolution ( const spacePointContainer &  spacePoints,
const std::array< double, 4 > &  parameters 
)

solves the equation system to calculate the seed

Template Parameters
spacePointContainrthe space point container
Parameters
spacePointsthe space points of the combinatorics
parametersthe lamda,alpha,gamma,kappa paramaters of the four layers
Returns
the pair of the seed position and direction

Definition at line 127 of file CombinatorialSeedSolver.h.

127  {
128 
129  //estimate the seed positionInChamber from the 1st equation of the system of the layer equations
130  Amg::Vector3D seedPosition = spacePoints[0]->positionInChamber() + parameters[0]*spacePoints[0]->directionInChamber();
131 
132  //estimate the seed direction from the 2nd equation of the system of the layer equations
133  Amg::Vector3D seedDirection = ((spacePoints[1]->positionInChamber() + parameters[1]*spacePoints[1]->directionInChamber() - seedPosition)).unit();
134 
135  Amg::Vector3D seedPositionZ0 = seedPosition + Amg::intersect<3>(seedPosition, seedDirection, Amg::Vector3D::UnitZ(), 0.).value_or(0.)*seedDirection;
136 
137 
138 
139  return std::make_pair(seedPositionZ0, seedDirection.z() > 0 ? seedDirection : -seedDirection);
140 
141  };

Variable Documentation

◆ acceptedContainer

template<typename Container >
concept MuonR4::CombinatorialSeedSolver::acceptedContainer
Initial value:
= requires(const Container& c){
{c.size()} ->std::same_as<std::size_t>;
requires hasPositionAndDirection<Container>;
}

Definition at line 52 of file CombinatorialSeedSolver.h.

◆ hasPointerValues

template<typename Container >
concept MuonR4::CombinatorialSeedSolver::hasPointerValues
Initial value:
typename Container::value_type;
requires std::is_pointer_v<typename Container::value_type>;
}

Definition at line 44 of file CombinatorialSeedSolver.h.

◆ hasPositionAndDirection

template<typename Container >
concept MuonR4::CombinatorialSeedSolver::hasPositionAndDirection
Initial value:
= requires(typename Container::value_type& v){
{v->directionInChamber()}->std::same_as<const Amg::Vector3D&>;
{v->positionInChamber()}->std::same_as<const Amg::Vector3D&>;
}

Definition at line 35 of file CombinatorialSeedSolver.h.

add-xsec-uncert-quadrature-N.alpha
alpha
Definition: add-xsec-uncert-quadrature-N.py:110
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
MuonR4::CombinatorialSeedSolver::AmgSymMatrix
requires acceptedContainer< spacePointContainer > &&hasPointerValues< spacePointContainer > AmgSymMatrix(2) betaMatrix(const spacePointContainer &spacePoints)
defines the betaMatrix calculated from the combinatoric hits
Definition: CombinatorialSeedSolver.h:66
requires
requires requires()
This specialization is used for classes deriving from DataObject.
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:68
makeTRTBarrelCans.y1
tuple y1
Definition: makeTRTBarrelCans.py:15
Container
storage of the time histories of all the cells
A
TrigVtx::gamma
@ gamma
Definition: TrigParticleTable.h:26
xAOD::positionInChamber
Amg::Vector3D positionInChamber(const ActsGeometryContext &gctx, const UncalibratedMeasurement *meas)
Returns the position of the uncalibrated muon measurement in the attached Muon chamber frame.
Definition: MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonPrepData/Root/UtilFunctions.cxx:86
G
#define G(x, y, z)
Definition: MD5.cxx:113
makeTRTBarrelCans.y2
tuple y2
Definition: makeTRTBarrelCans.py:18
MuonR4::SegmentFit::ParamDefs::y0
@ y0
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
python.PyAthena.v
v
Definition: PyAthena.py:154
physics_parameters.parameters
parameters
Definition: physics_parameters.py:144
python.FPGATrackSimAnalysisConfig.spacePoints
spacePoints
Definition: FPGATrackSimAnalysisConfig.py:584
python.compressB64.c
def c
Definition: compressB64.py:93