Munken created page: GeoDWIM authored by Jesper Halkjær's avatar Jesper Halkjær
...@@ -7,6 +7,62 @@ This project contains: ...@@ -7,6 +7,62 @@ This project contains:
* 1 prebuilt executable to determine the geometry of your setup based on Rutherford-scattering data: [RutherFitter](rutherfitter) * 1 prebuilt executable to determine the geometry of your setup based on Rutherford-scattering data: [RutherFitter](rutherfitter)
# Usage # Usage
As in put files you can either use sorted data or a file containing hit patterns. If you use sorted data, a hit patterns file will be generated.
* Step 1: Use (OPTIONAL) [Hitpattern](hitpattern) to generate hit patterns for all DSSDs in your setup
* Step 2: Feed the sorted data or generated hit patterns to one of the Fitters ([GeoDWIM](GeoDWIM), [IsotropicFitter](isotropicandpolynomialfitters), [PolynomialFitter](isotropicandpolynomialfitters) or [RutherFitter](rutherfitter)) to determine the position of the DSSDs
* Step 1: Use [Hitpattern](hitpattern) to generate hit patterns for all DSSDs in your setup # Example
* Step 2: Feed the generated hit patterns to one of the Fitters ([GeoDWIM](GeoDWIM), [IsotropicFitter](isotropicandpolynomialfitters), [PolynomialFitter](isotropicandpolynomialfitters) or [RutherFitter](rutherfitter)) to determine the position of the DSSDs
\ No newline at end of file As an example let's try to use the GeoDWIM to fit a setup to some data. Consider a directory with some sorted files and a setup:
```bash
setup.json sorted_data.root
```
The geometric fitters use hitpatterns to do their fitting. The generation of these are, however, now built into the fitter. That is we just need to supply the sorted data:
```bash
GeoDWIM -d setup.json -i sorted_data.root -n DSSD1
```
This yields the following output
```bash
Generating hit pattern in file sorted_data_hitpattern.root. Use this as input file next time for increased speed!
Could not recognize ''. Defaults to NEYMAN!
Original position: (40, 0, 40)
Doing first pass fitting with poly fitter
First position: (39.605, -0.0634049, 40.395) ± (0.25292, 0.0144567, 0.25292)
Estimating n with u and c locked with iso fitter
Second position: (40.1001, -0.0634049, 40.8901) ± (0.989724, 0, 0.989724)
Estimating full position with iso fitter
Full position: (40.0856, 0.0511174, 40.906) ± (1.01587, 0.406424, 1.04641)
Estimating center position with poly fitter
Poly position: (40.0856, 0.0511166, 40.9059) ± (1.01587, 0.406423, 1.04641)
```
Now, the first line here indicates that we used Sorted data, and not already generated data. If we do a `ls` now we see that there has been generated a new file
```bash
setup.json sorted_data_hitpattern.root sorted_data.root
```
As it says, we can now use this if we want to redo the calibration. If the sorted data was a huge file, it will be much faster to use the newly generated hit patterrns, since we do not need to loop all the data. We can then issue
```bash
GeoDWIM -d setup.json -i sorted_data_hitpattern.root -n DSSD1
```
This yields almost excatly the same output as before, just without the first line
```bash
Could not recognize ''. Defaults to NEYMAN!
Original position: (40, 0, 40)
Doing first pass fitting with poly fitter
First position: (39.605, -0.0634049, 40.395) ± (0.25292, 0.0144567, 0.25292)
Estimating n with u and c locked with iso fitter
Second position: (40.1001, -0.0634049, 40.8901) ± (0.989724, 0, 0.989724)
Estimating full position with iso fitter
Full position: (40.0856, 0.0511174, 40.906) ± (1.01587, 0.406424, 1.04641)
Estimating center position with poly fitter
Poly position: (40.0856, 0.0511166, 40.9059) ± (1.01587, 0.406423, 1.04641)
```
## Naming convention for hit patterns
As you maybe noticed, we did not specify the name of the hit pattern with the `-p` flag. When we do not do this, the geometric fitter assumes the naming convention of the [HitPatternPlotter](). This is what in internally used when sorted data is used, or the Hitpattern command line tool is ued. If we instead had generated the hit patterns in some analysis, we would need to specify where in the root file to find the correct hitpattern. This also means that an equivalent call would be
```bash
GeoDWIM -d setup.json -i sorted_data_hitpattern.root -n DSSD1 -p chits/hit_DSSD1
```