Skip to content

Commit 4610dab

Browse files
committed
Fix some code style issues, add codacy
1 parent a5196f1 commit 4610dab

File tree

5 files changed

+45
-47
lines changed

5 files changed

+45
-47
lines changed

G4Batch.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -e
55
## Geant 4 Version
66
# If a specific Geant4 version should be used, adapt and uncomment these lines.
77
# source /data/jmayer/software/geant4.10.05/bin/geant4.sh
8-
echo "Using Geant4 Version `geant4-config --version` in `dirname $(dirname $(geant4-config --prefix))`"
8+
echo "Using Geant4 Version $(geant4-config --version) in $(dirname $(dirname $(geant4-config --prefix)))"
99

1010

1111
## Build Project
@@ -21,16 +21,16 @@ cd ..
2121
## Set CAD Directory
2222
if [ -z "${G4HORUS_CAD_DIR}" ]
2323
then
24-
export G4HORUS_CAD_DIR=`pwd`/cad
24+
export G4HORUS_CAD_DIR=$(pwd)/cad
2525
fi
2626
echo "CAD Dir: ${G4HORUS_CAD_DIR}"
2727

2828
## Create output dir and run full simulation
2929
mkdir -p out
3030
cd out
3131
TS=$(date +%Y-%m-%dT%H-%M-%S)
32-
mkdir ${TS}
33-
cd ${TS}
32+
mkdir "${TS}"
33+
cd "${TS}"
3434

3535

3636
## Macro File

G4Horus.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export LIBGL_ALWAYS_INDIRECT=y
1111
## Geant 4 Version
1212
# If a specific Geant4 version should be used, adapt and uncomment these lines.
1313
# source /data/jmayer/software/geant4.10.05/bin/geant4.sh
14-
echo "Using Geant4 Version `geant4-config --version` in `dirname $(dirname $(geant4-config --prefix))`"
14+
echo "Using Geant4 Version $(geant4-config --version) in $(dirname $(dirname $(geant4-config --prefix)))"
1515

1616
## Build Project
1717
# Remove previous build directory if it exists and recreate it

benchmark.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ time build > /dev/null
2929

3030

3131
## Set CAD Directory
32-
export G4HORUS_CAD_DIR=`pwd`/cad
32+
export G4HORUS_CAD_DIR=$(pwd)/cad
3333

3434

3535
## Create output dir and run full simulation
3636
mkdir -p out
3737
cd out
3838
TS=$(date +%Y-%m-%dT%H-%M-%S)
39-
mkdir ${TS}
40-
cd ${TS}
39+
mkdir "${TS}"
40+
cd "${TS}"
4141

4242

4343
echo "Time for startup:"

readme.md

Lines changed: 36 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,62 +2,61 @@
22

33
[![DOI](https://zenodo.org/badge/130987160.svg)](https://zenodo.org/badge/latestdoi/130987160)
44
[![Build Status](https://travis-ci.org/janmayer/G4Horus.svg?branch=master)](https://travis-ci.org/janmayer/G4Horus)
5+
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/63623e8d5afb46b3a83014f7281af38c)](https://www.codacy.com/manual/janmayer/G4Horus)
56

67
An implementation of the HORUS High-Purity Germanium (HPGe) γ-ray spectrometer and associated equipment in Geant4.
78

89
![G4Horus Default Geometry](doc/g4horus.png)
910

10-
1111
## Overview
1212

1313
The main goal of this project is to provide an accurate, easy-to-use efficiency simulation for the HORUS setup at the Institute for Nuclear Physics, University of Cologne.
1414

1515
Components:
1616

1717
- Geometries
18-
- Target Chambers
19-
- Astro Target Chamber
20-
- Astro Target Chamber V2
21-
- SONIC
22-
- SONIC V3
23-
- SONIC V3 ΔEE
24-
- Setups (HPGe Arrays with positions for HPGe Detectors)
25-
- HORUS (14)
26-
- Cologne Clover Counting Setup (2)
27-
- Detectors
28-
- High-Purity Germanium (HPGe)*
29-
- Coaxial (default)
30-
- Clover
31-
- Encapsulated Hexagonal
32-
- Bismuth Germanate (BGO) anti-Compton shields
33-
- [WIP] Passivated Implanted Planar Silicon (PIPS)
34-
- Auxiliary equipment
35-
- γ-Filter-Disks
36-
- [NYI] Passive γ-Supershields
18+
- Target Chambers
19+
- Astro Target Chamber
20+
- Astro Target Chamber V2
21+
- SONIC
22+
- SONIC V3
23+
- SONIC V3 ΔEE
24+
- Setups (HPGe Arrays with positions for HPGe Detectors)
25+
- HORUS (14)
26+
- Cologne Clover Counting Setup (2)
27+
- Detectors
28+
- High-Purity Germanium (HPGe)*
29+
- Coaxial (default)
30+
- Clover
31+
- Encapsulated Hexagonal
32+
- Bismuth Germanate (BGO) anti-Compton shields
33+
- (WIP) Passivated Implanted Planar Silicon (PIPS)
34+
- Auxiliary equipment
35+
- γ-Filter-Disks
36+
- (NYI) Passive γ-Supershields
3737
- Actions
38-
- Event Generators
39-
- Particle Gun
40-
- [WIP] Scattering Gun
41-
- [NYI] Coincidence Gun
42-
- Output Formats
43-
- ROOT Histograms
44-
- ROOT Ntuples (not recommended)
45-
- SOCOv2 Events
46-
- Evaluation
47-
- Visualization Mode
48-
- Batch processing Mode
49-
- Automated efficiency evaluation
38+
- Event Generators
39+
- Particle Gun
40+
- (WIP) Scattering Gun
41+
- (NYI) Coincidence Gun
42+
- Output Formats
43+
- ROOT Histograms
44+
- ROOT Ntuples (not recommended)
45+
- SOCOv2 Events
46+
- Evaluation
47+
- Visualization Mode
48+
- Batch processing Mode
49+
- Automated efficiency evaluation
5050

5151
\*) Note that each HPGe detector has unique properties, stored in the `DetectorLibrary`, and is referenced by its manufactured ID.
5252

53-
5453
## Getting Started
5554

5655
### Dependencies
56+
5757
- A not horribly outdated C++ build environment (`cmake` >= 3.11, `gcc` with C++11 support)
58-
- [Geant4](https://github.com/Geant4/geant4) >= 10.5
59-
(make sure the proper environment variables are set, see example in `G4Horus.sh`
60-
- [CadMesh](https://github.com/christopherpoole/CADMesh/tree/v1.1) V1.1 (exactly!) and its dependencies
58+
- [Geant4](https://github.com/Geant4/geant4) >= 10.5 (make sure the proper environment variables are set, see example in `G4Horus.sh`)
59+
- [CadMesh](https://github.com/christopherpoole/CADMesh/tree/v1.1) V1.1 (exactly!) and its dependencies (WIP)
6160

6261
### Installation
6362

@@ -74,7 +73,6 @@ The project should compile and open a visual interface with a default view shoul
7473
- Run `./G4Batch.sh scripts/doit.mac` or other macro files to run the actual simulation.
7574
- Use `./efficiency.sh` to automatically extract efficiencies from the simulated data.
7675

77-
7876
## Constructing the Setup
7977

8078
The experimental setup is assembled in `src/DetectorConstruction.cc`. Change the target chamber, detectors, and sensitive volumes here.
@@ -90,7 +88,7 @@ horus->PlaceDetector("73954", "Ge00", 20. * cm);
9088
horus->PlaceDetector(BGO::tSMALLNOSE, "BGO00", 10. * cm, {{"G4_Cu", 2. * mm}});
9189
```
9290
93-
and the sensitive volumes [WIP]:
91+
and the sensitive volumes (WIP):
9492
9593
```C++
9694
extern const std::vector<std::string> detectors = {"Ge00", "BGO00"};

src/geometries/SONIC.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ SONIC::SONIC(G4LogicalVolume* mother_l)
3131
//Defining Spheres
3232
G4double sph_thick = 4. * mm; //2
3333
G4double sph_outer = 60. * mm, sph_inner = sph_outer - sph_thick; //TODO CHECK OUTER DIAMETER
34-
G4ThreeVector sph_pos = G4ThreeVector();
34+
//G4ThreeVector sph_pos = G4ThreeVector();
3535
G4Sphere* sph_fullS = new G4Sphere("sphere_full", 0, sph_outer, 0. * deg, 360. * deg, 0. * deg, 360. * deg);
3636
G4Sphere* sph_hollS = new G4Sphere("sphere_holl", 0, sph_inner, 0. * deg, 360. * deg, 0. * deg, 360. * deg);
3737
//G4LogicalVolume* sph_fullLV = new G4LogicalVolume(sph_fullS, SONIC_mat, "Sphere_full",0,0,0);

0 commit comments

Comments
 (0)