File indexing completed on 2025-08-05 08:11:59
0001
0002
0003 #ifndef G4MAIN_ReadSynRadFiles_H
0004 #define G4MAIN_ReadSynRadFiles_H
0005
0006 #include <fun4all/SubsysReco.h>
0007
0008 #include <phhepmc/PHHepMCGenHelper.h>
0009
0010 #include <fstream>
0011 #include <string>
0012
0013 class PHCompositeNode;
0014 class TChain;
0015
0016 namespace erhic
0017 {
0018 class EventMC;
0019 }
0020
0021 class ReadSynRadFiles : public SubsysReco
0022 {
0023 public:
0024 ReadSynRadFiles(const std::string &name = "ReadSynRadFiles");
0025 virtual ~ReadSynRadFiles();
0026
0027 int Init(PHCompositeNode *topNode);
0028 int process_event(PHCompositeNode *topNode);
0029
0030
0031 bool OpenInputFile(const std::string &name);
0032
0033
0034 void SetEntryPerEvent(int e) { nEntries = e; }
0035
0036 void SetNodeName(const std::string &s) { _node_name = s; }
0037
0038 void set_vertex_distribution_function(PHHepMCGenHelper::VTXFUNC x, PHHepMCGenHelper::VTXFUNC y, PHHepMCGenHelper::VTXFUNC z, PHHepMCGenHelper::VTXFUNC t)
0039 {
0040 hepmc_helper.set_vertex_distribution_function(x, y, z, t);
0041 }
0042
0043
0044 void set_vertex_distribution_mean(const double x, const double y, const double z, const double t)
0045 {
0046 hepmc_helper.set_vertex_distribution_mean(x, y, z, t);
0047 }
0048
0049
0050 void set_vertex_distribution_width(const double x, const double y, const double z, const double t)
0051 {
0052 hepmc_helper.set_vertex_distribution_width(x, y, z, t);
0053 }
0054
0055
0056 void set_reuse_vertex(int src_embedding_id)
0057 {
0058 hepmc_helper.set_reuse_vertex(src_embedding_id);
0059 }
0060
0061
0062
0063
0064
0065 int get_embedding_id() const { return hepmc_helper.get_embedding_id(); }
0066
0067
0068
0069
0070
0071 void set_embedding_id(int id) { hepmc_helper.set_embedding_id(id); }
0072
0073
0074 void set_reverseXZ(bool b = true) { m_reverseXZ = b; }
0075
0076 protected:
0077
0078 void GetTree();
0079
0080
0081 int CreateNodeTree(PHCompositeNode *topNode);
0082
0083
0084 std::string filename;
0085
0086
0087 std::ifstream m_csv_input;
0088
0089
0090 int nEntries;
0091
0092
0093 int entry;
0094
0095
0096
0097
0098 erhic::EventMC *GenEvent;
0099
0100
0101 std::string _node_name;
0102
0103
0104 PHHepMCGenHelper hepmc_helper;
0105
0106
0107 bool m_reverseXZ = false;
0108 };
0109
0110 #endif