Skip to content

Commit

Permalink
Better alignment of the Track members
Browse files Browse the repository at this point in the history
  • Loading branch information
JuanGonzalezCaminero committed Nov 5, 2024
1 parent fa8ba18 commit 60f4df3
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 15 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ add_compile_options("$<$<AND:$<COMPILE_LANGUAGE:CUDA>,$<CONFIG:RelWithDebInfo>>:
# - For Debug, generate full debug information - this completely disables optimizations!
add_compile_options("$<$<AND:$<COMPILE_LANGUAGE:CUDA>,$<CONFIG:Debug>>:--device-debug>")
# - For both, interleave the source in PTX to enhance the debugging experience.
add_compile_options("$<$<AND:$<COMPILE_LANGUAGE:CUDA>,$<OR:$<CONFIG:RelWithDebInfo>,$<CONFIG:Debug>>>:-G>")
add_compile_options("$<$<AND:$<COMPILE_LANGUAGE:CUDA>,$<OR:$<CONFIG:RelWithDebInfo>,$<CONFIG:Debug>>>:--source-in-ptx>")

# Disable warnings from the CUDA frontend about unknown GCC pragmas - let the compiler decide what it likes.
add_compile_options("$<$<COMPILE_LANGUAGE:CUDA>:-Xcudafe;--diag_suppress=unrecognized_gcc_pragma>")
Expand Down
3 changes: 1 addition & 2 deletions examples/Example1/macros/example1_ttbar.mac.in
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,4 @@

# run events with parametrised simulation
# by default all created models are active
/run/beamOn 8

/run/beamOn 8
2 changes: 1 addition & 1 deletion examples/Example1/macros/example1_ttbar_LHCb.mac.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
## Geant4 macro for modelling simplified sampling calorimeters
## =============================================================================
##
/run/numberOfThreads 8
/run/numberOfThreads 1
/control/verbose 0
/run/verbose 0
/process/verbose 0
Expand Down
2 changes: 2 additions & 0 deletions include/AdePT/core/AdePTTransport.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@
#include <G4HepEmStateInit.hh>
#include <G4HepEmParameters.hh>
#include <G4HepEmMatCutData.hh>
#ifdef USE_SPLIT_KERNELS
#include <G4HepEmElectronTrack.hh>
#include <G4HepEmGammaTrack.hh>
#endif

#include <iostream>
#include <iomanip>
Expand Down
27 changes: 16 additions & 11 deletions include/AdePT/core/Track.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@
#include <AdePT/copcore/SystemOfUnits.h>
#include <AdePT/copcore/Ranluxpp.h>

#include <G4HepEmRandomEngine.hh>

#include <VecGeom/base/Vector3D.h>
#include <VecGeom/navigation/NavigationState.h>

#ifdef USE_SPLIT_KERNELS
#include <G4HepEmRandomEngine.hh>
#endif

// A data structure to represent a particle track. The particle type is implicit
// by the queue and not stored in memory.
struct Track {
using Precision = vecgeom::Precision;

int parentID{0}; // Stores the track id of the initial particle given to AdePT

RanluxppDouble rngState;
double eKin;
double numIALeft[3];
Expand All @@ -36,26 +36,31 @@ struct Track {
vecgeom::NavigationState navState;

#ifdef USE_SPLIT_KERNELS
RanluxppDouble newRNG;

// Variables used to store track info needed for scoring
double preStepEKin;
vecgeom::Vector3D<Precision> preStepPos;
vecgeom::Vector3D<Precision> preStepDir;
vecgeom::NavigationState nextState;
vecgeom::NavigationState preStepNavState;
vecgeom::Vector3D<Precision> preStepPos;
vecgeom::Vector3D<Precision> preStepDir;
RanluxppDouble newRNG;
double preStepEKin{0};

// Variables used to store navigation results
long hitsurfID{0};
bool propagated{false};
double geometryStepLength{0};
double safety{0};
long hitsurfID{0};
#endif

int parentID{0}; // Stores the track id of the initial particle given to AdePT

#ifdef USE_SPLIT_KERNELS
bool propagated{false};

// Variables used to store results from G4HepEM
bool restrictedPhysicalStepLength{false};
bool stopped{false};
#endif


__host__ __device__ double Uniform() { return rngState.Rndm(); }

__host__ __device__ void InitAsSecondary(const vecgeom::Vector3D<Precision> &parentPos,
Expand Down

0 comments on commit 60f4df3

Please sign in to comment.