Skip to content

Commit 06cf1bf

Browse files
authored
Merge pull request #125 from rest-for-physics/lobis-cosmic-particles
Add new particles to cosmic generator
2 parents af24dd5 + ed7d965 commit 06cf1bf

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

inc/TRestGeant4Metadata.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,10 @@ class TRestGeant4Metadata : public TRestMetadata {
128128
Long64_t fNRequestedEntries = 0;
129129

130130
/// \brief Time before simulation is ended and saved
131-
Int_t fSimulationMaxTimeSeconds = 0;
131+
Double_t fSimulationMaxTimeSeconds = 0;
132132

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

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

261261
inline Int_t GetSimulationMaxTimeSeconds() const { return fSimulationMaxTimeSeconds; }
262262

263-
inline Long64_t GetSimulationTime() const { return fSimulationTime; }
263+
inline Double_t GetSimulationTime() const { return fSimulationTime; }
264264

265265
// Direct access to sources definition in primary generator
266266
///////////////////////////////////////////////////////////
@@ -301,7 +301,7 @@ class TRestGeant4Metadata : public TRestMetadata {
301301

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

304-
inline void SetSimulationMaxTimeSeconds(Int_t seconds) { fSimulationMaxTimeSeconds = seconds; }
304+
inline void SetSimulationMaxTimeSeconds(Double_t seconds) { fSimulationMaxTimeSeconds = seconds; }
305305

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

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

387-
void SetSimulationTime(Long64_t time) { fSimulationTime = time; }
387+
void SetSimulationTime(Double_t time) { fSimulationTime = time; }
388388

389389
void PrintMetadata() override;
390390

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

401-
ClassDefOverride(TRestGeant4Metadata, 16);
401+
ClassDefOverride(TRestGeant4Metadata, 17);
402402

403403
// Allow modification of otherwise inaccessible / immutable members that shouldn't be modified by the user
404404
friend class SteppingAction;

src/TRestGeant4ParticleSourceCosmics.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ mutex TRestGeant4ParticleSourceCosmics::fMutex;
1010
unique_ptr<TRandom3> TRestGeant4ParticleSourceCosmics::fRandom = nullptr;
1111

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

1517
TRestGeant4ParticleSourceCosmics::TRestGeant4ParticleSourceCosmics() = default;
1618

0 commit comments

Comments
 (0)