Geant4 11.1.1
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
39class G4MCTGenEvent;
40class G4MCTSimEvent;
42
43using MCTGen2SimParticleMap = std::map<G4MCTGenParticle, G4MCTSimParticle*>;
44using MCTSim2GenParticleMap = std::map<G4MCTSimParticle*, G4MCTGenParticle>;
45
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;
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;
77
78 using simprimary_const_iterator = MCTSim2GenParticleMap::const_iterator;
81
82 protected:
83
87
88 // primary table (bidirectional)
91};
92
93// ====================================================================
94// inline methods
95// ====================================================================
96
97inline G4MCTEvent::G4MCTEvent(const G4MCTEvent& right) { *this = right; }
98
100{
101 eventNumber = right.eventNumber;
102
103 simEvent = right.simEvent; // shallow copy...
104 genEvent = right.genEvent;
105
108
109 return *this;
110}
111
113{
114 eventNumber = n;
115}
116
118{
119 return eventNumber;
120}
121
123{
124 return (G4int)gen2simParticleMap.size();
125}
126
128{
129 return simEvent;
130}
131
133{
134 return genEvent;
135}
136
137// iterators
138inline
140{
141 return gen2simParticleMap.cbegin();
142}
143
144inline
146{
147 return gen2simParticleMap.cend();
148}
149
150inline
152{
153 return sim2genParticleMap.cbegin();
154}
155
156inline
158{
159 return sim2genParticleMap.cend();
160}
161
162#endif
std::map< G4MCTGenParticle, G4MCTSimParticle * > MCTGen2SimParticleMap
Definition: G4MCTEvent.hh:43
std::map< G4MCTSimParticle *, G4MCTGenParticle > MCTSim2GenParticleMap
Definition: G4MCTEvent.hh:44
std::pair< void *, void * > G4MCTGenParticle
int G4int
Definition: G4Types.hh:85
void SetEventNumber(G4int n)
Definition: G4MCTEvent.hh:112
G4MCTGenEvent * genEvent
Definition: G4MCTEvent.hh:85
G4int AddPrimaryPair(const G4MCTGenParticle &genp, const G4MCTSimParticle *simp)
Definition: G4MCTEvent.cc:82
G4MCTGenParticle GetGenParticle(const G4MCTSimParticle *simpart) const
Definition: G4MCTEvent.cc:67
MCTSim2GenParticleMap::const_iterator simprimary_const_iterator
Definition: G4MCTEvent.hh:78
void Print(std::ostream &ostr=std::cout) const
Definition: G4MCTEvent.cc:104
MCTGen2SimParticleMap::const_iterator genprimary_const_iterator
Definition: G4MCTEvent.hh:74
G4MCTEvent & operator=(const G4MCTEvent &right)
Definition: G4MCTEvent.hh:99
simprimary_const_iterator simprimaries_end() const
Definition: G4MCTEvent.hh:157
virtual ~G4MCTEvent()
Definition: G4MCTEvent.cc:45
G4MCTSimParticle * GetSimParticle(const G4MCTGenParticle &genpart) const
Definition: G4MCTEvent.cc:52
MCTSim2GenParticleMap sim2genParticleMap
Definition: G4MCTEvent.hh:90
G4int GetEventNumber() const
Definition: G4MCTEvent.hh:117
MCTGen2SimParticleMap gen2simParticleMap
Definition: G4MCTEvent.hh:89
G4MCTSimEvent * simEvent
Definition: G4MCTEvent.hh:86
genprimary_const_iterator genprimaries_end() const
Definition: G4MCTEvent.hh:145
G4int GetNofPrimaries() const
Definition: G4MCTEvent.hh:122
G4int eventNumber
Definition: G4MCTEvent.hh:84
G4MCTSimEvent * GetSimEvent() const
Definition: G4MCTEvent.hh:127
G4MCTGenEvent * GetGenEvent() const
Definition: G4MCTEvent.hh:132
void ClearEvent()
Definition: G4MCTEvent.cc:94
genprimary_const_iterator genprimaries_begin() const
Definition: G4MCTEvent.hh:139
simprimary_const_iterator simprimaries_begin() const
Definition: G4MCTEvent.hh:151