ECCE @ EIC Software
 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 
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 
80 {;
81 }
82 
83 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
84 
86 {
87  fTotalEventEdep=0.;
88  static G4int HCID = -1;
89 
92  HCID = GetCollectionID(0);
94 
97  HCID = GetCollectionID(1);
99 
102  HCID = GetCollectionID(2);
104 
107  HCID = GetCollectionID(3);
109 }
110 
111 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
112 
114 {
115  G4double weight =aStep->GetTrack()->GetWeight();
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 
140 {
143 }
144 
145 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
146 
148 {;
149 }
150 
151 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
152 
154 {;
155 }
156 
157 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
158 
160 {;
161 }
162 
163 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
164