Create Setup authored by Erik Asbjørn Mikkelsen Jensen's avatar Erik Asbjørn Mikkelsen Jensen
This page is about specifying a detector setup for use within AUSALIB.
The details of the experimental setup should be specified within a json file. This file should contain an entry for each detector specifying how that detector will appear within an unpacked data file. Additionally, details of the detector position and orientation can be provided. Additional files containing energy calibrations and detector specific properties, such as dead layer thickness and strip numbers, can also be provided.
This approach permits these parameters to be stored in an easy to read, plain text format. Furthermore, adjusting these parameters does not require any code recompilation. In cases where the detector geometry changes between runs, the exact same analysis code may be applied by simply providing different setup files as arguments.
The setup files are intended to be used both at the sorting and analysis stages.
__Please note: All lengths should be given as mm__
Example
=========================
The following shows an example of a setup json file.
```json
{
"name" : "IFA003",
"detectors" : [
{
"name" : "SU",
"file" : "S3_332um.json",
"calibration" : "S3_332um.cal",
"position" : {"x":"0mm", "y":"0mm", "z":"-43mm"},
"normal" : {"x":"0mm", "y":"0mm", "z":"-1mm"},
"orientation" : {"x":"0mm", "y":"1mm", "z":"0mm"},
"frontMapping" : {
"prefix" : "SU_S",
"multiplicity" : "",
"segment" : "I",
"adc" : "_E",
"tdc" : "-DEAD-"
},
"backMapping" : {
"prefix" : "SU_R",
"multiplicity" : "",
"segment" : "I",
"adc" : "_E",
"tdc" : "_T"
}
}
],
"signals" : [
"CLOCK",
"CHARGE",
"ACCEPTED",
"TOTAL"
]
}
```
It consists of three things:
1. `detectors` an array of detector objects.
2. `signals` an array of names of scaler values.
3. `name` optional value. Just nice to keep track of things.
Detectors
---------
Each detector must have the following properties
* `name` The detector name
* `position` The central position of the detector.
* `normal` The normal vector to the detector surface.
* `orientation` A vector describing the orientation of the detector. The interpretation of this is detector specific.
* `file` A file containing detector specific information such a strip numbers, dead layer thickness etc.
* (optional) `calibration` A file containing calibration as two column separated by space, offset first.
* (optional) `frontmapping/backmapping/mapping` Json object describing mapping from ROOT file to detector. Front/back is for dssd.
`position`, `direction`, `orientation` can be specified in three different coordinate systems
* Cartesian: `{"x":"40mm", "y":"0mm", "z":"-40mm"}`
* Cylindrical: `{"r":"40mm", "z":"-43mm", "phi":"45deg"}`
* Spherical: `{"r":"40mm", "theta":"20deg", "phi":"1.57rad"}`
__Mapping__
Name of the branches in the ROOT tree which contains the following information:
* `multiplicity` How many entries are the for this detector side.
* `segment` Which strip/detector segment have been hit
* `adc` ADC values
* `tdc` TDC values
* (optional) `prefix` This value is appended to the others.
The special value `-DEAD-` signal that this information is _not_ available.
Detector file
------------------
The following information is expected to be present in the detector file.
__All detectors__
* `type` What type of detector this is: Valid values are
* SquareDSSD
* RoundDSSD
* Clover
* SquareSSSD
* Pad
__All DSSD__
* `nFrontStrips` Number of front strips.
* `nBackStrips` Number of back strips.
* `reverseFront` true/false if the strip ordering should be reversed.
* `reverseBack` true/false if the strip ordering should be reversed.
* (optional) `solidAngle` path to csv file with solid angle for each pixel. If not provided approximate values is calculated.
![both](/uploads/3a11f75b24274dae3f7eccf70a90c5bc/both.png)
__All silicon__
* `thickness` Thickness of detector (optional default = 0)
* `deadLayer` Thickness of deadlayer on front side of detector (optional default = 0)
* `deadLayer_back` Thickness of deadlayer on back side of detector (optional default = 0)
__RoundDSSD (S3)__
* `ringWidth` Width of a single ring.
* `ringPitch` Width of ring + ring gap.
* `innerRadius` Inner radius of active area.
__SquareDSSD (W1)__
* `stripWidth` Width of a single strip.
* `stripPitch` Width of single strip + strip gap.
* `gridThickness` Thickness of W1 grid specified as string. Default : "0.5um"
* `gridWidth` Width of W1 grid on a single pixel specified as string. Default : "90um"
* `backContactThickness` Thickness of contact on back of W1 specified as string. Default : "0.2um"
__Clover__
* `nSegments` Number of segments the clover have.
__SquareSSSD__
* `nSegments` Number of segments the single sided detector have.
__Pad__
* `upLength` Size in mm along orientation vector
* `transverseLength` Size in mm along n x orientation vector.
Loading setup
==============
This small example shows how to load setup file
```c++
#include <ausa/json/IO.cpp>
using namespace AUSA;
int main() {
std::shared_ptr<Setup> s = JSON::readSetupFromJSON("setup/setup.json");
}
```
If in doubt
==============
[json/IO.cpp](https://gitlab.au.dk/ausa/ausalib/blob/master/source/json/IO.cpp) contains the implementation.