Commit be61dc5d authored by Morag Jean Williams's avatar Morag Jean Williams
Browse files

Dealing with no set DUT parameter in modules ATLASpixEventLoader, Alignment, and BasicTracking.

parent 02ccd90c
......@@ -12,7 +12,7 @@ This module requires either another event loader of another detector type before
#### Parameters
* `inputDirectory`: Path to the directory containing the `.dat` file. This path should lead to the directory above the ALTASpix directory, as this string is added to the input directory in the module.
* `clockCycle`: Period of the clock used to count the trigger timestamps in, defaults to `25ns`
* `DUT`: Name of the DUT plane.
* `DUT`: Name of the DUT plane. The ATLASpix device is assumed to be the `DUT`.
#### Plots produced
* 2D Hit map
......
......@@ -32,10 +32,18 @@ Alignment::Alignment(Configuration config, std::vector<Detector*> detectors)
// Get alignment method:
alignmentMethod = m_config.get<int>("alignmentMethod");
if(m_config.has("detectorToAlign")) {
detectorToAlign = m_config.get<std::string>("detectorToAlign");
} else {
detectorToAlign = m_config.get<std::string>("DUT");
if(alignmentMethod == 1) {
if(m_config.has("detectorToAlign")) {
detectorToAlign = m_config.get<std::string>("detectorToAlign");
} else {
if(m_config.has("DUT")) {
detectorToAlign = m_config.get<std::string>("DUT");
} else {
LOG(ERROR) << "Alignment method 1 selected but neither 'detectorToAlign' nor 'DUT' parameters were set in "
"the config file.";
return;
}
}
}
if(alignmentMethod == 1) {
......@@ -400,7 +408,8 @@ void Alignment::finalise() {
string detectorID = detector->name();
// Do not align the reference plane
if(detectorID == m_config.get<std::string>("reference") || detectorID == m_config.get<std::string>("DUT")) {
if(detectorID == m_config.get<std::string>("reference") ||
(m_config.has("DUT") && detectorID == m_config.get<std::string>("DUT"))) {
continue;
}
......@@ -494,7 +503,7 @@ void Alignment::finalise() {
for(auto& detector : get_detectors()) {
// Do not align the reference plane
if(detector->name() == m_config.get<std::string>("reference") ||
detector->name() == m_config.get<std::string>("DUT")) {
(m_config.has("DUT") && detector->name() == m_config.get<std::string>("DUT"))) {
continue;
}
......
......@@ -10,7 +10,7 @@ This module uses the tracks produced by the `BasicTracking` module to align the
There are two methods available for alignment:
##### 1) Minimising the track chi^2
For each telescope detector except the reference plane, this method moves the detector, refits all of the tracks, and minimises the chi^2 of these new tracks. The parameters `detectorToAlign` and `DUT` are not used in this method as it automatically iterates through all telescope planes except the DUT.
For each telescope detector except the reference plane, this method moves the detector, refits all of the tracks, and minimises the chi^2 of these new tracks. The parameters `detectorToAlign` and `DUT` are not used in this method as it automatically iterates through all telescope planes except the DUT (if a DUT is present).
##### 2) Minimising the track (unbiased) residuals
For the detector specified by the `detectorToAlign` parameter, this method moves the detector, refits all the tracks, and minimises the unbiased residuals calculated from the track intercepts with the plane.
......@@ -50,7 +50,6 @@ For the `detectorToAlign` the following plots are produced when using `alignment
```toml
[Alignment]
alignmentMethod = 0
masked = "W0005_H03" #excluding the DUT from the alignment
number_of_tracks = 1000000
log_level = INFO
```
......
......@@ -25,9 +25,8 @@ void BasicTracking::initialise() {
trackAngleX = new TH1F("trackAngleX", "trackAngleX", 2000, -0.01, 0.01);
trackAngleY = new TH1F("trackAngleY", "trackAngleY", 2000, -0.01, 0.01);
// Loop over all Timepix3
// Loop over all planes
for(auto& detector : get_detectors()) {
// Check if they are a Timepix3
string detectorID = detector->name();
string name = "residualsX_" + detectorID;
......@@ -60,7 +59,7 @@ StatusCode BasicTracking::run(Clipboard* clipboard) {
// Output track container
Tracks* tracks = new Tracks();
// Loop over all Timepix3 and get clusters
// Loop over all planes and get clusters
bool firstDetector = true;
std::string seedPlane;
for(auto& detector : get_detectors()) {
......@@ -73,7 +72,7 @@ StatusCode BasicTracking::run(Clipboard* clipboard) {
} else {
// Store them
LOG(DEBUG) << "Picked up " << tempClusters->size() << " clusters from " << detectorID;
if(firstDetector && detectorID != m_config.get<std::string>("DUT")) {
if(firstDetector && (!m_config.has("DUT") || detectorID != m_config.get<std::string>("DUT"))) {
referenceClusters = tempClusters;
seedPlane = detector->name();
LOG(DEBUG) << "Seed plane is " << seedPlane;
......@@ -113,8 +112,10 @@ StatusCode BasicTracking::run(Clipboard* clipboard) {
for(auto& detectorID : detectors) {
// Check if the DUT should be excluded and obey:
if(excludeDUT && detectorID == m_config.get<std::string>("DUT")) {
continue;
if(m_config.has("DUT")) {
if(excludeDUT && detectorID == m_config.get<std::string>("DUT")) {
continue;
}
}
if(detectorID == seedPlane)
......@@ -241,6 +242,4 @@ Cluster* BasicTracking::getNearestCluster(long long int timestamp, Clusters clus
return bestCluster;
}
void BasicTracking::finalise() {
LOG(INFO) << "Found " << associatedClusters << " associated clusters for detector " << m_config.get<std::string>("DUT");
}
void BasicTracking::finalise() {}
......@@ -13,7 +13,7 @@ Clusters from the first plane in Z (named the seed plane) are related to cluster
* `spatialCutDUT`: Maximum spatial distance in the XY plane allowed between clusters for association for the DUT. Default value is `0.2mm`.
* `timingCutDUT`: Maximum time difference allowed between clusters for association for the DUT. Default value is `200ns`.
* `minHitsOnTrack`: Minium number of associated clusters needed to create a track, equivalent to the minimum number of planes required for each track. Default value is `6`.
* `excludeDUT`: Boolean to chose if the DUT plane is included in the track finding. In either case, the DUT clusters possibly associated with the track are saved. Default value is `true`.
* `excludeDUT`: Boolean to chose if the DUT plane is included in the track finding. Default value is `true`.
* `DUT`: Name of the DUT plane.
#### Plots produced
......@@ -38,8 +38,9 @@ For each detector the following plots are produced:
```toml
[BasicTracking]
minHitsOnTrack = 4
spatialCut = 0.3 #300um
timingCut = 0.0000002 #200ns
spatialCut = 300um
DUT = "W13_01"
timingCut = 200ns
excludeDUT = true
```
Parameters to be used in multiple modules can also be defined globally at the top of the configuration file. This is highly encouraged for parameters such as `DUT` and `reference`.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment