CbmRoot
CbmLitCleverTrackExtrapolator.cxx
Go to the documentation of this file.
1 
7 
8 #include "../cbm/base/CbmLitToolFactory.h"
10 #include "base/CbmLitEnums.h"
11 #include "data/CbmLitTrackParam.h"
13 #include "utils/CbmLitMath.h"
14 #include "utils/CbmLitMatrixMath.h"
15 
17  450.; // z coordinate [cm] a
19  0.00354; // energy lost constant [GeV
21  1e-6; // minimum propagati
23  25.; // maximum distan
24 
25 
29 }
30 
32 
35  CbmLitTrackParam* parOut,
36  litfloat zOut,
37  std::vector<litfloat>* F) {
38  *parOut = *parIn;
39  return Extrapolate(parOut, zOut, F);
40 }
41 
43  litfloat zOut,
44  std::vector<litfloat>* F) {
45  litfloat zIn = par->GetZ();
47 
48  if (zIn >= zStart && zOut >= zStart) {
49  return fLineExtrapolator->Extrapolate(par, zOut, F);
50  } else if (zIn < zStart && zOut < zStart) {
51  return fRK4Extrapolator->Extrapolate(par, zOut, F);
52  } else if (zOut > zIn && zIn < zStart && zOut > zStart) {
53  std::vector<litfloat> F1(36), F2(36);
54  LitStatus result;
55  if (F != NULL) {
56  result = fRK4Extrapolator->Extrapolate(par, zStart, &F1);
57  } else {
58  result = fRK4Extrapolator->Extrapolate(par, zStart, NULL);
59  }
60  if (result == kLITERROR) {
61  return result;
62  } else {
63  LitStatus result1;
64  if (F != NULL) {
65  result1 = fLineExtrapolator->Extrapolate(par, zOut, &F2);
66  } else {
67  result1 = fLineExtrapolator->Extrapolate(par, zOut, NULL);
68  }
69  if (F != NULL && result1 == kLITSUCCESS) { Mult36(F2, F1, *F); }
70  return result1;
71  };
72  } else if (zOut < zIn && zIn > zStart && zOut < zStart) {
73  std::vector<litfloat> F1(36), F2(36);
74  LitStatus result;
75  if (F != NULL) {
76  result = fLineExtrapolator->Extrapolate(par, zStart, &F1);
77  } else {
78  result = fLineExtrapolator->Extrapolate(par, zStart, NULL);
79  }
80  if (result == kLITERROR) {
81  return result;
82  } else {
83  LitStatus result1;
84  if (F != NULL) {
85  result1 = fRK4Extrapolator->Extrapolate(par, zOut, &F2);
86  } else {
87  result1 = fRK4Extrapolator->Extrapolate(par, zOut, NULL);
88  }
89  if (F != NULL && result1 == kLITSUCCESS) { Mult36(F2, F1, *F); }
90  return result1;
91  }
92  }
93 
94  return kLITSUCCESS;
95 }
CbmLitTrackParam.h
Data class for track parameters.
litfloat
double litfloat
Definition: CbmLitFloat.h:15
lit::CbmLitDefaultSettings::MAXIMUM_TGEO_NAVIGATION_DISTANCE
static const litfloat MAXIMUM_TGEO_NAVIGATION_DISTANCE
Definition: CbmLitDefaultSettings.h:24
lit::CbmLitDefaultSettings::MINIMUM_PROPAGATION_DISTANCE
static const litfloat MINIMUM_PROPAGATION_DISTANCE
Definition: CbmLitDefaultSettings.h:22
CbmLitCleverTrackExtrapolator.h
"Clever" track extrapolation.
CbmLitTrackParam
Data class for track parameters.
Definition: CbmLitTrackParam.h:29
lit::CbmLitDefaultSettings::ENERGY_LOSS_CONST
static const litfloat ENERGY_LOSS_CONST
Definition: CbmLitDefaultSettings.h:20
CbmLitDefaultSettings.h
CbmLitCleverTrackExtrapolator::~CbmLitCleverTrackExtrapolator
virtual ~CbmLitCleverTrackExtrapolator()
Destructor.
Definition: CbmLitCleverTrackExtrapolator.cxx:31
CbmLitCleverTrackExtrapolator::fRK4Extrapolator
TrackExtrapolatorPtr fRK4Extrapolator
Definition: CbmLitCleverTrackExtrapolator.h:49
CbmLitCleverTrackExtrapolator::Extrapolate
virtual LitStatus Extrapolate(const CbmLitTrackParam *parIn, CbmLitTrackParam *parOut, litfloat zOut, std::vector< litfloat > *F)
Inherited from CbmLitTrackExtrapolator.
Definition: CbmLitCleverTrackExtrapolator.cxx:34
kLITSUCCESS
@ kLITSUCCESS
Definition: CbmLitEnums.h:24
CbmLitToolFactory::CreateTrackExtrapolator
static TrackExtrapolatorPtr CreateTrackExtrapolator(const string &name)
Create track extrapolation tool by name.
Definition: CbmLitToolFactory.cxx:42
CbmLitEnums.h
Define enumerations used in littrack.
CbmLitTrackExtrapolator.h
Interface for track extrapolation algorithm.
CbmLitTrackParam::GetZ
litfloat GetZ() const
Definition: CbmLitTrackParam.h:55
CbmLitCleverTrackExtrapolator::CbmLitCleverTrackExtrapolator
CbmLitCleverTrackExtrapolator()
Constructor.
Definition: CbmLitCleverTrackExtrapolator.cxx:26
CbmLitMath.h
kLITERROR
@ kLITERROR
Definition: CbmLitEnums.h:25
CbmLitCleverTrackExtrapolator::fLineExtrapolator
TrackExtrapolatorPtr fLineExtrapolator
Definition: CbmLitCleverTrackExtrapolator.h:48
lit::CbmLitDefaultSettings::LINE_EXTRAPOLATION_START_Z
static const litfloat LINE_EXTRAPOLATION_START_Z
Definition: CbmLitDefaultSettings.h:18
CbmLitMatrixMath.h
Mult36
bool Mult36(const std::vector< litfloat > &a, const std::vector< litfloat > &b, std::vector< litfloat > &c)
Definition: CbmLitMatrixMath.cxx:278
LitStatus
LitStatus
Definition: CbmLitEnums.h:23