Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
ff0d5ef
feat: support `iguana::Algorithm::Run` calls
c-dilks Aug 31, 2025
ba03ead
feat: iguana usage example
c-dilks Sep 4, 2025
256f742
feat: add more to the example
c-dilks Sep 5, 2025
6f22df4
feat: bank lvalue reference accessors
c-dilks Sep 5, 2025
1195f57
refactor!: remove iguana wrapper headers and their consumers
c-dilks Sep 10, 2025
41fdce4
fix: minimize example
c-dilks Sep 10, 2025
e815b25
fix: start using `Run` return values
c-dilks Sep 11, 2025
6916136
fix: complete copy constructor; lambda return type mismatch
c-dilks Sep 12, 2025
f6c7706
refactor!: use `HipoChain` in the example instead
c-dilks Sep 12, 2025
9b13396
feat: "allowed" state for `region_particle`
c-dilks Sep 16, 2025
47df919
doc: note about `hipo::bank::getRowList()`
c-dilks Sep 16, 2025
f115376
fix: add "allowed" state for FTB
c-dilks Sep 16, 2025
94a5281
doc: update guidance, relying on examples for the details
c-dilks Sep 16, 2025
01e036d
feat: handle filters in `region_particle` accessors
c-dilks Sep 16, 2025
cc36c9d
feat: ignores
c-dilks Nov 18, 2025
97720de
deleted: RunRoot/Ex11_Iguana_example_01_bank_rows.C
c-dilks Nov 18, 2025
bd1c4a9
fix: make accessors more readable, and proper overload
c-dilks Nov 18, 2025
cd5dbad
doc: docstrings for `clas12reader`
c-dilks Nov 18, 2025
4c113ac
ci: run `doxygen` and deploy
c-dilks Nov 18, 2025
4b1e612
doc: nicer style
c-dilks Nov 18, 2025
4f701c7
doc: link to doxygen page
c-dilks Nov 18, 2025
db6a8aa
refactor: doxygen wrapper script
c-dilks Nov 18, 2025
4a72967
doc: bank pointer accessors
c-dilks Nov 18, 2025
b728242
feat: draw plots in the example
c-dilks Nov 18, 2025
6f685ec
doc: version note
c-dilks Nov 18, 2025
2f9f5ab
doc: sort class members
c-dilks Dec 5, 2025
f6d8943
feat: `getParticleBank` to return appropriate particle bank (#3)
c-dilks Dec 16, 2025
31085fb
doc: clarify comments in example
c-dilks Jan 6, 2026
a31a47b
build: set version num to `1.9.0`
c-dilks Jan 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 40 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,15 @@ defaults:
shell: bash

jobs:

build_and_test:
name: Build and test
runs-on: ubuntu-latest
container:
image: codecr.jlab.org/hallb/clas12/container-forge/base_root:latest

steps:

- name: checkout repository
uses: actions/checkout@v5

- name: set clas12root env vars
run: |
CLAS12ROOT=$GITHUB_WORKSPACE
Expand All @@ -35,14 +34,49 @@ jobs:
echo PATH=$PATH | tee -a $GITHUB_ENV
echo LD_LIBRARY_PATH=$LD_LIBRARY_PATH | tee -a $GITHUB_ENV
echo ROOT_INCLUDE_PATH=$ROOT_INCLUDE_PATH | tee -a $GITHUB_ENV

- name: print versions
run: |
cmake --version
root --version

- name: build clas12root
run: ./installC12Root

- name: run example on data file
run: ./bin/clas12root -q ./tests/read_file.C

generate_documentation:
name: Generate documentation
runs-on: ubuntu-latest
container:
image: codecr.jlab.org/hallb/clas12/container-forge/base_root:latest
options: --user root
steps:
- uses: actions/checkout@v5
- name: install dependencies
run: |
pacman -Sy --noconfirm
pacman -S --noconfirm doxygen graphviz
- name: doxygen
run: docs/doxygen/generate.sh
- name: rename
run: mv share/doc/clas12root/html pages
- uses: actions/upload-pages-artifact@v4
with:
retention-days: 3
path: pages/

deploy_webpages:
if: ${{ github.ref == 'refs/heads/master' }}
name: Deploy documentation webpage
needs:
- generate_documentation
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: deployment
id: deployment
uses: actions/deploy-pages@v4
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ bin
build
lib
man
/share

# dependency installations
##############
Expand Down Expand Up @@ -54,6 +55,7 @@ ehthumbs.db
Thumbs.db
.nfs*
*~
.cache

#Dropbox
.dropbox.attr
Expand Down
8 changes: 8 additions & 0 deletions .ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# ignore configuration file for some IDE tools

# submodule source code
lz4/**
clas12-qadb/**
ccdb/**
hipo_src/**
rcdb/**
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ endif()
message(STATUS "Using cmake version ${CMAKE_VERSION}" )

# Define the project name, version, and language
project(clas12root VERSION 1.9 LANGUAGES CXX)
project(clas12root VERSION 1.9.0 LANGUAGES CXX)

# ==============================================================================
# Options
Expand Down
44 changes: 31 additions & 13 deletions Clas12Banks/clas12reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ namespace clas12 {
addBank(additionalBank);

_applyQA=other._applyQA;
_readEventUserAction=other._readEventUserAction;
}

void clas12reader::initReader(){
Expand Down Expand Up @@ -461,8 +462,9 @@ namespace clas12 {
_event.getStructure(*ibank.get());
}


return true;
// now that we have read all the banks, call user's custom read action;
// return its return value, since it's the last thing `readEvent()` does
return _readEventUserAction(this);
}
////////////////////////////////////////////////////////
///initialise next event from the reader
Expand Down Expand Up @@ -643,19 +645,35 @@ namespace clas12 {
return true;
}

////////////////////////////////////////////////////////
///Filter and return detParticles by given PID
std::vector<region_part_ptr> clas12reader::getByID(int id){
return container_filter(_detParticles, [id](region_part_ptr dr)
{return dr->getPid()==id;});
////////////////////////////////////////////////////////
// Filter and return detParticles

std::vector<region_part_ptr> clas12reader::getDetParticles(bool const& applyBankFilter) const
{
return applyBankFilter ?
container_filter(_detParticles, [](region_part_ptr dr) { return dr->isAllowed(); }) :
_detParticles;
}

std::vector<region_part_ptr> clas12reader::getByID(int id, bool const& applyBankFilter) const
{
return applyBankFilter ?
container_filter(_detParticles, [&id](region_part_ptr dr) { return dr->getPid()==id && dr->isAllowed(); }) :
container_filter(_detParticles, [&id](region_part_ptr dr) { return dr->getPid()==id; });
}
std::vector<region_part_ptr> clas12reader::getByRegion(int ir){
return container_filter(_detParticles, [ir](region_part_ptr dr)
{return dr->getRegion()==ir;});

std::vector<region_part_ptr> clas12reader::getByRegion(int ir, bool const& applyBankFilter) const
{
return applyBankFilter ?
container_filter(_detParticles, [&ir](region_part_ptr dr) { return dr->getRegion()==ir && dr->isAllowed(); }) :
container_filter(_detParticles, [&ir](region_part_ptr dr) { return dr->getRegion()==ir; });
}
std::vector<region_part_ptr> clas12reader::getByCharge(int ch){
return container_filter(_detParticles, [ch](region_part_ptr dr)
{return dr->par()->getCharge()==ch;});

std::vector<region_part_ptr> clas12reader::getByCharge(int ch, bool const& applyBankFilter) const
{
return applyBankFilter ?
container_filter(_detParticles, [&ch](region_part_ptr dr) { return dr->par()->getCharge()==ch && dr->isAllowed(); }) :
container_filter(_detParticles, [&ch](region_part_ptr dr) { return dr->par()->getCharge()==ch; });
}

////////////////////////////////////////////////////////////////
Expand Down
Loading