File indexing completed on 2025-08-06 08:19:21
0001
0002
0003 #ifndef G4MAIN_PHG4INEVENT_H
0004 #define G4MAIN_PHG4INEVENT_H
0005
0006 #include <phool/PHObject.h>
0007
0008 #include <iostream>
0009 #include <map>
0010 #include <utility>
0011
0012 class PHG4Particle;
0013 class PHG4VtxPoint;
0014
0015 class PHG4InEvent : public PHObject
0016 {
0017 public:
0018 PHG4InEvent() {}
0019 ~PHG4InEvent() override;
0020
0021 void identify(std::ostream &os = std::cout) const override;
0022 void Reset() override;
0023
0024 int AddVtxHepMC(const int id, const double x, const double y, const double z, const double t);
0025 int AddVtx(const double x, const double y, const double z, const double t);
0026 int AddVtx(const int id, const PHG4VtxPoint &);
0027 int AddParticle(const int vtxid, PHG4Particle *particle);
0028 void AddEmbeddedParticle(PHG4Particle *particle, int flag) { embedded_particlelist.insert(std::make_pair(particle, flag)); }
0029
0030
0031 std::pair<std::map<int, PHG4VtxPoint *>::const_iterator, std::map<int, PHG4VtxPoint *>::const_iterator> GetVertices() const;
0032 std::pair<std::multimap<int, PHG4Particle *>::const_iterator, std::multimap<int, PHG4Particle *>::const_iterator> GetParticles(const int vtxid) const;
0033 std::pair<std::multimap<int, PHG4Particle *>::const_iterator, std::multimap<int, PHG4Particle *>::const_iterator> GetParticles() const;
0034 std::pair<std::multimap<int, PHG4Particle *>::iterator, std::multimap<int, PHG4Particle *>::iterator> GetParticles_Modify();
0035 std::pair<std::map<PHG4Particle *, int>::const_iterator, std::map<PHG4Particle *, int>::const_iterator> GetEmbeddedParticles() const
0036 {
0037 return std::make_pair(embedded_particlelist.begin(), embedded_particlelist.end());
0038 }
0039 int isEmbeded(PHG4Particle *) const;
0040 int GetNEmbedded() const { return embedded_particlelist.size(); }
0041 int GetNVtx() const { return vtxlist.size(); }
0042 void DeleteParticle(std::multimap<int, PHG4Particle *>::iterator &iter);
0043
0044 protected:
0045 int AddVtxCommon(PHG4VtxPoint *newvtx);
0046 std::map<int, PHG4VtxPoint *> vtxlist;
0047 std::multimap<int, PHG4Particle *> particlelist;
0048 std::map<PHG4Particle *, int> embedded_particlelist;
0049
0050 ClassDefOverride(PHG4InEvent, 1)
0051 };
0052
0053 #endif