Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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.hh
27//
28// ====================================================================
29#ifndef MCT_EVENT_H
30#define MCT_EVENT_H
31
32#include "G4Types.hh"
33#include <iostream>
34#include <map>
35#include "G4MCTGenParticle.hh"
36
37// ====================================================================
38//
39// class definition
40//
41// ====================================================================
42class G4MCTGenEvent;
43class G4MCTSimEvent;
45
46typedef std::map<G4MCTGenParticle, G4MCTSimParticle*> MCTGen2SimParticleMap;
47typedef std::map<G4MCTSimParticle*, G4MCTGenParticle> MCTSim2GenParticleMap;
48
50protected:
54
55 // primary table (bidirectional)
58
59public:
60 G4MCTEvent();
61 virtual ~G4MCTEvent();
62
63 // copy constructor and assignment operator
64 G4MCTEvent(const G4MCTEvent& right);
65 const G4MCTEvent& operator=(const G4MCTEvent& right);
66
67 // set/get functions
68 void SetEventNumber(int n);
69 int GetEventNumber() const;
70
73
74 // methods...
75 int GetNofPrimaries() const;
78 int AddPrimaryPair(const G4MCTGenParticle& genp,
79 const G4MCTSimParticle* simp);
80 void ClearEvent();
81 void Print(std::ostream& ostr= std::cout) const;
82
83 // iterators
84 typedef MCTGen2SimParticleMap::const_iterator genprimary_const_iterator;
87
88 typedef MCTSim2GenParticleMap::const_iterator simprimary_const_iterator;
91};
92
93// ====================================================================
94// inline functions
95// ====================================================================
96
98{
99 *this= right;
100}
101
102inline const G4MCTEvent& G4MCTEvent::operator=(const G4MCTEvent& right)
103{
105
106 simEvent= right.simEvent; // shallow copy...
107 genEvent= right.genEvent;
108
111
112 return *this;
113}
114
115inline void G4MCTEvent::SetEventNumber(int n) { eventNumber= n; }
116inline int G4MCTEvent::GetEventNumber() const { return eventNumber; }
117
119 { return gen2simParticleMap.size(); }
122
123// iterators
125{ return gen2simParticleMap.begin(); }
126
128{ return gen2simParticleMap.end(); }
129
131{ return sim2genParticleMap.begin(); }
132
134{ return sim2genParticleMap.end(); }
135
136#endif
std::map< G4MCTGenParticle, G4MCTSimParticle * > MCTGen2SimParticleMap
Definition: G4MCTEvent.hh:46
std::map< G4MCTSimParticle *, G4MCTGenParticle > MCTSim2GenParticleMap
Definition: G4MCTEvent.hh:47
std::pair< void *, void * > G4MCTGenParticle
void SetEventNumber(int n)
Definition: G4MCTEvent.hh:115
G4MCTGenEvent * genEvent
Definition: G4MCTEvent.hh:52
G4MCTGenParticle GetGenParticle(const G4MCTSimParticle *simpart) const
Definition: G4MCTEvent.cc:74
void Print(std::ostream &ostr=std::cout) const
Definition: G4MCTEvent.cc:111
int AddPrimaryPair(const G4MCTGenParticle &genp, const G4MCTSimParticle *simp)
Definition: G4MCTEvent.cc:87
int eventNumber
Definition: G4MCTEvent.hh:51
simprimary_const_iterator simprimaries_end() const
Definition: G4MCTEvent.hh:133
virtual ~G4MCTEvent()
Definition: G4MCTEvent.cc:52
G4MCTSimParticle * GetSimParticle(const G4MCTGenParticle &genpart) const
Definition: G4MCTEvent.cc:61
MCTSim2GenParticleMap sim2genParticleMap
Definition: G4MCTEvent.hh:57
const G4MCTEvent & operator=(const G4MCTEvent &right)
Definition: G4MCTEvent.hh:102
MCTGen2SimParticleMap gen2simParticleMap
Definition: G4MCTEvent.hh:56
MCTSim2GenParticleMap::const_iterator simprimary_const_iterator
Definition: G4MCTEvent.hh:88
MCTGen2SimParticleMap::const_iterator genprimary_const_iterator
Definition: G4MCTEvent.hh:84
G4MCTSimEvent * simEvent
Definition: G4MCTEvent.hh:53
genprimary_const_iterator genprimaries_end() const
Definition: G4MCTEvent.hh:127
G4MCTSimEvent * GetSimEvent() const
Definition: G4MCTEvent.hh:120
int GetNofPrimaries() const
Definition: G4MCTEvent.hh:118
G4MCTGenEvent * GetGenEvent() const
Definition: G4MCTEvent.hh:121
void ClearEvent()
Definition: G4MCTEvent.cc:100
genprimary_const_iterator genprimaries_begin() const
Definition: G4MCTEvent.hh:124
simprimary_const_iterator simprimaries_begin() const
Definition: G4MCTEvent.hh:130
int GetEventNumber() const
Definition: G4MCTEvent.hh:116