/*
* Copyright (C) 2018 Université Clermont Auvergne, CNRS/IN2P3, LPC
* Author: Valentin NIESS (niess@in2p3.fr)
*
* A Geant4 particle source of atmospheric muons using GOUPIL
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see
*/
#pragma once
/* C++ standard library */
#include
/* Geant4 GOUPIL extension */
#include "IGoupilState.hh"
/* Geant4 vanilla */
#include "G4SingleParticleSource.hh"
/* Forward declaration of a custom user action */
class IGoupilUserAction;
class IGoupilSource : public G4SingleParticleSource {
public:
IGoupilSource();
~IGoupilSource();
void GeneratePrimaryVertex(G4Event * event);
void SetParticleDefinition(G4ParticleDefinition * definition);
/// Set the sampling mode between DETAILED and HYBRID.
/// DETAILED mode uses the detailed energy loss scheme and full scattering (see PUMAS docs).
/// HYBRID mode uses the hybrid energy loss scheme and longitudinal-only
/// scattering (see PUMAS docs).
void SetSamplerMode(const std::string& mode);
IGoupilState * GetAncester(G4int index=0) {
return &fAncester[index];
}
void SetUserAction(IGoupilUserAction * userAction) {
fUserAction = userAction;
}
protected:
struct goupil_sampler * fSampler;
std::string fSamplerMode;
IGoupilUserAction * fUserAction;
std::vector fAncester;
};