Commit 1daa491c authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Merge branch 'master' into docs

parents 38b1420e 7e95b788
......@@ -158,8 +158,7 @@ tst:telescope:
script:
- cd build/
- mkdir -p ../testing/data
- ctest -R test_timepix3tel --output-on-failure -j4
- ctest --output-on-failure -j4
############################
# Format and Lint Checking #
......
......@@ -235,41 +235,6 @@ void AnalysisDUT::initialise() {
-pitch_y / 2.,
pitch_y / 2.);
// Efficiency maps
title = "hPixelEfficiencyMap" + mod_axes + "efficiency";
hPixelEfficiencyMap = new TProfile2D("hPixelEfficiencyMap",
"hPixelEfficiencyMap;column;row;efficiency",
static_cast<int>(pitch_x),
-pitch_x / 2.,
pitch_x / 2.,
static_cast<int>(pitch_y),
-pitch_y / 2.,
pitch_y / 2.,
0,
1);
title = "hChipEfficiencyMap;column; row; efficiency";
hChipEfficiencyMap = new TProfile2D("hChipEfficiencyMap",
"hChipEfficiencyMap;column;row;efficiency",
m_detector->nPixels().X(),
0,
m_detector->nPixels().X(),
m_detector->nPixels().Y(),
0,
m_detector->nPixels().Y(),
0,
1);
title = "hGlobalEfficiencyMap;efficiency";
hGlobalEfficiencyMap = new TProfile2D("hGlobalEfficiencyMap",
"hGlobalEfficiencyMap;column;row;efficiency",
300,
-1.5 * m_detector->size().X(),
1.5 * m_detector->size().X(),
300,
-1.5 * m_detector->size().Y(),
1.5 * m_detector->size().Y(),
0,
1);
residualsTime = new TH1F("residualsTime", "residualsTime;time_{track}-time_{hit} [ns];#entries", 20000, -1000, +1000);
hTrackCorrelationX =
......@@ -421,6 +386,7 @@ StatusCode AnalysisDUT::run(std::shared_ptr<Clipboard> clipboard) {
continue;
}
}
has_associated_cluster = true;
// Check distance between track and cluster
ROOT::Math::XYZPoint intercept = track->intercept(assoc_cluster->global().z());
......@@ -519,14 +485,11 @@ StatusCode AnalysisDUT::run(std::shared_ptr<Clipboard> clipboard) {
rmsyvsxmym->Fill(xmod, ymod, yabsdistance);
rmsxyvsxmym->Fill(xmod, ymod, fabs(sqrt(xdistance * xdistance + ydistance * ydistance)));
}
hAssociatedTracksGlobalPosition->Fill(globalIntercept.X(), globalIntercept.Y());
hAssociatedTracksLocalPosition->Fill(m_detector->getColumn(localIntercept), m_detector->getRow(localIntercept));
}
hAssociatedTracksGlobalPosition->Fill(globalIntercept.X(), globalIntercept.Y());
hAssociatedTracksLocalPosition->Fill(m_detector->getColumn(localIntercept), m_detector->getRow(localIntercept));
// For pixels, only look at the ROI:
if(is_within_roi) {
hPixelEfficiencyMap->Fill(xmod, ymod, has_associated_cluster);
if(!has_associated_cluster) {
hUnassociatedTracksGlobalPosition->Fill(globalIntercept.X(), globalIntercept.Y());
}
num_tracks++;
}
......
......@@ -53,10 +53,6 @@ namespace corryvreckan {
TProfile2D* npxvsxmym;
TH2F *npx1vsxmym, *npx2vsxmym, *npx3vsxmym, *npx4vsxmym;
TProfile2D* hPixelEfficiencyMap;
TProfile2D* hChipEfficiencyMap;
TProfile2D* hGlobalEfficiencyMap;
TH1F* hTrackCorrelationX;
TH1F* hTrackCorrelationY;
TH1F* hTrackCorrelationPos;
......
......@@ -60,7 +60,7 @@ void EventLoaderEUDAQ2::initialise() {
hPixelTimes_long = new TH1F("hPixelTimes_long", title.c_str(), 3e6, 0, 3e3);
title = ";pixel raw values;# events";
hPixelRawValues = new TH1F("hPixelRawValues;", title.c_str(), 1024, 0, 1024);
hPixelRawValues = new TH1F("hPixelRawValues", title.c_str(), 1024, 0, 1024);
title = "Pixel Multiplicity per Corry Event;# pixels;# events";
hPixelMultiplicity = new TH1F("pixelMultiplicity", title.c_str(), 1000, 0, 1000);
......@@ -220,7 +220,7 @@ Event::Position EventLoaderEUDAQ2::is_within_event(std::shared_ptr<Clipboard> cl
std::shared_ptr<eudaq::StandardEvent> evt) const {
// Check if this event has timestamps available:
if(evt->GetTimeBegin() == 0) {
if(evt->GetTimeBegin() == 0 && evt->GetTimeEnd() == 0) {
LOG(DEBUG) << evt->GetDescription() << ": Event has no timestamp, comparing trigger IDs";
// If there is no event defined yet, there is little we can do:
......@@ -443,6 +443,7 @@ StatusCode EventLoaderEUDAQ2::run(std::shared_ptr<Clipboard> clipboard) {
LOG(DEBUG) << "Is within current Corryvreckan event, storing data";
// Store data on the clipboard
auto new_pixels = get_pixel_data(event_, plane_id);
m_hits += new_pixels->size();
pixels->insert(pixels->end(), new_pixels->begin(), new_pixels->end());
}
......@@ -513,3 +514,8 @@ StatusCode EventLoaderEUDAQ2::run(std::shared_ptr<Clipboard> clipboard) {
LOG(DEBUG) << "Finished Corryvreckan event";
return StatusCode::Success;
}
void EventLoaderEUDAQ2::finalise() {
LOG(INFO) << "Found " << m_hits << " hits in the data.";
}
......@@ -55,6 +55,11 @@ namespace corryvreckan {
*/
StatusCode run(std::shared_ptr<Clipboard> clipboard);
/**
* @brief [Finalise this module]
*/
void finalise();
private:
/**
* @brief Read and return the next decoded StandardEvent (smallest possible granularity) from timesorted buffer
......@@ -106,6 +111,8 @@ namespace corryvreckan {
Matrix<std::string> m_adjust_event_times;
int m_buffer_depth;
size_t m_hits = 0;
// EUDAQ file reader instance to retrieve data from
eudaq::FileReaderUP reader_;
......
......@@ -10,6 +10,7 @@ OnlineMonitor::OnlineMonitor(Configuration config, std::vector<std::shared_ptr<D
: Module(std::move(config), std::move(detectors)) {
canvasTitle = m_config.get<std::string>("canvas_title", "Corryvreckan Testbeam Monitor");
updateNumber = m_config.get<int>("update", 200);
ignoreAux = m_config.get<bool>("ignore_aux", true);
// Set up overview plots:
canvas_overview = m_config.getMatrix<std::string>("overview",
......@@ -20,14 +21,12 @@ OnlineMonitor::OnlineMonitor(Configuration config, std::vector<std::shared_ptr<D
// Set up individual plots for the DUT
canvas_dutplots = m_config.getMatrix<std::string>("dut_plots",
{{"EventLoaderCLICpix2/%DUT%/hitMap", "colz"},
{"EventLoaderCLICpix2/%DUT%/hitMapDiscarded", "colz"},
{"EventLoaderCLICpix2/%DUT%/pixelToT"},
{"EventLoaderCLICpix2/%DUT%/pixelToA"},
{"EventLoaderCLICpix2/%DUT%/pixelCnt", "log"},
{"EventLoaderCLICpix2/%DUT%/pixelMultiplicity", "log"},
{"AnalysisDUT/clusterChargeAssociated"},
{"AnalysisDUT/associatedTracksVersusTime"}});
{{"EventLoaderEUDAQ2/%DUT%/hitmap", "colz"},
{"EventLoaderEUDAQ2/%DUT%/hPixelTimes"},
{"EventLoaderEUDAQ2/%DUT%/hPixelRawValues"},
{"EventLoaderEUDAQ2/%DUT%/pixelMultiplicity", "log"},
{"AnalysisDUT/%DUT%/clusterChargeAssociated"},
{"AnalysisDUT/%DUT%/associatedTracksVersusTime"}});
canvas_tracking = m_config.getMatrix<std::string>("tracking",
{{"Tracking4D/trackChi2"},
{"Tracking4D/trackAngleX"},
......@@ -220,6 +219,11 @@ void OnlineMonitor::AddPlots(std::string canvas_name, Matrix<std::string> canvas
} else {
LOG(DEBUG) << "Adding plot " << name << " for all detectors.";
for(auto& detector : get_detectors()) {
// Ignore AUX detectors
if(ignoreAux && detector->isAuxiliary()) {
continue;
}
AddHisto(canvas_name,
std::regex_replace(name, std::regex("%DETECTOR%"), detector->name()),
plot.back(),
......
......@@ -51,6 +51,7 @@ namespace corryvreckan {
// Member variables
int eventNumber;
int updateNumber;
bool ignoreAux;
std::string canvasTitle;
......
......@@ -13,8 +13,8 @@ The displayed plots and their source can be configured via the framework configu
Here, each canvas is configured via a matrix containing the path of the plot and its plotting options in each row, e.g.
```toml
DUTPlots = [["Clicpix2EventLoader/hitMap", "colz"],
["Clicpix2EventLoader/pixelCnt", "log"]]
DUTPlots = [["EventLoaderEUDAQ2/%DUT%/hitmap", "colz"],
["EventLoaderEUDAQ2/%DUT%/hPixelRawValues", "log"]]
```
The allowed plotting options comprise all drawing options offered by ROOT.
......@@ -26,24 +26,25 @@ Several keywords can be used in the plot path, which are parsed and interpreted
* `%DUT%`: This keyword is replaced by the vale of the `DUT` configuration key of the framework.
* `%REFERENCE%`: This keyword is replaced by the vale of the `reference` configuration key of the framework.
The "corryvreckan" namespace i not required to be added to the plot path.
The "corryvreckan" namespace is not required to be added to the plot path.
### Parameters
* `update`: Number of events after which to update, defaults to `500`.
* `canvas_title`: Title of the GUI window to be shown, defaults to `Corryvreckan Testbeam Monitor`. This parameter can be used to e.g. display the current run number in the window title.
* `ignore_aux`: With this boolean variable set, detectors with `auxiliary` roles are ignored and none of their histograms are added to the UI. Defaults to `true`.
* `overview`: List of plots to be placed on the "Overview" canvas of the online monitor. The list of plots created in the default configuration is listed below.
* `dut_plots`: List of plots to be placed on the "DUTPlots" canvas of the online monitor. By default, this canvas is empty and should be customized for the respective DUT.
* `hitmaps`: List of plots to be placed on the "HitMaps" canvas of the online monitor. By default, this canvas displays `TestAlgorithm/hitmap_%DETECTOR%` for all detectors.
* `dut_plots`: List of plots to be placed on the "DUTPlots" canvas of the online monitor. By default, this canvas contains plots collected from the `EventLoaderEUDAQ2` as well as the `AnalysisDUT` modules for the each configured DUT. This canvas should be customized for the respective DUT.
* `hitmaps`: List of plots to be placed on the "HitMaps" canvas of the online monitor. By default, this canvas displays `TestAlgorithm/%DETECTOR%/hitmap` for all detectors.
* `tracking`: List of plots to be placed on the "Tracking" canvas of the online monitor. The list of plots created in the default configuration is listed below.
* `residuals`: List of plots to be placed on the "Residuals" canvas of the online monitor. By default, this canvas displays `BasicTracking/residualsX_%DETECTOR%` for all detectors.
* `correlation_x`: List of plots to be placed on the "CorrelationX" canvas of the online monitor. By default, this canvas displays `TestAlgorithm/correlationX_%DETECTOR%` for all detectors.
* `correlation_y`: List of plots to be placed on the "CorrelationY" canvas of the online monitor. By default, this canvas displays `TestAlgorithm/correlationY_%DETECTOR%` for all detectors.
* `correlation_x2d`: List of plots to be placed on the "CorrelationX2D" canvas of the online monitor. By default, this canvas displays `TestAlgorithm/correlationX_2Dlocal_%DETECTOR%` for all detectors.
* `correlation_y2d`: List of plots to be placed on the "CorrelationY2D" canvas of the online monitor. By default, this canvas displays `TestAlgorithm/correlationY_2Dlocal_%DETECTOR%` for all detectors.
* `charge_distributions`: List of plots to be placed on the "ChargeDistributions" canvas of the online monitor. By default, this canvas displays `Timepix3Clustering/clusterTot_%DETECTOR%` for all detectors.
* `event_times`: List of plots to be placed on the "EventTimes" canvas of the online monitor. By default, this canvas displays `TestAlgorithm/eventTimes_%DETECTOR%` for all detectors.
* `residuals`: List of plots to be placed on the "Residuals" canvas of the online monitor. By default, this canvas displays `Tracking4D/%DETECTOR%/residualsX` for all detectors.
* `correlation_x`: List of plots to be placed on the "CorrelationX" canvas of the online monitor. By default, this canvas displays `TestAlgorithm/%DETECTOR%/correlationX` for all detectors.
* `correlation_y`: List of plots to be placed on the "CorrelationY" canvas of the online monitor. By default, this canvas displays `TestAlgorithm/%DETECTOR%/correlationY` for all detectors.
* `correlation_x2d`: List of plots to be placed on the "CorrelationX2D" canvas of the online monitor. By default, this canvas displays `TestAlgorithm/%DETECTOR%/correlationX_2Dlocal` for all detectors.
* `correlation_y2d`: List of plots to be placed on the "CorrelationY2D" canvas of the online monitor. By default, this canvas displays `TestAlgorithm/%DETECTOR%/correlationY_2Dlocal` for all detectors.
* `charge_distributions`: List of plots to be placed on the "ChargeDistributions" canvas of the online monitor. By default, this canvas displays `Clustering4D/%DETECTOR%/clusterCharge` for all detectors.
* `event_times`: List of plots to be placed on the "EventTimes" canvas of the online monitor. By default, this canvas displays `TestAlgorithm/%DETECTOR%/eventTimes` for all detectors.
### Plots produced
Overview canvas:
......@@ -61,12 +62,10 @@ Tracking canvas:
```toml
[OnlineMonitor]
update = 200
dut_plots = [["Clicpix2EventLoader/hitMap", "colz"],
[Clicpix2EventLoader/hitMapDiscarded", "colz"],
[Clicpix2EventLoader/pixelToT"],
[Clicpix2EventLoader/pixelToA"],
[Clicpix2EventLoader/pixelCnt", "log"],
[Clicpix2EventLoader/pixelMultiplicity", "log"],
[DUTAnalysis/clusterTotAssociated"],
[DUTAnalysis/associatedTracksVersusTime"]]
dut_plots = [["EventLoaderEUDAQ2/%DUT%/hitmap", "colz"],
["EventLoaderEUDAQ2/%DUT%/hPixelTimes"],
["EventLoaderEUDAQ2/%DUT%/hPixelRawValues"],
["EventLoaderEUDAQ2/%DUT%/pixelMultiplicity", "log"],
["AnalysisDUT/clusterChargeAssociated"],
["AnalysisDUT/associatedTracksVersusTime"]]
```
......@@ -22,6 +22,7 @@ BASE_TARGET = 'data/'
DATASETS = {
'timepix3tel_ebeam120': 'a196166ea38a14bbf00c2165a9aee37c291f1201ed39fd313cc6b3f25dfa225d',
'timepix3tel_dut150um_ebeam120_sim': 'e6de5f9fff6a2a284dc462a27073a76fdfd6a41436bdcec392e3f78276e9dbc6',
'mimosa26tel_desy_5400MeV': '74313bddcc4ce2d8c727414390a9daedd87384a0e1eb4ee98a03b35db3289c76',
}
def sha256(path):
......
[TLU_0]
number_of_pixels = 0,0
orientation = 0deg,0deg,0deg
orientation_mode = "xyz"
pixel_pitch = 0um, 0um
position = 0mm,0mm,0mm
resolution = 0um,0um
type = "TLU"
[MIMOSA26_0]
mask_file = "mask_MIMOSA26_0.txt"
number_of_pixels = 1152,576
orientation = -0.0317992deg,-0.0306532deg,-0.356494deg
orientation_mode = "xyz"
pixel_pitch = 18.4um,18.4um
position = -605.953um,-12.574um,0
resolution = 4um,4um
type = "MIMOSA26"
[MIMOSA26_1]
mask_file = "mask_MIMOSA26_1.txt"
number_of_pixels = 1152,576
orientation = 1.57283deg,0.297652deg,-0.214515deg
orientation_mode = "xyz"
pixel_pitch = 18.4um,18.4um
position = -860.897um,280.298um,152mm
resolution = 4um,4um
type = "MIMOSA26"
[MIMOSA26_2]
mask_file = "mask_MIMOSA26_2.txt"
number_of_pixels = 1152,576
orientation = -0.0336899deg,0.0812454deg,-0.00343775deg
orientation_mode = "xyz"
pixel_pitch = 18.4um,18.4um
position = -1.10334mm,99.171um,305mm
resolution = 4um,4um
role = "reference"
type = "MIMOSA26"
[MIMOSA26_3]
mask_file = "mask_MIMOSA26_3.txt"
number_of_pixels = 1152,576
orientation = 2.08156deg,1.19691deg,0.00699009deg
orientation_mode = "xyz"
pixel_pitch = 18.4um,18.4um
position = -2.58205mm,285.418um,348mm
resolution = 4um,4um
type = "MIMOSA26"
[MIMOSA26_4]
mask_file = "mask_MIMOSA26_4.txt"
number_of_pixels = 1152,576
orientation = -2.53133deg,-0.753898deg,-0.354489deg
orientation_mode = "xyz"
pixel_pitch = 18.4um,18.4um
position = -2.3413mm,173.727um,498mm
resolution = 4um,4um
type = "MIMOSA26"
[MIMOSA26_5]
mask_file = "mask_MIMOSA26_5.txt"
number_of_pixels = 1152,576
orientation = -3.04516deg,-0.866713deg,0.0708176deg
orientation_mode = "xyz"
pixel_pitch = 18.4um,18.4um
position = -2.24809mm,202.137um,585mm
resolution = 4um,4um
type = "MIMOSA26"
[Timepix3_0]
number_of_pixels = 256,256
orientation = 0,0,0
orientation_mode = "xyz"
pixel_pitch = 55um,55um
position = 0,0,666mm
resolution = 10um,10um
role = "dut"
type = "Timepix3"
p 5 466
p 7 410
p 9 14
p 17 338
p 19 261
p 21 36
p 22 305
p 22 545
p 32 462
p 33 251
p 33 389
p 36 18
p 38 285
p 40 292
p 46 286
p 50 344
p 51 441
p 58 235
p 59 114
p 60 273
p 60 326
p 61 381
p 62 452
p 69 517
p 71 508
p 72 270
p 80 173
p 81 371
p 82 146
p 86 43
p 91 4
p 93 335
p 100 128
p 100 557
p 101 398
p 103 80
p 103 241
p 108 560
p 109 172
p 110 491
p 111 214
p 116 452
p 118 68
p 124 336
p 125 132
p 125 133
p 129 299
p 138 324
p 140 209
p 143 95
p 144 95
p 146 92
p 149 453
p 151 261
p 154 67
p 155 67
p 157 286
p 159 186
p 159 434
p 163 23
p 165 280
p 167 423
p 170 343
p 170 344
p 176 108
p 179 506
p 179 507
p 182 346
p 185 100
p 192 551
p 196 70
p 199 298
p 199 416
p 202 19
p 203 42
p 205 178
p 205 179
p 206 311
p 206 312
p 206 313
p 206 314
p 207 312
p 207 313
p 208 119
p 212 8
p 217 405
p 217 556
p 219 170
p 219 235
p 224 336
p 225 336
p 225 499
p 233 124
p 236 43
p 240 21
p 247 81
p 249 146
p 249 478
p 250 146
p 251 545
p 253 518
p 254 518
p 259 197
p 259 198
p 260 198
p 262 138
p 265 148
p 265 149
p 266 149
p 267 90
p 277 420
p 278 420
p 278 443
p 281 513
p 282 483
p 286 108
p 286 328
p 291 397
p 294 461
p 296 334
p 300 158
p 301 129
p 303 101
p 304 101
p 315 518
p 318 29
p 322 146
p 324 186
p 329 196
p 334 157
p 334 541
p 341 538
p 341 539
p 342 492
p 350 335
p 353 187
p 357 568
p 363 231
p 364 214
p 365 214
p 366 89
p 372 98
p 372 318
p 373 318
p 373 319
p 376 533
p 385 255
p 388 504
p 389 504
p 389 505
p 391 209
p 393 111
p 393 112
p 395 75
p 399 114
p 399 296
p 401 29
p 405 396
p 407 387
p 407 388
p 408 387
p 410 252
p 411 395
p 412 395
p 413 478
p 415 216
p 421 486
p 433 104
p 435 130
p 437 1
p 446 78
p 452 77
p 458 16
p 458 48
p 458 217
p 458 218
p 458 358
p 463 288
p 467 125
p 469 560
p 473 544
p 474 347
p 477 147
p 480 469
p 483 131
p 485 10
p 489 556
p 490 97
p 493 280
p 497 367
p 497 368
p 500 8
p 505 296
p 508 93
p 508 461
p 515 289
p 515 432
p 516 32
p 516 33
p 518 284
p 529 146
p 529 147
p 531 171
p 536 263
p 540 143
p 541 143
p 541 300
p 548 538
p 550 97
p 553 265
p 553 549
p 554 403
p 554 404
p 555 362
p 556 105
p 558 409
p 559 114
p 559 345
p 560 113
p 561 214
p 562 308
p 563 308
p 563 309
p 569 192
p 571 109
p 571 193
p 571 251
p 571 312
p 571 313
p 572 108
p 572 109
p 572 110
p 572 251
p 572 263
p 573 108
p 573 109
p 573 366
p 577 422
p 596 150
p 597 135
p 601 363
p 601 364
p 601 490
p 602 62
p 604 136
p 604 310
p 604 311
p 605 13
p 605 310
p 605 311
p 605 414
p 606 258
p 606 259
p 609 553
p 611 213
p 611 307
p 619 111
p 621 254
p 624 301
p 629 135
p 630 378
p 632 548
p 633 267
p 635 257
p 646 192
p 646 193
p 648 119
p 654 156