PandaRoot
PndLmdDimPropMat Class Reference

#include <PndLmdDim.h>

Public Member Functions

 PndLmdDimPropMat ()
 
void Set (const double *matrix)
 
 PndLmdDimPropMat (double mom_init)
 
void Propagate (TVector3 &pos, TVector3 &momdir)
 

Public Attributes

double mom
 
double M [7][7]
 

Detailed Description

Definition at line 62 of file PndLmdDim.h.

Constructor & Destructor Documentation

◆ PndLmdDimPropMat() [1/2]

PndLmdDimPropMat::PndLmdDimPropMat ( )
inline

Definition at line 66 of file PndLmdDim.h.

References i.

67  {
68  mom = 0;
69  for (int i = 0; i < 7; i++) {
70  for (int j = 0; j < 7; j++) {
71  M[i][j] = 0;
72  }
73  }
74  }
unsigned int i
Definition: P4_F32vec4.h:21
double M[7][7]
Definition: PndLmdDim.h:65

◆ PndLmdDimPropMat() [2/2]

PndLmdDimPropMat::PndLmdDimPropMat ( double  mom_init)
inline

Definition at line 85 of file PndLmdDim.h.

86  {
87  mom = mom_init;
88  if (mom == 1.5) {
89  double matrix_init[49] = {1.012, 1.22, 5.216e-05, 0.2599, 1.096, -0.1589, -0.0001459, -0.5851, 1.042, 0.001092,
90  -3.991e-06, 0.3103, 1.064, -3.991e-06, -0.04447, -0.04501, 0.001764, 11.24, -0.04385, 0.007135,
91  0.0001733, -1.36e-15, 1.816e-14, 3.031e-15, 1, 1.513e-16, -2.272e-16, 7.904e-17, 0.006668, 1.356,
92  -0.0001811, 0.000127, 0.9794, -0.1215, 0.4001, -0.6638, 0.04068, 0.001168, -7.627e-06, 0.2952,
93  0.9388, -7.627e-06, -1.003e-15, -3.248e-15, 9.487e-17, 5.594e-18, 2.41e-16, -1.086e-16, 1};
94  Set(matrix_init);
95  } else {
96  if (mom == 15) {
97  double matrix_init[49] = {0.9633, 0.2086, -0.01173, 0.2598, 1.123, -0.03217, -0.0002463, -0.104, 0.97, -0.006443,
98  5.119e-06, 0.06427, 1.12, 5.119e-06, -0.03828, 0.005853, 0.004478, 11.24, -0.0447, 0.001794,
99  2.613e-06, 2.376e-06, -0.0003806, -2.583e-07, 1, -1.647e-05, -1.871e-05, -3.862e-07, -0.01744, 0.1777,
100  -0.01384, 0.0001758, 0.9997, -0.02581, 0.4002, -0.09394, -0.05056, -0.002047, 3.624e-05, 0.06091,
101  0.994, 3.624e-05, 2.376e-06, -0.0003806, -2.583e-07, -3.862e-07, -1.647e-05, -1.871e-05, 1};
102  Set(matrix_init);
103  } else { // identity matrix
104  cout << " Warning in PndLmdDimPropMat: loading identity matrix only " << endl;
105  double matrix_init[49] = {1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1,
106  0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1};
107  Set(matrix_init);
108  }
109  }
110  }
void Set(const double *matrix)
Definition: PndLmdDim.h:76

Member Function Documentation

◆ Propagate()

void PndLmdDimPropMat::Propagate ( TVector3 &  pos,
TVector3 &  momdir 
)
inline

Definition at line 113 of file PndLmdDim.h.

References i.

114  {
115  // TVector3 dir = mom.Unit();
116  double mommag = momdir.Mag();
117  // position transformation was evaluated for meter and angles * 10.
118  double xip[7] = {pos.X() / 100., pos.Y() / 100., pos.Z() / 100., 1, momdir.X() / momdir.Z() * 10., momdir.Y() / momdir.Z() * 10., 1};
119  double xlmd[7] = {0, 0, 0, 0, 0, 0, 0};
120  for (int i = 0; i < 7; i++) {
121  for (int j = 0; j < 7; j++) {
122  xlmd[i] += M[i][j] * xip[j];
123  }
124  }
125  pos.SetXYZ(xlmd[0] * 100., xlmd[1] * 100., xlmd[2] * 100.);
126  momdir.SetXYZ(xlmd[4] / 10., xlmd[5] / 10., 1.); // not an exact calculation ;)
127  momdir = momdir.Unit() * mommag;
128  }
unsigned int i
Definition: P4_F32vec4.h:21
double M[7][7]
Definition: PndLmdDim.h:65

◆ Set()

void PndLmdDimPropMat::Set ( const double *  matrix)
inline

Definition at line 76 of file PndLmdDim.h.

References i.

77  {
78  for (int i = 0; i < 7 * 7; i++) {
79  M[i / 7][i % 7] = matrix[i];
80  }
81  }
unsigned int i
Definition: P4_F32vec4.h:21
double M[7][7]
Definition: PndLmdDim.h:65

Member Data Documentation

◆ M

double PndLmdDimPropMat::M[7][7]

Definition at line 65 of file PndLmdDim.h.

◆ mom

double PndLmdDimPropMat::mom

Definition at line 64 of file PndLmdDim.h.


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