File indexing completed on 2025-08-03 08:16:34
0001 #ifndef PHHEPMC_PHHEPMCGENEVENT_H
0002 #define PHHEPMC_PHHEPMCGENEVENT_H
0003
0004 #include <phool/PHObject.h>
0005
0006 #include <phool/phool.h>
0007
0008 #include <HepMC/SimpleVector.h>
0009
0010 #include <CLHEP/Vector/LorentzRotation.h>
0011
0012 #include <iostream> // for cout, ostream
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 void identify(std::ostream& os = std::cout) const override;
0029 void Reset() override;
0030 int isValid() const override
0031 {
0032 return (getEvent() != nullptr) ? 1 : 0;
0033 }
0034 PHObject* CloneMe() const override { return new PHHepMCGenEvent(*this); }
0035
0036 HepMC::GenEvent* getEvent();
0037 const HepMC::GenEvent* getEvent() const;
0038
0039
0040
0041
0042
0043 int get_embedding_id() const { return _embedding_id; }
0044
0045
0046
0047
0048
0049 void set_embedding_id(int id) { _embedding_id = id; }
0050
0051
0052 bool is_simulated() const { return _isSimulated; }
0053
0054
0055 void is_simulated(bool v) { _isSimulated = v; }
0056
0057
0058 const HepMC::FourVector& get_collision_vertex() const { return _collisionVertex; }
0059
0060
0061 void set_collision_vertex(const HepMC::FourVector& v) { _collisionVertex = v; }
0062
0063
0064 virtual const HepMC::ThreeVector& get_boost_beta_vector() const
0065 {
0066 PHOOL_VIRTUAL_WARNING;
0067 static HepMC::ThreeVector dummy_vec(0, 0, 0);
0068 return dummy_vec;
0069 }
0070
0071
0072 virtual void set_boost_beta_vector(const HepMC::ThreeVector&) { PHOOL_VIRTUAL_WARNING; }
0073
0074
0075 virtual const HepMC::ThreeVector& get_rotation_vector() const
0076 {
0077 PHOOL_VIRTUAL_WARNING;
0078 static HepMC::ThreeVector dummy_vec(0, 0, 1);
0079 return dummy_vec;
0080 }
0081
0082
0083 virtual void set_rotation_vector(const HepMC::ThreeVector&) { PHOOL_VIRTUAL_WARNING; }
0084
0085
0086 virtual double get_rotation_angle() const
0087 {
0088 PHOOL_VIRTUAL_WARNING;
0089 return 0;
0090 }
0091
0092
0093 virtual void set_rotation_angle(const double) { PHOOL_VIRTUAL_WARNING; }
0094
0095
0096 virtual CLHEP::HepLorentzRotation get_LorentzRotation_EvtGen2Lab() const { return CLHEP::HepLorentzRotation::IDENTITY; }
0097
0098
0099 virtual CLHEP::HepLorentzRotation get_LorentzRotation_Lab2EvtGen() const { return CLHEP::HepLorentzRotation::IDENTITY; }
0100
0101
0102 bool addEvent(HepMC::GenEvent* evt);
0103 bool addEvent(HepMC::GenEvent& evt);
0104 bool swapEvent(HepMC::GenEvent*& evt);
0105 void clearEvent();
0106
0107
0108 virtual void moveVertex(double x, double y, double z, double t = 0);
0109
0110
0111 virtual int size(void) const;
0112 virtual int vertexSize(void) const;
0113
0114 void print(std::ostream& os = std::cout) const;
0115
0116 void PrintEvent();
0117
0118 protected:
0119
0120
0121
0122
0123 int _embedding_id;
0124
0125
0126 bool _isSimulated;
0127
0128
0129 HepMC::FourVector _collisionVertex;
0130
0131
0132 HepMC::GenEvent* _theEvt;
0133
0134 ClassDefOverride(PHHepMCGenEvent, 5)
0135 };
0136
0137 #endif