FairRoot/PandaRoot
Public Types | Public Member Functions | Private Attributes | List of all members
RhoLorentzVectorErr Class Reference

#include <RhoLorentzVectorErr.h>

Inheritance diagram for RhoLorentzVectorErr:

Public Types

enum  MPolarCoordinateIndex {
  Mom = 0, Theta = 1, Phi = 2, Mass = 3,
  NUM_MPCOORDINATES = 4
}
 
enum  EPolarCoordinateIndex {
  Energy = 0, ETheta = 1, EPhi = 2, EMom = 3,
  NUM_EPCOORDINATES = 4
}
 

Public Member Functions

 RhoLorentzVectorErr ()
 
 RhoLorentzVectorErr (const TLorentzVector &p)
 
 RhoLorentzVectorErr (const TLorentzVector &p, const RhoError &covMat)
 
 RhoLorentzVectorErr (const RhoVector3Err &p3, Double_t mass)
 
 RhoLorentzVectorErr (const RhoLorentzVectorErr &v)
 
virtual ~RhoLorentzVectorErr ()
 
RhoLorentzVectorErroperator= (const RhoLorentzVectorErr &v)
 
RhoLorentzVectorErroperator- ()
 
RhoLorentzVectorErroperator+= (const RhoLorentzVectorErr &v)
 
RhoLorentzVectorErroperator-= (const RhoLorentzVectorErr &v)
 
RhoLorentzVectorErrTransform (const TRotation &rot)
 
RhoLorentzVectorErrTransform (const TLorentzRotation &rot)
 
Double_t DetermineChisq (const TLorentzVector &refVector)
 
const RhoErrorCovMatrix () const
 
void SetCovMatrix (const RhoError &v)
 
void PrintOn (std::ostream &o=std::cout) const
 

Private Attributes

RhoErrorfCovMatrix
 

Detailed Description

Definition at line 23 of file RhoLorentzVectorErr.h.

Member Enumeration Documentation

Enumerator
Energy 
ETheta 
EPhi 
EMom 
NUM_EPCOORDINATES 

Definition at line 33 of file RhoLorentzVectorErr.h.

Enumerator
Mom 
Theta 
Phi 
Mass 
NUM_MPCOORDINATES 

Definition at line 26 of file RhoLorentzVectorErr.h.

Constructor & Destructor Documentation

RhoLorentzVectorErr::RhoLorentzVectorErr ( )

Definition at line 71 of file RhoLorentzVectorErr.cxx.

References fCovMatrix.

71  : TLorentzVector()
72 {
73  fCovMatrix = new RhoError ( 4 );
74 }
RhoLorentzVectorErr::RhoLorentzVectorErr ( const TLorentzVector &  p)

Definition at line 77 of file RhoLorentzVectorErr.cxx.

References fCovMatrix.

77  :
78  TLorentzVector ( p )
79 {
80  fCovMatrix = new RhoError ( 4 );
81 }
Double_t p
Definition: anasim.C:58
RhoLorentzVectorErr::RhoLorentzVectorErr ( const TLorentzVector &  p,
const RhoError covMat 
)

Definition at line 83 of file RhoLorentzVectorErr.cxx.

References fCovMatrix.

83  :
84  TLorentzVector ( p )
85 {
86  fCovMatrix = new RhoError ( covMat );
87 }
Double_t p
Definition: anasim.C:58
RhoLorentzVectorErr::RhoLorentzVectorErr ( const RhoVector3Err p3,
Double_t  mass 
)

Definition at line 28 of file RhoLorentzVectorErr.cxx.

References RhoVector3Err::CovMatrix(), Double_t, energy, fCovMatrix, i, and SetCovMatrix().

29  :
30  TLorentzVector ( ( const TVector3& ) p3, sqrt ( p3.Mag2() + mass* mass ) )
31 {
32  int i=0,j=0;
33  fCovMatrix = new RhoError ( 4 );
34  // The 3-vector part of the error, initialized as a 0-matrix, then copied
35  // from p3:
36  TMatrixD p4Err ( 4,4 );
37  for ( i = 0; i < 3; ++i ) {
38  for ( j = i; j < 3; ++j ) { // start from j=i, since (i,j) = (j,i)
39  p4Err ( i,j ) = p3.CovMatrix() ( i,j );
40  }
41  }
42 
43  // The energy part of the error:
44  const Double_t energy = E();
45 
46  if ( energy != 0 ) {
47  p4Err ( 4,4 ) = 0.0;
48  for ( i = 0; i < 3; ++i ) {
49  for ( j = 0; j < 3; ++j ) {
50  p4Err ( 4,4 ) += p3[i] * p3[j] *
51  p3.CovMatrix() ( i, j );
52  }
53  }
54  p4Err ( 4,4 ) /= ( energy * energy );
55  }
56 
57  // The E-p correlated part of the error is
58  // <(E - <E>) (Pi - <Pi>)> = dE/dPj Vjk dPi/dPk
59  // Since dPi/dPk = delta_ik, we get dE/dPj Vji.
60  for ( i = 0; i < 3; ++i ) {
61  for ( j = 0; j < 3; ++j ) {
62  p4Err ( i,3 ) += p3 ( j ) / energy * p3.CovMatrix() ( j,i );
63  // No need to switch indices for a TMatrixD, so no p4Err(4,i)
64  }
65  }
66 
67  SetCovMatrix ( p4Err );
68 }
Int_t i
Definition: run_full.C:25
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
Double_t
void SetCovMatrix(const RhoError &v)
TMatrixT< double > TMatrixD
Definition: PndLmdDim.h:52
Double_t energy
Definition: plot_dirc.C:15
RhoLorentzVectorErr::RhoLorentzVectorErr ( const RhoLorentzVectorErr v)

Definition at line 90 of file RhoLorentzVectorErr.cxx.

References CovMatrix(), and fCovMatrix.

90  : TLorentzVector ( v )
91 {
92  fCovMatrix = new RhoError ( v.CovMatrix() );
93 }
const RhoError & CovMatrix() const
virtual RhoLorentzVectorErr::~RhoLorentzVectorErr ( )
inlinevirtual

Definition at line 55 of file RhoLorentzVectorErr.h.

References fCovMatrix.

55  {
56  if(fCovMatrix)delete fCovMatrix;
57  }

Member Function Documentation

const RhoError& RhoLorentzVectorErr::CovMatrix ( ) const
inline
Double_t RhoLorentzVectorErr::DetermineChisq ( const TLorentzVector &  refVector)

Definition at line 129 of file RhoLorentzVectorErr.cxx.

References RhoError::DetermineChisq(), fCovMatrix, T, X, Y, and Z.

130 {
131  TVectorD temp ( 4 );
132  temp ( 0 ) = refVector.X()-this->X();
133  temp ( 1 ) = refVector.Y()-this->Y();
134  temp ( 2 ) = refVector.Z()-this->Z();
135  temp ( 3 ) = refVector.T()-this->T();
136 
137  return fCovMatrix->DetermineChisq ( temp );
138 }
Double_t DetermineChisq(TVectorD &diff)
Definition: RhoError.cxx:166
double Y
Definition: anaLmdDigi.C:68
TTree * T
Definition: anaLmdReco.C:32
double X
Definition: anaLmdDigi.C:68
double Z
Definition: anaLmdDigi.C:68
RhoLorentzVectorErr & RhoLorentzVectorErr::operator+= ( const RhoLorentzVectorErr v)

Definition at line 113 of file RhoLorentzVectorErr.cxx.

References CovMatrix(), fCovMatrix, and operator+=().

114 {
116  *fCovMatrix += v.CovMatrix();
117  return *this;
118 }
const RhoError & CovMatrix() const
friend void operator+=(F32vec1 &a, const F32vec1 &b)
RhoLorentzVectorErr & RhoLorentzVectorErr::operator- ( )

Definition at line 107 of file RhoLorentzVectorErr.cxx.

108 {
109  ( ( TLorentzVector ) *this ) *= -1.;
110  return *this; // fCovMatrix unaltered
111 }
RhoLorentzVectorErr & RhoLorentzVectorErr::operator-= ( const RhoLorentzVectorErr v)

Definition at line 120 of file RhoLorentzVectorErr.cxx.

References CovMatrix(), fCovMatrix, and operator-=().

121 {
123  *fCovMatrix += v.CovMatrix();
124  return *this;
125 }
const RhoError & CovMatrix() const
friend void operator-=(F32vec1 &a, const F32vec1 &b)
RhoLorentzVectorErr & RhoLorentzVectorErr::operator= ( const RhoLorentzVectorErr v)

Definition at line 96 of file RhoLorentzVectorErr.cxx.

References CovMatrix(), and fCovMatrix.

97 {
98  if ( this != &v ) {
99  TLorentzVector::operator= ( v );
100  fCovMatrix = new RhoError ( v.CovMatrix() );
101  }
102  return *this;
103 }
const RhoError & CovMatrix() const
void RhoLorentzVectorErr::PrintOn ( std::ostream o = std::cout) const

Definition at line 206 of file RhoLorentzVectorErr.cxx.

References T, X, Y, and Z.

Referenced by operator<<().

207 {
208  out << X() << "\t" << Y() << "\t" << Z() << "\t" << T();
209 }
double Y
Definition: anaLmdDigi.C:68
TTree * T
Definition: anaLmdReco.C:32
TFile * out
Definition: reco_muo.C:20
double X
Definition: anaLmdDigi.C:68
double Z
Definition: anaLmdDigi.C:68
void RhoLorentzVectorErr::SetCovMatrix ( const RhoError v)
inline

Definition at line 106 of file RhoLorentzVectorErr.h.

References fCovMatrix.

Referenced by RhoLorentzVectorErr().

106  {
107  if(fCovMatrix)delete fCovMatrix;
108  fCovMatrix = new RhoError ( v );
109  }
RhoLorentzVectorErr & RhoLorentzVectorErr::Transform ( const TRotation &  rot)

Definition at line 152 of file RhoLorentzVectorErr.cxx.

References col, fCovMatrix, rot, row, and RhoError::Similarity().

153 {
154  TLorentzVector::Transform ( rot );
155  TMatrixD tempRot ( 4,4 );
156 
157  // Fill a 4x4 matrix from the 3x3 TRotation. Note that they use different
158  // indexing schemes (!?@#$&^*&#$@#):
159 
160  int row;
161  int col;
162  for ( row = 0; row < 3; ++row ) { // 3 is the size of TRotation
163  for ( col = 0; col < 3; ++col ) { // (which provides no enum)
164  tempRot ( row, col ) = rot ( row, col );
165  }
166  }
167 
168  // fill the 4th row:
169  tempRot ( 3,3 ) = 1.0;
170  for ( col = 0; col < 3; ++col ) {
171  tempRot ( 3, col ) = 0.0;
172  }
173 
174  // fill the 4th column:
175  for ( row = 0; row < 3; ++row ) {
176  tempRot ( row, 3 ) = 0.0;
177  }
178 
179  *fCovMatrix = fCovMatrix->Similarity ( tempRot );
180  return *this;
181 }
int row
Definition: anaLmdDigi.C:67
int col
Definition: anaLmdDigi.C:67
RhoError Similarity(const TMatrixD &m1) const
Definition: RhoError.cxx:104
TGeoRotation rot
TMatrixT< double > TMatrixD
Definition: PndLmdDim.h:52
RhoLorentzVectorErr & RhoLorentzVectorErr::Transform ( const TLorentzRotation &  rot)

Definition at line 143 of file RhoLorentzVectorErr.cxx.

References fCovMatrix, and RhoError::Similarity().

144 {
145  TLorentzVector::Transform ( rot );
147  return *this;
148 }
RhoError Similarity(const TMatrixD &m1) const
Definition: RhoError.cxx:104
TGeoRotation rot

Member Data Documentation

RhoError* RhoLorentzVectorErr::fCovMatrix
private

The documentation for this class was generated from the following files: