Class Reference for E1039 Core & Analysis Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PHHepMCGenHelper.h
Go to the documentation of this file.
1 // $Id: $
2 
11 #ifndef SIMULATION_CORESOFTWARE_SIMULATION_G4SIMULATION_PHHEPMC_PHHEPMCGENHELPER_H_
12 #define SIMULATION_CORESOFTWARE_SIMULATION_G4SIMULATION_PHHEPMC_PHHEPMCGENHELPER_H_
13 
14 
15 
16 class PHCompositeNode;
17 class PHHepMCGenEvent;
18 class PHHepMCGenEventMap;
19 
20 namespace HepMC
21 {
22 class GenEvent;
23 };
24 
25 #ifndef __CINT__
26 #include <gsl/gsl_rng.h>
27 #endif
28 
33 {
34  public:
36  virtual ~PHHepMCGenHelper();
37 
39  enum VTXFUNC
40  {
45  };
46 
49 
51  void set_vertex_distribution_mean(const double x, const double y, const double z, const double t);
52 
54  void set_vertex_distribution_width(const double x, const double y, const double z, const double t);
55 
60  int get_embedding_id() const { return _embedding_id; }
61  //
66  void set_embedding_id(int id) { _embedding_id = id; }
67  //
69  void set_reuse_vertex(int src_embedding_id)
70  {
71  _reuse_vertex = true;
72  _reuse_vertex_embedding_id = src_embedding_id;
73  }
74 
75  //
77  int create_node_tree(PHCompositeNode *topNode);
78 
80  PHHepMCGenEvent *insert_event(HepMC::GenEvent *evt);
81 
83  void move_vertex(PHHepMCGenEvent *genevent);
84 
86  {
87  return _geneventmap;
88  }
89 
91  {
92  return _geneventmap;
93  }
94 
95 #ifndef __CINT__
96  gsl_rng * get_random_generator() {return RandomGenerator;}
97 #endif
98 
100  {
101  _geneventmap = geneventmap;
102  }
103 
104  protected:
105 #ifndef __CINT__
106  gsl_rng *RandomGenerator;
107 #endif
108 
109  double smear(const double position, const double width, VTXFUNC dist) const;
110 
111  private:
112  VTXFUNC _vertex_func_x;
113  VTXFUNC _vertex_func_y;
114  VTXFUNC _vertex_func_z;
115  VTXFUNC _vertex_func_t;
116 
117  double _vertex_x;
118  double _vertex_y;
119  double _vertex_z;
120  double _vertex_t;
121 
122  double _vertex_width_x;
123  double _vertex_width_y;
124  double _vertex_width_z;
125  double _vertex_width_t;
126 
130  int _embedding_id;
131 
133  bool _reuse_vertex;
134 
136  int _reuse_vertex_embedding_id;
137 
139  PHHepMCGenEventMap *_geneventmap;
140 };
141 
142 #endif /* SIMULATION_CORESOFTWARE_SIMULATION_G4SIMULATION_PHHEPMC_PHHEPMCGENHELPER_H_ */
PHHepMCGenEventMap is collection of HEPMC events input into this simulation map of embedding ID -&gt; PH...
void set_reuse_vertex(int src_embedding_id)
reuse vertex from another PHHepMCGenEvent with embedding_id = src_embedding_id Additional smearing an...
uniform distribution with half width set via set_vertex_distribution_width()
int get_embedding_id() const
PHHepMCGenHelper provides service of DST upload of HepMC subevent, vertex assignment and random gener...
PHHepMCGenEvent * insert_event(HepMC::GenEvent *evt)
send HepMC::GenEvent to DST tree. This function takes ownership of evt
PHHepMCGenEventMap * get_geneventmap()
gsl_rng * RandomGenerator
void set_vertex_distribution_mean(const double x, const double y, const double z, const double t)
set the mean value of the vertex distribution, use PHENIX units of cm, ns
void set_vertex_distribution_function(VTXFUNC x, VTXFUNC y, VTXFUNC z, VTXFUNC t)
toss a new vertex according to a Uniform or Gaus distribution
void move_vertex(PHHepMCGenEvent *genevent)
move vertex according to vertex settings
void set_geneventmap(PHHepMCGenEventMap *geneventmap)
gsl_rng * get_random_generator()
const PHHepMCGenEventMap * get_geneventmap() const
void set_vertex_distribution_width(const double x, const double y, const double z, const double t)
set the width of the vertex distribution function about the mean, use PHENIX units of cm...
VTXFUNC
supported function distributions
normal distribution with sigma width set via set_vertex_distribution_width()
int create_node_tree(PHCompositeNode *topNode)
init interface nodes
void set_embedding_id(int id)
double smear(const double position, const double width, VTXFUNC dist) const
virtual ~PHHepMCGenHelper()