File indexing completed on 2025-12-16 09:19:21
0001 #ifndef PHHEPMC_PHHEPMCGENEVENT_H
0002 #define PHHEPMC_PHHEPMCGENEVENT_H
0003
0004 #include <phool/PHObject.h>
0005 #include <phool/phool.h>
0006
0007 #include <HepMC/SimpleVector.h>
0008
0009 #include <CLHEP/Vector/LorentzRotation.h>
0010
0011 #include <iostream> // for cout, ostream
0012 #include <map>
0013
0014 namespace HepMC
0015 {
0016 class GenEvent;
0017 }
0018
0019 class PHHepMCGenEvent : public PHObject
0020 {
0021 public:
0022 PHHepMCGenEvent();
0023
0024 PHHepMCGenEvent(const PHHepMCGenEvent& event);
0025 PHHepMCGenEvent& operator=(const PHHepMCGenEvent& event);
0026 ~PHHepMCGenEvent() override;
0027
0028
0029
0030
0031 typedef std::map<unsigned int, float> FlowAfterburner_PsiMap;
0032
0033 void identify(std::ostream& os = std::cout) const override;
0034 void Reset() override;
0035 int isValid() const override
0036 {
0037 return (getEvent() != nullptr) ? 1 : 0;
0038 }
0039 PHObject* CloneMe() const override { return new PHHepMCGenEvent(*this); }
0040
0041 HepMC::GenEvent* getEvent();
0042 const HepMC::GenEvent* getEvent() const;
0043
0044
0045
0046
0047
0048 int get_embedding_id() const { return _embedding_id; }
0049
0050
0051
0052
0053
0054 void set_embedding_id(int id) { _embedding_id = id; }
0055
0056
0057 bool is_simulated() const { return _isSimulated; }
0058
0059
0060 void is_simulated(bool v) { _isSimulated = v; }
0061
0062
0063 const HepMC::FourVector& get_collision_vertex() const { return _collisionVertex; }
0064
0065
0066 void set_collision_vertex(const HepMC::FourVector& v) { _collisionVertex = v; }
0067
0068
0069 virtual const HepMC::ThreeVector& get_boost_beta_vector() const
0070 {
0071 PHOOL_VIRTUAL_WARNING;
0072 static HepMC::ThreeVector dummy_vec(0, 0, 0);
0073 return dummy_vec;
0074 }
0075
0076
0077 virtual void set_boost_beta_vector(const HepMC::ThreeVector&) { PHOOL_VIRTUAL_WARNING; }
0078
0079
0080 virtual const HepMC::ThreeVector& get_rotation_vector() const
0081 {
0082 PHOOL_VIRTUAL_WARNING;
0083 static HepMC::ThreeVector dummy_vec(0, 0, 1);
0084 return dummy_vec;
0085 }
0086
0087
0088 virtual void set_rotation_vector(const HepMC::ThreeVector&) { PHOOL_VIRTUAL_WARNING; }
0089
0090
0091 virtual double get_rotation_angle() const
0092 {
0093 PHOOL_VIRTUAL_WARNING;
0094 return 0;
0095 }
0096
0097
0098 virtual void set_rotation_angle(const double) { PHOOL_VIRTUAL_WARNING; }
0099
0100
0101 virtual CLHEP::HepLorentzRotation get_LorentzRotation_EvtGen2Lab() const { return CLHEP::HepLorentzRotation::IDENTITY; }
0102
0103
0104 virtual CLHEP::HepLorentzRotation get_LorentzRotation_Lab2EvtGen() const { return CLHEP::HepLorentzRotation::IDENTITY; }
0105
0106
0107 virtual float get_flow_psi(unsigned int ) const
0108 {
0109 PHOOL_VIRTUAL_WARNING;
0110 return 0.0f;
0111 }
0112
0113
0114 virtual const FlowAfterburner_PsiMap& get_flow_psi_map() const
0115 {
0116 PHOOL_VIRTUAL_WARNING;
0117 static FlowAfterburner_PsiMap dummy_map;
0118 return dummy_map;
0119 }
0120
0121
0122 virtual void set_flow_psi(unsigned int , float ) { PHOOL_VIRTUAL_WARNING; }
0123
0124 virtual void set_flow_psi_map(const FlowAfterburner_PsiMap& )
0125 {
0126 PHOOL_VIRTUAL_WARNING;
0127 }
0128
0129
0130 bool addEvent(HepMC::GenEvent* evt);
0131 bool addEvent(HepMC::GenEvent& evt);
0132 bool swapEvent(HepMC::GenEvent*& evt);
0133 void clearEvent();
0134
0135
0136 virtual void moveVertex(double x, double y, double z, double t = 0);
0137
0138
0139 virtual int size(void) const;
0140 virtual int vertexSize(void) const;
0141
0142 void print(std::ostream& out = std::cout) const;
0143
0144 void PrintEvent();
0145
0146 protected:
0147
0148
0149
0150
0151 int _embedding_id;
0152
0153
0154 bool _isSimulated;
0155
0156
0157 HepMC::FourVector _collisionVertex;
0158
0159
0160 HepMC::GenEvent* _theEvt{nullptr};
0161
0162 ClassDefOverride(PHHepMCGenEvent, 5)
0163 };
0164
0165 #endif