Geant4_10
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 // ====================================================================
42 class G4MCTSimParticle;
44 
45 typedef std::map<int, G4MCTSimParticle*> G4MCTSimParticleContainer;
46 typedef std::vector<G4MCTSimVertex*> G4MCTSimVertexContainer;
47 
49 protected:
52 
53 public:
54  G4MCTSimEvent();
56 
57  // copy constructor and assignment operator
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 
70  void BuildVertexContainer();
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
G4bool AddParticle(const G4MCTSimParticle *aparticle)
vertex_iterator vertices_begin()
G4MCTSimParticleContainer::const_iterator particle_const_iterator
vertex_iterator vertices_end()
G4MCTSimParticle * FindParticle(int tid) const
void Print(std::ostream &ostr=std::cout) const
particle_iterator particles_begin()
int GetNofVertices() const
bool G4bool
Definition: G4Types.hh:79
const G4MCTSimEvent & operator=(const G4MCTSimEvent &right)
particle_iterator particles_end()
G4MCTSimVertexContainer::const_iterator vertex_const_iterator
std::vector< G4MCTSimVertex * > G4MCTSimVertexContainer
int GetNofParticles() const
G4MCTSimVertexContainer vertexVec
G4MCTSimParticleContainer particleMap
void BuildVertexContainer()
int GetNofStoredParticles() const
G4MCTSimVertex * GetVertex(int vid) const
G4MCTSimVertexContainer::iterator vertex_iterator
std::map< int, G4MCTSimParticle * > G4MCTSimParticleContainer
G4MCTSimParticleContainer::iterator particle_iterator
int GetNofStoredVertices() const