LDMX Software
BertiniExactlyNProductsModel.h
1#ifndef SIMCORE_BERTINI_EXACTLY_N_PRODUCTS_MODEL_H
2#define SIMCORE_BERTINI_EXACTLY_N_PRODUCTS_MODEL_H
3#include <G4HadProjectile.hh>
4#include <G4Nucleus.hh>
5#include <G4ProcessManager.hh>
6
7#include "Framework/Configure/Parameters.h"
8#include "SimCore/PhotoNuclearModels/BertiniEventTopologyProcess.h" /* */
9#include "SimCore/PhotoNuclearModels/PhotoNuclearModel.h"
10
11namespace simcore {
13 public:
14 BertiniExactlyNProductsProcess(double threshold, int zmin, double emin,
15 std::vector<int> pdg_ids, bool check_allmatch,
16 int n_products)
18 threshold_{threshold},
19 zmin_{zmin},
20 emin_{emin},
21 pdg_ids_{pdg_ids},
22 check_allmatch_{check_allmatch},
23 n_products_{n_products} {}
24
25 virtual ~BertiniExactlyNProductsProcess() = default;
26
27 bool acceptProjectile(const G4HadProjectile& projectile) const override {
28 return projectile.GetKineticEnergy() >= emin_;
29 }
30
31 bool acceptTarget(const G4Nucleus& targetNucleus) const override {
32 return targetNucleus.GetZ_asInt() >= zmin_;
33 }
34
35 bool acceptEvent() const override;
36
37 private:
38 double threshold_;
39 int zmin_;
40 double emin_;
41 std::vector<int> pdg_ids_;
42 bool check_allmatch_;
43 int n_products_;
44};
45
47 public:
48 BertiniExactlyNProductsModel(const std::string& name,
49 const framework::config::Parameters& parameters)
50 : PhotoNuclearModel{name, parameters},
51 threshold_{parameters.getParameter<double>("hard_particle_threshold")},
52 zmin_{parameters.getParameter<int>("zmin")},
53 emin_{parameters.getParameter<double>("emin")},
54 pdg_ids_{parameters.getParameter<std::vector<int>>("pdg_ids")},
55 check_allmatch_{parameters.getParameter<bool>("check_allmatch")},
56 n_products_{parameters.getParameter<int>("n_products")} {}
57 virtual ~BertiniExactlyNProductsModel() = default;
58 void constructGammaProcess(G4ProcessManager* processManager);
59
60 private:
61 double threshold_;
62 int zmin_;
63 double emin_;
64 std::vector<int> pdg_ids_;
65 bool check_allmatch_;
66 int n_products_;
67};
68
69} // namespace simcore
70#endif /* SIMCORE_BERTINI_AT_LEAST_N_PRODUCTS_MODEL_H */
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:26
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 ...