Commit Graph
226 Commits
Author SHA1 Message Date
hinger_v 14bfc19b6a Rework RemapAlgorithm.hpp according to comments
Build on RHEL9 / build (push) Successful in 2m36s
Build on RHEL8 / build (push) Successful in 3m9s
Run tests using data on local RHEL8 / build (push) Successful in 3m53s
- Add assert to flip
- Only one SensorPlacement for strixel_to_pixel_maps
- Pass order_map as NDView to ApplyRemap

Additional:
- Check output.shape() matches order_map.shape (correct buffer allocation)
- Chash nrows and ncols
- pass NDViews by value (copying is cheap and it makes the intent more clear that it only takes a snapshot of the arrays
2026-07-16 19:21:09 +02:00
hinger_v 60c4d77627 Rename: alignROIs -> rebaseROI 2026-07-16 12:22:26 +02:00
hinger_v 98385902df Merge branch 'main' into dev/strixels/remap_simple 2026-07-16 11:05:30 +02:00
hinger_v afd92ac457 Bugfix: Separate Rotation and Routing 2026-07-16 11:04:43 +02:00
4aadb6f7f0 refactor: hide Minuit2 from aare's public API (#331)
Build on RHEL9 / build (push) Successful in 3m13s
Build on RHEL8 / build (push) Successful in 3m52s
Run tests using data on local RHEL8 / build (push) Successful in 3m56s
Build on local RHEL8 / build (push) Successful in 2m45s
- Move Chi2.hpp from include/aare/ to src/ (private)
- Pimpl on FitModel<Model>: MnUserParameters/MnStrategy behind opaque
src/FitModelImpl.hpp, no Minuit2 includes in public headers
- Move fit_pixel/fit_3d bodies to Fit.cpp with explicit instantiations
for all 8 models; drop FCN template param from public API
- CMake: aare::Minuit2 wrapped in $<BUILD_INTERFACE:...> (hidden from
exported targets, same pattern as lmfit), MINUIT2_INSTALL OFF, Chi2.hpp
removed from PUBLICHEADERS
- Update python bindings and benchmark callsites accordingly

---------

Co-authored-by: Erik Fröjdh <erik.frojdh@psi.ch>
Co-authored-by: Alice <alice.mazzoleni@psi.ch>
2026-07-02 16:04:22 +02:00
mazzol_aandGitHub b4686e6b85 added moench05 defs (#333)
Build on RHEL9 / build (push) Successful in 2m37s
Build on RHEL8 / build (push) Successful in 3m16s
Run tests using data on local RHEL8 / build (push) Successful in 3m56s
Build on local RHEL8 / build (push) Successful in 2m42s
- add moench05 chip/chiptestboard defs
2026-06-26 17:43:06 +02:00
mazzol_aandGitHub 982419149d Merge branch 'main' into dev/treat_errors_as_warnings
Build on RHEL9 / build (push) Successful in 2m50s
Build on RHEL8 / build (push) Successful in 3m30s
Run tests using data on local RHEL8 / build (push) Successful in 3m53s
2026-06-15 14:44:13 +02:00
mazzol_a 0a4c4f5ec1 change AxisType to float for pixelhistogram tests 2026-06-15 14:27:26 +02:00
mazzol_a 559c822a02 change AxisType to float for pixelhistogram tests
Build on RHEL9 / build (push) Successful in 2m29s
Build on RHEL8 / build (push) Successful in 3m40s
Run tests using data on local RHEL8 / build (push) Successful in 3m58s
2026-06-15 14:22:24 +02:00
mazzol_a b71fcb1d1a fixed apple clang warning 2026-06-15 14:03:36 +02:00
mazzol_a 85833cebb3 fixed unsued warning in PedestalTrackingHistogram 2026-06-15 11:52:44 +02:00
Erik FröjdhandGitHub b4b28fc9e0 len() and pedestal subtraction (#328)
Build on RHEL9 / build (push) Successful in 2m57s
Build on RHEL8 / build (push) Successful in 3m28s
Run tests using data on local RHEL8 / build (push) Successful in 4m0s
Build on local RHEL8 / build (push) Successful in 2m44s
Collection of small improvements in usability: 

- NDView works for large arrays
- Direct subtraction of Pedestal from np.array
- len() support for python bindings of files
2026-06-15 11:38:06 +02:00
ee7503082d Dev/matterhorn decoder (#324)
Build on RHEL9 / build (push) Successful in 2m49s
Build on RHEL8 / build (push) Successful in 3m35s
Run tests using data on local RHEL8 / build (push) Successful in 4m1s
Build on local RHEL8 / build (push) Successful in 3m9s
- reshape image directly in decoder such that first dimension is num
counters
- take into account chip artefact in decoder.

---------

Co-authored-by: Erik Fröjdh <erik.frojdh@psi.ch>
2026-06-11 15:04:20 +02:00
Erik FröjdhandGitHub 2041c7310a Fixed usage of fmt::format and fmt::print for C++20 (#323)
Build on RHEL8 / build (push) Successful in 3m5s
Build on RHEL9 / build (push) Successful in 3m4s
Run tests using data on local RHEL8 / build (push) Successful in 3m57s
Build on local RHEL8 / build (push) Successful in 2m41s
With C++20 `fmt::print(s)` expects a compile time format string and
otherwise fails complaining about consteval. To get runtime formatting
use `fmt::print(fmt::runtime(s))`
2026-06-11 08:01:03 +02:00
hinger_v e70392aafe Merge branch 'main' into dev/strixels/remap_simple
Build on RHEL9 / build (push) Successful in 2m51s
Build on RHEL8 / build (push) Successful in 3m13s
Run tests using data on local RHEL8 / build (push) Successful in 4m2s
2026-06-10 13:33:46 +02:00
Erik FröjdhandGitHub 17d04083a7 Bugfix: NDArary/NDView overflow in calculating number of elements (#322)
Build on RHEL9 / build (push) Successful in 2m38s
Build on RHEL8 / build (push) Successful in 3m10s
Run tests using data on local RHEL8 / build (push) Successful in 3m59s
Build on local RHEL8 / build (push) Successful in 2m45s
Fixed number of elements calculation that caused integer overflow. Now
return size_t instead of int.
2026-06-10 12:24:18 +02:00
f670ba77a2 PixelHistogram (#317)
Build on RHEL9 / build (push) Successful in 2m31s
Build on RHEL8 / build (push) Successful in 3m6s
Run tests using data on local RHEL8 / build (push) Successful in 3m55s
Build on local RHEL8 / build (push) Successful in 2m42s
Multi threaded filling of per pixel histograms for example for detector calibration

1. PixelHistogram - Generic variant expects already pedestal subtracted
data
2. PedestalTrackingHistogram - Terrible name, useful class. Keeps it's
own pedestal and does conversion and pedestal tracking in the worker
threads.

---------

Co-authored-by: Lars Erik Fröjd <froejdh_e@pc-jungfrau-02.psi.ch>
2026-06-09 09:08:48 +02:00
hinger_v 47ebbd2267 Merge branch 'main' into dev/strixels/remap_simple 2026-05-22 18:12:05 +02:00
lunin_landGitHub 8f8173feb6 CI/CD: Integrate pre-commit hooks and GitHub Actions workflow (#303)
Build on RHEL8 / build (push) Successful in 2m48s
Build on RHEL9 / build (push) Successful in 3m8s
Run tests using data on local RHEL8 / build (push) Successful in 3m34s
Build on local RHEL8 / build (push) Successful in 2m24s
To improve codebase quality and reduce human error, this PR introduces
the pre-commit framework. This ensures that all code adheres to project
standards before it is even committed, maintaining a consistent style
and catching common mistakes early.

Key Changes:

- Code Formatting: Automated C++ formatting using clang-format (based on
the project's .clang-format file).
- Syntax Validation: Basic checks for file integrity and syntax.
- Spell Check: Automated scanning for typos in source code and comments.
- CMake Formatting: Standardization of CMakeLists.txt and .cmake
configuration files.
- GitHub Workflow: Added a CI action that validates every Pull Request
against the pre-commit configuration to ensure compliance.

The configuration includes a [ci] block to handle automated fixes within
the PR. Currently, this is disabled. If we want the CI to automatically
commit formatting fixes back to the PR branch, this can be toggled to
true in .pre-commit-config.yaml.

```yaml
ci:
  autofix_commit_msg: [pre-commit] auto fixes from pre-commit hooks
  autofix_prs: false
  autoupdate_schedule: monthly
```

The last large commit with the fit functions, for example, was not
formatted according to the clang-format rules. This PR would allow to
avoid similar mistakes in the future.

Python fomat with `ruff` for tests and sanitiser for `.ipynb` notebooks
can be added as well.
2026-04-14 11:52:23 +02:00
a6afa45b3b Feature/minuit2 wrapper (#279)
Build on RHEL8 / build (push) Successful in 3m6s
Build on RHEL9 / build (push) Successful in 3m20s
Run tests using data on local RHEL8 / build (push) Successful in 3m36s
Build on local RHEL8 / build (push) Successful in 2m21s
## Unified Minuit2 fitting framework with FitModel API

### Models (`Models.hpp`)
Consolidate all model structs (Gaussian, RisingScurve, FallingScurve)
into a
single header. Each model provides: `eval`, `eval_and_grad`, `is_valid`,
`estimate_par`, `compute_steps`, and `param_info` metadata. No Minuit2
dependency.

### Chi2 functors (`Chi2.hpp`)
Generic `Chi2Model1DGrad` (analytic gradient) templated on the model
struct.
Replaces the separate Chi2Gaussian, Chi2GaussianGradient,
Chi2Scurves, and Chi2ScurvesGradient headers.

### FitModel (`FitModel.hpp`)
Configuration object wrapping `MnUserParameters`, strategy, tolerance,
and
user-override tracking. User constraints (fixed parameters, start
values, limits)
always take precedence over automatic data-driven estimates.

### Fit functions (`Fit.hpp`)
- `fit_pixel<Model, FCN>(model, x, y, y_err)` -> single-pixel,
self-contained
- `fit_pixel<Model, FCN>(model, upar_local, x, y, y_err)` -> pre-cloned
upar for hot loops
- `fit_3d<Model, FCN>(model, x, y, y_err, ..., n_threads)` ->
row-parallel over pixel grid

### Python bindings
- `Pol1`, `Pol2`, `Gaussian`, `RisingScurve`, `FallingScurve` model
classes with
  `FixParameter`, `SetParLimits`, `SetParameter`, and properties for
  `max_calls`, `tolerance`, `compute_errors`
- Single `fit(model, x, y, y_err, n_threads)` dispatch replacing the old
`fit_gaus_minuit`, `fit_gaus_minuit_grad`, `fit_scurve_minuit_grad`,
etc.

### Benchmarks
- Updated `fit_benchmark.cpp` (Google Benchmark) to use the new FitModel
API
- Jupyter notebooks for 1D and 3D S-curve fitting (lmfit vs Minuit2
analytic)
- ~1.8x speedup over lmfit, near-linear thread scaling up to physical
core count

---------

Co-authored-by: Erik Fröjdh <erik.frojdh@psi.ch>
2026-03-30 09:12:23 +02:00
hinger_v 69da26c3f3 Fix type error
Build on RHEL8 / build (push) Successful in 2m18s
Build on RHEL9 / build (push) Successful in 2m35s
Run tests using data on local RHEL8 / build (push) Successful in 3m7s
2026-03-24 16:40:22 +01:00
hinger_v 06985e537b Adapt algorithm and generate to incorporate quad sensor 2026-03-24 11:37:13 +01:00
hinger_v 705b525b6a Delete old Remap
Build on RHEL8 / build (push) Successful in 2m43s
Build on RHEL9 / build (push) Successful in 3m0s
Run tests using data on local RHEL8 / build (push) Successful in 3m13s
2026-03-10 18:02:42 +01:00
hinger_v 99708a8d55 Pass config by const& to algorithms 2026-03-09 19:52:14 +01:00
hinger_v 525a51cd34 Comments 2026-03-09 19:02:36 +01:00
hinger_v 02045c5aa9 Add rotation and bond_shift 2026-03-09 18:37:04 +01:00
hinger_v 09bfcbf8bf Merge branch 'main' into dev/strixels/remap_simple
Build on RHEL8 / build (push) Successful in 2m24s
Build on RHEL9 / build (push) Successful in 2m36s
Run tests using data on local RHEL8 / build (push) Successful in 3m11s
2026-03-09 17:01:41 +01:00
hinger_v 89e5593bbf Adapt for renaming of legacy namespace 2026-03-09 17:00:34 +01:00
hinger_v e00b1d24fa Add hardcoded Jungfrau config structures 2026-03-09 17:00:17 +01:00
hinger_v 5cc2b9f501 Add formatters 2026-03-09 15:15:37 +01:00
mazzol_aandGitHub eee34ba211 fixed matterhorn pixelmap (#283)
Build on RHEL8 / build (push) Successful in 2m19s
Build on RHEL9 / build (push) Successful in 2m44s
Run tests using data on local RHEL8 / build (push) Successful in 3m14s
Build on local RHEL8 / build (push) Successful in 1m57s
Fixed Matterhorn PixelMap 

Example Image can be found on
pc-moench-03/tmp/alicetestdata3_master_3.json
2026-03-09 14:38:26 +01:00
hinger_v 166c0e0ff9 Implement general remapping (first draft) 2026-03-06 20:47:09 +01:00
hinger_v 495da9b2e9 Adapt namespaces 2026-03-05 20:55:20 +01:00
hinger_v 1ec11e4c80 Add missing simplification steps 2026-03-05 18:50:26 +01:00
hinger_vandGitHub c665c0e6c6 Fix #281 std::bad_optional_access in RawMasterFile::roi() (#282)
Build on RHEL8 / build (push) Successful in 2m22s
Build on RHEL9 / build (push) Successful in 2m34s
Run tests using data on local RHEL8 / build (push) Successful in 3m7s
Build on local RHEL8 / build (push) Successful in 2m7s
Fixes #281
2026-02-27 12:17:17 +01:00
hinger_v 586012f525 Merge branch 'fix/ROI_bad_optional_access' into dev/strixels/remap 2026-02-27 11:31:18 +01:00
hinger_v 9f5c1a743b Specify throw if empty
Build on RHEL8 / build (push) Successful in 2m22s
Build on RHEL9 / build (push) Successful in 2m34s
Run tests using data on local RHEL8 / build (push) Successful in 3m11s
2026-02-27 11:15:24 +01:00
hinger_v d6127f3986 Merge branch 'fix/ROI_bad_optional_access' into dev/strixels/remap 2026-02-26 16:42:52 +01:00
hinger_v f9a74a3be7 Prevent acces and throw of m_rois.value() in if condition if m_rois->empty() 2026-02-26 16:25:28 +01:00
hinger_v e31c8582e4 Merge branch 'main' into dev/strixels/remap
Build on RHEL8 / build (push) Successful in 2m24s
Build on RHEL9 / build (push) Successful in 2m50s
Run tests using data on local RHEL8 / build (push) Failing after 3m16s
2026-02-25 17:21:34 +01:00
mazzol_aandGitHub 31dd0ca8b7 Dev/automatic nfs server upload (#276)
Build on local RHEL9 / build (push) Successful in 1m10s
Build on RHEL8 / build (push) Successful in 2m17s
Build on RHEL9 / build (push) Successful in 2m37s
Run tests using data on local RHEL8 / build (push) Failing after 3m11s
Build on local RHEL8 / build (push) Successful in 1m55s
- automatically builds aare and uploads to mpc2935 (from there its
eventually uploaded to nfs every day)
2026-02-25 16:40:03 +01:00
hinger_v 32eb686c87 Fix libc++ compilation error 2026-02-24 19:39:37 +01:00
hinger_v bb237ff012 Add first remapping draft 2026-02-24 19:33:28 +01:00
mazzol_aandGitHub 2139e5843c Dev/stuff from pyctbgui (#273)
Build on RHEL8 / build (push) Successful in 2m23s
Build on RHEL9 / build (push) Successful in 2m35s
Run tests using data on local RHEL8 / build (push) Failing after 3m19s
Matterhorn10 Transform 
some other Transformations from pyctbGUI 
added method get_reading_mode for easier error handling in decoders 


## TODO: 

- proper error handling for all other decoders 
- proper documentation for all other decoders 
- refactoring all other decoders to store hard coded values in a Struct
ChipSpecification
2026-02-19 16:12:44 +01:00
mazzol_a 5dbc746462 clang-format
Build on RHEL8 / build (push) Successful in 2m30s
Build on RHEL9 / build (push) Successful in 2m34s
Run tests using data on local RHEL8 / build (push) Failing after 3m10s
2026-02-19 15:35:19 +01:00
218f31ce60 Dev/multiple rois in aare (#263)
Build on RHEL8 / build (push) Successful in 2m23s
Build on RHEL9 / build (push) Successful in 2m32s
Run tests using data on local RHEL8 / build (push) Failing after 3m14s
Reading multiple ROI's for aare 

- read_frame, read_n etc throws for multiple ROIs
- new functions read_ROIs, read_n_ROIs 
-  read_roi_into (used for python bindings - to not copy) 

all these functions use get_frame or get_frame_into where one passes the
roi_index
## Refactoring:
- each roi keeps track of its subfiles that one has to open e.g.
subfiles can be opened several times
- refactored class DetectorGeometry - keep track of the updated module
geometries in new class ROIGeometry.
- ModuleGeometry updates based on ROI

## ROIGeometry: 
- stores number of modules overlapping with ROI and its indices
- size of ROI 

Note: only tested size of the resulting frames not the actual values

---------

Co-authored-by: Erik Fröjdh <erik.frojdh@psi.ch>
Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>
2026-02-18 10:57:56 +01:00
Erik Fröjdh 8ac633dc75 open xilinx ctb 2026-01-26 10:44:09 +01:00
b77a576f72 Dev/automate tests using data (#267)
Build on RHEL8 / build (push) Successful in 2m13s
Build on RHEL9 / build (push) Successful in 2m37s
Run tests using data on local RHEL8 / build (push) Successful in 3m12s
- automatically run python tests 
- automatically run test using data files on local runner from gitea
- fixed some of the workflows

---------

Co-authored-by: Erik Fröjdh <erik.frojdh@psi.ch>
2026-01-20 17:20:48 +01:00
31f3a60cd3 added correct decoder for ADC-SAR-05-06-07-08 ASIC (#266)
Adding function to correctly decode the ADC-SAR-05-06-07-08 Chip. 

Co-authored-by: Erik Fröjdh <erik.frojdh@psi.ch>
2026-01-20 16:38:06 +01:00
froejdh_e dceda21496 fixed parsing of dynamic range 2026-01-19 15:20:37 +01:00