EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHG4InEvent.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHG4InEvent.h
1 // Tell emacs that this is a C++ source
2 // -*- C++ -*-.
3 #ifndef G4MAIN_PHG4INEVENT_H
4 #define G4MAIN_PHG4INEVENT_H
5 
6 #include <phool/PHObject.h>
7 
8 #include <iostream>
9 #include <map>
10 #include <utility>
11 
12 class PHG4Particle;
13 class PHG4VtxPoint;
14 
15 class PHG4InEvent: public PHObject
16 {
17  public:
19  ~PHG4InEvent() override;
20 
21  void identify(std::ostream& os = std::cout) const override;
22  void Reset() override;
23  // this one is for HepMC records where we want to keep the HepMC vertex numbering
24  int AddVtxHepMC(const int id, const double x, const double y, const double z, const double t);
25  int AddVtx(const double x, const double y, const double z, const double t);
26  int AddVtx(const int id,const PHG4VtxPoint &);
27  int AddParticle(const int vtxid, PHG4Particle *particle);
28  void AddEmbeddedParticle(PHG4Particle *particle, int flag) {embedded_particlelist.insert(std::make_pair(particle,flag));}
29 
30  // PHG4VtxPoint *GetVtx() {return vtxlist.begin()->second;}
31  std::pair< std::map<int, PHG4VtxPoint *>::const_iterator, std::map<int, PHG4VtxPoint *>::const_iterator > GetVertices() const;
32  std::pair< std::multimap<int,PHG4Particle *>::const_iterator, std::multimap<int,PHG4Particle *>::const_iterator > GetParticles(const int vtxid) const;
33  std::pair< std::multimap<int,PHG4Particle *>::const_iterator, std::multimap<int,PHG4Particle *>::const_iterator > GetParticles() const;
34  std::pair< std::multimap<int,PHG4Particle *>::iterator, std::multimap<int,PHG4Particle *>::iterator > GetParticles_Modify();
35  std::pair< std::map<PHG4Particle *,int>::const_iterator, std::map<PHG4Particle *,int>::const_iterator> GetEmbeddedParticles() const
36  {return std::make_pair(embedded_particlelist.begin(), embedded_particlelist.end());}
37  int isEmbeded(PHG4Particle *) const;
38  int GetNEmbedded() const {return embedded_particlelist.size();}
39  int GetNVtx() const {return vtxlist.size();}
40  void DeleteParticle(std::multimap<int,PHG4Particle *>::iterator &iter);
41 
42  protected:
43 
44  int AddVtxCommon(PHG4VtxPoint *newvtx);
45  std::map<int,PHG4VtxPoint *> vtxlist;
46  std::multimap<int,PHG4Particle *> particlelist;
47  std::map<PHG4Particle *,int> embedded_particlelist;
48 
49  ClassDefOverride(PHG4InEvent,1)
50 };
51 
52 #endif