25 int iret = AddVtxCommon(newvtx);
41 int iret = AddVtxCommon(newvtx);
48 std::pair< std::map<int, PHG4VtxPoint *>::const_iterator, std::map<int, PHG4VtxPoint *>::const_iterator > vtxbegin_end = GetVertices();
49 for (map<int, PHG4VtxPoint *>::const_iterator viter = vtxbegin_end.first; viter != vtxbegin_end.second; ++viter)
51 if (*newvtx == *(viter->second))
65 if (vtxlist.find(vtxid) == vtxlist.end())
67 cout <<
"cannot add particle to non existing vertex, id: " << vtxid << endl;
83 particlelist.insert(pair<int,PHG4Particle *>(vtxid, particle) );
90 embedded_particlelist.clear();
91 while(vtxlist.begin() != vtxlist.end())
93 delete vtxlist.begin()->second;
94 vtxlist.erase(vtxlist.begin());
96 while(particlelist.begin() != particlelist.end())
98 delete particlelist.begin()->second;
99 particlelist.erase(particlelist.begin());
104 pair< map<int, PHG4VtxPoint *>::const_iterator, map<int, PHG4VtxPoint *>::const_iterator >
107 pair< map<int, PHG4VtxPoint *>::const_iterator, map<int, PHG4VtxPoint *>::const_iterator > retpair(vtxlist.begin(), vtxlist.end());
112 pair< multimap<int,PHG4Particle *>::const_iterator, multimap<int,PHG4Particle *>::const_iterator >
115 pair<multimap<int,PHG4Particle *>::const_iterator, multimap<int,PHG4Particle *>::const_iterator > retpair(particlelist.lower_bound(vtxid),particlelist.upper_bound(vtxid));
119 pair< multimap<int,PHG4Particle *>::const_iterator, multimap<int,PHG4Particle *>::const_iterator >
122 pair<multimap<int,PHG4Particle *>::const_iterator, multimap<int,PHG4Particle *>::const_iterator > retpair(particlelist.begin(),particlelist.end());
126 pair< multimap<int,PHG4Particle *>::iterator, multimap<int,PHG4Particle *>::iterator >
129 pair<multimap<int,PHG4Particle *>::iterator, multimap<int,PHG4Particle *>::iterator > retpair(particlelist.begin(),particlelist.end());
136 os <<
"vtx: " << endl;
137 multimap<int,PHG4Particle *>::const_iterator particle_iter;
138 for(map<int,PHG4VtxPoint *>::const_iterator iter = vtxlist.begin(); iter != vtxlist.end(); ++iter)
140 os <<
"vtx " << iter->first <<
" , ";
141 iter->second->identify(os);
142 pair<multimap<int, PHG4Particle *>::const_iterator, multimap<int, PHG4Particle *>::const_iterator > particlebegin_end = GetParticles(iter->first);
143 for(particle_iter = particlebegin_end.first; particle_iter != particlebegin_end.second; ++particle_iter)
145 os <<
"vtx " << particle_iter->first <<
", ";
146 particle_iter->second->identify(os);
149 if (!embedded_particlelist.empty())
151 os <<
"embedded particles:" << endl;
152 for (map<PHG4Particle *,int>::const_iterator iter = embedded_particlelist.begin(); iter != embedded_particlelist.end(); ++iter)
154 (iter->first)->identify(os);
159 os <<
"no embedded particles" << endl;
167 std::map<PHG4Particle*,int>::const_iterator iter = embedded_particlelist.find(p);
168 if (iter == embedded_particlelist.end()) {
179 particlelist.erase(iter);
ClassImp(PHG4InEvent) PHG4InEvent
int AddParticle(const int vtxid, PHG4Particle *particle)
std::pair< std::multimap< int, PHG4Particle * >::const_iterator, std::multimap< int, PHG4Particle * >::const_iterator > GetParticles() const
int AddVtx(const double x, const double y, const double z, const double t)
void DeleteParticle(std::multimap< int, PHG4Particle * >::iterator &iter)
int AddVtxHepMC(const int id, const double x, const double y, const double z, const double t)
std::pair< std::map< int, PHG4VtxPoint * >::const_iterator, std::map< int, PHG4VtxPoint * >::const_iterator > GetVertices() const
std::pair< std::multimap< int, PHG4Particle * >::iterator, std::multimap< int, PHG4Particle * >::iterator > GetParticles_Modify()
virtual void identify(std::ostream &os=std::cout) const
int isEmbeded(PHG4Particle *) const
int AddVtxCommon(PHG4VtxPoint *newvtx)