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
G4Event.cc
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//
27// $Id$
28//
29
30// G4Event
31
32#include "G4Event.hh"
33#include "G4VVisManager.hh"
34//#include "G4HCofThisEvent.hh"
35//#include "G4DCofThisEvent.hh"
36#include "G4VHitsCollection.hh"
37#include "G4VDigiCollection.hh"
38#include "G4ios.hh"
39
41
43:eventID(0),
44 thePrimaryVertex(0),numberOfPrimaryVertex(0),
45 HC(0),DC(0),trajectoryContainer(0),eventAborted(false),userInfo(0),
46 randomNumberStatus(0),validRandomNumberStatus(false),
47 randomNumberStatusForProcessing(0),validRandomNumberStatusForProcessing(false),
48 keepTheEvent(false)
49{;}
50
52:eventID(evID),
53 thePrimaryVertex(0),numberOfPrimaryVertex(0),
54 HC(0),DC(0),trajectoryContainer(0),eventAborted(false),userInfo(0),
55 randomNumberStatus(0),validRandomNumberStatus(false),
56 randomNumberStatusForProcessing(0),validRandomNumberStatusForProcessing(false),
57 keepTheEvent(false)
58{;}
59
61{
62 if(thePrimaryVertex) delete thePrimaryVertex;
63 if(HC) delete HC;
64 if(DC) delete DC;
65 if(trajectoryContainer)
66 {
67 trajectoryContainer->clearAndDestroy();
68 delete trajectoryContainer;
69 }
70 if(userInfo) delete userInfo;
71 if(validRandomNumberStatus) delete randomNumberStatus;
72 if(validRandomNumberStatusForProcessing) delete randomNumberStatusForProcessing;
73}
74
76{
77 return ( eventID == right.eventID );
78}
79
81{
82 return ( eventID != right.eventID );
83}
84
85void G4Event::Print() const
86{
87 G4cout << "G4Event " << eventID << G4endl;
88}
89
90void G4Event::Draw() const
91{
93 if(!pVVisManager) return;
94
95 if(trajectoryContainer)
96 {
97 G4int n_traj = trajectoryContainer->entries();
98 for(G4int i=0;i<n_traj;i++)
99 { (*trajectoryContainer)[i]->DrawTrajectory(); }
100 }
101
102 if(HC)
103 {
104 G4int n_HC = HC->GetCapacity();
105 for(G4int j=0;j<n_HC;j++)
106 {
107 G4VHitsCollection * VHC = HC->GetHC(j);
108 if(VHC) VHC->DrawAllHits();
109 }
110 }
111
112 if(DC)
113 {
114 G4int n_DC = DC->GetCapacity();
115 for(G4int j=0;j<n_DC;j++)
116 {
117 G4VDigiCollection * VDC = DC->GetDC(j);
118 if(VDC) VDC->DrawAllDigi();
119 }
120 }
121}
122
G4Allocator< G4Event > anEventAllocator
Definition: G4Event.cc:40
int G4int
Definition: G4Types.hh:66
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
G4int GetCapacity() const
G4VDigiCollection * GetDC(G4int i) const
void Print() const
Definition: G4Event.cc:85
~G4Event()
Definition: G4Event.cc:60
G4int operator==(const G4Event &right) const
Definition: G4Event.cc:75
G4int operator!=(const G4Event &right) const
Definition: G4Event.cc:80
G4Event()
Definition: G4Event.cc:42
void Draw() const
Definition: G4Event.cc:90
G4VHitsCollection * GetHC(G4int i)
virtual void DrawAllDigi()
virtual void DrawAllHits()
static G4VVisManager * GetConcreteInstance()