Commit Graph
502 Commits
Author SHA1 Message Date
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
Erik FröjdhandGitHub b78ea64ea7 Conditional use of Minuit2 (#320)
Build on RHEL9 / build (push) Successful in 2m31s
Build on RHEL8 / build (push) Successful in 3m9s
Run tests using data on local RHEL8 / build (push) Successful in 3m56s
Build on local RHEL8 / build (push) Successful in 2m44s
If AARE_FETCH_MINUIT is set to OFF we first look for a standalone
Minuit2 and if that is not found we try to find Minuit2 as a part of
ROOT.

In both cases we make an alias to allow for simpler use of the target
later.

It still doesn't solve the issue that we install Minuit to when we fetch
it but that can be addressed in a separate PR.

closes #316
2026-06-10 08:30:03 +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 414d2689c1 Fix comment
Build on RHEL9 / build (push) Successful in 2m26s
Build on RHEL8 / build (push) Successful in 3m2s
Run tests using data on local RHEL8 / build (push) Successful in 3m52s
2026-06-04 19:25:42 +02:00
hinger_v d87e834963 Merge branch 'main' into dev/strixels/remap_simple 2026-06-04 16:40:09 +02:00
hinger_v d7dd3a07ef Clarify layout with comments and printouts
Build on RHEL9 / build (push) Successful in 2m36s
Build on RHEL8 / build (push) Successful in 3m8s
Run tests using data on local RHEL8 / build (push) Successful in 3m55s
2026-06-04 16:39:14 +02:00
maliakal_dandGitHub 8e69b498e5 Fix version (#319)
Build on RHEL9 / build (push) Successful in 2m34s
Build on RHEL8 / build (push) Successful in 3m2s
Run tests using data on local RHEL8 / build (push) Successful in 3m45s
Build on local RHEL8 / build (push) Successful in 2m38s
- install VERSION file and copy to build
- fix lookup for VERSION file in case of error
- update documentation for installing python bindings
2026-06-03 12:10:58 +02:00
hinger_v 4b8d71a452 Add more generators
Build on RHEL9 / build (push) Successful in 2m37s
Build on RHEL8 / build (push) Successful in 3m2s
Run tests using data on local RHEL8 / build (push) Successful in 3m50s
2026-06-01 17:11:57 +02:00
282debcc94 Add __version__ variable for python library (#308)
Build on RHEL9 / build (push) Successful in 2m23s
Build on RHEL8 / build (push) Successful in 3m5s
Run tests using data on local RHEL8 / build (push) Successful in 3m56s
Build on local RHEL8 / build (push) Successful in 2m38s
[PEP 396](https://peps.python.org/pep-0396/)

---------

Co-authored-by: AliceMazzoleni99 <alice.mazzoleni@psi.ch>
2026-05-27 14:38:35 +02:00
hinger_v 47ebbd2267 Merge branch 'main' into dev/strixels/remap_simple 2026-05-22 18:12:05 +02:00
mazzol_aandGitHub 41c47cb54b dont reinstall fmt (#314)
Build on RHEL9 / build (push) Successful in 2m24s
Build on RHEL8 / build (push) Successful in 2m58s
Run tests using data on local RHEL8 / build (push) Successful in 3m43s
Build on local RHEL8 / build (push) Successful in 2m37s
- dont reinstall fmt/nlohmann
2026-05-22 15:44:35 +02:00
mazzol_aandGitHub 502c37a00a number of clusters is always uint32_t (#313)
Build on RHEL9 / build (push) Successful in 2m45s
Build on RHEL8 / build (push) Successful in 3m21s
Run tests using data on local RHEL8 / build (push) Successful in 3m55s
Build on local RHEL8 / build (push) Successful in 2m37s
2026-05-22 09:22:29 +02:00
Khalil FerjaouiandGitHub 52b5cf6b9f Feature/gauss+plateau (#312)
Build on RHEL9 / build (push) Successful in 2m27s
Build on RHEL8 / build (push) Successful in 3m1s
Run tests using data on local RHEL8 / build (push) Successful in 3m54s
Build on local RHEL8 / build (push) Successful in 2m36s
Adds three Minuit2-backed spectrum models to the Python-exposed fitting
API:

- `GaussianErfcPlateau`
- `GaussianChargeSharing`
- `GaussianChargeSharingKb`

Closes #297
2026-05-21 08:33:02 +02:00
de74f12640 Dev var cluster finder (#310)
Build on RHEL9 / build (push) Successful in 2m30s
Build on RHEL8 / build (push) Successful in 3m36s
Run tests using data on local RHEL8 / build (push) Successful in 3m51s
Build on local RHEL8 / build (push) Successful in 2m36s
Add options for var cluster_finder_X:
1. number of neighbors (for better segmentation of clusters)
2. option to empty the surrounding pixels

---------

Co-authored-by: xiangyu.xie <xiangyu.xie@psi.ch>
2026-05-18 16:16:09 +02:00
lunin_landGitHub 4e3b70140a CI/CD: add conda build installation (#309)
Build on RHEL8 / build (push) Successful in 2m59s
Build on RHEL9 / build (push) Successful in 2m56s
Run tests using data on local RHEL8 / build (push) Successful in 3m41s
Build on local RHEL8 / build (push) Successful in 2m37s
Build conda pkgs workflows
[failing](https://github.com/slsdetectorgroup/aare/actions/runs/25800676450/job/75789547058#step:5:10)
due to the missing `conda build` command.

This PR fixes the issue.
2026-05-13 16:32:02 +02:00
mazzol_aandGitHub 2736d975c5 Dev/enable custom etas (#305)
Build on local RHEL8 / build (push) Successful in 2m32s
Build on RHEL9 / build (push) Successful in 2m29s
Build on RHEL8 / build (push) Successful in 2m52s
Run tests using data on local RHEL8 / build (push) Successful in 3m49s
- Allowing the users more flexibility to play around with custom eta
functions without touching the c++ code

- passing vector of eta values to ``transform_eta_values`` 

```
from aare import Interpolator, ClusterVector, Etai, Cluster
import numpy as np 

def custom_eta(cluster_pixel_coordinate_x, cluster_pixel_coordinate_y, cluster_data):
    # dummy custom eta function that just returns the sum of the cluster data
    eta = Etai()
    eta.x = 0.1 # dummy x value
    eta.y = 0.1 # dummy y value
    eta.sum = np.sum(cluster_data) # sum of the cluster data as the "energy
    return eta

# Create a dummy eta distribution and bins
eta_distribution = np.zeros((10, 10, 1)) # dummy eta distribution
etax_bins = np.linspace(0, 1.0, 11)
etay_bins = np.linspace(0, 1.0, 11)
e_bins = np.array([0., 10.]) # dummy energy bins

# Create the interpolator
interpolator = Interpolator(eta_distribution, etax_bins, etay_bins, e_bins)

# Create a dummy cluster vector
cluster_vector = ClusterVector()
cluster_vector.push_back(Cluster(10, 5, np.ones(shape=9, dtype = np.int32)))
cluster_vector.push_back(Cluster(20, 10, np.ones(shape=9, dtype = np.int32)))

# Create dummy etas for the clusters
cluster_array = np.array(cluster_vector)
etas = np.array([custom_eta(cluster["x"], cluster["y"], cluster["data"]) for cluster in cluster_array])

# transform eta values to uniform coordinates 
uniform_coordinates = interpolator.transform_eta_values(etas)

# Interpolate to get the photon coordinates e.g. apply interpolation logic 
photon_coordinates_x = cluster_array["x"] + uniform_coordinates["x"] # add to pixel coordinate 
photon_coordinates_y = cluster_array["y"] + uniform_coordinates["y"] # add to pixel coordinate 

```
advantage: full control over interpolation logic, 
downside: inefficient quite some loops in python
- passing pre computed eta values to interpolate function 
```
Interpolator.interpolate(cluster_vector, etas) 
```
downside: less flexibility in interpolation logic. 
downside: People might misuse it instead of using interpolate directly
with a pre compiled eta function implemented in c++
2026-04-24 14:01:13 +02:00
6ff664f812 allow passing mask to clustervector (#304)
Build on RHEL9 / build (push) Successful in 2m24s
Build on RHEL8 / build (push) Successful in 2m54s
Run tests using data on local RHEL8 / build (push) Successful in 3m52s
Build on local RHEL8 / build (push) Successful in 2m34s
- passing mask to ClusterVector 
- creates a copy of the ClusterVector

Co-authored-by: Erik Fröjdh <erik.frojdh@psi.ch>
2026-04-17 17:13:02 +02:00
Erik FröjdhandGitHub 4875c31513 bumped pybind version, cmake fixes (#300)
Build on RHEL9 / build (push) Successful in 2m25s
Build on RHEL8 / build (push) Successful in 2m57s
Run tests using data on local RHEL8 / build (push) Successful in 3m37s
Build on local RHEL8 / build (push) Successful in 2m33s
- Bumped pybind11 version
- Bumped libfmt version
- Patch  Minuit to avoid messing around with CMake policy
2026-04-17 15:50:49 +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
mazzol_aandGitHub 85098d2008 fixed fmt error (#302)
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 3m43s
Build on local RHEL8 / build (push) Successful in 2m22s
2026-04-10 17:46:01 +02:00
a25f5d2344 Access to parameter names and fast erf approx (#298)
Build on RHEL8 / build (push) Successful in 2m44s
Build on RHEL9 / build (push) Successful in 3m3s
Run tests using data on local RHEL8 / build (push) Successful in 3m39s
Build on local RHEL8 / build (push) Successful in 2m23s
- Set parameter starting values, limits or fix through name as well as
index
- Updated parameter names for the scurve
- Fast approximation to erf function (~10% speedup of fitting)

---------

Co-authored-by: Khalil Ferjaoui <khalilferjaoui@yahoo.fr>
2026-04-02 13:33:37 +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
mazzol_aandGitHub 05e6e69c66 added getter and setter for nSigma (#293)
Build on RHEL9 / build (push) Successful in 2m46s
Build on RHEL8 / build (push) Successful in 2m51s
Run tests using data on local RHEL8 / build (push) Successful in 3m15s
Build on local RHEL8 / build (push) Successful in 1m57s
2026-03-26 14:52:32 +01: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
Erik FröjdhandGitHub 7e6c6081dc Updated build pipeline (#290)
Build on RHEL8 / build (push) Successful in 2m19s
Build on RHEL9 / build (push) Successful in 2m34s
Run tests using data on local RHEL8 / build (push) Successful in 3m3s
Build on local RHEL8 / build (push) Successful in 1m57s
- Fixed failing conda builds (numpy >=2.1 and added pytest-check)
- added cibuildwheel settings for osx
- Bumped cibuildwheel to 3.4.0 in pipeline
- build also for macos-latest
- fixed conda workflow which was only on developer branch (now main and
pr to main)
2026-03-24 15:09:57 +01:00
hinger_v 7ecc6a9fa0 Merge branch 'main' into dev/strixels/remap_simple
Build on RHEL8 / build (push) Successful in 2m18s
Build on RHEL9 / build (push) Successful in 2m36s
Run tests using data on local RHEL8 / build (push) Successful in 3m18s
2026-03-24 11:39:17 +01:00
hinger_v 06985e537b Adapt algorithm and generate to incorporate quad sensor 2026-03-24 11:37:13 +01:00
hinger_v eb5626c9c9 Correct quad config 2026-03-24 11:35:38 +01:00
81acab6091 bumped version number edited RELEASE.md (#288)
Build on RHEL8 / build (push) Successful in 2m26s
Build on RHEL9 / build (push) Successful in 2m53s
Run tests using data on local RHEL8 / build (push) Successful in 3m17s
Build on local RHEL8 / build (push) Successful in 1m58s
Co-authored-by: Alice <alice.mazzoleni@psi.ch>
2026.3.17
2026-03-17 17:22:36 +01:00
d9ff73e8b2 added matterhorn transformation tests (#284)
- added matterhorn transformation tests

---------

Co-authored-by: Erik Fröjdh <erik.frojdh@psi.ch>
2026-03-17 16:54:06 +01:00
Erik FröjdhandGitHub fca17e65d2 Added conda/pypi buyilds for python 3.14 removed 3.11 (#287)
Build on RHEL8 / build (push) Successful in 2m24s
Build on RHEL9 / build (push) Successful in 2m41s
Run tests using data on local RHEL8 / build (push) Successful in 3m16s
Build on local RHEL8 / build (push) Successful in 1m55s
In line with supporting the 3 latest versions of Python
2026-03-17 10:49:52 +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 59b423be07 Include in CMake
Build on RHEL8 / build (push) Successful in 2m20s
Build on RHEL9 / build (push) Successful in 2m36s
Run tests using data on local RHEL8 / build (push) Successful in 3m15s
2026-03-09 20:37:28 +01:00
hinger_v fad8ca0dcf Change lambdas into inline functions
Build on RHEL8 / build (push) Successful in 2m17s
Build on RHEL9 / build (push) Successful in 2m35s
Run tests using data on local RHEL8 / build (push) Successful in 3m19s
2026-03-09 20:12:21 +01:00
hinger_v 99708a8d55 Pass config by const& to algorithms 2026-03-09 19:52:14 +01:00
hinger_v e925287fc4 Typo fix 2026-03-09 19:51:50 +01:00
hinger_v 442fe78d38 Comment 2026-03-09 19:51:38 +01:00
hinger_v f276cf6384 Make hardcoded configs inline 2026-03-09 19:34:11 +01:00
hinger_v 525a51cd34 Comments 2026-03-09 19:02:36 +01:00
hinger_v db5c453b35 Add generation functions for Jungfrau multipitch strixel
Build on RHEL8 / build (push) Successful in 2m25s
Build on RHEL9 / build (push) Successful in 2m39s
Run tests using data on local RHEL8 / build (push) Successful in 3m12s
2026-03-09 18:55:44 +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
hinger_v d4091d56a6 Add ApplyRemap 2026-03-09 15:15:26 +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 f05c4126fe Draft remap algorithm 2026-03-06 19:53:47 +01:00