AbsMaterialInterface implementation for use with ROOT's TGeoManager.
More...
#include <TGeoMaterialInterface.h>
|
bool | initTrack (double posX, double posY, double posZ, double dirX, double dirY, double dirZ) override |
| Initialize the navigator at given position and with given direction. More...
|
|
Material | getMaterialParameters () override |
|
double | findNextBoundary (const RKTrackRep *rep, const M1x7 &state7, double sMax, bool varField=true) override |
| Make a step (following the curvature) until step length sMax or the next boundary is reached. More...
|
|
virtual void | setDebugLvl (unsigned int lvl=1) |
|
AbsMaterialInterface implementation for use with ROOT's TGeoManager.
Definition at line 35 of file TGeoMaterialInterface.h.
◆ findNextBoundary()
double findNextBoundary |
( |
const RKTrackRep * |
rep, |
|
|
const M1x7 & |
state7, |
|
|
double |
sMax, |
|
|
bool |
varField = true |
|
) |
| |
|
overridevirtual |
Make a step (following the curvature) until step length sMax or the next boundary is reached.
After making a step to a boundary, the position has to be beyond the boundary, i.e. the current material has to be that beyond the boundary. The actual step made is returned.
Implements AbsMaterialInterface.
Definition at line 70 of file TGeoMaterialInterface.cc.
75 const double delta(1.E-2);
76 const double epsilon(1.E-1);
80 M1x7 state7, oldState7;
81 oldState7 = stateOrig;
83 int stepSign(sMax < 0 ? -1 : 1);
87 const unsigned maxIt = 300;
91 gGeoManager->FindNextBoundary(fabs(sMax) - s);
92 double safety = gGeoManager->GetSafeDistance();
93 double slDist = gGeoManager->GetStep();
101 double step = slDist;
104 debugOut <<
" safety = " << safety <<
"; step, slDist = " << step <<
"\n";
108 Exception exc(
"TGeoMaterialInterface::findNextBoundary ==> maximum number of iterations exceeded",__LINE__,__FILE__);
114 if (s + safety > fabs(sMax)) {
116 debugOut <<
" next boundary is further away than sMax \n";
117 return stepSign*(s + safety);
121 if (slDist < delta) {
123 debugOut <<
" very close to the boundary -> return"
124 <<
" stepSign*(s + slDist) = "
125 << stepSign <<
"*(" << s + slDist <<
")\n";
126 return stepSign*(s + slDist);
135 rep->RKPropagate(state7,
nullptr, SA, stepSign*(s + step), varField);
139 double dist2 = (pow(state7[0] - oldState7[0], 2)
140 + pow(state7[1] - oldState7[1], 2)
141 + pow(state7[2] - oldState7[2], 2));
143 double maxDeviation2 = 0.25*(step*step - dist2);
146 && maxDeviation2 > epsilon*epsilon) {
155 step = std::max(step / 2, safety);
157 gGeoManager->PushPoint();
158 bool volChanged =
initTrack(state7[0], state7[1], state7[2],
159 stepSign*state7[3], stepSign*state7[4],
166 gGeoManager->PopPoint();
172 if (step <= safety) {
174 debugOut <<
" step <= safety, return stepSign*(s + step) = " << stepSign*(s + step) <<
"\n";
175 return stepSign*(s + step);
180 step = std::max(step / 2, safety);
186 gGeoManager->PopDummy();
188 gGeoManager->FindNextBoundary(fabs(sMax) - s);
189 safety = gGeoManager->GetSafeDistance();
190 slDist = gGeoManager->GetStep();
200 debugOut <<
" safety = " << safety <<
"; step, slDist = " << step <<
"\n";
◆ initTrack()
bool initTrack |
( |
double |
posX, |
|
|
double |
posY, |
|
|
double |
posZ, |
|
|
double |
dirX, |
|
|
double |
dirY, |
|
|
double |
dirZ |
|
) |
| |
|
overridevirtual |
The documentation for this class was generated from the following files: