README for SurfaceChecker



History:
----------------------------------

19.Dec 05
- Code is now using GetPointOnSurface()
- Added new elliptic solid EllipticalCone
- Added Tet

26.July 05 
- Added support for segmented torus (fPhi,fPhiSegment)

25.July 05
- Sphere, Shell and other G4Sphere objects are now using the same 
  code of SurfacePoint generation.
- Added code for  
    * small shells: Q2Shell Q3Shell Q4Shell Q5Shell Q6Shell Q7Shell Q8Shell
    * special regular spheres: HalfSphere HollowSphere HalfHollowSphere

4.July 05
- Added Ellipsoid to the check

1.July 05
- SurfaceChecker supports now G4Sphere("aSphere",rmin,rmax,phi,dphi,theta,dtheta) without
  restricting the parameters.
- corrected error in the surface equation of the twisted tubs solid. (The edge of the hyperbolic
  surface was not compatible with the implementation in G4TwistedTubs).

31.May 05
- change in singlesolid.kumac: 
   added an argument in order to specifiy the name of 
   the hbook file directly, e.g
      PAW>>  exec singlesolid hbk/yourfile.hbk 
- corrected a misleading information in extract.pl

27.May 05
- change in testall.pl: additionally executes at the end the paw macro single.kumac 
                        the default number of events is set to 100000
- added a paw macro single.kumac:  
  analyses systematically all hbook files found in folder hbk ( hbk/run_cone_10000.hbk )
  and produces two plots
    - solid-full.ps  : comparing all solids in a full range    (1e-12 to 1e5 mm)
    - solid-zoom.ps  : comparing all solids in a reduced range (1e-12 to 1e-8 mm)
  Attention: only files respecting the naming rule run_solidname_nevents.hbk will be considered!
- added a paw macro singlesolid.kumac:
  Can be used to to the same analysis for one single file only. No naming rule for the bhook file.

23.May 05
- changed naming of general surface parameters (hbk only): now u,v insted of u,phi
- Detector is directly selectable from macro file for the following solids:
    Torus (360 deg only, test of outer surface)
    Box (one side only)
    Sphere (solid sphere, 360 deg)
    Tube (solid tub, 360 deg)
    Orb
    Cone
    TwistedTubs (test of hyperbolic surface ; all parameters free) 
    TwistedBox (test of 0deg side)
    TwistedTrd (test of 0deg side)
    TwistedTrap  (regular case: equal endcaps, alpha=0, phi=0, theta=0 ; test of 0deg side)
    TwistedTrap2 (equal endcaps ; test of 0deg side )
    TwistedTrap3 (general case ; test of 0deg side )
- Added testall.pl: a script to systematically test a list of solids with SurfaceChecker.
  Produces hbook files in folder hbk, eg. for 500 events and G4Box file will be named hbk/run_box_500.hbk

Author:
Oliver Link, Oliver.Link@cern.ch
Thu May 19 14:50:39 CEST 2005


SurfaceChecker
====================================

The following two steps have to be executed in order:

1) SurfaceChecker run1.mac > data/yourfile.data

   Comments:
   - in run1.mac: select your detector (Box, Torus, Cons, Sphere, Orb, TwistedTrap..)
   - run1.mac can be replaced by some longer tests,e.g. runLong.mac
   - runspecial.mac is used to save the random number at the end of 
     a given event. Restart with runSingle.mac at the previous random
     number position.
   - You have to redirect the output to a file in the directory
     "data", with the filename extension ".data". 

2) extract.pl
   
   This perl script parses the output file (located in the "data" 
   directory) and converts the information into a ntuple. The file will
   have the same name as your data file (e.g. yourfile.hbk) and will
   be stored in the directory "hbk".
   The format of the ntuple (with Id 1) is the following:

	 u,v :      general surface parameters
	 x,y,z:     generated (true) surface point in cartesian coordinates
	 px,py,pz:  vertex position in cartesian coordinates
	 dist:      (true) distance between vertex and intersection
	 vx,vy,vz:  momentum of particle at vertex
	 rx,ry,rz:  reconstructed intersection 
	 delta :    distance between reconstructed and true intersection
	 theta:     angle between momentum and surface normal at intersection
   