src/modules/DepositionCosmics/CosmicsGeneratorActionG4.hpp

Defines the CRY interface to Geant4. More…

Namespaces

Name
allpix
Helper class to hold support layers for a detector model.

Classes

Name
class allpix::CosmicsGeneratorActionG4
Generates the particles in every event.
class allpix::GeneratorActionInitializationMaster
Creates and initialize the GPS messenger on master before workers use it.

Detailed Description

Defines the CRY interface to Geant4.

Copyright: Copyright (c) 2017-2024 CERN and the Allpix Squared authors. This software is distributed under the terms of the MIT License, copied verbatim in the file “LICENSE.md”. In applying this license, CERN does not waive the privileges and immunities granted to it by virtue of its status as an Intergovernmental Organization or submit itself to any jurisdiction. SPDX-License-Identifier: MIT

Source code


#ifndef ALLPIX_COSMICS_DEPOSITION_MODULE_GENERATOR_ACTION_H
#define ALLPIX_COSMICS_DEPOSITION_MODULE_GENERATOR_ACTION_H

#include <memory>

#include <G4DataVector.hh>
#include <G4ParticleGun.hh>
#include <G4ThreeVector.hh>
#include <G4VUserPrimaryGeneratorAction.hh>

#include <CRYGenerator.h>
#include <CRYParticle.h>
#include <CRYSetup.h>
#include <CRYUtils.h>

#include "core/config/Configuration.hpp"

namespace allpix {
    class CosmicsGeneratorActionG4 : public G4VUserPrimaryGeneratorAction {
    public:
        explicit CosmicsGeneratorActionG4(const Configuration& config);

        void GeneratePrimaries(G4Event*) override;

    private:
        std::unique_ptr<G4ParticleGun> particle_gun_;
        std::unique_ptr<CRYGenerator> cry_generator_;

        bool reset_particle_time_{};
        const Configuration& config_;
    };

    class GeneratorActionInitializationMaster {
    public:
        explicit GeneratorActionInitializationMaster(const Configuration&){};
    };
} // namespace allpix

#endif /* ALLPIX_COSMICS_DEPOSITION_MODULE_GENERATOR_ACTION_H */

Updated on 2025-02-27 at 14:14:46 +0000