Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
LXeScintSD.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 //
26 // $Id: LXeScintSD.cc 110138 2018-05-16 07:31:43Z gcosmo $
27 //
30 //
31 //
32 #include "LXeScintSD.hh"
33 #include "LXeScintHit.hh"
34 #include "G4VPhysicalVolume.hh"
35 #include "G4LogicalVolume.hh"
36 #include "G4Track.hh"
37 #include "G4Step.hh"
38 #include "G4ParticleDefinition.hh"
39 #include "G4VTouchable.hh"
40 #include "G4TouchableHistory.hh"
41 #include "G4ios.hh"
42 #include "G4VProcess.hh"
43 
44 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
45 
47  : G4VSensitiveDetector(name)
48 {
49  fScintCollection = nullptr;
50  collectionName.insert("scintCollection");
51 }
52 
53 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
54 
56 
57 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
58 
62  //A way to keep all the hits of this event in one place if needed
63  static G4int hitsCID = -1;
64  if(hitsCID<0){
65  hitsCID = GetCollectionID(0);
66  }
67  hitsCE->AddHitsCollection( hitsCID, fScintCollection );
68 }
69 
70 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
71 
74  if(edep==0.) return false; //No edep so dont count as hit
75 
76  G4StepPoint* thePrePoint = aStep->GetPreStepPoint();
77  G4TouchableHistory* theTouchable =
79  G4VPhysicalVolume* thePrePV = theTouchable->GetVolume();
80 
81  G4StepPoint* thePostPoint = aStep->GetPostStepPoint();
82 
83  //Get the average position of the hit
84  G4ThreeVector pos = thePrePoint->GetPosition() + thePostPoint->GetPosition();
85  pos/=2.;
86 
87  LXeScintHit* scintHit = new LXeScintHit(thePrePV);
88 
89  scintHit->SetEdep(edep);
90  scintHit->SetPos(pos);
91 
92  fScintCollection->insert(scintHit);
93 
94  return true;
95 }
96 
97 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
98 
100 
101 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
102 
104 
105 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
106 
108 
109 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
110 
virtual G4int GetCollectionID(G4int i)
G4THitsCollection< LXeScintHit > LXeScintHitsCollection
Definition: LXeScintHit.hh:79
const XML_Char * name
Definition: expat.h:151
virtual void clear()
Definition: LXeScintSD.cc:103
void SetEdep(G4double de)
Definition: LXeScintHit.hh:63
const G4VTouchable * GetTouchable() const
static const G4double pos
G4StepPoint * GetPreStepPoint() const
virtual ~LXeScintSD()
Definition: LXeScintSD.cc:55
virtual void Initialize(G4HCofThisEvent *)
Definition: LXeScintSD.cc:59
void AddHitsCollection(G4int HCID, G4VHitsCollection *aHC)
Definition of the LXeScintSD class.
virtual void PrintAll()
Definition: LXeScintSD.cc:111
double G4double
Definition: G4Types.hh:76
bool G4bool
Definition: G4Types.hh:79
LXeScintHitsCollection * fScintCollection
Definition: LXeScintSD.hh:58
G4VPhysicalVolume * GetVolume(G4int depth=0) const
const G4ThreeVector & GetPosition() const
virtual void EndOfEvent(G4HCofThisEvent *)
Definition: LXeScintSD.cc:99
G4double GetTotalEnergyDeposit() const
Definition: G4Step.hh:76
G4StepPoint * GetPostStepPoint() const
virtual void DrawAll()
Definition: LXeScintSD.cc:107
Double_t edep
int G4int
Definition: G4Types.hh:78
G4CollectionNameVector collectionName
void SetPos(G4ThreeVector xyz)
Definition: LXeScintHit.hh:67
virtual G4bool ProcessHits(G4Step *aStep, G4TouchableHistory *)
Definition: LXeScintSD.cc:72
Definition of the LXeScintHit class.
LXeScintSD(G4String name)
Definition: LXeScintSD.cc:46