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 pdgCode{secondary->GetDefinition()->GetPDGEncoding()};
9 if (skipCountingParticle(pdgCode)) {
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 photoNuclearProcess{
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(photoNuclearProcess);
28 photoNuclearProcess->RegisterMe(model);
29 processManager->AddDiscreteProcess(photoNuclearProcess);
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) override
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.