Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added test for converter script and CLIC reconstruction #19

Merged
merged 6 commits into from
Oct 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/scripts/gmp_build_and_test.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

yum -y install make git
yum -y install make git wget

source /cvmfs/clicdp.cern.ch/iLCSoft/lcg/97/nightly/x86_64-centos7-gcc8-opt/init_ilcsoft.sh

Expand All @@ -15,4 +15,4 @@ cmake \
.. && \
make -j 2 && \
make install && \
ctest -R test_gmp2 -V
ctest --verbose --output-on-failure
2 changes: 1 addition & 1 deletion GMPWrapper/examples/runit.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

read = LcioEvent()
read.OutputLevel = DEBUG
read.Files = ["../test/inputFiles/my.slcio"]
read.Files = ["../test/inputFiles/muons.slcio"]
algList.append(read)

END_TAG = "END_TAG"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Copy file and run:

```bash
mkdir ../test/inputFiles
cp /path/to/muon.slcio ../test/inputFiles/my.slcio
cp /path/to/muons.slcio ../test/inputFiles/muons.slcio
./run gaudirun.py ../GMPWrapper/examples/runit.py
```

Expand All @@ -41,7 +41,7 @@ cp /path/to/muon.slcio ../test/inputFiles/my.slcio
```bash
# Check that input file exist
mkdir ../test/inputFiles
cp /path/to/muon.slcio ../test/inputFiles/my.slcio
cp /path/to/muons.slcio ../test/inputFiles/muons.slcio
# Display available tests
ctest -N
# Run tests
Expand Down
9 changes: 8 additions & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,11 @@ if (BASH_PROGRAM)
ENVIRONMENT GMP_tests_DIR=${CMAKE_CURRENT_SOURCE_DIR}
PASS_REGULAR_EXPRESSION "INFO Application Manager Terminated successfully")

endif(BASH_PROGRAM)
# Test clicReconstruction
add_test( test_clicReconstruction ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/test_clicReconstruction.sh )
set_tests_properties ( test_clicReconstruction
PROPERTIES
ENVIRONMENT GMP_tests_DIR=${CMAKE_CURRENT_SOURCE_DIR}
PASS_REGULAR_EXPRESSION "INFO Application Manager Terminated successfully")

endif(BASH_PROGRAM)
2 changes: 1 addition & 1 deletion test/gaudi_opts/test_gmp1.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

read = LcioEvent()
read.OutputLevel = DEBUG
read.Files = ["$GMP_tests_DIR/inputFiles/my.slcio"]
read.Files = ["$GMP_tests_DIR/inputFiles/muons.slcio"]
algList.append(read)

END_TAG = "END_TAG"
Expand Down
42 changes: 42 additions & 0 deletions test/scripts/test_clicReconstruction.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash
# exit if command or variable fails
set -eu

# Clone CLICPerformance for input files
if [ ! -d CLICPerformance ]; then
git clone https://github.com/iLCSoft/CLICPerformance
fi

cd CLICPerformance/clicConfig

python \
$GMP_tests_DIR/../GMPWrapper/scripts/convertMarlinSteeringToGaudi.py \
clicReconstruction.xml \
clicReconstruction.py

# Generate slcio file if not present
if [ ! -f testSimulation.slcio ]; then
echo "Input file not found. Generating one..."
ddsim \
--steeringFile clic_steer.py \
--inputFiles ../Tests/yyxyev_000.stdhep -N 4 \
--compactFile $ILCSOFT/lcgeo/HEAD/CLIC/compact/CLIC_o3_v14/CLIC_o3_v14.xml \
--outputFile testSimulation.slcio
fi


echo "Modifying clicReconstruction.py file..."
# Replace SLCIO file path
sed -i 's|/run/simulation/with/ctest/to/create/a/file.slcio|testSimulation.slcio|g' clicReconstruction.py
# Uncomment selected optional processors
sed -i 's;EvtMax = 10,;EvtMax = 3,;' clicReconstruction.py
sed -i 's;"MaxRecordNumber", "10", END_TAG,;"MaxRecordNumber", "3", END_TAG,;' clicReconstruction.py
sed -i 's;# algList.append(OverlayFalse);algList.append(OverlayFalse);' clicReconstruction.py
sed -i 's;# algList.append(MyConformalTracking);algList.append(MyConformalTracking);' clicReconstruction.py
sed -i 's;# algList.append(ClonesAndSplitTracksFinder);algList.append(ClonesAndSplitTracksFinder);' clicReconstruction.py
sed -i 's;# algList.append(RenameCollection);algList.append(RenameCollection);' clicReconstruction.py
sed -i 's;"DD4hepXMLFile", ".*",; "DD4hepXMLFile", os.environ["ILCSOFT"]+"/lcgeo/HEAD/CLIC/compact/CLIC_o3_v14/CLIC_o3_v14.xml",;' clicReconstruction.py
# Change output level for correct test confirmation
sed -i 's;OutputLevel=WARNING; OutputLevel=DEBUG;' clicReconstruction.py

../../../run gaudirun.py clicReconstruction.py
10 changes: 10 additions & 0 deletions test/scripts/test_gmp1.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
#!/bin/bash
# set -eu

if [ ! -d $GMP_tests_DIR/inputFiles/ ]; then
mkdir $GMP_tests_DIR/inputFiles
fi

if [ ! -f $GMP_tests_DIR/inputFiles/muons.slcio ]; then
wget https://github.com/AIDASoft/DD4hep/raw/master/DDTest/inputFiles/muons.slcio -P $GMP_tests_DIR/inputFiles/
fi

../run gaudirun.py $GMP_tests_DIR/gaudi_opts/test_gmp1.py