alcap-org/g4sim — pull request #44 by AndrewEdmonds11 (2014-10-09 13:17:05+00:00)
Title: Ae add turtle mode

So I've finally (after some tricky trigonometry) managed to get the Turtle data into g4sim.

The data was given to us was in the form of a text file with histograms of x, y, x' and y', where x and y are the positions in the x,y plane and x' and y' are the angles between the z axis and the x(y) projection of the direction vector. Note that x' and y' are very small since we are firing along the z-axis.

To use:
- run the script ```scripts/MakeTURTLEInput.C``` which will generate a ROOT file called TURTLE_fits.root that contain the fits to the TURTLE data
- set ```DirectionMode``` and ```PositionMode`` to ```turtle``` and make sure that ```ThetaMode``` and ```PhiMode``` are disabled.
- run g4sim

Here are some plots showing that it works:

The fits:
![gausfit_xangle](https://cloud.githubusercontent.com/assets/1848575/4576570/6969f516-4fb4-11e4-98c3-6c3c916d77a9.png)
![gausfit_xposition](https://cloud.githubusercontent.com/assets/1848575/4576571/69708a52-4fb4-11e4-9775-aa544a0eb196.png)
![gausfit_yposition](https://cloud.githubusercontent.com/assets/1848575/4576569/69676724-4fb4-11e4-92b8-aaf9fa43387a.png)

NB the y' fit is just a uniform distribution between -150 and 150 mrad.

Here is the McTruth data from g4sim:
![g4sim_output_xangle](https://cloud.githubusercontent.com/assets/1848575/4576776/68336b80-4fb6-11e4-89bf-f2fa0f1ceea0.png)
I realise now that this looks like it's mirrored so I will try and fix this before merging.

![g4sim_output_xposition](https://cloud.githubusercontent.com/assets/1848575/4576778/6836e5c6-4fb6-11e4-9b62-9c7b8dae87d5.png)
![g4sim_output_yangle](https://cloud.githubusercontent.com/assets/1848575/4576775/6830f5a8-4fb6-11e4-9be9-471742173618.png)
![g4sim_output_yposition](https://cloud.githubusercontent.com/assets/1848575/4576777/683641de-4fb6-11e4-8d97-66d55e773975.png)

Once I fix that x' value then I'll merge this in and close issue #43.