22 double RadiusTargetEff = RadiusTarget;
23 double Z_DistTargetEff = Z_DistTarget;
24 double Z_CentrTargetEff = Z_CentrTarget;
25 if(TrackerOnly==
true){
33 double acceptR = RadiusTargetEff + stepSize;
34 double acceptZ = Z_DistTargetEff + stepSize;
35 bool continuePropagation =
true;
36 while (continuePropagation){
38 if (
dY < 0. &&
tmpVy < -acceptR) continuePropagation =
false;
39 if (
dY >= 0. &&
tmpVy > acceptR) continuePropagation =
false;
41 if (std::fabs(
tmpVz - Z_CentrTargetEff) < acceptZ &&
rVxyTmp() < acceptR){
43 continuePropagation =
false;
45 if (continuePropagation)
updateTmp(stepSize);
51 double acceptR = RadiusTargetEff + stepSize;
52 double acceptZ = Z_DistTargetEff + stepSize;
53 bool continuePropagation =
true;
54 while (continuePropagation){
56 if (
dY < 0. &&
tmpVy < -acceptR) continuePropagation =
false;
57 if (
dY >= 0. &&
tmpVy > acceptR) continuePropagation =
false;
59 if (std::fabs(
tmpVz - Z_CentrTargetEff) < acceptZ &&
rVxyTmp() < acceptR){
61 continuePropagation =
false;
63 if (continuePropagation)
updateTmp(stepSize);
69 double acceptR = RadiusTargetEff + stepSize;
70 double acceptZ = Z_DistTargetEff + stepSize;
71 bool continuePropagation =
true;
72 while (continuePropagation){
74 if (
dY < 0. &&
tmpVy < -acceptR) continuePropagation =
false;
75 if (
dY >= 0. &&
tmpVy > acceptR) continuePropagation =
false;
77 if (std::fabs(
tmpVz - Z_CentrTargetEff) < acceptZ &&
rVxyTmp() < acceptR){
79 continuePropagation =
false;
81 if (continuePropagation)
updateTmp(stepSize);
87 double acceptR = RadiusTargetEff + stepSize;
88 double acceptZ = Z_DistTargetEff + stepSize;
89 bool continuePropagation =
true;
90 while (continuePropagation){
92 if (
dY < 0. &&
tmpVy < -acceptR) continuePropagation =
false;
93 if (
dY >= 0. &&
tmpVy > acceptR) continuePropagation =
false;
95 if (std::fabs(
tmpVz - Z_CentrTargetEff) < acceptZ &&
rVxyTmp() < acceptR){
97 continuePropagation =
false;
99 if (continuePropagation)
updateTmp(stepSize);
105 double acceptR = RadiusTargetEff + stepSize;
106 double acceptZ = Z_DistTargetEff + stepSize;
107 bool continuePropagation =
true;
108 while (continuePropagation){
110 if (
dY < 0. &&
tmpVy < -acceptR) continuePropagation =
false;
111 if (
dY >= 0. &&
tmpVy > acceptR) continuePropagation =
false;
113 if (std::fabs(
tmpVz - Z_CentrTargetEff) < acceptZ &&
rVxyTmp() < acceptR){
115 continuePropagation =
false;
117 if (continuePropagation)
updateTmp(stepSize);
123 double acceptR = RadiusTargetEff + stepSize;
124 double acceptZ = Z_DistTargetEff + stepSize;
125 bool continuePropagation =
true;
126 while (continuePropagation){
128 if (
dY < 0. &&
tmpVy < -acceptR) continuePropagation =
false;
129 if (
dY >= 0. &&
tmpVy > acceptR) continuePropagation =
false;
132 if (std::fabs(
tmpVz - Z_CentrTargetEff) < acceptZ &&
rVxyTmp() < acceptR){
134 continuePropagation =
false;
137 if (continuePropagation)
updateTmp(stepSize);
144 int nMat[6] = {0, 0, 0, 0, 0, 0};
148 if(TrackerOnly==
true){
152 bool continuePropagation =
true;
153 while (continuePropagation){
155 if (
dY < 0. &&
tmpVy < -acceptR) continuePropagation =
false;
156 if (
dY >= 0. &&
tmpVy > acceptR) continuePropagation =
false;
158 if (std::fabs(
Vz - Z_CentrTargetEff) < acceptZ &&
rVxy() < acceptR){
160 continuePropagation =
false;
162 if (continuePropagation)
update(stepSize);
170 double lPlug = double(nMat[
Plug])*stepSize;
171 double lWall = double(nMat[
Wall])*stepSize;
172 double lAir = double(nMat[
Air])*stepSize;
173 double lClay = double(nMat[
Clay])*stepSize;
174 double lRock = double(nMat[
Rock])*stepSize;
199 double L10E = log10(
E);
201 double A = (1.91514 + 0.254957*L10E)/1000.;
202 double B = (0.379763 + 1.69516*L10E - 0.175026*L10E*L10E)/1000000.;
205 double oldAbsMom =
absmom();
207 Px =
Px*newAbsMom/oldAbsMom;
208 Py =
Py*newAbsMom/oldAbsMom;
209 Pz =
Pz*newAbsMom/oldAbsMom;
213 double L10E = log10(Energy);
215 double A = (1.91514 + 0.254957*L10E)/1000.;
216 double B = (0.379763 + 1.69516*L10E - 0.175026*L10E*L10E)/1000000.;
218 double newEnergy = (Energy +
EPS)*
exp(-B*waterEquivalents) -
EPS;
219 double EnergyLoss = Energy - newEnergy;
232 return E_ug - (E_sf-dE);
237 double Px_in,
double Py_in,
double Pz_in,
238 double& Vx_up,
double& Vy_up,
double& Vz_up) {
242 Vx_up = Vx_in - dy*Px_in/
Py_in;
243 Vz_up = Vz_in - dy*Pz_in/
Py_in;
245 << Vy_up <<
" Vz_up=" << Vz_up << std::endl;
252 return std::fabs(
tmpVz);
307 double phiXZ = atan2(
Px,
Pz);
308 if (phiXZ < 0.) phiXZ = phiXZ +
TwoPi;
321 return std::fabs(
Vz);
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()
Exp< T >::type exp(const T &t)
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