LDMX Software
BertiniExactlyNProductsModel.h
1#ifndef SIMCORE_BERTINI_EXACTLY_N_PRODUCTS_MODEL_H
2#define SIMCORE_BERTINI_EXACTLY_N_PRODUCTS_MODEL_H
3#include <G4CrossSectionDataSetRegistry.hh>
4#include <G4Gamma.hh>
5#include <G4HadProjectile.hh>
6#include <G4HadronInelasticProcess.hh>
7#include <G4Nucleus.hh>
8#include <G4ProcessManager.hh>
9
10#include "Framework/Configure/Parameters.h"
11#include "SimCore/PhotoNuclearModels/BertiniEventTopologyProcess.h" /* */
12#include "SimCore/PhotoNuclearModels/PhotoNuclearModel.h"
13
14namespace simcore {
16 public:
17 BertiniExactlyNProductsProcess(double threshold, int zmin, double emin,
18 std::vector<int> pdg_ids, bool check_allmatch,
19 int n_products)
21 threshold_{threshold},
22 zmin_{zmin},
23 emin_{emin},
24 pdg_ids_{pdg_ids},
25 check_allmatch_{check_allmatch},
26 n_products_{n_products} {}
27
28 virtual ~BertiniExactlyNProductsProcess() = default;
29
30 bool acceptProjectile(const G4HadProjectile& projectile) const override {
31 return projectile.GetKineticEnergy() >= emin_;
32 }
33
34 bool acceptTarget(const G4Nucleus& targetNucleus) const override {
35 return targetNucleus.GetZ_asInt() >= zmin_;
36 }
37
38 bool acceptEvent() const override;
39
40 private:
41 double threshold_;
42 int zmin_;
43 double emin_;
44 std::vector<int> pdg_ids_;
45 bool check_allmatch_;
46 int n_products_;
47};
48
50 public:
51 BertiniExactlyNProductsModel(const std::string& name,
52 const framework::config::Parameters& parameters)
53 : PhotoNuclearModel{name, parameters},
54 threshold_{parameters.getParameter<double>("hard_particle_threshold")},
55 zmin_{parameters.getParameter<int>("zmin")},
56 emin_{parameters.getParameter<double>("emin")},
57 pdg_ids_{parameters.getParameter<std::vector<int>>("pdg_ids")},
58 check_allmatch_{parameters.getParameter<bool>("check_allmatch")},
59 n_products_{parameters.getParameter<int>("n_products")} {}
60 virtual ~BertiniExactlyNProductsModel() = default;
61 void constructGammaProcess(G4ProcessManager* processManager);
62
63 private:
64 double threshold_;
65 int zmin_;
66 double emin_;
67 std::vector<int> pdg_ids_;
68 bool check_allmatch_;
69 int n_products_;
70};
71
72} // namespace simcore
73#endif /* SIMCORE_BERTINI_AT_LEAST_N_PRODUCTS_MODEL_H */
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:29
void constructGammaProcess(G4ProcessManager *processManager)
The primary part of the model interface, responsible for adding the desired G4HadronicInteraction to ...
Dynamically loadable photonuclear models either from SimCore or external libraries implementing this ...