oliskir created page: isotropicandpolynomialfitters authored by Oliver Kirsebom's avatar Oliver Kirsebom
# Description # Description
This project contains 1 prebuilt executable to create hit patterns (Hitpattern) and 2 prebuilt executables to determine the geometry of your setup (IsotropicFitter and PolynomialFitter) based on two different fitting routines implemented in AUSAlib. Besides fitting the hit patterns, the programs also generate nice graphical output. The plots can either be outputted to a file or shown directly using ROOT's batch mode. This project contains:
# Usage
Syntax for the geometry fitters:
```
./IsotropicFitter [options] -d setup_file -i input_file -n detector_name -p hitpattern
./PolynomialFitter [options] -d setup_file -i input_file -n detector_name -p hitpattern
```
The syntax for the program to generate hit patterns is slightly different. Type ``.\Hitpattern -h`` to see required and optional input arguments.
# Options
| Option | Name | Example |
| :-- | :--- | :------------ |
| d | Setup json file | ``-d setup.json`` |
| i | Input file containing hitpatterns | ``-i hitpatterns.root`` |
| n | Name of the detector to be calibrated | ``-n DSSSD1`` |
| p | Name of the hitpattern histogram in the input file | ``-p chits_DSSD1`` |
| o | Outputs the plot to a file. It can either be a pdf or root file. | ``-o output.pdf``|
| V | Outputs the full minimazation report | ``-V``|
| a | The isotropic fitter supports three fitting schemes: (N)eyman, (P)earson or (L)ikelihoodRatio. (IsotropicFitter only!) | ``-a L``|
| z | Fixes the local normal component when using the Isotropic fitter. (IsotropicFitter only!) | ``-z``|
* 1 prebuilt executable to create hit patterns: [Hitpattern]()
* 2 prebuilt executables to determine the geometry of your setup based on near-isotropic source data: [IsotropicFitter](https://git.kern.phys.au.dk/ausa/GeometryFitter/wikis/isotropicandpolynomialfitters) and [PolynomialFitter](https://git.kern.phys.au.dk/ausa/GeometryFitter/wikis/isotropicandpolynomialfitters)
* 1 prebuilt executable to determine the geometry of your setup based on Rutherford-scattering data: [RutherFitter]()
# Error estimateion # Usage
The fits are performed in the local coordinate systems of the detectors. The fit thus give an error estimate in the local x, y and z direction, corresponding to global the `c=up.Cross(n)`, `up` and `n` directions. The transformation matrix from a point in the global coordinate system to a point in the local detector coordinate system is given as
![matrix](/uploads/2ceea14209403953e63695a490e38bbc/matrix.png)
Note that this will transform coordinates between the two system with a coinciding orego, but since we are interested in the error this will suffice for us. The reverse transformation is simply the inverse. From error propagation we can now calculate the covariance matrix on the coordinates in the global coordinate system as inv(A)*V*inv(A)^T. However, the inverse A is simply the transpose and we thus get A^T *V*A. The errors reported is the square root of the diagonal of this propagated error.
* Step 1: Use [Hitpattern]() to generate hit patterns for all DSSDs in your setup
* Step 2: Feed the hit pattern to one of the 3 Fitters () to determine the position of the DSSDs
\ No newline at end of file