ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
RMC01SD.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file RMC01SD.cc
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
//
28
//
29
//
31
// Class Name: RMC01SD
32
// Author: L. Desorgher
33
// Organisation: SpaceIT GmbH
34
// Contract: ESA contract 21435/08/NL/AT
35
// Customer: ESA/ESTEC
37
38
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
39
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
40
41
#include "
RMC01SD.hh
"
42
#include "
G4Step.hh
"
43
#include "G4HCofThisEvent.hh"
44
#include "
G4Track.hh
"
45
#include "
G4SDManager.hh
"
46
#include "
G4ios.hh
"
47
#include "
G4ParticleDefinition.hh
"
48
#include "
G4VProcess.hh
"
49
#include "
G4LogicalVolumeStore.hh
"
50
#include "
G4LogicalVolume.hh
"
51
#include "
G4PhysicalVolumeStore.hh
"
52
#include "
G4VPhysicalVolume.hh
"
53
54
//#include "G4AdjointAnalysisManager.hh"
55
#include "G4THitsCollection.hh"
56
#include "
G4RunManager.hh
"
57
#include "
G4Electron.hh
"
58
#include "
G4Gamma.hh
"
59
#include "
G4Proton.hh
"
60
61
class
G4Step
;
62
63
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
64
65
RMC01SD::RMC01SD
(
G4String
name
)
66
:
G4VSensitiveDetector
(name),
67
fTotalEventEdep(0.),fEventEdepCollection(0),
68
fProtonCurrentCollection(0),fGammaCurrentCollection(0),
69
fElectronCurrentCollection(0)
70
{
71
collectionName
.
insert
(
"edep"
);
72
collectionName
.
insert
(
"current_electron"
);
73
collectionName
.
insert
(
"current_proton"
);
74
collectionName
.
insert
(
"current_gamma"
);
75
}
76
77
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
78
79
RMC01SD::~RMC01SD
()
80
{;
81
}
82
83
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
84
85
void
RMC01SD::Initialize
(
G4HCofThisEvent
* HCE)
86
{
87
fTotalEventEdep
=0.;
88
static
G4int
HCID = -1;
89
90
fEventEdepCollection
=
new
G4THitsCollection<RMC01DoubleWithWeightHit>
91
(
SensitiveDetectorName
,
collectionName
[0]);
92
HCID =
GetCollectionID
(0);
93
HCE->
AddHitsCollection
(HCID,
fEventEdepCollection
);
94
95
fElectronCurrentCollection
=
new
G4THitsCollection<RMC01DoubleWithWeightHit>
96
(
SensitiveDetectorName
,
collectionName
[1]);
97
HCID =
GetCollectionID
(1);
98
HCE->
AddHitsCollection
(HCID,
fElectronCurrentCollection
);
99
100
fProtonCurrentCollection
=
new
G4THitsCollection<RMC01DoubleWithWeightHit>
101
(
SensitiveDetectorName
,
collectionName
[2]);
102
HCID =
GetCollectionID
(2);
103
HCE->
AddHitsCollection
(HCID,
fProtonCurrentCollection
);
104
105
fGammaCurrentCollection
=
new
G4THitsCollection<RMC01DoubleWithWeightHit>
106
(
SensitiveDetectorName
,
collectionName
[3]);
107
HCID =
GetCollectionID
(3);
108
HCE->
AddHitsCollection
(HCID,
fGammaCurrentCollection
);
109
}
110
111
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
112
113
G4bool
RMC01SD::ProcessHits
(
G4Step
*aStep,
G4TouchableHistory
* )
114
{
115
G4double
weight
=aStep->
GetTrack
()->
GetWeight
();
116
G4double
edep
= aStep->
GetTotalEnergyDeposit
();
117
if
(edep >0)
fEventEdepCollection
->
insert
(
118
new
RMC01DoubleWithWeightHit
(edep,weight));
119
120
G4StepPoint
* preStepPoint =aStep->
GetPreStepPoint
();
121
122
if
(preStepPoint->
GetStepStatus
() ==
fGeomBoundary
){
123
// Entering the sensitive volume
124
weight=preStepPoint->
GetWeight
();
125
G4double
eKin = preStepPoint->
GetKineticEnergy
();
126
G4ParticleDefinition
* thePartDef = aStep->
GetTrack
()->
GetDefinition
();
127
if
(thePartDef ==
G4Electron::Electron
())
fElectronCurrentCollection
->
128
insert(
new
RMC01DoubleWithWeightHit
(eKin,weight));
129
else
if
(thePartDef ==
G4Gamma::Gamma
())
fGammaCurrentCollection
->
130
insert(
new
RMC01DoubleWithWeightHit
(eKin,weight));
131
else
if
(thePartDef ==
G4Proton::Proton
())
fProtonCurrentCollection
->
132
insert(
new
RMC01DoubleWithWeightHit
(eKin,weight));
133
}
134
return
true
;
135
}
136
137
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
138
139
void
RMC01SD::EndOfEvent
(
G4HCofThisEvent
*)
140
{
141
fEventEdepCollection
->
insert
(
142
new
RMC01DoubleWithWeightHit
(
fTotalEventEdep
,1.));
143
}
144
145
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
146
147
void
RMC01SD::Clear
()
148
{;
149
}
150
151
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
152
153
void
RMC01SD::DrawAll
()
154
{;
155
}
156
157
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
158
159
void
RMC01SD::PrintAll
()
160
{;
161
}
162
163
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
164
geant4
tree
geant4-10.6-release
examples
extended
biasing
ReverseMC01
src
RMC01SD.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:03
using
1.8.2 with
ECCE GitHub integration