LDMX Software
BertiniAtLeastNProductsModel.h
1#ifndef SIMCORE_BERTINI_AT_LEAST_N_PRODUCTS_MODEL_H
2#define SIMCORE_BERTINI_AT_LEAST_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"
10namespace simcore {
12 public:
13 BertiniAtLeastNProductsProcess(double threshold, int Zmin, double Emin,
14 std::vector<int> pdg_ids, int min_products)
16 threshold_{threshold},
17 zmin_{Zmin},
18 emin_{Emin},
19 pdg_ids_{pdg_ids},
20 min_products_{min_products} {}
21 virtual ~BertiniAtLeastNProductsProcess() = default;
22 bool acceptProjectile(const G4HadProjectile& projectile) const override {
23 return projectile.GetKineticEnergy() >= emin_;
24 }
25 bool acceptTarget(const G4Nucleus& targetNucleus) const override {
26 return targetNucleus.GetZ_asInt() >= zmin_;
27 }
28 bool acceptEvent() const override;
29
30 private:
31 double threshold_;
32 int zmin_;
33 double emin_;
34 std::vector<int> pdg_ids_;
35 int min_products_;
36};
37
39 public:
40 BertiniAtLeastNProductsModel(const std::string& name,
41 const framework::config::Parameters& parameters)
42 : PhotoNuclearModel{name, parameters},
43 threshold_{parameters.getParameter<double>("hard_particle_threshold")},
44 zmin_{parameters.getParameter<int>("zmin")},
45 emin_{parameters.getParameter<double>("emin")},
46 pdg_ids_{parameters.getParameter<std::vector<int>>("pdg_ids")},
47 min_products_{parameters.getParameter<int>("min_products")} {}
48 virtual ~BertiniAtLeastNProductsModel() = default;
49 void constructGammaProcess(G4ProcessManager* processManager);
50
51 private:
52 double threshold_;
53 int zmin_;
54 double emin_;
55 std::vector<int> pdg_ids_;
56 int min_products_;
57};
58
59} // namespace simcore
60#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 ...