4 int id,
double px,
double py,
double pz,
double e,
double m,
double vx,
double vy,
double vz,
double t0) {
33 double RadiusTargetEff = RadiusTarget;
34 double Z_DistTargetEff = Z_DistTarget;
35 double Z_CentrTargetEff = Z_CentrTarget;
44 double acceptR = RadiusTargetEff + stepSize;
45 double acceptZ = Z_DistTargetEff + stepSize;
46 bool continuePropagation =
true;
47 while (continuePropagation) {
49 if (
dY < 0. &&
tmpVy < -acceptR)
50 continuePropagation =
false;
51 if (
dY >= 0. &&
tmpVy > acceptR)
52 continuePropagation =
false;
54 if (std::fabs(
tmpVz - Z_CentrTargetEff) < acceptZ &&
rVxyTmp() < acceptR) {
56 continuePropagation =
false;
58 if (continuePropagation)
65 double acceptR = RadiusTargetEff + stepSize;
66 double acceptZ = Z_DistTargetEff + stepSize;
67 bool continuePropagation =
true;
68 while (continuePropagation) {
70 if (
dY < 0. &&
tmpVy < -acceptR)
71 continuePropagation =
false;
72 if (
dY >= 0. &&
tmpVy > acceptR)
73 continuePropagation =
false;
75 if (std::fabs(
tmpVz - Z_CentrTargetEff) < acceptZ &&
rVxyTmp() < acceptR) {
77 continuePropagation =
false;
79 if (continuePropagation)
86 double acceptR = RadiusTargetEff + stepSize;
87 double acceptZ = Z_DistTargetEff + stepSize;
88 bool continuePropagation =
true;
89 while (continuePropagation) {
91 if (
dY < 0. &&
tmpVy < -acceptR)
92 continuePropagation =
false;
93 if (
dY >= 0. &&
tmpVy > acceptR)
94 continuePropagation =
false;
96 if (std::fabs(
tmpVz - Z_CentrTargetEff) < acceptZ &&
rVxyTmp() < acceptR) {
98 continuePropagation =
false;
100 if (continuePropagation)
107 double acceptR = RadiusTargetEff + stepSize;
108 double acceptZ = Z_DistTargetEff + stepSize;
109 bool continuePropagation =
true;
110 while (continuePropagation) {
112 if (
dY < 0. &&
tmpVy < -acceptR)
113 continuePropagation =
false;
114 if (
dY >= 0. &&
tmpVy > acceptR)
115 continuePropagation =
false;
117 if (std::fabs(
tmpVz - Z_CentrTargetEff) < acceptZ &&
rVxyTmp() < acceptR) {
119 continuePropagation =
false;
121 if (continuePropagation)
128 double acceptR = RadiusTargetEff + stepSize;
129 double acceptZ = Z_DistTargetEff + stepSize;
130 bool continuePropagation =
true;
131 while (continuePropagation) {
133 if (
dY < 0. &&
tmpVy < -acceptR)
134 continuePropagation =
false;
135 if (
dY >= 0. &&
tmpVy > acceptR)
136 continuePropagation =
false;
138 if (std::fabs(
tmpVz - Z_CentrTargetEff) < acceptZ &&
rVxyTmp() < acceptR) {
140 continuePropagation =
false;
142 if (continuePropagation)
149 double acceptR = RadiusTargetEff + stepSize;
150 double acceptZ = Z_DistTargetEff + stepSize;
151 bool continuePropagation =
true;
152 while (continuePropagation) {
154 if (
dY < 0. &&
tmpVy < -acceptR)
155 continuePropagation =
false;
156 if (
dY >= 0. &&
tmpVy > acceptR)
157 continuePropagation =
false;
160 if (std::fabs(
tmpVz - Z_CentrTargetEff) < acceptZ &&
rVxyTmp() < acceptR) {
162 continuePropagation =
false;
165 if (continuePropagation)
173 int nMat[6] = {0, 0, 0, 0, 0, 0};
181 bool continuePropagation =
true;
182 while (continuePropagation) {
184 if (
dY < 0. &&
tmpVy < -acceptR)
185 continuePropagation =
false;
186 if (
dY >= 0. &&
tmpVy > acceptR)
187 continuePropagation =
false;
189 if (std::fabs(
Vz - Z_CentrTargetEff) < acceptZ &&
rVxy() < acceptR) {
191 continuePropagation =
false;
193 if (continuePropagation)
202 double lPlug = double(nMat[
Plug]) * stepSize;
203 double lWall = double(nMat[
Wall]) * stepSize;
204 double lAir = double(nMat[
Air]) * stepSize;
205 double lClay = double(nMat[
Clay]) * stepSize;
206 double lRock = double(nMat[
Rock]) * stepSize;
233 double L10E = log10(
E);
235 double A = (1.91514 + 0.254957 * L10E) / 1000.;
236 double B = (0.379763 + 1.69516 * L10E - 0.175026 * L10E * L10E) / 1000000.;
239 double oldAbsMom =
absmom();
241 Px =
Px * newAbsMom / oldAbsMom;
242 Py =
Py * newAbsMom / oldAbsMom;
243 Pz =
Pz * newAbsMom / oldAbsMom;
247 double L10E = log10(
Energy);
249 double A = (1.91514 + 0.254957 * L10E) / 1000.;
250 double B = (0.379763 + 1.69516 * L10E - 0.175026 * L10E * L10E) / 1000000.;
263 return E_ug - (E_sf - dE);
281 std::cout <<
"Vx_up=" << Vx_up <<
" Vy_up=" << Vy_up <<
" Vz_up=" << Vz_up << std::endl;
288 return std::fabs(
tmpVz);
339 double phiXZ = atan2(
Px,
Pz);
341 phiXZ = phiXZ +
TwoPi;
void propagate(double ElossScaleFac, double RadiusTarget, double Z_DistTarget, double Z_CentrTarget, bool TrackerOnly, bool MTCCHalf)
const double Z_DistTracker
double Eloss(double waterEquivalents, double Energy)
void updateTmp(double stepSize)
void subtractEloss(double waterEquivalents)
double WaterEquivalents()
void update(double stepSize)
const double SurfaceOfEarth
double deltaEmin(double Energy)
void SurfProj(double Vx_in, double Vy_in, double Vz_in, double Px_in, double Py_in, double Pz_in, double &Vx_up, double &Vy_up, double &Vz_up)
int inMat(double vx, double vy, double vz, double PlugVx=PlugOnShaftVx, double PlugVz=PlugOnShaftVz, double ClayWidth=DefaultClayWidth)
void create(int id, double px, double py, double pz, double e, double m, double vx, double vy, double vz, double t0)
const double RadiusTracker