Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cbmroot
Manage
Activity
Members
Labels
Plan
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Computing
cbmroot
Commits
b0c7d689
Commit
b0c7d689
authored
1 year ago
by
Felix Weiglhofer
Committed by
Florian Uhlig
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
algo: Add test to ensure online reconstruction can process timeslice.
parent
6ee55548
No related branches found
No related tags found
1 merge request
!1457
algo: Add test to ensure online reconstruction can process timeslice.
Pipeline
#25156
passed
1 year ago
Stage: build
Stage: package
Stage: verify
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
algo/test/CMakeLists.txt
+17
-0
17 additions, 0 deletions
algo/test/CMakeLists.txt
algo/test/realdata_test.sh
+94
-0
94 additions, 0 deletions
algo/test/realdata_test.sh
with
111 additions
and
0 deletions
algo/test/CMakeLists.txt
+
17
−
0
View file @
b0c7d689
...
@@ -20,3 +20,20 @@ AddBasicTest(_GTestDigiEventSelector)
...
@@ -20,3 +20,20 @@ AddBasicTest(_GTestDigiEventSelector)
AddBasicTest
(
_GTestYamlConfig
)
AddBasicTest
(
_GTestYamlConfig
)
AddBasicTest
(
_GTestPartitionedVector
)
AddBasicTest
(
_GTestPartitionedVector
)
AddBasicTest
(
_GTestPartitionedSpan
)
AddBasicTest
(
_GTestPartitionedSpan
)
if
(
DEFINED ENV{RAW_DATA_PATH}
)
set
(
RAW_DATA_PATH $ENV{RAW_DATA_PATH}
)
set
(
TEST_SCRIPT
${
CMAKE_SOURCE_DIR
}
/algo/test/realdata_test.sh
)
set
(
RECO_BIN
${
EXECUTABLE_OUTPUT_PATH
}
/cbmreco
)
set
(
PARAMS_DIR
${
CMAKE_SOURCE_DIR
}
/parameters/online
)
set
(
TSA_FILE
${
RAW_DATA_PATH
}
/2391_firstTs.tsa
)
Add_Test
(
NAME OnlineRecoCanProcessTimeslice
COMMAND
${
TEST_SCRIPT
}
${
RECO_BIN
}
${
PARAMS_DIR
}
${
TSA_FILE
}
)
set_tests_properties
(
OnlineRecoCanProcessTimeslice PROPERTIES TIMEOUT 600
)
endif
()
This diff is collapsed.
Click to expand it.
algo/test/realdata_test.sh
0 → 100755
+
94
−
0
View file @
b0c7d689
#!/bin/bash
cbmreco_bin
=
$1
parameter_dir
=
$2
tsa_file
=
$3
reco_args
=
"
\
-p
$parameter_dir
\
-i
$tsa_file
\
-n1
\
--steps Unpack DigiTrigger LocalReco
\
"
script
=
$(
readlink
-f
"
$0
"
)
function
check_arg
{
if
[
-z
"
$1
"
]
;
then
echo
"Error: <
$2
> not specified."
echo
"Usage:
$script
<cbmreco_bin> <parameter_dir> <tsa_file>"
exit
1
fi
}
function
ensure_gt_zero
{
local
output
=
"
$1
"
local
pattern
=
"
$2
"
# Extract placeholders from the pattern, e.g. %1, %2, ..., %9
# [[ $? == 1 ]] is a workaround for the following issue:
# grep returns 1 if no match is found, but set -e causes the script to exit in this case
placeholders
=(
$(
echo
"
$pattern
"
|
grep
-o
'%[0-9]\+'
||
[[
$?
==
1
]]
)
)
if
[[
$?
-ne
0
]]
;
then
echo
"Error: Failed to extract placeholders:
$pattern
"
exit
1
fi
if
[
-z
"
${
placeholders
[*]
}
"
]
;
then
echo
"Error: No placeholders found:
$pattern
"
exit
1
fi
# Replace placeholders with a regex that matches the value
sed_pattern
=
$pattern
for
placeholder
in
"
${
placeholders
[@]
}
"
;
do
sed_pattern
=
"
${
sed_pattern
//
$placeholder
/\\([0-9]\\+\\)
}
"
done
for
placeholder
in
"
${
placeholders
[@]
}
"
;
do
# Use sed to extract the value for the current placeholder
# echo "Searching for $placeholder..."
id
=
$(
echo
"
$placeholder
"
|
grep
-o
'[0-9]\+'
)
value
=
$(
echo
"
$output
"
|
sed
-n
"s/.*
$sed_pattern
.*/
\\
$id
/p"
)
if
[
-n
"
$value
"
]
&&
[
"
$value
"
-gt
0
]
;
then
continue
else
echo
"
$pattern
: FAIL (
$placeholder
is not greater than zero.)"
echo
"Output:"
echo
"
$output
"
exit
1
fi
done
echo
"
$pattern
: OK"
}
check_arg
"
$cbmreco_bin
"
"cbmreco_bin"
check_arg
"
$parameter_dir
"
"parameter_dir"
check_arg
"
$tsa_file
"
"tsa_file"
# Run the reconstruction and capture the log
echo
"Running '
$cbmreco_bin
$reco_args
'"
log
=
"
$(
$cbmreco_bin
$reco_args
2>&1
)
"
reco_ok
=
$?
echo
"
$log
"
echo
"=============================="
if
[
$reco_ok
-ne
0
]
;
then
echo
"Error: Reconstruction failed. Exit early."
exit
1
fi
# Check Digis
ensure_gt_zero
"
$log
"
"Timeslice contains %1 STS Digis"
ensure_gt_zero
"
$log
"
"Timeslice contains %1 TOF Digis"
ensure_gt_zero
"
$log
"
"Timeslice contains %1 BMON Digis"
ensure_gt_zero
"
$log
"
"Timeslice contains %1 MUCH Digis"
ensure_gt_zero
"
$log
"
"Timeslice contains %1 TRD Digis"
ensure_gt_zero
"
$log
"
"Timeslice contains %1 TRD2D Digis"
ensure_gt_zero
"
$log
"
"Timeslice contains %1 RICH Digis"
# Check Events
ensure_gt_zero
"
$log
"
"Triggers: %1, events %2"
# Check Hits
ensure_gt_zero
"
$log
"
"TS contains %1 TOF Hits"
ensure_gt_zero
"
$log
"
"Timeslice contains %1 STS hits and %2 STS clusters"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment