Geant4
11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4MCTEvent.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
// G4MCTEvent
27
28
// Author: Youhei Morita, 12.09.2001
29
// --------------------------------------------------------------------
30
#ifndef G4MCTEVENT_HH
31
#define G4MCTEVENT_HH 1
32
33
#include <iostream>
34
#include <map>
35
36
#include "
G4Types.hh
"
37
#include "
G4MCTGenParticle.hh
"
38
39
class
G4MCTGenEvent
;
40
class
G4MCTSimEvent
;
41
class
G4MCTSimParticle
;
42
43
using
MCTGen2SimParticleMap
= std::map<G4MCTGenParticle, G4MCTSimParticle*>;
44
using
MCTSim2GenParticleMap
= std::map<G4MCTSimParticle*, G4MCTGenParticle>;
45
46
class
G4MCTEvent
47
{
48
public
:
49
50
G4MCTEvent
();
51
virtual
~G4MCTEvent
();
52
53
inline
G4MCTEvent
(
const
G4MCTEvent
& right);
54
inline
G4MCTEvent
&
operator=
(
const
G4MCTEvent
& right);
55
// copy constructor and assignment operator
56
57
inline
void
SetEventNumber
(
G4int
n);
58
inline
G4int
GetEventNumber
()
const
;
59
// set/get functions
60
61
inline
G4MCTGenEvent
*
GetGenEvent
()
const
;
62
inline
G4MCTSimEvent
*
GetSimEvent
()
const
;
63
64
inline
G4int
GetNofPrimaries
()
const
;
65
G4MCTSimParticle
*
GetSimParticle
(
const
G4MCTGenParticle
& genpart)
const
;
66
G4MCTGenParticle
GetGenParticle
(
const
G4MCTSimParticle
* simpart)
const
;
67
G4int
AddPrimaryPair
(
const
G4MCTGenParticle
& genp,
68
const
G4MCTSimParticle
* simp);
69
void
ClearEvent
();
70
void
Print
(std::ostream& ostr = std::cout)
const
;
71
72
// iterators
73
74
using
genprimary_const_iterator
= MCTGen2SimParticleMap::const_iterator;
75
inline
genprimary_const_iterator
genprimaries_begin
()
const
;
76
inline
genprimary_const_iterator
genprimaries_end
()
const
;
77
78
using
simprimary_const_iterator
= MCTSim2GenParticleMap::const_iterator;
79
inline
simprimary_const_iterator
simprimaries_begin
()
const
;
80
inline
simprimary_const_iterator
simprimaries_end
()
const
;
81
82
protected
:
83
84
G4int
eventNumber
= 0;
85
G4MCTGenEvent
*
genEvent
=
nullptr
;
86
G4MCTSimEvent
*
simEvent
=
nullptr
;
87
88
// primary table (bidirectional)
89
MCTGen2SimParticleMap
gen2simParticleMap
;
90
MCTSim2GenParticleMap
sim2genParticleMap
;
91
};
92
93
// ====================================================================
94
// inline methods
95
// ====================================================================
96
97
inline
G4MCTEvent::G4MCTEvent
(
const
G4MCTEvent
& right) { *
this
= right; }
98
99
inline
G4MCTEvent
&
G4MCTEvent::operator=
(
const
G4MCTEvent
& right)
100
{
101
eventNumber
= right.
eventNumber
;
102
103
simEvent
= right.
simEvent
;
// shallow copy...
104
genEvent
= right.
genEvent
;
105
106
gen2simParticleMap
= right.
gen2simParticleMap
;
107
sim2genParticleMap
= right.
sim2genParticleMap
;
108
109
return
*
this
;
110
}
111
112
inline
void
G4MCTEvent::SetEventNumber
(
G4int
n)
113
{
114
eventNumber
= n;
115
}
116
117
inline
G4int
G4MCTEvent::GetEventNumber
()
const
118
{
119
return
eventNumber
;
120
}
121
122
inline
G4int
G4MCTEvent::GetNofPrimaries
()
const
123
{
124
return
(
G4int
)
gen2simParticleMap
.size();
125
}
126
127
inline
G4MCTSimEvent
*
G4MCTEvent::GetSimEvent
()
const
128
{
129
return
simEvent
;
130
}
131
132
inline
G4MCTGenEvent
*
G4MCTEvent::GetGenEvent
()
const
133
{
134
return
genEvent
;
135
}
136
137
// iterators
138
inline
139
G4MCTEvent::genprimary_const_iterator
G4MCTEvent::genprimaries_begin
()
const
140
{
141
return
gen2simParticleMap
.cbegin();
142
}
143
144
inline
145
G4MCTEvent::genprimary_const_iterator
G4MCTEvent::genprimaries_end
()
const
146
{
147
return
gen2simParticleMap
.cend();
148
}
149
150
inline
151
G4MCTEvent::simprimary_const_iterator
G4MCTEvent::simprimaries_begin
()
const
152
{
153
return
sim2genParticleMap
.cbegin();
154
}
155
156
inline
157
G4MCTEvent::simprimary_const_iterator
G4MCTEvent::simprimaries_end
()
const
158
{
159
return
sim2genParticleMap
.cend();
160
}
161
162
#endif
MCTGen2SimParticleMap
std::map< G4MCTGenParticle, G4MCTSimParticle * > MCTGen2SimParticleMap
Definition
G4MCTEvent.hh:43
MCTSim2GenParticleMap
std::map< G4MCTSimParticle *, G4MCTGenParticle > MCTSim2GenParticleMap
Definition
G4MCTEvent.hh:44
G4MCTGenParticle.hh
G4MCTGenParticle
std::pair< void *, void * > G4MCTGenParticle
Definition
G4MCTGenParticle.hh:35
G4Types.hh
G4int
int G4int
Definition
G4Types.hh:85
G4MCTEvent
Definition
G4MCTEvent.hh:47
G4MCTEvent::SetEventNumber
void SetEventNumber(G4int n)
Definition
G4MCTEvent.hh:112
G4MCTEvent::genEvent
G4MCTGenEvent * genEvent
Definition
G4MCTEvent.hh:85
G4MCTEvent::AddPrimaryPair
G4int AddPrimaryPair(const G4MCTGenParticle &genp, const G4MCTSimParticle *simp)
Definition
G4MCTEvent.cc:82
G4MCTEvent::GetGenParticle
G4MCTGenParticle GetGenParticle(const G4MCTSimParticle *simpart) const
Definition
G4MCTEvent.cc:67
G4MCTEvent::simprimary_const_iterator
MCTSim2GenParticleMap::const_iterator simprimary_const_iterator
Definition
G4MCTEvent.hh:78
G4MCTEvent::Print
void Print(std::ostream &ostr=std::cout) const
Definition
G4MCTEvent.cc:104
G4MCTEvent::genprimary_const_iterator
MCTGen2SimParticleMap::const_iterator genprimary_const_iterator
Definition
G4MCTEvent.hh:74
G4MCTEvent::operator=
G4MCTEvent & operator=(const G4MCTEvent &right)
Definition
G4MCTEvent.hh:99
G4MCTEvent::simprimaries_end
simprimary_const_iterator simprimaries_end() const
Definition
G4MCTEvent.hh:157
G4MCTEvent::~G4MCTEvent
virtual ~G4MCTEvent()
Definition
G4MCTEvent.cc:45
G4MCTEvent::GetSimParticle
G4MCTSimParticle * GetSimParticle(const G4MCTGenParticle &genpart) const
Definition
G4MCTEvent.cc:52
G4MCTEvent::sim2genParticleMap
MCTSim2GenParticleMap sim2genParticleMap
Definition
G4MCTEvent.hh:90
G4MCTEvent::GetEventNumber
G4int GetEventNumber() const
Definition
G4MCTEvent.hh:117
G4MCTEvent::gen2simParticleMap
MCTGen2SimParticleMap gen2simParticleMap
Definition
G4MCTEvent.hh:89
G4MCTEvent::simEvent
G4MCTSimEvent * simEvent
Definition
G4MCTEvent.hh:86
G4MCTEvent::genprimaries_end
genprimary_const_iterator genprimaries_end() const
Definition
G4MCTEvent.hh:145
G4MCTEvent::G4MCTEvent
G4MCTEvent()
Definition
G4MCTEvent.cc:38
G4MCTEvent::GetNofPrimaries
G4int GetNofPrimaries() const
Definition
G4MCTEvent.hh:122
G4MCTEvent::eventNumber
G4int eventNumber
Definition
G4MCTEvent.hh:84
G4MCTEvent::GetSimEvent
G4MCTSimEvent * GetSimEvent() const
Definition
G4MCTEvent.hh:127
G4MCTEvent::GetGenEvent
G4MCTGenEvent * GetGenEvent() const
Definition
G4MCTEvent.hh:132
G4MCTEvent::ClearEvent
void ClearEvent()
Definition
G4MCTEvent.cc:94
G4MCTEvent::genprimaries_begin
genprimary_const_iterator genprimaries_begin() const
Definition
G4MCTEvent.hh:139
G4MCTEvent::simprimaries_begin
simprimary_const_iterator simprimaries_begin() const
Definition
G4MCTEvent.hh:151
G4MCTGenEvent
Definition
G4MCTGenEvent.hh:39
G4MCTSimEvent
Definition
G4MCTSimEvent.hh:46
G4MCTSimParticle
Definition
G4MCTSimParticle.hh:47
geant4-v11.2.2
source
persistency
mctruth
include
G4MCTEvent.hh
Generated by
1.12.0