StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMuPrimaryTrackCovariance.cxx
1 #include "StMuPrimaryTrackCovariance.h"
2 #include "TMath.h"
3 #include "Stiostream.h"
4 #include "TRSymMatrix.h"
6 StMuPrimaryTrackCovariance::StMuPrimaryTrackCovariance() {memset(mBeg,0,mEnd-mBeg+1);}
7 StMuPrimaryTrackCovariance::StMuPrimaryTrackCovariance(StMatrixF cov) {
8  memset(mBeg,0,mEnd-mBeg+1);
9  Float_t *covv = &mTanTan;
10  for (Int_t i = 0; i < 3; i++) {
11  for (Int_t j = 0; j <= i; j++) {
12  Int_t ij = i*(i+1)/2 + j;
13  covv[ij] = cov(i+3,j+3);
14  if (i == 1) covv[ij] *= TMath::DegToRad();
15  if (j == 1) covv[ij] *= TMath::DegToRad();
16  }
17  }
18 }
19 //________________________________________________________________________________
20 StMuPrimaryTrackCovariance::StMuPrimaryTrackCovariance(const Float_t *cov) {
21  memset(mBeg,0,mEnd-mBeg+1);
22  mTanTan = cov[ 9];
23  mPsiTan = cov[10]*TMath::DegToRad(); mPsiPsi = cov[12]*TMath::DegToRad()*TMath::DegToRad();
24  mPtiTan = cov[11] ; mPtiPsi = cov[13]*TMath::DegToRad() ; mPtiPti = cov[14];
25 }
26 ostream& operator<<(ostream& os, const StMuPrimaryTrackCovariance& v) {
27  TRSymMatrix cov(3,v.errMatrix());
28  os << "StMuPrimaryTrackCovariance: " << cov;
29  return os;
30 }
31 void StMuPrimaryTrackCovariance::Print(Option_t *option) const {cout << *this << endl;}