Skip to content

Commit 41487dc

Browse files
committed
Merge branch 'master' into jgalan_detector_migration
2 parents 4d24e71 + 7e5b861 commit 41487dc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+609
-492
lines changed

.cmake-format.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# https://cmake-format.readthedocs.io/en/latest/configuration.html
2+
3+
format:
4+
tab_size: 4
5+
separate_ctrl_name_with_space: true
6+
separate_fn_name_with_space: false

.github/pr-badge.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
when: "$additions < 100"
1616
- imageUrl: "https://gitlab.cern.ch/rest-for-physics/rawlib/badges/$branchName/pipeline.svg"
1717
url: "https://gitlab.cern.ch/rest-for-physics/rawlib/-/commits/$branchName"
18-
- imageUrl: "https://gitlab.cern.ch/rest-for-physics/framework/badges/$branchName/pipeline.svg"
19-
url: "https://gitlab.cern.ch/rest-for-physics/framework/-/commits/$branchName"
18+
- imageUrl: "https://github.com/rest-for-physics/rawlib/actions/workflows/validation.yml/badge.svg?branch=$branchName"
19+
url: "https://github.com/rest-for-physics/rawlib/commits/$branchName"
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Framework Validation
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
release:
9+
10+
# Allows you to run this workflow manually from the Actions tab
11+
workflow_dispatch:
12+
13+
env:
14+
CMAKE_BUILD_TYPE: Release
15+
REST_PATH: /rest/rawlib/install
16+
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
17+
18+
defaults:
19+
run:
20+
shell: bash
21+
22+
jobs:
23+
framework-validation:
24+
uses: rest-for-physics/framework/.github/workflows/validation.yml@master

.github/workflows/validation.yml

Lines changed: 44 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,57 @@
11
name: Validation
22

33
on:
4-
push:
5-
branches: [ "master" ]
6-
pull_request:
7-
branches: [ "master" ]
8-
release:
9-
104
workflow_dispatch:
5+
workflow_call:
116

127
env:
138
CMAKE_BUILD_TYPE: Release
149
REST_PATH: /rest/rawlib/install
10+
RAW_LIB_PATH: rawlib
1511
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
1612

1713
defaults:
1814
run:
1915
shell: bash
2016

2117
jobs:
22-
framework-validation:
23-
uses: rest-for-physics/framework/.github/workflows/validation.yml@master
24-
18+
2519
libCheck:
2620
name: Validate library
2721
runs-on: ubuntu-latest
2822
container:
2923
image: ghcr.io/lobis/root-geant4-garfield:rest-for-physics
3024
steps:
31-
- uses: actions/checkout@v3
32-
- run: python3 pipeline/validateLibrary.py .
25+
- uses: rest-for-physics/framework/.github/actions/checkout@master
26+
with:
27+
branch: ${{ env.BRANCH_NAME }}
28+
repository: rest-for-physics/rawlib
29+
path: ${{ env.RAW_LIB_PATH }}
30+
- run: python3 ${{ env.RAW_LIB_PATH }}/pipeline/validateLibrary.py .
31+
32+
precommit-config:
33+
name: Validate pre-commit config
34+
runs-on: ubuntu-latest
35+
container:
36+
image: ghcr.io/lobis/root-geant4-garfield:rest-for-physics
37+
steps:
38+
- name: Checkout rawlib
39+
uses: rest-for-physics/framework/.github/actions/checkout@master
40+
with:
41+
branch: ${{ env.BRANCH_NAME }}
42+
repository: rest-for-physics/rawlib
43+
path: ${{ env.RAW_LIB_PATH }}
44+
- name: Verify pre-commit config files match
45+
run: |
46+
cd ${{ env.RAW_LIB_PATH }}
47+
curl https://raw.githubusercontent.com/rest-for-physics/framework/master/scripts/validatePreCommitConfig.py | python
3348
3449
build-rawlib:
3550
name: Build only rawlib
3651
runs-on: ubuntu-latest
3752
container:
3853
image: ghcr.io/lobis/root-geant4-garfield:rest-for-physics
3954
steps:
40-
- uses: actions/checkout@v3
4155
- name: Build and install
4256
uses: rest-for-physics/framework/.github/actions/build@master
4357
with:
@@ -57,7 +71,11 @@ jobs:
5771
image: ghcr.io/lobis/root-geant4-garfield:rest-for-physics
5872
needs: [ build-rawlib ]
5973
steps:
60-
- uses: actions/checkout@v3
74+
- uses: rest-for-physics/framework/.github/actions/checkout@master
75+
with:
76+
branch: ${{ env.BRANCH_NAME }}
77+
repository: rest-for-physics/rawlib
78+
path: ${{ env.RAW_LIB_PATH }}
6179
- name: Restore cache
6280
uses: actions/cache@v3
6381
id: rawlib-install-cache
@@ -67,38 +85,38 @@ jobs:
6785
- name: Add signal noise
6886
run: |
6987
source ${{ env.REST_PATH }}/thisREST.sh
70-
cd pipeline/processes/noise
88+
cd ${{ env.RAW_LIB_PATH }}/pipeline/processes/noise
7189
python addNoise.py
7290
- name: Common Noise
7391
run: |
7492
source ${{ env.REST_PATH }}/thisREST.sh
75-
cd pipeline/processes/commonNoise
93+
cd ${{ env.RAW_LIB_PATH }}/pipeline/processes/commonNoise
7694
restRoot -b -q commonNoise.C
7795
- name: Veto Analysis
7896
run: |
7997
source ${{ env.REST_PATH }}/thisREST.sh
80-
cd pipeline/processes/veto
98+
cd ${{ env.RAW_LIB_PATH }}/pipeline/processes/veto
8199
restManager --c veto.rml --f ../../data/R01208_Ar2Iso_Background14h_14Vetos_IccubFEC-000.aqs
82100
python vetoValidation.py
83101
- name: Signal Shaping
84102
run: |
85103
source ${{ env.REST_PATH }}/thisREST.sh
86-
cd pipeline/processes/shaping
104+
cd ${{ env.RAW_LIB_PATH }}/pipeline/processes/shaping
87105
restRoot -b -q shaping.C
88106
- name: Fitting Process
89107
run: |
90108
source ${{ env.REST_PATH }}/thisREST.sh
91-
cd pipeline/processes/fit
109+
cd ${{ env.RAW_LIB_PATH }}/pipeline/processes/fit
92110
restRoot -b -q fit.C
93111
- name: General Fit Process
94112
run: |
95113
source ${{ env.REST_PATH }}/thisREST.sh
96-
cd pipeline/processes/fit
114+
cd ${{ env.RAW_LIB_PATH }}/pipeline/processes/fit
97115
restRoot -b -q GeneralFit.C
98116
- name: Analysis Process
99117
run: |
100118
source ${{ env.REST_PATH }}/thisREST.sh
101-
cd pipeline/processes/analysis
119+
cd ${{ env.RAW_LIB_PATH }}/pipeline/processes/analysis
102120
restManager --c veto.rml --f ../../data/R01208_Ar2Iso_Background14h_14Vetos_IccubFEC-000.aqs
103121
restRoot -b -q validate.C
104122
@@ -109,7 +127,11 @@ jobs:
109127
image: ghcr.io/lobis/root-geant4-garfield:rest-for-physics
110128
needs: [ build-rawlib ]
111129
steps:
112-
- uses: actions/checkout@v3
130+
- uses: rest-for-physics/framework/.github/actions/checkout@master
131+
with:
132+
branch: ${{ env.BRANCH_NAME }}
133+
repository: rest-for-physics/rawlib
134+
path: ${{ env.RAW_LIB_PATH }}
113135
- name: Restore cache
114136
uses: actions/cache@v3
115137
id: rawlib-install-cache
@@ -119,6 +141,6 @@ jobs:
119141
- name: Dream data
120142
run: |
121143
source ${{ env.REST_PATH }}/thisREST.sh
122-
cd pipeline/external/dream
144+
cd ${{ env.RAW_LIB_PATH }}/pipeline/external/dream
123145
restManager --c dream.rml --f dummyDreamData.fdf
124146
restRoot -b -q dream.C

.pre-commit-config.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.4.0
4+
hooks:
5+
- id: check-added-large-files
6+
- id: check-case-conflict
7+
- id: check-merge-conflict
8+
- id: check-symlinks
9+
- id: check-yaml
10+
- id: check-xml
11+
- id: requirements-txt-fixer
12+
- id: end-of-file-fixer
13+
exclude: external/.*$
14+
- id: mixed-line-ending
15+
exclude: external/.*$
16+
- id: trailing-whitespace
17+
exclude: external/.*$
18+
19+
- repo: https://github.com/pre-commit/mirrors-clang-format
20+
rev: v15.0.6
21+
hooks:
22+
- id: clang-format
23+
exclude: external/.*$
24+
25+
- repo: https://github.com/cheshirekow/cmake-format-precommit
26+
rev: v0.6.13
27+
hooks:
28+
- id: cmake-format
29+
additional_dependencies: [ pyyaml ]
30+
# - id: cmake-lint
31+
32+
- repo: https://github.com/psf/black
33+
rev: 22.12.0
34+
hooks:
35+
- id: black

CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ endif (CMAKE_SYSTEM_NAME MATCHES "Windows")
77

88
set(deps)
99

10-
COMPILELIB(deps)
10+
compilelib(deps)
1111

1212
file(GLOB_RECURSE MAC "${CMAKE_CURRENT_SOURCE_DIR}/macros/*")
13-
INSTALL(FILES ${MAC} DESTINATION ./macros/raw)
13+
install(FILES ${MAC} DESTINATION ./macros/raw)
1414

1515
file(GLOB_RECURSE MAC "${CMAKE_CURRENT_SOURCE_DIR}/examples/*")
16-
INSTALL(FILES ${MAC} DESTINATION ./examples/raw)
16+
install(FILES ${MAC} DESTINATION ./examples/raw)
1717

18-
ADD_LIBRARY_TEST()
18+
add_library_test()

examples/tdsAQS.rml

Lines changed: 24 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,25 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
2-
3-
<TRestManager name="TDS" title="Reading TDS rawdata" verboseLevel="info" >
4-
5-
<TRestRun name="TDSRun" title="Reading a TDS Scope file" verboseLevel="silent">
6-
<parameter name="experimentName" value="GEMMM"/>
7-
<parameter name="runNumber" value="preserve"/>
8-
<parameter name="runTag" value="preserve"/>
9-
<parameter name="runType" value="TDS"/>
10-
<parameter name="runDescription" value=""/>
11-
<parameter name="user" value="${USER}"/>
12-
<parameter name="verboseLevel" value="0"/>
13-
<parameter name="overwrite" value="on" />
14-
<parameter name="outputFileName" value="R[fRunNumber]_[fRunType]_[fParentRunNumber].root" />
15-
<parameter name="readOnly" value="false" />
16-
<parameter name="inputFormat" value="GEMMM[fRunNumber].raw.[fParentRunNumber]" />
17-
</TRestRun>
18-
19-
<TRestProcessRunner name="Processor" verboseLevel="info">
20-
<parameter name="eventsToProcess" value="0" />
21-
<parameter name="threadNumber" value="1"/>
22-
23-
<parameter name="inputAnalysisStorage" value="on"/>
24-
<parameter name="inputEventStorage" value="on"/>
25-
<parameter name="outputEventStorage" value="on"/>
26-
27-
<addProcess type="TRestRawTDSToSignalProcess" name="tdsRaw" value="ON" electronics="TDS"/>
28-
29-
</TRestProcessRunner>
30-
31-
<addTask command="Processor->RunProcess()" value="ON"/>
32-
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<TRestManager name="TDS" title="Reading TDS rawdata" verboseLevel="info">
3+
<TRestRun name="TDSRun" title="Reading a TDS Scope file" verboseLevel="silent">
4+
<parameter name="experimentName" value="GEMMM"/>
5+
<parameter name="runNumber" value="preserve"/>
6+
<parameter name="runTag" value="preserve"/>
7+
<parameter name="runType" value="TDS"/>
8+
<parameter name="runDescription" value=""/>
9+
<parameter name="user" value="${USER}"/>
10+
<parameter name="verboseLevel" value="0"/>
11+
<parameter name="overwrite" value="on"/>
12+
<parameter name="outputFileName" value="R[fRunNumber]_[fRunType]_[fParentRunNumber].root"/>
13+
<parameter name="readOnly" value="false"/>
14+
<parameter name="inputFormat" value="GEMMM[fRunNumber].raw.[fParentRunNumber]"/>
15+
</TRestRun>
16+
<TRestProcessRunner name="Processor" verboseLevel="info">
17+
<parameter name="eventsToProcess" value="0"/>
18+
<parameter name="threadNumber" value="1"/>
19+
<parameter name="inputAnalysisStorage" value="on"/>
20+
<parameter name="inputEventStorage" value="on"/>
21+
<parameter name="outputEventStorage" value="on"/>
22+
<addProcess type="TRestRawTDSToSignalProcess" name="tdsRaw" value="ON" electronics="TDS"/>
23+
</TRestProcessRunner>
24+
<addTask command="Processor-&gt;RunProcess()" value="ON"/>
3325
</TRestManager>
34-

inc/TRestRawBaseLineCorrectionProcess.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ class TRestRawBaseLineCorrectionProcess : public TRestEventProcess {
5757
BeginPrintProcess();
5858

5959
RESTMetadata << "Smoothing window size: " << fSmoothingWindow << RESTendl;
60-
RESTMetadata << "Baseline correction applied to signals with IDs in range (" << fSignalsRange.X() << "," << fSignalsRange.Y() << ")" << RESTendl;
60+
RESTMetadata << "Baseline correction applied to signals with IDs in range (" << fSignalsRange.X()
61+
<< "," << fSignalsRange.Y() << ")" << RESTendl;
6162

6263
EndPrintProcess();
6364
}

inc/TRestRawFEUDreamToSignalProcess.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class TRestRawFEUDreamToSignalProcess : public TRestRawToSignalProcess {
7373
bool get_zs_mode() const { return (((data)&0x400) >> 10); }
7474
int get_Feu_ID() const { return (((data)&0xFF)); }
7575
long int get_finetstp() const { return (((data)&0x0007)); }
76-
//#define GET_FINETSTP(word) (word & 0x0007)
76+
// #define GET_FINETSTP(word) (word & 0x0007)
7777
int get_sample_ID() const { return (((data)&0xFF8) >> 3); }
7878
int get_channel_ID() const { return (((data)&0x3F)); }
7979
int get_dream_ID() const { return (((data)&0xE00) >> 9); } // non-zS mode

inc/TRestRawSignalAnalysisProcess.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ class TRestRawSignalAnalysisProcess : public TRestEventProcess {
7070
BeginPrintProcess();
7171

7272
RESTMetadata << "Baseline range : ( " << fBaseLineRange.X() << " , " << fBaseLineRange.Y() << " ) "
73-
<< RESTendl;
73+
<< RESTendl;
7474
RESTMetadata << "Integral range : ( " << fIntegralRange.X() << " , " << fIntegralRange.Y() << " ) "
75-
<< RESTendl;
75+
<< RESTendl;
7676
RESTMetadata << "Point Threshold : " << fPointThreshold << " sigmas" << RESTendl;
7777
RESTMetadata << "Signal threshold : " << fSignalThreshold << " sigmas" << RESTendl;
7878
RESTMetadata << "Number of points over threshold : " << fPointsOverThreshold << RESTendl;

0 commit comments

Comments
 (0)