Skip to content

Commit

Permalink
Merge pull request #125 from rest-for-physics/lobis-cosmic-particles
Browse files Browse the repository at this point in the history
Add new particles to cosmic generator
  • Loading branch information
lobis committed Apr 19, 2024
2 parents af24dd5 + ed7d965 commit 06cf1bf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
12 changes: 6 additions & 6 deletions inc/TRestGeant4Metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ class TRestGeant4Metadata : public TRestMetadata {
Long64_t fNRequestedEntries = 0;

/// \brief Time before simulation is ended and saved
Int_t fSimulationMaxTimeSeconds = 0;
Double_t fSimulationMaxTimeSeconds = 0;

/// \brief The time, in seconds, that the simulation took to complete.
Long64_t fSimulationTime = 0;
Double_t fSimulationTime = 0;

/// \brief The seed value used for Geant4 random event generator.
/// If it is zero its value will be assigned using the system timestamp.
Expand Down Expand Up @@ -260,7 +260,7 @@ class TRestGeant4Metadata : public TRestMetadata {

inline Int_t GetSimulationMaxTimeSeconds() const { return fSimulationMaxTimeSeconds; }

inline Long64_t GetSimulationTime() const { return fSimulationTime; }
inline Double_t GetSimulationTime() const { return fSimulationTime; }

// Direct access to sources definition in primary generator
///////////////////////////////////////////////////////////
Expand Down Expand Up @@ -301,7 +301,7 @@ class TRestGeant4Metadata : public TRestMetadata {

inline void SetNumberOfRequestedEntries(Long64_t n) { fNRequestedEntries = n; }

inline void SetSimulationMaxTimeSeconds(Int_t seconds) { fSimulationMaxTimeSeconds = seconds; }
inline void SetSimulationMaxTimeSeconds(Double_t seconds) { fSimulationMaxTimeSeconds = seconds; }

/// Sets the name of the sensitive volume
inline void InsertSensitiveVolume(const TString& volume) {
Expand Down Expand Up @@ -384,7 +384,7 @@ class TRestGeant4Metadata : public TRestMetadata {

void SetActiveVolume(const TString& name, Double_t chance, Double_t maxStep = 0);

void SetSimulationTime(Long64_t time) { fSimulationTime = time; }
void SetSimulationTime(Double_t time) { fSimulationTime = time; }

void PrintMetadata() override;

Expand All @@ -398,7 +398,7 @@ class TRestGeant4Metadata : public TRestMetadata {
TRestGeant4Metadata(const TRestGeant4Metadata& metadata);
TRestGeant4Metadata& operator=(const TRestGeant4Metadata& metadata);

ClassDefOverride(TRestGeant4Metadata, 16);
ClassDefOverride(TRestGeant4Metadata, 17);

// Allow modification of otherwise inaccessible / immutable members that shouldn't be modified by the user
friend class SteppingAction;
Expand Down
4 changes: 3 additions & 1 deletion src/TRestGeant4ParticleSourceCosmics.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ mutex TRestGeant4ParticleSourceCosmics::fMutex;
unique_ptr<TRandom3> TRestGeant4ParticleSourceCosmics::fRandom = nullptr;

const map<string, string> geant4ParticleNames = {
{"neutron", "neutron"}, {"proton", "proton"}, {"gamma", "gamma"}, {"electron", "e-"}, {"muon", "mu-"}};
{"neutron", "neutron"}, {"proton", "proton"}, {"gamma", "gamma"}, {"electron_minus", "e-"},
{"electron_plus", "e+"}, {"muon_minus", "mu-"}, {"muon_plus", "mu+"},
};

TRestGeant4ParticleSourceCosmics::TRestGeant4ParticleSourceCosmics() = default;

Expand Down

0 comments on commit 06cf1bf

Please sign in to comment.