LDMX Software
BertiniNothingHardModel.cxx
1#include "SimCore/PhotoNuclearModels/BertiniNothingHardModel.h"
2namespace simcore {
3
4bool BertiniNothingHardProcess::acceptEvent() const {
5 int secondaries{theParticleChange.GetNumberOfSecondaries()};
6 for (int i{0}; i < secondaries; ++i) {
7 const auto secondary{theParticleChange.GetSecondary(i)->GetParticle()};
8 const auto pdg_code{secondary->GetDefinition()->GetPDGEncoding()};
9 if (skipCountingParticle(pdg_code)) {
10 continue;
11 }
12 const auto energy{secondary->GetKineticEnergy()};
13 if (energy > threshold_) {
14 return false;
15 }
16 }
17 return true;
18}
19
21 G4ProcessManager* processManager) {
22 auto photo_nuclear_process{
23 new G4HadronInelasticProcess("photonNuclear", G4Gamma::Definition())};
24 auto model{new BertiniNothingHardProcess{threshold_, zmin_, emin_,
25 count_light_ions_}};
26 model->SetMaxEnergy(15 * CLHEP::GeV);
27 addPNCrossSectionData(photo_nuclear_process);
28 photo_nuclear_process->RegisterMe(model);
29 processManager->AddDiscreteProcess(photo_nuclear_process);
30}
31} // namespace simcore
32
33DECLARE_PHOTONUCLEAR_MODEL(simcore::BertiniNothingHardModel)
constexpr bool skipCountingParticle(const int pdgcode) const
Whether or not to include a particular particle type in any counting.
void constructGammaProcess(G4ProcessManager *processManager)
The primary part of the model interface, responsible for adding the desired G4HadronicInteraction to ...
virtual void addPNCrossSectionData(G4HadronInelasticProcess *process) const
Default implementation for adding XS data for the process.
Dynamically loadable photonuclear models either from SimCore or external libraries implementing this ...