- for(i=0;i<3;++i) {
- vect[i]=pos[i];
- dir[i]=mom[i];
- }
-
- t = fGener->PropagateCylinder(vect,dir,fGener->RadMax(),fGener->ZMax());
-
- if(step) {
- fTotAbso += step/absl;
- fTotRadl += step/radl;
- fTotGcm2 += step*dens;
-// Int_t copy;
-// Int_t id = gMC->CurrentVolID(copy);
-// char* vol = gMC->VolName(id);
-// printf("\n %f %f %f %f %s %f ", fTotRadl, vect[0], vect[1], vect[2], vol, t);
- }
+ for(i=0;i<3;++i) {
+ vect[i]=pos[i];
+ dir[i]=mom[i];
+ }
+
+ t = fGener->PropagateCylinder(vect,dir,fGener->RadMax(),fGener->ZMax());
+
+ if(step) {
+ fTotAbso += step/absl;
+ fTotRadl += step/radl;
+ fTotGcm2 += step*dens;
+ }
+
+
+ } else {
+ if (fDebug) {
+//
+// Geometry debugging
+// Fly back and compare volume sequence
+//
+ if (fStepsBackward < fStepsForward) {
+ AliDebugVolume* tmp = (AliDebugVolume*) (*fVolumesBwd)[fStepsBackward];
+ if (tmp->IsEqual(vol, copy)) {
+// return;
+ }
+ }
+
+ fStepsBackward--;
+
+ if (fStepsBackward < 0) {
+ gMC->StopTrack();
+ if (fErrorCondition) {
+ //
+ // Dump volume sequence in case of error
+ //
+ printf("\n Dumping Volume Sequence:");
+ printf("\n ==============================================");
+
+ for (i = fStepsForward-1; i>=0; i--)
+ {
+ AliDebugVolume* tmp1 = (AliDebugVolume*) (*fVolumesFwd)[i];
+ AliDebugVolume* tmp2 = (AliDebugVolume*) (*fVolumesBwd)[i];
+
+ printf("\n Volume Fwd: %3d: %5s (%3d) step: %12.5e (x,y,z) (%12.5e %12.5e %12.5e) status: %9s\n"
+ , i,
+ tmp1->GetName(), tmp1->CopyNumber(), tmp1->Step(), tmp1->X(), tmp1->Y(), tmp1->Z(), tmp1->Status());
+
+ printf("\n Volume Bwd: %3d: %5s (%3d) step: %12.5e (x,y,z) (%12.5e %12.5e %12.5e) status: %9s\n"
+ , i,
+ tmp2->GetName(), tmp2->CopyNumber(), tmp2->Step(), tmp2->X(), tmp2->Y(), tmp2->Z(), tmp2->Status());
+
+ printf("\n ............................................................................\n");
+ }
+ printf("\n ==============================================\n");
+ }
+ fVolumesFwd->Delete();
+ fVolumesBwd->Delete();
+ fStepBack = 0;
+ fStepsForward = 0;
+ fStepsBackward = 0;
+ fErrorCondition = 0;
+ return;
+ }
+
+ TClonesArray &lvols = *fVolumesBwd;
+ new(lvols[fStepsBackward]) AliDebugVolume(vol,copy,step,pos[0], pos[1], pos[2], status);
+
+ AliDebugVolume* tmp = (AliDebugVolume*) (*fVolumesFwd)[fStepsBackward];
+ if (! (tmp->IsEqual(vol, copy)) && (!fErrorCondition))
+ {
+ printf("\n Problem at (x,y,z): %d %f %f %f, volumes: %s %s step: %f\n",
+ fStepsBackward, pos[0], pos[1], pos[2], tmp->GetName(), vol, step);
+ fErrorCondition = 1;
+ }
+ } // Debug
+ } // bwd/fwd