ATLAS Offline Software
Loading...
Searching...
No Matches
MuonExperimental::Gx2fSystem Struct Reference

A container to manage all properties of a gx2f system. More...

#include <Chi2Fitter.h>

Collaboration diagram for MuonExperimental::Gx2fSystem:

Public Member Functions

 Gx2fSystem (std::size_t nDims)
 Constructor to initialize matrices and vectors to zero based on specified dimensions.
std::size_t nDims () const
 Accessor for the number of dimensions of the extended system.
double chi2 () const
 Accessor for the accumulated chi-squared value (const version).
double & chi2 ()
 Accessor for the accumulated chi-squared value (mutable version).
const Eigen::MatrixXd & aMatrix () const
 Accessor for the extended system matrix (const version).
Eigen::MatrixXd & aMatrix ()
 Accessor for the extended system matrix (mutable version).
const Eigen::VectorXd & bVector () const
 Accessor for the extended system vector (const version).
Eigen::VectorXd & bVector ()
 Accessor for the extended system vector (mutable version).
std::size_t ndf () const
 Accessor for the number of degrees of freedom (const version).
std::size_t & ndf ()
 Accessor for the number of degrees of freedom (mutable version).
std::size_t findRequiredNdf ()
 Determines the minimum number of degrees of freedom required for the fit.
bool isWellDefined ()
 Checks if the system has sufficient degrees of freedom for fitting.

Private Attributes

std::size_t m_nDims
 Number of dimensions of the (extended) system.
double m_chi2 = 0.
 Sum of chi-squared values.
Eigen::MatrixXd m_aMatrix {Eigen::MatrixXd::Zero(m_nDims, m_nDims)}
 Extended matrix for accumulation.
Eigen::VectorXd m_bVector {Eigen::VectorXd::Zero(m_nDims)}
 Extended vector for accumulation.
std::size_t m_ndf = 0u
 Number of degrees of freedom of the system.

Detailed Description

A container to manage all properties of a gx2f system.

This struct manages the mathematical infrastructure for the gx2f. It initializes and maintains the extended aMatrix and extended bVector.

Definition at line 421 of file Chi2Fitter.h.

Constructor & Destructor Documentation

◆ Gx2fSystem()

MuonExperimental::Gx2fSystem::Gx2fSystem ( std::size_t nDims)
inlineexplicit

Constructor to initialize matrices and vectors to zero based on specified dimensions.

Parameters
nDimsNumber of dimensions for the extended matrix and vector.

Definition at line 425 of file Chi2Fitter.h.

425: m_nDims{nDims} {}
std::size_t m_nDims
Number of dimensions of the (extended) system.
Definition Chi2Fitter.h:491
std::size_t nDims() const
Accessor for the number of dimensions of the extended system.
Definition Chi2Fitter.h:429

Member Function Documentation

◆ aMatrix() [1/2]

Eigen::MatrixXd & MuonExperimental::Gx2fSystem::aMatrix ( )
inline

Accessor for the extended system matrix (mutable version).

Returns
Mutable reference to the aMatrix for adding measurement and material contributions

Definition at line 445 of file Chi2Fitter.h.

445{ return m_aMatrix; }
Eigen::MatrixXd m_aMatrix
Extended matrix for accumulation.
Definition Chi2Fitter.h:497

◆ aMatrix() [2/2]

const Eigen::MatrixXd & MuonExperimental::Gx2fSystem::aMatrix ( ) const
inline

Accessor for the extended system matrix (const version).

Returns
Const reference to the aMatrix containing measurement and material contributions

Definition at line 441 of file Chi2Fitter.h.

441{ return m_aMatrix; }

◆ bVector() [1/2]

Eigen::VectorXd & MuonExperimental::Gx2fSystem::bVector ( )
inline

Accessor for the extended system vector (mutable version).

Returns
Mutable reference to the bVector for adding measurement and material contributions

Definition at line 453 of file Chi2Fitter.h.

453{ return m_bVector; }
Eigen::VectorXd m_bVector
Extended vector for accumulation.
Definition Chi2Fitter.h:500

◆ bVector() [2/2]

const Eigen::VectorXd & MuonExperimental::Gx2fSystem::bVector ( ) const
inline

Accessor for the extended system vector (const version).

Returns
Const reference to the bVector containing measurement and material contributions

Definition at line 449 of file Chi2Fitter.h.

449{ return m_bVector; }

◆ chi2() [1/2]

double & MuonExperimental::Gx2fSystem::chi2 ( )
inline

Accessor for the accumulated chi-squared value (mutable version).

Returns
Mutable reference to chi-squared sum for modification during fitting

Definition at line 437 of file Chi2Fitter.h.

437{ return m_chi2; }
double m_chi2
Sum of chi-squared values.
Definition Chi2Fitter.h:494

◆ chi2() [2/2]

double MuonExperimental::Gx2fSystem::chi2 ( ) const
inline

Accessor for the accumulated chi-squared value (const version).

Returns
Current sum of chi-squared contributions from measurements and material

Definition at line 433 of file Chi2Fitter.h.

433{ return m_chi2; }

◆ findRequiredNdf()

std::size_t MuonExperimental::Gx2fSystem::findRequiredNdf ( )
inline

Determines the minimum number of degrees of freedom required for the fit.

Automatically deduces the required NDF based on the system configuration. We have only 3 cases, because we always have l0, l1, phi, theta:

  • 4: no magnetic field -> q/p is empty
  • 5: no time measurement -> time is not fittable
  • 6: full fit with all parameters
Returns
Required NDF based on which parameters can be fitted

Definition at line 472 of file Chi2Fitter.h.

472 {
473 std::size_t ndfSystem = 0;
474 if (m_aMatrix(4, 4) == 0) {
475 ndfSystem = 4;
476 } else if (m_aMatrix(5, 5) == 0) {
477 ndfSystem = 5;
478 } else {
479 ndfSystem = 6;
480 }
481
482 return ndfSystem;
483 }

◆ isWellDefined()

bool MuonExperimental::Gx2fSystem::isWellDefined ( )
inline

Checks if the system has sufficient degrees of freedom for fitting.

Returns
True if NDF exceeds the minimum required for the parameter configuration

Definition at line 487 of file Chi2Fitter.h.

487{ return m_ndf > findRequiredNdf(); }
std::size_t m_ndf
Number of degrees of freedom of the system.
Definition Chi2Fitter.h:503
std::size_t findRequiredNdf()
Determines the minimum number of degrees of freedom required for the fit.
Definition Chi2Fitter.h:472

◆ ndf() [1/2]

std::size_t & MuonExperimental::Gx2fSystem::ndf ( )
inline

Accessor for the number of degrees of freedom (mutable version).

Returns
Mutable reference to NDF counter for incrementing during measurement processing

Definition at line 461 of file Chi2Fitter.h.

461{ return m_ndf; }

◆ ndf() [2/2]

std::size_t MuonExperimental::Gx2fSystem::ndf ( ) const
inline

Accessor for the number of degrees of freedom (const version).

Returns
Current number of degrees of freedom from processed measurements

Definition at line 457 of file Chi2Fitter.h.

457{ return m_ndf; }

◆ nDims()

std::size_t MuonExperimental::Gx2fSystem::nDims ( ) const
inline

Accessor for the number of dimensions of the extended system.

Returns
Number of dimensions for the aMatrix and bVector (bound parameters + scattering angles)

Definition at line 429 of file Chi2Fitter.h.

429{ return m_nDims; }

Member Data Documentation

◆ m_aMatrix

Eigen::MatrixXd MuonExperimental::Gx2fSystem::m_aMatrix {Eigen::MatrixXd::Zero(m_nDims, m_nDims)}
private

Extended matrix for accumulation.

Definition at line 497 of file Chi2Fitter.h.

497{Eigen::MatrixXd::Zero(m_nDims, m_nDims)};

◆ m_bVector

Eigen::VectorXd MuonExperimental::Gx2fSystem::m_bVector {Eigen::VectorXd::Zero(m_nDims)}
private

Extended vector for accumulation.

Definition at line 500 of file Chi2Fitter.h.

500{Eigen::VectorXd::Zero(m_nDims)};

◆ m_chi2

double MuonExperimental::Gx2fSystem::m_chi2 = 0.
private

Sum of chi-squared values.

Definition at line 494 of file Chi2Fitter.h.

◆ m_ndf

std::size_t MuonExperimental::Gx2fSystem::m_ndf = 0u
private

Number of degrees of freedom of the system.

Definition at line 503 of file Chi2Fitter.h.

◆ m_nDims

std::size_t MuonExperimental::Gx2fSystem::m_nDims
private

Number of dimensions of the (extended) system.

Definition at line 491 of file Chi2Fitter.h.


The documentation for this struct was generated from the following file: