ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
ROOT::Minuit2::TileMuonTrackDistance Class Reference

Auxiliary to TileMuonFitter. Chi-square function for Minuit. More...

#include <TileMuonTrackDistance.h>

Inheritance diagram for ROOT::Minuit2::TileMuonTrackDistance:
Collaboration diagram for ROOT::Minuit2::TileMuonTrackDistance:

Public Member Functions

 TileMuonTrackDistance (const std::vector< double > &X, const std::vector< double > &Y, const std::vector< double > &Z, const std::vector< double > &E)
 Constructor. More...
 
virtual ~TileMuonTrackDistance ()
 
virtual double operator() (const std::vector< double > &) const override
 Provides Chi-square in function of parameter vector. More...
 
virtual double Up () const override
 
void Means ()
 Calculates means (weighted or not) of cell positions. More...
 
double Distance2SinglePoint (double x, double y, double z, const std::vector< double > &par) const
 Returns squared distance from point to track defined by par. More...
 
CLHEP::Hep3Vector ClosestPoint (CLHEP::Hep3Vector *dataPoint, const std::vector< double > &par) const
 Returns point in track defined by par closest to dataPoint. More...
 
double GetMeanX ()
 X mean getter. More...
 
double GetMeanY ()
 Y mean getter. More...
 
double GetMeanZ ()
 Z mean getter. More...
 
void SetWeighted (bool weight)
 Set weight/no-weight flag. More...
 
bool GetWeighted ()
 Get weight/no-weight flag. More...
 

Private Attributes

std::vector< double > m_theX
 Vector of cell center X coordinates. More...
 
std::vector< double > m_theY
 Vector of cell center Y coordinates. More...
 
std::vector< double > m_theZ
 Vector of cell center Z coordinates. More...
 
std::vector< double > m_theE
 Vector of cell energies. More...
 
bool m_doWeighted
 Weight/no-weight flag. More...
 
double m_meanX
 
double m_meanY
 
double m_meanZ
 

Detailed Description

Auxiliary to TileMuonFitter. Chi-square function for Minuit.

This class is auxiliary to TileMuonFitter. Provides sum of squared orthogonal distances from cells to track. Implemented as a FCNBase in order to be called directly by Minuit.

Definition at line 70 of file TileMuonTrackDistance.h.

Constructor & Destructor Documentation

◆ TileMuonTrackDistance()

ROOT::Minuit2::TileMuonTrackDistance::TileMuonTrackDistance ( const std::vector< double > &  X,
const std::vector< double > &  Y,
const std::vector< double > &  Z,
const std::vector< double > &  E 
)
inline

Constructor.

Definition at line 75 of file TileMuonTrackDistance.h.

77  {
78  return m_meanZ;

◆ ~TileMuonTrackDistance()

virtual ROOT::Minuit2::TileMuonTrackDistance::~TileMuonTrackDistance ( )
inlinevirtual

Definition at line 80 of file TileMuonTrackDistance.h.

82  {

Member Function Documentation

◆ ClosestPoint()

Hep3Vector ROOT::Minuit2::TileMuonTrackDistance::ClosestPoint ( CLHEP::Hep3Vector *  dataPoint,
const std::vector< double > &  par 
) const

Returns point in track defined by par closest to dataPoint.

Definition at line 93 of file TileMuonTrackDistance.cxx.

93  {
94 
95  double aa, bb, cc, dd;
96  double xort = 0;
97  Hep3Vector linePoint;
98 
99  aa = par[0];
100  bb = par[1];
101  cc = par[2];
102  dd = par[3];
103 
104  xort = dataPoint->getX() + bb * (dataPoint->getY() - aa) + dd * (dataPoint->getZ() - cc);
105  xort /= (1 + bb * bb + dd * dd);
106  linePoint.setX(xort);
107  linePoint.setY(aa + bb * xort);
108  linePoint.setZ(cc + dd * xort);
109 
110  return linePoint;
111  }

◆ Distance2SinglePoint()

double ROOT::Minuit2::TileMuonTrackDistance::Distance2SinglePoint ( double  x,
double  y,
double  z,
const std::vector< double > &  par 
) const

Returns squared distance from point to track defined by par.

Definition at line 84 of file TileMuonTrackDistance.cxx.

85  {
86 
87  Hep3Vector dataP(x, y, z);
88  Hep3Vector lineP(ClosestPoint(&dataP, par));
89 
90  return (dataP - lineP).mag2();
91  }

◆ GetMeanX()

double ROOT::Minuit2::TileMuonTrackDistance::GetMeanX ( )
inline

X mean getter.

Definition at line 97 of file TileMuonTrackDistance.h.

◆ GetMeanY()

double ROOT::Minuit2::TileMuonTrackDistance::GetMeanY ( )
inline

Y mean getter.

Definition at line 101 of file TileMuonTrackDistance.h.

◆ GetMeanZ()

double ROOT::Minuit2::TileMuonTrackDistance::GetMeanZ ( )
inline

Z mean getter.

Definition at line 105 of file TileMuonTrackDistance.h.

◆ GetWeighted()

bool ROOT::Minuit2::TileMuonTrackDistance::GetWeighted ( )
inline

Get weight/no-weight flag.

Definition at line 114 of file TileMuonTrackDistance.h.

◆ Means()

void ROOT::Minuit2::TileMuonTrackDistance::Means ( )

Calculates means (weighted or not) of cell positions.

Definition at line 28 of file TileMuonTrackDistance.cxx.

28  {
29  m_meanX = m_meanY = m_meanZ = 0.;
30  double eSum = 0.;
31  int ncells = m_theX.size();
32 
33  if (m_doWeighted) {
34  for (int i = 0; i < ncells; i++) {
35  m_meanX += m_theE[i] * m_theX[i];
36  m_meanY += m_theE[i] * m_theY[i];
37  m_meanZ += m_theE[i] * m_theZ[i];
38  eSum += m_theE[i];
39  }
40  if (eSum > 0) {
41  m_meanX /= eSum;
42  m_meanY /= eSum;
43  m_meanZ /= eSum;
44  } else {
45  m_meanX = 0;
46  m_meanY = 0;
47  m_meanZ = 0;
48  }
49  } else {
50  for (int i = 0; i < ncells; i++) {
51  m_meanX += m_theX[i];
52  m_meanY += m_theY[i];
53  m_meanZ += m_theZ[i];
54  }
55  m_meanX /= (double) (ncells);
56  m_meanY /= (double) (ncells);
57  m_meanZ /= (double) (ncells);
58  }
59 
60  }

◆ operator()()

double ROOT::Minuit2::TileMuonTrackDistance::operator() ( const std::vector< double > &  par) const
overridevirtual

Provides Chi-square in function of parameter vector.

Definition at line 62 of file TileMuonTrackDistance.cxx.

63  {
64  double distSum2 = 0;
65  std::vector<double> fourPar;
66 
67  fourPar.push_back(m_meanY - par[0] * m_meanX);
68  fourPar.push_back(par[0]);
69  fourPar.push_back(m_meanZ - par[1] * m_meanX);
70  fourPar.push_back(par[1]);
71 
72  for (int i = 0; i < (int) (m_theX.size()); i++) {
73  if (m_doWeighted) {
74  distSum2 += m_theE[i] * Distance2SinglePoint(m_theX[i], m_theY[i], m_theZ[i], fourPar);
75  } else {
76  distSum2 += Distance2SinglePoint(m_theX[i], m_theY[i], m_theZ[i], fourPar);
77  }
78  }
79 
80  return distSum2;
81 
82  }

◆ SetWeighted()

void ROOT::Minuit2::TileMuonTrackDistance::SetWeighted ( bool  weight)
inline

Set weight/no-weight flag.

Definition at line 110 of file TileMuonTrackDistance.h.

◆ Up()

virtual double ROOT::Minuit2::TileMuonTrackDistance::Up ( ) const
inlineoverridevirtual

Definition at line 85 of file TileMuonTrackDistance.h.

86  {
87  return m_doWeighted;

Member Data Documentation

◆ m_doWeighted

bool ROOT::Minuit2::TileMuonTrackDistance::m_doWeighted
private

Weight/no-weight flag.

Definition at line 129 of file TileMuonTrackDistance.h.

◆ m_meanX

double ROOT::Minuit2::TileMuonTrackDistance::m_meanX
private

Definition at line 131 of file TileMuonTrackDistance.h.

◆ m_meanY

double ROOT::Minuit2::TileMuonTrackDistance::m_meanY
private

Definition at line 132 of file TileMuonTrackDistance.h.

◆ m_meanZ

double ROOT::Minuit2::TileMuonTrackDistance::m_meanZ
private

Definition at line 133 of file TileMuonTrackDistance.h.

◆ m_theE

std::vector<double> ROOT::Minuit2::TileMuonTrackDistance::m_theE
private

Vector of cell energies.

Definition at line 126 of file TileMuonTrackDistance.h.

◆ m_theX

std::vector<double> ROOT::Minuit2::TileMuonTrackDistance::m_theX
private

Vector of cell center X coordinates.

Definition at line 120 of file TileMuonTrackDistance.h.

◆ m_theY

std::vector<double> ROOT::Minuit2::TileMuonTrackDistance::m_theY
private

Vector of cell center Y coordinates.

Definition at line 122 of file TileMuonTrackDistance.h.

◆ m_theZ

std::vector<double> ROOT::Minuit2::TileMuonTrackDistance::m_theZ
private

Vector of cell center Z coordinates.

Definition at line 124 of file TileMuonTrackDistance.h.


The documentation for this class was generated from the following files:
ROOT::Minuit2::TileMuonTrackDistance::m_meanY
double m_meanY
Definition: TileMuonTrackDistance.h:132
ROOT::Minuit2::TileMuonTrackDistance::m_doWeighted
bool m_doWeighted
Weight/no-weight flag.
Definition: TileMuonTrackDistance.h:129
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
ROOT::Minuit2::TileMuonTrackDistance::m_theZ
std::vector< double > m_theZ
Vector of cell center Z coordinates.
Definition: TileMuonTrackDistance.h:124
x
#define x
ROOT::Minuit2::TileMuonTrackDistance::Distance2SinglePoint
double Distance2SinglePoint(double x, double y, double z, const std::vector< double > &par) const
Returns squared distance from point to track defined by par.
Definition: TileMuonTrackDistance.cxx:84
ROOT::Minuit2::TileMuonTrackDistance::m_theE
std::vector< double > m_theE
Vector of cell energies.
Definition: TileMuonTrackDistance.h:126
lumiFormat.i
int i
Definition: lumiFormat.py:85
z
#define z
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
ROOT::Minuit2::TileMuonTrackDistance::m_theY
std::vector< double > m_theY
Vector of cell center Y coordinates.
Definition: TileMuonTrackDistance.h:122
createCoolChannelIdFile.par
par
Definition: createCoolChannelIdFile.py:29
library_scraper.dd
list dd
Definition: library_scraper.py:46
ROOT::Minuit2::TileMuonTrackDistance::ClosestPoint
CLHEP::Hep3Vector ClosestPoint(CLHEP::Hep3Vector *dataPoint, const std::vector< double > &par) const
Returns point in track defined by par closest to dataPoint.
Definition: TileMuonTrackDistance.cxx:93
y
#define y
ROOT::Minuit2::TileMuonTrackDistance::m_meanZ
double m_meanZ
Definition: TileMuonTrackDistance.h:133
ROOT::Minuit2::TileMuonTrackDistance::m_meanX
double m_meanX
Definition: TileMuonTrackDistance.h:131
ROOT::Minuit2::TileMuonTrackDistance::m_theX
std::vector< double > m_theX
Vector of cell center X coordinates.
Definition: TileMuonTrackDistance.h:120
test_AnalysisBaseEventLoopJob.aa
aa
Definition: test_AnalysisBaseEventLoopJob.py:37
python.handimod.cc
int cc
Definition: handimod.py:523