Problem 1435 - explanation of units conversion for error matrix
Summary: explanation of units conversion for error matrix
Status: RESOLVED FIXED
Alias: None
Product: Examples/Extended
Classification: Unclassified
Component: errorpropagation (show other problems)
Version: 9.4
Hardware: All All
: P5 trivial
Assignee: Pedro.Arce
URL:
Depends on:
Blocks:
 
Reported: 2013-02-01 23:38 CET by janstar1122
Modified: 2013-04-05 14:40 CEST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description janstar1122 2013-02-01 23:38:26 CET
Hi,
I'm trying to make sense out of error propagation matrix produced by G4E.
From the manual I gather that for the surface representation, the intrinsic units are GeV & cm - what differs form intrinsic G4 units.

I constructed very simply test-bed with 2mm thick Be plane place din a vacuum and throw at it a 30 MeV electron in 0.01T B-filed (negligible small).

2m Be are equivalent to 05.7e-4 radiation length, so the expected angular scattering should be of 0.034 rad , what translates to 1.02 MeV error of the transverse momentum after 2 mm of Be.

I got the following answer, the error on Py~Pz is of 35 MeV - it is 30x too large.
 
surfErr: |P| (MeV) 29.25  +/- 0.56  rsigP=0.019
surfErr: 1/|P| (GeV) 34.19  +/- 0.65 
surfErr: Py (MeV)  0.18  +/- 35.02
surfErr: Pz (MeV)  0.00  +/- 35.02
surfErr: Y   (mm)  0.19  +/- 0.07
surfErr: Z   (mm)  20.00  +/- 0.02
at surf X location   (mm)  62.00 

It makes no sense to me. Below is my code projecting freeTrajectory error matrix to surface trajectory. (it was added to your example). I make there units conversion in each print-line.
Can you help me to make sense out of it?
Thanks
Jan Balewski

 if(1){
    G4cout << " $$$ PROPAGATION ENDED : SurfTraj" << G4endl;
    // project traj to surf representation
    const G4Vector3D Vdir=G4Vector3D(0,1,0),  Wdir=G4Vector3D(0,0,1);

    G4ErrorSurfaceTrajState g4SurfTraj(g4ErrorTrajState,Vdir,Wdir);
    // extract current state info
    G4Point3D posEnd = g4SurfTraj.GetPosition();
    G4Normal3D momEnd = g4SurfTraj.GetMomentum();
    G4ErrorTrajErr errorEnd2 = g4SurfTraj.GetError();
    
    G4cout << " Position: " << posEnd << " particle:"<< g4SurfTraj.GetParticleType ()<<G4endl
           << " Momentum: " << momEnd << G4endl
           << " Error [1/p, Pv, Pw, v, w] (GeV,cm): " << errorEnd2 << G4endl; 
    
    double rsigP=   sqrt(errorEnd2(1,1))* (momEnd.mag()/GeV);
    printf("surfErr: |P| (MeV) %.2f  +/- %.2f  rsigP=%.3f\n",momEnd.mag()/MeV,rsigP*momEnd.mag()/MeV ,rsigP);
    printf("surfErr: 1/|P| (GeV) %.2f  +/- %.2f \n",1./momEnd.mag()*GeV,sqrt(errorEnd2(1,1)));

    printf("surfErr: Py (MeV)  %.2f  +/- %.2f\n",momEnd.y()/MeV,sqrt(errorEnd2(2,2))*GeV/MeV);
    printf("surfErr: Pz (MeV)  %.2f  +/- %.2f\n",momEnd.z()/MeV,sqrt(errorEnd2(3,3))*GeV/MeV);

    printf("surfErr: Y   (mm)  %.2f  +/- %.2f\n",posEnd.y()/mm,sqrt(errorEnd2(4,4))*cm/mm);
    printf("surfErr: Z   (mm)  %.2f  +/- %.2f\n",posEnd.z()/mm,sqrt(errorEnd2(5,5))*cm/mm);
    printf("at surf X location   (mm)  %.2f \n",posEnd.x()/mm);
  }
Comment 1 janstar1122 2013-02-02 02:23:45 CET
Hi,
forgive me if my speculation is wrong, but I thing there is a bug in  constructor (or in the writeup)
 G4ErrorSurfaceTrajState g4SurfTraj(g4ErrorTrajState,Vdir,Wdir);

Looks to me that for 

 G4ErrorTrajErr errorEnd2 = g4SurfTraj.GetError();

the 2nd & 3rd diagonal elements are not squares of the error of PV and PW in Ge^2 but rather they are 
relative errors of  PV/P and PW/P w/o units.

Once I change to this interpretation of errorEnd2 and printed:

   printf("surfErr:fix Py (MeV)  %.2f  +/- %.2f\n",momEnd.y()/MeV,sqrt(errorEnd2(2,2))*momEnd.mag()/MeV);
    printf("surfErr:fix Pz (MeV)  %.2f  +/- %.4g\n",momEnd.z()/MeV,sqrt(errorEnd2(3,3))*momEnd.mag()/MeV);

I see reasonable values of error of both transverse components in the order of 1 MeV for my concrete example of 30 MeV electron passing through 2mm of Be.

So in short in constructor   G4ErrorSurfaceTrajState  multiplication by momentum magnitude is probably lost.

Perhaps it helps
Jan