1#include "Biasing/PhotoNuclearProductsFilter.h"
11#include "G4RunManager.hh"
18#include "SimCore/G4User/UserTrackInformation.h"
24 :
simcore::UserAction(name, parameters) {
26 min_e_ = parameters.
get<
double>(
"min_e");
33 auto track{step->GetTrack()};
41 if ((track_info !=
nullptr) && !track_info->isPNGamma())
return;
44 auto secondaries{step->GetSecondary()};
50 bool product_found{
false};
51 for (
const auto& secondary : *secondaries) {
53 auto pdg_id{std::abs(secondary->GetParticleDefinition()->GetPDGEncoding())};
58 if (secondary->GetKineticEnergy() > min_e_) {
68 track->SetTrackStatus(fKillTrackAndSecondaries);
69 G4RunManager::GetRunManager()->AbortEvent();
76 track_info->tagPNGamma(
false);
#define DECLARE_ACTION(CLASS)
register a new UserAction with its factory
User action used to filter out photo-nuclear events that don't see the photo-nuclear gamma produce sp...
std::vector< int > products_pdg_id_
Container to hold the PDG IDs of products of interest.
~PhotoNuclearProductsFilter()
Destructor.
void stepping(const G4Step *step) override
Callback that allows a user to take some actions at the end of a step.
PhotoNuclearProductsFilter(const std::string &name, framework::config::Parameters ¶meters)
Constructor.
Class encapsulating parameters for configuring a processor.
const T & get(const std::string &name) const
Retrieve the parameter of the given name.
Dynamically loadable photonuclear models either from SimCore or external libraries implementing this ...