File indexing completed on 2025-08-03 08:12:34
0001 #ifndef __PHPYTHIA6_H__
0002 #define __PHPYTHIA6_H__
0003
0004 #include <fun4all/SubsysReco.h>
0005 #include <phhepmc/PHHepMCGenHelper.h>
0006
0007 #include <string>
0008 #include <vector>
0009
0010 class PHCompositeNode;
0011 class PHHepMCGenEvent;
0012 class PHPy6GenTrigger;
0013
0014 namespace HepMC {
0015 class GenEvent;
0016 };
0017
0018 class PHPythia6: public SubsysReco {
0019
0020 public:
0021
0022 PHPythia6(const std::string &name = "PHPythia6");
0023 virtual ~PHPythia6();
0024
0025 int Init(PHCompositeNode *topNode);
0026
0027 int process_event(PHCompositeNode *topNode);
0028
0029 int ResetEvent(PHCompositeNode *topNode);
0030
0031 int End(PHCompositeNode *topNode);
0032
0033 void set_config_file( const std::string cfg_file ) { _configFile = cfg_file; }
0034
0035 void print_config() const;
0036
0037 void beam_vertex_parameters(double beamX,
0038 double beamY,
0039 double beamZ,
0040 double beamXsigma,
0041 double beamYsigma,
0042 double beamZsigma) {
0043
0044 set_vertex_distribution_mean(beamX, beamY, beamZ, 0);
0045 set_vertex_distribution_width(beamXsigma, beamYsigma, beamZsigma, 0);
0046 }
0047
0048 void save_ascii( std::string fname = "pythia_hepmc.dat" )
0049 {
0050 _save_ascii = true;
0051 _filename_ascii = fname;
0052 }
0053
0054
0055 void register_trigger(PHPy6GenTrigger *theTrigger);
0056 void set_trigger_OR() { _triggersOR = true; }
0057 void set_trigger_AND() { _triggersAND = true; }
0058
0059
0060 void set_vertex_distribution_function(PHHepMCGenHelper::VTXFUNC x, PHHepMCGenHelper::VTXFUNC y, PHHepMCGenHelper::VTXFUNC z, PHHepMCGenHelper::VTXFUNC t)
0061 {
0062 hepmc_helper.set_vertex_distribution_function(x, y, z, t);
0063 }
0064
0065
0066 void set_vertex_distribution_mean(const double x, const double y, const double z, const double t)
0067 {
0068 hepmc_helper.set_vertex_distribution_mean(x, y, z, t);
0069 }
0070
0071
0072 void set_vertex_distribution_width(const double x, const double y, const double z, const double t)
0073 {
0074 hepmc_helper.set_vertex_distribution_width(x, y, z, t);
0075 }
0076
0077
0078 void set_reuse_vertex(int src_embedding_id)
0079 {
0080 hepmc_helper.set_reuse_vertex(src_embedding_id);
0081 }
0082
0083
0084
0085
0086
0087 int get_embedding_id() const { return hepmc_helper.get_embedding_id(); }
0088
0089
0090
0091
0092
0093 void set_embedding_id(int id) { hepmc_helper.set_embedding_id(id); }
0094 private:
0095
0096 int ReadConfig(const std::string cfg_file = "");
0097 int CreateNodeTree(PHCompositeNode *topNode);
0098
0099
0100
0101
0102
0103 void IntegerTest(double number );
0104
0105 int _eventcount;
0106 int _geneventcount;
0107
0108
0109 std::string _configFile;
0110
0111
0112
0113
0114 bool _save_ascii;
0115
0116
0117
0118
0119 std::string _filename_ascii;
0120
0121
0122 std::vector<PHPy6GenTrigger*> _registeredTriggers;
0123 bool _triggersOR;
0124 bool _triggersAND;
0125
0126
0127
0128
0129 void initPythia();
0130
0131 PHHepMCGenHelper hepmc_helper;
0132
0133 };
0134
0135 #endif
0136