CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
DTSurveyChamber Class Reference

#include <DTSurveyChamber.h>

Public Member Functions

void addPoint (int, const TMatrixD &, const TMatrixD &, const TMatrixD &)
 
void compute ()
 
 DTSurveyChamber (int, int, int, long)
 
float getAlpha () const
 
float getAlphaError () const
 
float getBeta () const
 
float getBetaError () const
 
float getDeltaX () const
 
float getDeltaXError () const
 
float getDeltaY () const
 
float getDeltaYError () const
 
float getDeltaZ () const
 
float getDeltaZError () const
 
float getGamma () const
 
float getGammaError () const
 
long getId () const
 
int getNumberPoints () const
 
void printChamberInfo ()
 

Private Member Functions

TMatrixD & makeErrors ()
 
TMatrixD & makeMatrix ()
 
TMatrixD & makeVector ()
 

Private Attributes

TMatrixD Covariance
 
int pointNumber
 
std::vector< TMatrixD > points
 
std::vector< TMatrixD > pointsDiff
 
std::vector< TMatrixD > pointsError
 
std::vector< TMatrixD > pointsTheoretical
 
long rawId
 
int sector
 
TMatrixD Solution
 
int station
 
int wheel
 

Detailed Description

Implements a chamber in the context of Drift Tube Survey Measurements
and calculates displacements and rotations for it.

Date
2008/04/11 05:08:01
Revision
1.5
Author
Pablo Martinez Ruiz del Arbol

Definition at line 19 of file DTSurveyChamber.h.

Constructor & Destructor Documentation

◆ DTSurveyChamber()

DTSurveyChamber::DTSurveyChamber ( int  m_wheel,
int  m_station,
int  m_sector,
long  m_rawId 
)

Definition at line 6 of file DTSurveyChamber.cc.

6  {
7  //Coordinates of the chamber
8  wheel = m_wheel;
9  station = m_station;
10  sector = m_sector;
11  pointNumber = 0;
12  rawId = m_rawId;
13 }

References pointNumber, rawId, sector, station, and wheel.

Member Function Documentation

◆ addPoint()

void DTSurveyChamber::addPoint ( int  code,
const TMatrixD &  r,
const TMatrixD &  disp,
const TMatrixD &  err 
)

Definition at line 28 of file DTSurveyChamber.cc.

28  {
29  ++pointNumber;
30 
31  points.push_back(r);
32  pointsDiff.push_back(disp);
33  pointsError.push_back(err);
34  pointsTheoretical.push_back(r - disp);
35 }

References submitPVResolutionJobs::err, pointNumber, points, pointsDiff, pointsError, pointsTheoretical, and alignCSCRings::r.

Referenced by DTSurvey::ReadChambers().

◆ compute()

void DTSurveyChamber::compute ( )

Definition at line 15 of file DTSurveyChamber.cc.

15  {
16  TMatrixD leftMatrix = makeMatrix();
17  TMatrixD rightMatrix = makeVector();
18  TMatrixD errors = makeErrors();
19 
20  Chi2 myChi2(leftMatrix, rightMatrix, errors);
21 
22  Solution.ResizeTo(6, 1);
23  Solution = myChi2.getSolution();
24  Covariance.ResizeTo(6, 6);
25  Covariance = myChi2.getCovariance();
26 }

References Chi2::getCovariance(), Chi2::getSolution(), makeErrors(), makeMatrix(), makeVector(), and Solution.

Referenced by DTSurvey::CalculateChambers().

◆ getAlpha()

float DTSurveyChamber::getAlpha ( ) const
inline

Definition at line 35 of file DTSurveyChamber.h.

35 { return Solution(5, 0); }

References Solution.

◆ getAlphaError()

float DTSurveyChamber::getAlphaError ( ) const
inline

Definition at line 41 of file DTSurveyChamber.h.

41 { return TMath::Sqrt(Covariance(5, 5)); }

References Covariance.

◆ getBeta()

float DTSurveyChamber::getBeta ( ) const
inline

Definition at line 36 of file DTSurveyChamber.h.

36 { return -1.0 * Solution(4, 0); }

References Solution.

◆ getBetaError()

float DTSurveyChamber::getBetaError ( ) const
inline

Definition at line 42 of file DTSurveyChamber.h.

42 { return TMath::Sqrt(Covariance(4, 4)); }

References Covariance.

◆ getDeltaX()

float DTSurveyChamber::getDeltaX ( ) const
inline

Definition at line 31 of file DTSurveyChamber.h.

31 { return Solution(0, 0); }

References Solution.

◆ getDeltaXError()

float DTSurveyChamber::getDeltaXError ( ) const
inline

Definition at line 38 of file DTSurveyChamber.h.

38 { return TMath::Sqrt(Covariance(0, 0)); }

References Covariance.

◆ getDeltaY()

float DTSurveyChamber::getDeltaY ( ) const
inline

Definition at line 32 of file DTSurveyChamber.h.

32 { return Solution(1, 0); }

References Solution.

◆ getDeltaYError()

float DTSurveyChamber::getDeltaYError ( ) const
inline

Definition at line 39 of file DTSurveyChamber.h.

39 { return TMath::Sqrt(Covariance(1, 1)); }

References Covariance.

◆ getDeltaZ()

float DTSurveyChamber::getDeltaZ ( ) const
inline

Definition at line 33 of file DTSurveyChamber.h.

33 { return Solution(2, 0); }

References Solution.

◆ getDeltaZError()

float DTSurveyChamber::getDeltaZError ( ) const
inline

Definition at line 40 of file DTSurveyChamber.h.

40 { return TMath::Sqrt(Covariance(2, 2)); }

References Covariance.

◆ getGamma()

float DTSurveyChamber::getGamma ( ) const
inline

Definition at line 37 of file DTSurveyChamber.h.

37 { return Solution(3, 0); }

References Solution.

◆ getGammaError()

float DTSurveyChamber::getGammaError ( ) const
inline

Definition at line 43 of file DTSurveyChamber.h.

43 { return TMath::Sqrt(Covariance(3, 3)); }

References Covariance.

◆ getId()

long DTSurveyChamber::getId ( ) const
inline

Definition at line 30 of file DTSurveyChamber.h.

30 { return rawId; }

References rawId.

◆ getNumberPoints()

int DTSurveyChamber::getNumberPoints ( ) const
inline

Definition at line 27 of file DTSurveyChamber.h.

27 { return pointNumber; }

References pointNumber.

Referenced by makeErrors(), makeMatrix(), and makeVector().

◆ makeErrors()

TMatrixD & DTSurveyChamber::makeErrors ( )
private

Definition at line 50 of file DTSurveyChamber.cc.

50  {
51  TMatrixD *result = new TMatrixD(3 * getNumberPoints(), 3 * getNumberPoints());
52  result->Zero();
53  int real = 0;
54  for (std::vector<TMatrixD>::iterator p = pointsError.begin(); p != pointsError.end(); ++p) {
55  double rmsn = 1.0 / ((*p)(0, 0) * (*p)(0, 0));
56  (*result)(real * 3, real * 3) = rmsn;
57  (*result)(real * 3 + 1, real * 3 + 1) = rmsn;
58  (*result)(real * 3 + 2, real * 3 + 2) = rmsn;
59  real++;
60  }
61  return *result;
62 }

References getNumberPoints(), AlCaHLTBitMon_ParallelJobs::p, pointsError, and mps_fire::result.

Referenced by compute().

◆ makeMatrix()

TMatrixD & DTSurveyChamber::makeMatrix ( )
private

Definition at line 64 of file DTSurveyChamber.cc.

64  {
65  TMatrixD *result = new TMatrixD(3 * getNumberPoints(), 6);
66  result->Zero();
67  int real = 0;
68  for (std::vector<TMatrixD>::iterator p = pointsTheoretical.begin(); p != pointsTheoretical.end(); p++) {
69  (*result)(real * 3, 0) = 1.0;
70  (*result)(real * 3, 3) = (*p)(1, 0);
71  (*result)(real * 3, 4) = (*p)(2, 0);
72  (*result)(real * 3 + 1, 1) = 1.0;
73  (*result)(real * 3 + 1, 3) = -(*p)(0, 0);
74  (*result)(real * 3 + 1, 5) = (*p)(2, 0);
75  (*result)(real * 3 + 2, 2) = 1.0;
76  (*result)(real * 3 + 2, 4) = -(*p)(0, 0);
77  (*result)(real * 3 + 2, 5) = -(*p)(1, 0);
78  real++;
79  }
80  return *result;
81 }

References getNumberPoints(), AlCaHLTBitMon_ParallelJobs::p, pointsTheoretical, and mps_fire::result.

Referenced by compute().

◆ makeVector()

TMatrixD & DTSurveyChamber::makeVector ( )
private

Definition at line 37 of file DTSurveyChamber.cc.

37  {
38  TMatrixD *result = new TMatrixD(3 * getNumberPoints(), 1);
39  result->Zero();
40  int real = 0;
41  for (std::vector<TMatrixD>::iterator p = pointsDiff.begin(); p != pointsDiff.end(); ++p) {
42  (*result)(real * 3, 0) = (*p)(0, 0);
43  (*result)(real * 3 + 1, 0) = (*p)(1, 0);
44  (*result)(real * 3 + 2, 0) = (*p)(2, 0);
45  ++real;
46  }
47  return *result;
48 }

References getNumberPoints(), AlCaHLTBitMon_ParallelJobs::p, pointsDiff, and mps_fire::result.

Referenced by compute().

◆ printChamberInfo()

void DTSurveyChamber::printChamberInfo ( )

Member Data Documentation

◆ Covariance

TMatrixD DTSurveyChamber::Covariance
private

◆ pointNumber

int DTSurveyChamber::pointNumber
private

Definition at line 67 of file DTSurveyChamber.h.

Referenced by addPoint(), DTSurveyChamber(), and getNumberPoints().

◆ points

std::vector<TMatrixD> DTSurveyChamber::points
private

Definition at line 58 of file DTSurveyChamber.h.

Referenced by addPoint().

◆ pointsDiff

std::vector<TMatrixD> DTSurveyChamber::pointsDiff
private

Definition at line 59 of file DTSurveyChamber.h.

Referenced by addPoint(), and makeVector().

◆ pointsError

std::vector<TMatrixD> DTSurveyChamber::pointsError
private

Definition at line 60 of file DTSurveyChamber.h.

Referenced by addPoint(), and makeErrors().

◆ pointsTheoretical

std::vector<TMatrixD> DTSurveyChamber::pointsTheoretical
private

Definition at line 61 of file DTSurveyChamber.h.

Referenced by addPoint(), and makeMatrix().

◆ rawId

long DTSurveyChamber::rawId
private

Definition at line 55 of file DTSurveyChamber.h.

Referenced by DTSurveyChamber(), and getId().

◆ sector

int DTSurveyChamber::sector
private

◆ Solution

TMatrixD DTSurveyChamber::Solution
private

Definition at line 63 of file DTSurveyChamber.h.

Referenced by compute(), getAlpha(), getBeta(), getDeltaX(), getDeltaY(), getDeltaZ(), and getGamma().

◆ station

int DTSurveyChamber::station
private

◆ wheel

int DTSurveyChamber::wheel
private

Definition at line 53 of file DTSurveyChamber.h.

Referenced by DTSurveyChamber(), and geometryXMLparser.DTAlignable::index().

DTSurveyChamber::makeMatrix
TMatrixD & makeMatrix()
Definition: DTSurveyChamber.cc:64
DTSurveyChamber::makeVector
TMatrixD & makeVector()
Definition: DTSurveyChamber.cc:37
DTSurveyChamber::Solution
TMatrixD Solution
Definition: DTSurveyChamber.h:63
DTSurveyChamber::Covariance
TMatrixD Covariance
Definition: DTSurveyChamber.h:64
Chi2
Definition: Chi2.h:15
DTSurveyChamber::sector
int sector
Definition: DTSurveyChamber.h:53
errors
Definition: errors.py:1
DTSurveyChamber::station
int station
Definition: DTSurveyChamber.h:53
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
DTSurveyChamber::wheel
int wheel
Definition: DTSurveyChamber.h:53
submitPVResolutionJobs.err
err
Definition: submitPVResolutionJobs.py:85
DTSurveyChamber::makeErrors
TMatrixD & makeErrors()
Definition: DTSurveyChamber.cc:50
alignCSCRings.r
r
Definition: alignCSCRings.py:93
DTSurveyChamber::pointsTheoretical
std::vector< TMatrixD > pointsTheoretical
Definition: DTSurveyChamber.h:61
DTSurveyChamber::points
std::vector< TMatrixD > points
Definition: DTSurveyChamber.h:58
DTSurveyChamber::getNumberPoints
int getNumberPoints() const
Definition: DTSurveyChamber.h:27
Covariance
Definition: Histograms.h:1877
DTSurveyChamber::pointNumber
int pointNumber
Definition: DTSurveyChamber.h:67
mps_fire.result
result
Definition: mps_fire.py:311
DTSurveyChamber::pointsError
std::vector< TMatrixD > pointsError
Definition: DTSurveyChamber.h:60
DTSurveyChamber::rawId
long rawId
Definition: DTSurveyChamber.h:55
DTSurveyChamber::pointsDiff
std::vector< TMatrixD > pointsDiff
Definition: DTSurveyChamber.h:59