Skip to content

Commit 140f3d1

Browse files
authored
Merge pull request #11 from lobis/master
Added GitHub Actions CI, Refactoring
2 parents 4f818da + c186412 commit 140f3d1

18 files changed

+225
-596
lines changed

.github/workflows/validation.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Validation
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
env:
10+
BUILD_TYPE: Debug
11+
FRAMEWORK_PATH: /__w/restG4/restG4/framework
12+
13+
defaults:
14+
run:
15+
shell: bash -ieo pipefail {0}
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
container:
21+
image: lobis/root-geant4-garfieldpp:cxx14_ROOTv6-25-01_Geant4v10.4.3
22+
23+
strategy:
24+
matrix:
25+
framework-branch: [master, development]
26+
27+
steps:
28+
- name: Source ROOT and Geant4
29+
run: |
30+
source /root/.bashrc
31+
printenv
32+
33+
- name: Checkout REST Framework
34+
uses: actions/checkout@v2
35+
with:
36+
repository: rest-for-physics/framework
37+
ref: ${{ matrix.framework-branch }}
38+
path: framework
39+
40+
- name: Pull submodules
41+
run: |
42+
cd ${{env.FRAMEWORK_PATH}}
43+
python3 pull-submodules.py
44+
45+
- name: Checkout RestG4 (this repository)
46+
uses: actions/checkout@v2
47+
with:
48+
path: framework/source/packages/restG4
49+
50+
- name: Debug - Print latest commit info in Framework souce
51+
run: |
52+
cd ${{env.FRAMEWORK_PATH}}/source/packages/restG4
53+
git branch
54+
git show -s --format=%H
55+
56+
- name: Configure CMake (REST Framework)
57+
run: |
58+
source /root/.bashrc
59+
cmake -B ${{env.FRAMEWORK_PATH}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DREST_G4=ON -DREST_EVE=OFF ${{env.FRAMEWORK_PATH}}
60+
61+
- name: Make
62+
run: make --directory=${{env.FRAMEWORK_PATH}}/build

include/DetectorConstruction.hh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1+
12
#ifndef DetectorConstruction_h
23
#define DetectorConstruction_h 1
34

4-
#include <G4PhysicalVolumeStore.hh>
5-
#include "G4VUserDetectorConstruction.hh"
6-
//#include <G4SystemOfUnits.hh>
7-
8-
#include <G4GDMLParser.hh>
9-
105
#include <TRestGeant4Event.h>
116
#include <TRestGeant4Metadata.h>
127

8+
#include <G4GDMLParser.hh>
9+
#include <G4PhysicalVolumeStore.hh>
10+
#include <G4VUserDetectorConstruction.hh>
11+
1312
class DetectorConstruction : public G4VUserDetectorConstruction {
1413
private:
1514
G4GDMLParser* parser;

include/EventAction.hh

Lines changed: 4 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,16 @@
1-
//
2-
// ********************************************************************
3-
// * License and Disclaimer *
4-
// * *
5-
// * The Geant4 software is copyright of the Copyright Holders of *
6-
// * the Geant4 Collaboration. It is provided under the terms and *
7-
// * conditions of the Geant4 Software License, included in the file *
8-
// * LICENSE and available at http://cern.ch/geant4/license . These *
9-
// * include a list of copyright holders. *
10-
// * *
11-
// * Neither the authors of this software system, nor their employing *
12-
// * institutes,nor the agencies providing financial support for this *
13-
// * work make any representation or warranty, express or implied, *
14-
// * regarding this software system or assume any liability for its *
15-
// * use. Please see the license in the file LICENSE and URL above *
16-
// * for the full disclaimer and the limitation of liability. *
17-
// * *
18-
// * This code implementation is the result of the scientific and *
19-
// * technical work of the GEANT4 collaboration. *
20-
// * By using, copying, modifying or distributing the software (or *
21-
// * any work based on the software) you agree to acknowledge its *
22-
// * use in resulting scientific publications, and indicate your *
23-
// * acceptance of all terms of the Geant4 Software license. *
24-
// ********************************************************************
25-
//
26-
/// \file radioactivedecay/rdecay01/include/EventAction.hh
27-
/// \brief Definition of the EventAction class
28-
//
29-
// $Id: EventAction.hh 68017 2013-03-13 13:29:53Z gcosmo $
30-
//
31-
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32-
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
331

342
#ifndef EventAction_h
353
#define EventAction_h 1
364

375
using namespace std;
386

39-
#include "G4UserEventAction.hh"
40-
#include "globals.hh"
41-
42-
#include "TH1D.h"
43-
7+
#include <TH1D.h>
448
#include <TRestGeant4Event.h>
459
#include <TRestGeant4Metadata.h>
4610
#include <TRestGeant4Track.h>
4711

48-
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
12+
#include <G4UserEventAction.hh>
13+
#include <globals.hh>
4914

5015
class EventAction : public G4UserEventAction {
5116
public:
@@ -62,7 +27,7 @@ class EventAction : public G4UserEventAction {
6227
return -x;
6328
}
6429

65-
int SetTrackSubeventIDs();
30+
int SetTrackSubEventIDs();
6631
static void FillSubEvent(Int_t subId);
6732
// old method `FillSubEvent` has been split into `FillSubEvent` and `ReOrderTrackIds` for speed
6833
static void ReOrderTrackIds(Int_t subId);
@@ -71,6 +36,4 @@ class EventAction : public G4UserEventAction {
7136
UInt_t sensitive_volume_hits_count = 0;
7237
};
7338

74-
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
75-
7639
#endif

include/Particles.hh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
#ifndef Particles_h
33
#define Particles_h 1
44

5-
#include "G4VPhysicsConstructor.hh"
6-
#include "globals.hh"
5+
#include <G4VPhysicsConstructor.hh>
6+
#include <globals.hh>
77

88
class Particles : public G4VPhysicsConstructor {
99
public:

include/PhysicsList.hh

Lines changed: 4 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,16 @@
1-
//
2-
// ********************************************************************
3-
// * License and Disclaimer *
4-
// * *
5-
// * The Geant4 software is copyright of the Copyright Holders of *
6-
// * the Geant4 Collaboration. It is provided under the terms and *
7-
// * conditions of the Geant4 Software License, included in the file *
8-
// * LICENSE and available at http://cern.ch/geant4/license . These *
9-
// * include a list of copyright holders. *
10-
// * *
11-
// * Neither the authors of this software system, nor their employing *
12-
// * institutes,nor the agencies providing financial support for this *
13-
// * work make any representation or warranty, express or implied, *
14-
// * regarding this software system or assume any liability for its *
15-
// * use. Please see the license in the file LICENSE and URL above *
16-
// * for the full disclaimer and the limitation of liability. *
17-
// * *
18-
// * This code implementation is the result of the scientific and *
19-
// * technical work of the GEANT4 collaboration. *
20-
// * By using, copying, modifying or distributing the software (or *
21-
// * any work based on the software) you agree to acknowledge its *
22-
// * use in resulting scientific publications, and indicate your *
23-
// * acceptance of all terms of the Geant4 Software license. *
24-
// ********************************************************************
25-
//
26-
/// \file radioactivedecay/rdecay01/include/PhysicsList.hh
27-
/// \brief Definition of the PhysicsList class
28-
//
29-
//
30-
// $Id: PhysicsList.hh 68017 2013-03-13 13:29:53Z gcosmo $
31-
//
32-
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33-
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
341

352
#ifndef PhysicsList_h
363
#define PhysicsList_h 1
374

38-
#include "G4EmConfigurator.hh"
39-
#include "G4VModularPhysicsList.hh"
40-
#include "globals.hh"
41-
425
#include <TRestGeant4PhysicsLists.h>
436

7+
#include <G4EmConfigurator.hh>
8+
#include <G4VModularPhysicsList.hh>
9+
#include <globals.hh>
10+
4411
using namespace std;
4512
class G4VPhysicsConstructor;
4613

47-
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
48-
4914
class PhysicsList : public G4VModularPhysicsList {
5015
public:
5116
PhysicsList();
@@ -70,6 +35,4 @@ class PhysicsList : public G4VModularPhysicsList {
7035
TRestGeant4PhysicsLists* restPhysList;
7136
};
7237

73-
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
74-
7538
#endif

include/PrimaryGeneratorAction.hh

Lines changed: 7 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,24 @@
1-
//
2-
// ********************************************************************
3-
// * License and Disclaimer *
4-
// * *
5-
// * The Geant4 software is copyright of the Copyright Holders of *
6-
// * the Geant4 Collaboration. It is provided under the terms and *
7-
// * conditions of the Geant4 Software License, included in the file *
8-
// * LICENSE and available at http://cern.ch/geant4/license . These *
9-
// * include a list of copyright holders. *
10-
// * *
11-
// * Neither the authors of this software system, nor their employing *
12-
// * institutes,nor the agencies providing financial support for this *
13-
// * work make any representation or warranty, express or implied, *
14-
// * regarding this software system or assume any liability for its *
15-
// * use. Please see the license in the file LICENSE and URL above *
16-
// * for the full disclaimer and the limitation of liability. *
17-
// * *
18-
// * This code implementation is the result of the scientific and *
19-
// * technical work of the GEANT4 collaboration. *
20-
// * By using, copying, modifying or distributing the software (or *
21-
// * any work based on the software) you agree to acknowledge its *
22-
// * use in resulting scientific publications, and indicate your *
23-
// * acceptance of all terms of the Geant4 Software license. *
24-
// ********************************************************************
25-
//
26-
/// \file radioactivedecay/rdecay01/include/PrimaryGeneratorAction.hh
27-
/// \brief Definition of the PrimaryGeneratorAction class
28-
//
29-
//
30-
// $Id: PrimaryGeneratorAction.hh 68017 2013-03-13 13:29:53Z gcosmo $
31-
//
32-
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33-
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
341

352
#ifndef PrimaryGeneratorAction_h
363
#define PrimaryGeneratorAction_h 1
374

38-
#include "DetectorConstruction.hh"
39-
#include "G4IonTable.hh"
40-
#include "G4ParticleGun.hh"
41-
#include "G4VUserPrimaryGeneratorAction.hh"
42-
#include "globals.hh"
43-
445
#include <TH1D.h>
456

7+
#include <G4IonTable.hh>
8+
#include <G4ParticleGun.hh>
9+
#include <G4VUserPrimaryGeneratorAction.hh>
4610
#include <fstream>
11+
#include <globals.hh>
4712
#include <iostream>
13+
14+
#include "DetectorConstruction.hh"
15+
4816
using namespace std;
4917

5018
const int nSpct = 3000;
5119

5220
class G4Event;
5321

54-
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
55-
5622
class PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction {
5723
public:
5824
PrimaryGeneratorAction(DetectorConstruction* pDetector);
@@ -143,6 +109,4 @@ class PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction {
143109
G4int nCollections;
144110
};
145111

146-
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
147-
148112
#endif

include/RunAction.hh

Lines changed: 4 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,18 @@
1-
//
2-
// ********************************************************************
3-
// * License and Disclaimer *
4-
// * *
5-
// * The Geant4 software is copyright of the Copyright Holders of *
6-
// * the Geant4 Collaboration. It is provided under the terms and *
7-
// * conditions of the Geant4 Software License, included in the file *
8-
// * LICENSE and available at http://cern.ch/geant4/license . These *
9-
// * include a list of copyright holders. *
10-
// * *
11-
// * Neither the authors of this software system, nor their employing *
12-
// * institutes,nor the agencies providing financial support for this *
13-
// * work make any representation or warranty, express or implied, *
14-
// * regarding this software system or assume any liability for its *
15-
// * use. Please see the license in the file LICENSE and URL above *
16-
// * for the full disclaimer and the limitation of liability. *
17-
// * *
18-
// * This code implementation is the result of the scientific and *
19-
// * technical work of the GEANT4 collaboration. *
20-
// * By using, copying, modifying or distributing the software (or *
21-
// * any work based on the software) you agree to acknowledge its *
22-
// * use in resulting scientific publications, and indicate your *
23-
// * acceptance of all terms of the Geant4 Software license. *
24-
// ********************************************************************
25-
//
26-
/// \file radioactivedecay/rdecay01/include/RunAction.hh
27-
/// \brief Definition of the RunAction class
28-
//
29-
//
30-
// $Id: RunAction.hh 68017 2013-03-13 13:29:53Z gcosmo $
31-
//
32-
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33-
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
341

352
#ifndef RunAction_h
363
#define RunAction_h 1
374

38-
#include <map>
39-
#include "G4UserRunAction.hh"
40-
#include "globals.hh"
41-
5+
#include <G4UserRunAction.hh>
426
#include <fstream>
7+
#include <globals.hh>
438
#include <iostream>
9+
#include <map>
10+
4411
using namespace std;
4512

4613
class G4Run;
4714
class PrimaryGeneratorAction;
4815

49-
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
50-
5116
class RunAction : public G4UserRunAction {
5217
public:
5318
RunAction(PrimaryGeneratorAction*);
@@ -69,6 +34,4 @@ class RunAction : public G4UserRunAction {
6934
G4double fPbalance[3];
7035
};
7136

72-
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
73-
7437
#endif

include/SteppingAction.hh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1+
12
#ifndef SteppingAction_h
23
#define SteppingAction_h 1
34

4-
#include "G4RunManager.hh"
5-
#include "G4UserSteppingAction.hh"
6-
#include "globals.hh"
7-
8-
#include "TH1D.h"
9-
#include "TH2D.h"
10-
5+
#include <TH1D.h>
6+
#include <TH2D.h>
117
#include <TRestGeant4BiasingVolume.h>
128

9+
#include <G4RunManager.hh>
10+
#include <G4UserSteppingAction.hh>
1311
#include <fstream>
12+
#include <globals.hh>
1413
#include <iostream>
14+
1515
using namespace std;
1616

1717
class SteppingAction : public G4UserSteppingAction {

0 commit comments

Comments
 (0)