Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
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.hh
27//
28// ====================================================================
29#ifndef MCT_SIM_EVENT_H
30#define MCT_SIM_EVENT_H
31
32#include "G4Types.hh"
33#include <iostream>
34#include <vector>
35#include <map>
36
37// ====================================================================
38//
39// class definition
40//
41// ====================================================================
43class G4MCTSimVertex;
44
45typedef std::map<int, G4MCTSimParticle*> G4MCTSimParticleContainer;
46typedef std::vector<G4MCTSimVertex*> G4MCTSimVertexContainer;
47
49protected:
52
53public:
56
57 // copy constructor and assignment operator
58 G4MCTSimEvent(const G4MCTSimEvent& right);
59 const G4MCTSimEvent& operator=(const G4MCTSimEvent& right);
60
61 // methods...
62 G4bool AddParticle(const G4MCTSimParticle* aparticle);
63 int GetNofParticles() const;
64 int GetNofVertices() const;
65 int GetNofStoredParticles() const;
66 int GetNofStoredVertices() const;
67 G4MCTSimParticle* FindParticle(int tid) const;
68 G4MCTSimVertex* GetVertex(int vid) const;
69
71 void ClearEvent();
72 void Print(std::ostream& ostr= std::cout) const;
73
74 // iterators
75 typedef G4MCTSimParticleContainer::iterator particle_iterator;
76 typedef G4MCTSimParticleContainer::const_iterator particle_const_iterator;
81
82 typedef G4MCTSimVertexContainer::iterator vertex_iterator;
83 typedef G4MCTSimVertexContainer::const_iterator vertex_const_iterator;
88};
89
90// ====================================================================
91// inline functions
92// ====================================================================
93
95{
96 *this= right;
97}
98
100{
101 particleMap= right.particleMap; // shallow copy
102
103 return *this;
104}
105
107{
108 return particleMap.size();
109}
110
112{
113 return vertexVec.size();
114}
115
116// iterators
118{ return particleMap.begin(); }
119
121{ return particleMap.end(); }
122
125{ return particleMap.begin(); }
126
128{ return particleMap.end(); }
129
131{ return vertexVec.begin(); }
132
134{ return vertexVec.end(); }
135
137{ return vertexVec.begin(); }
138
140{ return vertexVec.end(); }
141
142#endif
std::map< int, G4MCTSimParticle * > G4MCTSimParticleContainer
std::vector< G4MCTSimVertex * > G4MCTSimVertexContainer
bool G4bool
Definition: G4Types.hh:67
particle_iterator particles_begin()
particle_iterator particles_end()
void BuildVertexContainer()
int GetNofStoredParticles() const
const G4MCTSimEvent & operator=(const G4MCTSimEvent &right)
vertex_iterator vertices_begin()
int GetNofVertices() const
G4bool AddParticle(const G4MCTSimParticle *aparticle)
G4MCTSimVertex * GetVertex(int vid) const
int GetNofStoredVertices() const
vertex_iterator vertices_end()
G4MCTSimVertexContainer::iterator vertex_iterator
G4MCTSimParticleContainer::const_iterator particle_const_iterator
G4MCTSimParticleContainer particleMap
G4MCTSimParticleContainer::iterator particle_iterator
G4MCTSimVertexContainer vertexVec
G4MCTSimVertexContainer::const_iterator vertex_const_iterator
int GetNofParticles() const
void Print(std::ostream &ostr=std::cout) const
G4MCTSimParticle * FindParticle(int tid) const