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

Fix find_vertex.C to make ROOT interpreter happy #375

Closed
wants to merge 5 commits into from
Closed
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
46 changes: 46 additions & 0 deletions .github/workflows/build-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,52 @@ jobs:
docker run --volumes-from star-test-data ghcr.io/star-bnl/star-sw-${{ env.STARENV }} \
sh -c "set -e; MALLOC_CHECK_=3 $TEST_CMD 2>&1 | tee log; grep 'Run completed' log"

ROOT5_test_macros:
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
test_id: [102, 103]
env:
STARENV: root5-gcc485
steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: star-sw-${{ env.STARENV }}
path: /tmp

- run: docker load --input /tmp/star-sw-${{ env.STARENV }}.tar
- run: docker run --name star-test-data --volume /star ghcr.io/star-bnl/star-test-data:v4
- run: |
TEST_FILE=$(echo "$(docker run --rm ghcr.io/star-bnl/star-sw-${{ env.STARENV }} tests/executest.py ${{ matrix.test_id }} -a fullpath)" | sed -E 's/\.(daq|fzd)$/.event.root/')
TEST_CMD="root4star -b -q -l 'StRoot/macros/analysis/doEvents.C(100, \"$TEST_FILE\")'"
docker run --volumes-from star-test-data ghcr.io/star-bnl/star-sw-${{ env.STARENV }} \
sh -c "set -e; $TEST_CMD 2>&1 | tee log; grep '<StIOMaker::Finish> IO:' log"

ROOT5_test_find_vertex:
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
test_id: [102]
env:
STARENV: root5-gcc485
steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: star-sw-${{ env.STARENV }}
path: /tmp

- run: docker load --input /tmp/star-sw-${{ env.STARENV }}.tar
- run: docker run --name star-test-data --volume /star ghcr.io/star-bnl/star-test-data:v4
- run: |
TEST_FILE=$(echo "$(docker run --rm ghcr.io/star-bnl/star-sw-${{ env.STARENV }} tests/executest.py ${{ matrix.test_id }} -a fullpath)" | sed -E 's/\.(daq|fzd)$/.event.root/')
TEST_CMD="root4star -b -q -l 'StRoot/macros/analysis/find_vertex.C(\"$TEST_FILE\")'"
docker run --volumes-from star-test-data ghcr.io/star-bnl/star-sw-${{ env.STARENV }} \
sh -c "set -e; $TEST_CMD 2>&1 | tee log; grep '<StIOMaker::Finish> IO:' log"

ROOT6_test_ignore_fail:
runs-on: ubuntu-latest
needs: build
Expand Down
3 changes: 3 additions & 0 deletions StRoot/macros/analysis/find_vertex.C
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ class StChain;
class StMinuitVertexFinder;
class StGenericVertexFinder;
class StGenericVertexMaker;
class StEvent;
class StPrimaryVertex;

StChain *chain=0;
TH1F *dca_z_h=0;
Expand Down Expand Up @@ -122,6 +124,7 @@ void find_vertex(char * fname="high_053/st_physics_6053108_raw_2020002.event.roo

gSystem->Load("Sti");
gSystem->Load("libStEEmcUtil");
gSystem->Load("libMinuit");
gSystem->Load("StGenericVertexMaker");

TFile *fout = new TFile("vtx_tree.root","RECREATE");
Expand Down
6 changes: 6 additions & 0 deletions tests/executest.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def _json_object_hook(d):
parser.add_argument("jobid")
parser.add_argument("-d", "--description", default=False, action="store_true", help="Print job description")
parser.add_argument("-c", "--command", default=False, action="store_true", help="Print command")
parser.add_argument("-a", "--attribute", default='', choices=JobInfo._fields + ('fullpath', ), help="Print job's attribute")
args = parser.parse_args()

joblist_file = os.path.join(os.path.dirname(__file__), "joblist.json")
Expand All @@ -40,3 +41,8 @@ def _json_object_hook(d):
if job.jobid != args.jobid: continue
if args.description: print("{descr}".format(**job._asdict()))
if args.command: print("root4star -b -q -l \'bfc.C({nevents}, \"{chopts}\", \"{inppath}/{inpfile}\")\'".format(**job._asdict()))
if args.attribute:
if args.attribute == 'fullpath':
print("{}/{}".format(job.inppath, job.inpfile))
else:
print(job._asdict()[args.attribute])