CbmRoot
Loading...
Searching...
No Matches
CbmLitCleverTrackExtrapolator.cxx
Go to the documentation of this file.
1/* Copyright (C) 2009-2017 GSI/JINR-LIT, Darmstadt/Dubna
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Andrey Lebedev [committer] */
4
11
12#include "../cbm/base/CbmLitToolFactory.h"
14#include "base/CbmLitEnums.h"
17#include "utils/CbmLitMath.h"
19
21const litfloat lit::CbmLitDefaultSettings::ENERGY_LOSS_CONST = 0.00354; // energy lost constant [GeV
24
25
31
33
35 litfloat zOut, std::vector<litfloat>* F)
36{
37 *parOut = *parIn;
38 return Extrapolate(parOut, zOut, F);
39}
40
42{
43 litfloat zIn = par->GetZ();
45
46 if (zIn >= zStart && zOut >= zStart) {
47 return fLineExtrapolator->Extrapolate(par, zOut, F);
48 }
49 else if (zIn < zStart && zOut < zStart) {
50 return fRK4Extrapolator->Extrapolate(par, zOut, F);
51 }
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 }
58 else {
59 result = fRK4Extrapolator->Extrapolate(par, zStart, NULL);
60 }
61 if (result == kLITERROR) {
62 return result;
63 }
64 else {
65 LitStatus result1;
66 if (F != NULL) {
67 result1 = fLineExtrapolator->Extrapolate(par, zOut, &F2);
68 }
69 else {
70 result1 = fLineExtrapolator->Extrapolate(par, zOut, NULL);
71 }
72 if (F != NULL && result1 == kLITSUCCESS) {
73 Mult36(F2, F1, *F);
74 }
75 return result1;
76 };
77 }
78 else if (zOut < zIn && zIn > zStart && zOut < zStart) {
79 std::vector<litfloat> F1(36), F2(36);
80 LitStatus result;
81 if (F != NULL) {
82 result = fLineExtrapolator->Extrapolate(par, zStart, &F1);
83 }
84 else {
85 result = fLineExtrapolator->Extrapolate(par, zStart, NULL);
86 }
87 if (result == kLITERROR) {
88 return result;
89 }
90 else {
91 LitStatus result1;
92 if (F != NULL) {
93 result1 = fRK4Extrapolator->Extrapolate(par, zOut, &F2);
94 }
95 else {
96 result1 = fRK4Extrapolator->Extrapolate(par, zOut, NULL);
97 }
98 if (F != NULL && result1 == kLITSUCCESS) {
99 Mult36(F2, F1, *F);
100 }
101 return result1;
102 }
103 }
104
105 return kLITSUCCESS;
106}
"Clever" track extrapolation.
Define enumerations used in littrack.
LitStatus
Definition CbmLitEnums.h:29
@ kLITERROR
Definition CbmLitEnums.h:31
@ kLITSUCCESS
Definition CbmLitEnums.h:30
double litfloat
Definition CbmLitFloat.h:19
bool Mult36(const std::vector< litfloat > &a, const std::vector< litfloat > &b, std::vector< litfloat > &c)
Interface for track extrapolation algorithm.
Data class for track parameters.
virtual LitStatus Extrapolate(const CbmLitTrackParam *parIn, CbmLitTrackParam *parOut, litfloat zOut, std::vector< litfloat > *F)
Inherited from CbmLitTrackExtrapolator.
static TrackExtrapolatorPtr CreateTrackExtrapolator(const string &name)
Create track extrapolation tool by name.
Data class for track parameters.
litfloat GetZ() const
static const litfloat LINE_EXTRAPOLATION_START_Z
static const litfloat ENERGY_LOSS_CONST
static const litfloat MINIMUM_PROPAGATION_DISTANCE
static const litfloat MAXIMUM_TGEO_NAVIGATION_DISTANCE