ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHG4ParticleGeneratorVectorMeson.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHG4ParticleGeneratorVectorMeson.h
1 // Tell emacs that this is a C++ source
2 // -*- C++ -*-.
3 #ifndef G4MAIN_PHG4PARTICLEGENERATORVECTORMESON_H
4 #define G4MAIN_PHG4PARTICLEGENERATORVECTORMESON_H
5 
7 
8 #include <cmath>
9 #include <map>
10 #include <string> // for string
11 
12 class PHCompositeNode;
13 class PHG4InEvent;
14 class TRandom;
15 class TF1;
16 
18 {
19  public:
21  enum FUNCTION
22  {
25  };
26 
27  explicit PHG4ParticleGeneratorVectorMeson(const std::string &name = "VMESON");
29 
30  int InitRun(PHCompositeNode *topNode) override;
31  int process_event(PHCompositeNode *topNode) override;
32 
34  void add_decay_particles(const std::string &name1, const std::string &name2, const unsigned int decay_id);
35  void add_decay_particles(const std::string &name, const unsigned int decay_id);
36 
37  void set_decay_vertex_offset(double dx, double dy, double dz, const unsigned int decay_id);
38  void set_eta_range(const double eta_min, const double eta_max);
39  void set_rapidity_range(const double y_min, const double y_max);
40  void set_mom_range(const double mom_min, const double mom_max);
41  void set_pt_range(const double pt_min, const double pt_max);
44 
46  void set_vertex_distribution_mean(const double x, const double y, const double z);
47 
49  void set_vertex_distribution_width(const double x, const double y, const double z);
50 
52  void set_existing_vertex_offset_vector(const double x, const double y, const double z);
53 
56 
58  void set_vertex_size_parameters(const double mean, const double width);
59 
60  void set_read_vtx_from_hepmc(bool read_vtx) { read_vtx_from_hepmc = read_vtx; }
61 
62  void set_mass(const double mass_in) { mass = mass_in; }
63  void set_width(const double width_in) { m_Width = width_in; }
64  void set_decay_types(const std::string &decay1, const std::string &decay2);
65  void set_histrand_init(const int initflag) { _histrand_init = initflag; }
66  void set_upsilon_1s();
67  void set_upsilon_2s();
68  void set_upsilon_3s();
69 
70  private:
71  double smearvtx(const double position, const double width, FUNCTION dist) const;
72  std::map<unsigned int, int> decay1_codes; // <pdgcode, count>
73  std::map<unsigned int, std::string> decay1_names; // <names, count>
74  std::map<unsigned int, int> decay2_codes; // <pdgcode, count>
75  std::map<unsigned int, std::string> decay2_names; // <names, count>
76  std::map<unsigned int, double> decay_vtx_offset_x;
77  std::map<unsigned int, double> decay_vtx_offset_y;
78  std::map<unsigned int, double> decay_vtx_offset_z;
79 
83  double _vertex_x = 0.; // primary vertex (or mean) x component, cf. vtx_x = track-by-track vertex x component
84  double _vertex_y = 0.; // primary vertex (or mean) y component, cf. vtx_y = track-by-track vertex y component
85  double _vertex_z = 0.; // primary vertex (or mean)z component, cf. vtx_z = track-by-track vertex z component
86  double _vertex_width_x = 0.; // sigma x if not use existing vtx
87  double _vertex_width_y = 0.; // sigma y if not use existing vtx
88  double _vertex_width_z = 0.; // sigma z if not use existing vtx
89  double _vertex_offset_x = 0.; // track-by-track decay vertex offset if use existing vtx
90  double _vertex_offset_y = 0.; // track-by-track decay vertex offset if use existing vtx
91  double _vertex_offset_z = 0.; // track-by-track decay vertex offset if use existing vtx
93  double _vertex_size_mean = 0.;
94  double _vertex_size_width = 0.;
95  bool read_vtx_from_hepmc = true;
96 
97  double y_min = 0.;
98  double y_max = 0.;
99  double eta_min = -1.;
100  double eta_max = 1.;
101  double mom_min = 0.;
102  double mom_max = 10.;
103  double pt_min = 4.;
104  double pt_max = 4.;
105  double mass = NAN;
106  double m_Width = NAN;
107  double m1 = NAN;
108  double m2 = NAN;
109  int _histrand_init = 0;
110  std::string decay1 = "e+";
111  std::string decay2 = "e-";
112 
113  TF1 *fsin = nullptr;
114  TF1 *frap = nullptr;
115  TF1 *fpt = nullptr;
116  TRandom *trand = nullptr;
117 
118  PHG4InEvent *ineve = nullptr;
119 };
120 
121 #endif