Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
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 // $Id: RMC01SD.cc 98774 2016-08-09 14:28:06Z gcosmo $
30 //
32 // Class Name: RMC01SD
33 // Author: L. Desorgher
34 // Organisation: SpaceIT GmbH
35 // Contract: ESA contract 21435/08/NL/AT
36 // Customer: ESA/ESTEC
38 
39 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
40 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
41 
42 #include "RMC01SD.hh"
43 #include "G4Step.hh"
44 #include "G4HCofThisEvent.hh"
45 #include "G4Track.hh"
46 #include "G4SDManager.hh"
47 #include "G4ios.hh"
48 #include "G4ParticleDefinition.hh"
49 #include "G4VProcess.hh"
50 #include "G4LogicalVolumeStore.hh"
51 #include "G4LogicalVolume.hh"
52 #include "G4PhysicalVolumeStore.hh"
53 #include "G4VPhysicalVolume.hh"
54 
55 //#include "G4AdjointAnalysisManager.hh"
56 #include "G4THitsCollection.hh"
57 #include "G4RunManager.hh"
58 #include "G4Electron.hh"
59 #include "G4Gamma.hh"
60 #include "G4Proton.hh"
61 
62 class G4Step;
63 
64 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
65 
68  fTotalEventEdep(0.),fEventEdepCollection(0),
69  fProtonCurrentCollection(0),fGammaCurrentCollection(0),
70  fElectronCurrentCollection(0)
71 {
72  collectionName.insert("edep");
73  collectionName.insert("current_electron");
74  collectionName.insert("current_proton");
75  collectionName.insert("current_gamma");
76 }
77 
78 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
79 
81 {;
82 }
83 
84 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
85 
87 {
88  fTotalEventEdep=0.;
89  static G4int HCID = -1;
90 
93  HCID = GetCollectionID(0);
95 
98  HCID = GetCollectionID(1);
100 
103  HCID = GetCollectionID(2);
105 
108  HCID = GetCollectionID(3);
110 }
111 
112 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
113 
115 {
116  G4double weight =aStep->GetTrack()->GetWeight();
118  if (edep >0) fEventEdepCollection->insert(
119  new RMC01DoubleWithWeightHit(edep,weight));
120 
121  G4StepPoint* preStepPoint =aStep->GetPreStepPoint();
122 
123  if (preStepPoint->GetStepStatus() == fGeomBoundary ){
124  // Entering the sensitive volume
125  weight=preStepPoint->GetWeight();
126  G4double eKin = preStepPoint->GetKineticEnergy();
127  G4ParticleDefinition* thePartDef = aStep->GetTrack()->GetDefinition();
128  if (thePartDef == G4Electron::Electron()) fElectronCurrentCollection->
129  insert(new RMC01DoubleWithWeightHit(eKin,weight));
130  else if (thePartDef == G4Gamma::Gamma()) fGammaCurrentCollection->
131  insert(new RMC01DoubleWithWeightHit(eKin,weight));
132  else if (thePartDef == G4Proton::Proton()) fProtonCurrentCollection->
133  insert(new RMC01DoubleWithWeightHit(eKin,weight));
134  }
135  return true;
136 }
137 
138 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
139 
141 {
144 }
145 
146 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
147 
149 {;
150 }
151 
152 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
153 
155 {;
156 }
157 
158 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
159 
161 {;
162 }
163 
164 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
165 
virtual G4int GetCollectionID(G4int i)
virtual void PrintAll()
Definition: RMC01SD.cc:160
RMC01DoubleWithWeightHitsCollection * fElectronCurrentCollection
Definition: RMC01SD.hh:83
const XML_Char * name
Definition: expat.h:151
G4StepPoint * GetPreStepPoint() const
void AddHitsCollection(G4int HCID, G4VHitsCollection *aHC)
virtual void EndOfEvent(G4HCofThisEvent *HCE)
Definition: RMC01SD.cc:140
static G4Proton * Proton()
Definition: G4Proton.cc:93
G4ParticleDefinition * GetDefinition() const
RMC01DoubleWithWeightHitsCollection * fEventEdepCollection
Definition: RMC01SD.hh:80
RMC01DoubleWithWeightHitsCollection * fProtonCurrentCollection
Definition: RMC01SD.hh:81
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
G4double GetWeight() const
RMC01DoubleWithWeightHitsCollection * fGammaCurrentCollection
Definition: RMC01SD.hh:82
double G4double
Definition: G4Types.hh:76
bool G4bool
Definition: G4Types.hh:79
G4StepStatus GetStepStatus() const
G4double fTotalEventEdep
Definition: RMC01SD.hh:79
virtual void Initialize(G4HCofThisEvent *HCE)
Definition: RMC01SD.cc:86
G4Track * GetTrack() const
G4double GetTotalEnergyDeposit() const
Definition: G4Step.hh:76
virtual G4bool ProcessHits(G4Step *aStep, G4TouchableHistory *ROhist)
Definition: RMC01SD.cc:114
G4double GetKineticEnergy() const
static G4Electron * Electron()
Definition: G4Electron.cc:94
Double_t edep
Definition of the RMC01SD class.
double weight
Definition: plottest35.C:25
int G4int
Definition: G4Types.hh:78
G4CollectionNameVector collectionName
virtual void Clear()
Definition: RMC01SD.cc:148
RMC01SD(G4String name)
Definition: RMC01SD.cc:66
virtual void DrawAll()
Definition: RMC01SD.cc:154
G4double GetWeight() const
virtual ~RMC01SD()
Definition: RMC01SD.cc:80