17#ifndef _RMG_GENERATOR_MUSUN_COSMIC_MUONS_HH_
18#define _RMG_GENERATOR_MUSUN_COSMIC_MUONS_HH_
22#include "CLHEP/Units/SystemOfUnits.h"
23#include "G4GenericMessenger.hh"
24#include "G4ParticleGun.hh"
26#include "RMGAnalysisReader.hh"
27#include "RMGVGenerator.hh"
28#include "RMGVVertexGenerator.hh"
61class RMGGeneratorMUSUNCosmicMuons :
public RMGVGenerator {
65 RMGGeneratorMUSUNCosmicMuons();
66 ~RMGGeneratorMUSUNCosmicMuons() =
default;
68 RMGGeneratorMUSUNCosmicMuons(RMGGeneratorMUSUNCosmicMuons
const&) =
delete;
69 RMGGeneratorMUSUNCosmicMuons& operator=(RMGGeneratorMUSUNCosmicMuons
const&) =
delete;
70 RMGGeneratorMUSUNCosmicMuons(RMGGeneratorMUSUNCosmicMuons&&) =
delete;
71 RMGGeneratorMUSUNCosmicMuons& operator=(RMGGeneratorMUSUNCosmicMuons&&) =
delete;
85 void DefineCommands();
86 void SetMUSUNFile(
G4String pathToFile);
92 bool PrepareCopy(std::string pathToFile);
94 std::unique_ptr<G4ParticleGun> fGun =
nullptr;
95 std::unique_ptr<G4GenericMessenger> fMessenger =
nullptr;
97 std::filesystem::path fPathToTmpFolder;
98 std::filesystem::path fPathToTmpFile;
101 static bool fHasCartesianMomentum;
wrapper around G4VAnalysisReader instances with special handling for LH5 files.
Definition RMGAnalysisReader.hh:41
void BeginOfRunAction(const G4Run *) override
Convert the MUSUN ASCII input to Geant4 CSV and open it for reading.
Definition RMGGeneratorMUSUNCosmicMuons.cc:125
void GeneratePrimaries(G4Event *) override
Read the next muon entry from the temporary file and shoot it.
Definition RMGGeneratorMUSUNCosmicMuons.cc:165
void EndOfRunAction(const G4Run *) override
Close the input file and clean up the temporary directory.
Definition RMGGeneratorMUSUNCosmicMuons.cc:157
void SetParticlePosition(G4ThreeVector) override
No-op: vertex sampling is fixed by the input MUSUN file.
Definition RMGGeneratorMUSUNCosmicMuons.hh:76
Row schema for the MUSUN input ntuple consumed by RMGGeneratorMUSUNCosmicMuons.
Definition RMGGeneratorMUSUNCosmicMuons.hh:38