diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6c027a23..467c18e7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,4 @@ -image: ghcr.io/lobis/root-geant4-garfield:cpp17_ROOT-v6-26-00_Geant4-v10.4.3_Garfield-af4a1451 -#image: nkx1231/root6-geant4-garfield:0.8 +image: ghcr.io/lobis/root-geant4-garfield:rest-for-physics stages: - build @@ -19,7 +18,7 @@ before_script: # This is the one we use to run validations tests. We save the installation as an artifact. Build and Install: - type: build + stage: build script: - echo "**${CI_PROJECT_DIR}**" - git clone https://github.com/rest-for-physics/framework.git framework @@ -51,7 +50,7 @@ Build and Install: expire_in: 1 day Build Standalone: - type: build-standalone + stage: build-standalone script: - echo "**${CI_PROJECT_DIR}**" - cd ${CI_PROJECT_DIR}/ @@ -65,13 +64,13 @@ Build Standalone: - rm -rf ${CI_PROJECT_DIR}/install-standalone Load REST Libraries: - type: loadRESTLibs + stage: loadRESTLibs script: - . ${CI_PROJECT_DIR}/install/thisREST.sh - restRoot -b -q 01_NLDBD: - type: examples + stage: examples script: - . ${CI_PROJECT_DIR}/install/thisREST.sh - cd ${CI_PROJECT_DIR}/install/examples/restG4/01.NLDBD/ @@ -80,7 +79,7 @@ Load REST Libraries: - restRoot -b -q Validate.C'("Run00001_NLDBD_Test.root")' 03_Fluorescence: - type: examples + stage: examples script: - . ${CI_PROJECT_DIR}/install/thisREST.sh - cd ${CI_PROJECT_DIR}/install/examples/restG4/03.Fluorescence/ @@ -90,7 +89,7 @@ Load REST Libraries: - restRoot -b -q Validate.C'("Run00111_g4Analysis_Gamma_rest.root")' 04_MuonScan: - type: examples + stage: examples script: - . ${CI_PROJECT_DIR}/install/thisREST.sh - cd ${CI_PROJECT_DIR}/install/examples/restG4/04.MuonScan/ @@ -101,7 +100,7 @@ Load REST Libraries: - restRoot -b -q ValidateWall.C'("Run00111_restG4_MuonsFromWall_rest.root")' 05_PandaXIII: - type: examples + stage: examples script: - . ${CI_PROJECT_DIR}/install/thisREST.sh - cd ${CI_PROJECT_DIR}/install/examples/restG4/05.PandaXIII/ @@ -109,7 +108,7 @@ Load REST Libraries: - restRoot -b -q ValidateG4.C'("Xe136bb0n_n2E06.root")' 06_IonRecoils: - type: examples + stage: examples script: - . ${CI_PROJECT_DIR}/install/thisREST.sh - cd ${CI_PROJECT_DIR}/install/examples/restG4/06.IonRecoils/ @@ -117,7 +116,7 @@ Load REST Libraries: - restRoot -b -q Validate.C'("Run00001_F20_Recoils.root")' 07_FullChainDecay: - type: examples + stage: examples script: - . ${CI_PROJECT_DIR}/install/thisREST.sh - cd ${CI_PROJECT_DIR}/install/examples/restG4/07.FullChainDecay/ @@ -130,7 +129,7 @@ Load REST Libraries: - restRoot -b -q Validate.C'("Run00002_Be7_SingleChainDecay.root", 1)' 08_Alphas: - type: examples + stage: examples script: - . ${CI_PROJECT_DIR}/install/thisREST.sh - cd ${CI_PROJECT_DIR}/install/examples/restG4/08.Alphas/ @@ -151,7 +150,7 @@ Load REST Libraries: - restRoot -b -q Validate.C 09_Pb210_Shielding: - type: examples + stage: examples script: - . ${CI_PROJECT_DIR}/install/thisREST.sh - cd ${CI_PROJECT_DIR}/install/examples/restG4/09.Pb210_Shield/ @@ -159,7 +158,7 @@ Load REST Libraries: - restRoot -b -q Validate.C'("Run00001_Pb210_Shielding.root")' 10_Geometries: - type: examples + stage: examples script: - . ${CI_PROJECT_DIR}/install/thisREST.sh - cd ${CI_PROJECT_DIR}/install/examples/restG4/10.Geometries/ @@ -167,7 +166,7 @@ Load REST Libraries: - restRoot -b -q Validate.C'("Run00001_Assembly_Assembly.root")' 11_Xrays: - type: examples + stage: examples script: - . ${CI_PROJECT_DIR}/install/thisREST.sh - cd ${CI_PROJECT_DIR}/install/examples/restG4/11.Xrays/ diff --git a/src/EventAction.cxx b/src/EventAction.cxx index 5b6bac4f..35b63a87 100644 --- a/src/EventAction.cxx +++ b/src/EventAction.cxx @@ -183,11 +183,11 @@ void EventAction::FillSubEvent(Int_t subId) { } for (int n = 0; n < restG4Event->GetNumberOfTracks(); n++) { - TRestGeant4Track* tck = restG4Event->GetTrack(n); + const auto& tck = restG4Event->GetTrack(n); - if (tck->GetSubEventID() == subId) - if (tck->GetNumberOfHits() > 0 || restG4Metadata->RegisterEmptyTracks()) { - subRestG4Event->AddTrack(*tck); + if (tck.GetSubEventID() == subId) + if (tck.GetNumberOfHits() > 0 || restG4Metadata->RegisterEmptyTracks()) { + subRestG4Event->AddTrack(tck); } } @@ -206,10 +206,10 @@ void EventAction::ReOrderTrackIds(Int_t subId) { if (subId > 0) { for (int n = 0; n < restG4Event->GetNumberOfTracks(); n++) { - TRestGeant4Track* tck = restG4Event->GetTrack(n); + const auto& tck = restG4Event->GetTrack(n); - if (tck->GetSubEventID() == subId - 1) - if (tck->isRadiactiveDecay()) subRestG4Event->SetSubEventTag(tck->GetParticleName()); + if (tck.GetSubEventID() == subId - 1) + if (tck.isRadiactiveDecay()) subRestG4Event->SetSubEventTag(tck.GetParticleName()); } } @@ -218,27 +218,27 @@ void EventAction::ReOrderTrackIds(Int_t subId) { Int_t nTracks = subRestG4Event->GetNumberOfTracks(); for (int i = 0; i < nTracks; i++) { - TRestGeant4Track* tr = subRestG4Event->GetTrack(i); + const auto& tr = subRestG4Event->GetTrackPointer(i); tr->SetTrackID(tr->GetTrackID() - lowestID + 1); tr->SetParentID(tr->GetParentID() - lowestID + 1); if (tr->GetParentID() < 0) tr->SetParentID(0); } for (int i = 0; i < nTracks; i++) { - TRestGeant4Track* tr = subRestG4Event->GetTrack(i); + TRestGeant4Track* tr = subRestG4Event->GetTrackPointer(i); Int_t id = tr->GetTrackID(); if (id - i != 1) { // Changing track ids tr->SetTrackID(i + 1); for (int t = i + 1; t < subRestG4Event->GetNumberOfTracks(); t++) { - TRestGeant4Track* tr2 = subRestG4Event->GetTrack(t); + TRestGeant4Track* tr2 = subRestG4Event->GetTrackPointer(t); if (tr2->GetTrackID() == i + 1) tr2->SetTrackID(id); } // Changing parent ids for (int t = 0; t < subRestG4Event->GetNumberOfTracks(); t++) { - TRestGeant4Track* tr2 = subRestG4Event->GetTrack(t); + TRestGeant4Track* tr2 = subRestG4Event->GetTrackPointer(t); if (tr2->GetParentID() == id) tr2->SetParentID(i + 1); else if (tr2->GetParentID() == i + 1) @@ -255,7 +255,7 @@ int EventAction::SetTrackSubEventIDs() { // reorder tracks map tracks; for (int n = 0; n < nTracks; n++) { - TRestGeant4Track* track = restG4Event->GetTrack(n); + TRestGeant4Track* track = restG4Event->GetTrackPointer(n); tracks[track->GetTrackID()] = track; }