Geant4-11
G4MCTSimEvent.hh
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26// G4MCTSimEvent
27
28// Author: Youhei Morita, 12.09.2001
29// --------------------------------------------------------------------
30#ifndef G4MCTSIMEVENT_HH
31#define G4MCTSIMEVENT_HH 1
32
33#include <iostream>
34#include <vector>
35#include <map>
36
37#include "G4Types.hh"
38
40class G4MCTSimVertex;
41
42using G4MCTSimParticleContainer = std::map<int, G4MCTSimParticle*>;
43using G4MCTSimVertexContainer = std::vector<G4MCTSimVertex*>;
44
46{
47 public:
48
51
52 inline G4MCTSimEvent(const G4MCTSimEvent& right);
53 inline G4MCTSimEvent& operator=(const G4MCTSimEvent& right);
54 // copy constructor and assignment operator
55
56 G4bool AddParticle(const G4MCTSimParticle* aparticle);
57 inline G4int GetNofParticles() const;
58 inline G4int GetNofVertices() const;
62 G4MCTSimVertex* GetVertex(G4int vid) const;
63
65 void ClearEvent();
66 void Print(std::ostream& ostr = std::cout) const;
67
68 // iterators
69 using particle_iterator = G4MCTSimParticleContainer::iterator;
70 using particle_const_iterator = G4MCTSimParticleContainer::const_iterator;
75
76 using vertex_iterator = G4MCTSimVertexContainer::iterator;
77 using vertex_const_iterator = G4MCTSimVertexContainer::const_iterator;
82
83 protected:
84
87};
88
89// ====================================================================
90// inline methods
91// ====================================================================
92
94{
95 *this = right;
96}
97
99{
100 particleMap = right.particleMap; // shallow copy
101
102 return *this;
103}
104
106{
107 return particleMap.size();
108}
109
111{
112 return vertexVec.size();
113}
114
115// iterators
117{
118 return particleMap.begin();
119}
120
122{
123 return particleMap.end();
124}
125
127 const
128{
129 return particleMap.cbegin();
130}
131
133 const
134{
135 return particleMap.cend();
136}
137
139{
140 return vertexVec.begin();
141}
142
144{
145 return vertexVec.end();
146}
147
149 const
150{
151 return vertexVec.cbegin();
152}
153
155{
156 return vertexVec.cend();
157}
158
159#endif
std::vector< G4MCTSimVertex * > G4MCTSimVertexContainer
std::map< int, G4MCTSimParticle * > G4MCTSimParticleContainer
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
particle_iterator particles_begin()
G4MCTSimParticleContainer::const_iterator particle_const_iterator
G4MCTSimVertexContainer::const_iterator vertex_const_iterator
particle_iterator particles_end()
G4int GetNofVertices() const
G4int GetNofStoredVertices() const
void BuildVertexContainer()
vertex_iterator vertices_begin()
G4bool AddParticle(const G4MCTSimParticle *aparticle)
vertex_iterator vertices_end()
G4int GetNofStoredParticles() const
G4MCTSimEvent & operator=(const G4MCTSimEvent &right)
G4MCTSimParticleContainer particleMap
G4int GetNofParticles() const
G4MCTSimVertexContainer vertexVec
G4MCTSimVertexContainer::iterator vertex_iterator
void Print(std::ostream &ostr=std::cout) const
G4MCTSimParticle * FindParticle(G4int tid) const
G4MCTSimParticleContainer::iterator particle_iterator
G4MCTSimVertex * GetVertex(G4int vid) const