Geant4
10.03.p02
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
LXeScintSD.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
// $Id: LXeScintSD.cc 68752 2013-04-05 10:23:47Z 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
46
LXeScintSD::LXeScintSD
(
G4String
name
)
47
:
G4VSensitiveDetector
(name)
48
{
49
fScintCollection = NULL;
50
collectionName
.
insert
(
"scintCollection"
);
51
}
52
53
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
54
55
LXeScintSD::~LXeScintSD
() {}
56
57
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
58
59
void
LXeScintSD::Initialize
(
G4HCofThisEvent
* hitsCE){
60
fScintCollection =
new
LXeScintHitsCollection
61
(
SensitiveDetectorName
,
collectionName
[0]);
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
72
G4bool
LXeScintSD::ProcessHits
(
G4Step
* aStep,
G4TouchableHistory
* ){
73
G4double
edep = aStep->
GetTotalEnergyDeposit
();
74
if
(edep==0.)
return
false
;
//No edep so dont count as hit
75
76
G4StepPoint
* thePrePoint = aStep->
GetPreStepPoint
();
77
G4TouchableHistory
* theTouchable =
78
(
G4TouchableHistory
*)(aStep->
GetPreStepPoint
()->
GetTouchable
());
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
99
void
LXeScintSD::EndOfEvent
(
G4HCofThisEvent
* ) {}
100
101
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
102
103
void
LXeScintSD::clear
() {}
104
105
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
106
107
void
LXeScintSD::DrawAll
() {}
108
109
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
110
111
void
LXeScintSD::PrintAll
() {}
G4VSensitiveDetector::SensitiveDetectorName
G4String SensitiveDetectorName
Definition:
G4VSensitiveDetector.hh:105
name
const XML_Char * name
Definition:
expat.h:151
G4TouchableHistory.hh
CLHEP::Hep3Vector
Definition:
ThreeVector.h:41
G4TouchableHistory::GetVolume
G4VPhysicalVolume * GetVolume(G4int depth=0) const
G4Track.hh
G4StepPoint
Definition:
G4StepPoint.hh:68
G4VPhysicalVolume
Definition:
G4VPhysicalVolume.hh:82
G4VSensitiveDetector
Definition:
G4VSensitiveDetector.hh:50
LXeScintHit::SetPos
void SetPos(G4ThreeVector xyz)
Definition:
LXeScintHit.hh:67
G4Step.hh
LXeScintHit
Definition:
LXeScintHit.hh:46
G4THitsCollection::insert
G4int insert(T *aHit)
Definition:
G4THitsCollection.hh:105
G4StepPoint::GetTouchable
const G4VTouchable * GetTouchable() const
G4int
int G4int
Definition:
G4Types.hh:78
G4VSensitiveDetector::GetCollectionID
virtual G4int GetCollectionID(G4int i)
Definition:
G4VSensitiveDetector.cc:102
LXeScintSD::LXeScintSD
LXeScintSD(G4String name)
Definition:
LXeScintSD.cc:46
G4Step::GetPreStepPoint
G4StepPoint * GetPreStepPoint() const
G4CollectionNameVector::insert
void insert(G4String str)
Definition:
G4CollectionNameVector.hh:42
LXeScintSD::~LXeScintSD
virtual ~LXeScintSD()
Definition:
LXeScintSD.cc:55
G4StepPoint::GetPosition
const G4ThreeVector & GetPosition() const
LXeScintHit::SetEdep
void SetEdep(G4double de)
Definition:
LXeScintHit.hh:63
G4bool
bool G4bool
Definition:
G4Types.hh:79
LXeScintHitsCollection
G4THitsCollection< LXeScintHit > LXeScintHitsCollection
Definition:
LXeScintHit.hh:79
G4ParticleDefinition.hh
G4Step
Definition:
G4Step.hh:76
G4Step::GetTotalEnergyDeposit
G4double GetTotalEnergyDeposit() const
G4HCofThisEvent::AddHitsCollection
void AddHitsCollection(G4int HCID, G4VHitsCollection *aHC)
Definition:
G4HCofThisEvent.cc:57
G4LogicalVolume.hh
G4TouchableHistory
Definition:
G4TouchableHistory.hh:53
LXeScintSD::DrawAll
virtual void DrawAll()
Definition:
LXeScintSD.cc:107
G4VProcess.hh
G4Step::GetPostStepPoint
G4StepPoint * GetPostStepPoint() const
G4ios.hh
LXeScintSD::clear
virtual void clear()
Definition:
LXeScintSD.cc:103
LXeScintSD.hh
Definition of the LXeScintSD class.
G4HCofThisEvent
Definition:
G4HCofThisEvent.hh:64
LXeScintSD::Initialize
virtual void Initialize(G4HCofThisEvent *)
Definition:
LXeScintSD.cc:59
G4VTouchable.hh
G4VSensitiveDetector::collectionName
G4CollectionNameVector collectionName
Definition:
G4VSensitiveDetector.hh:99
G4VPhysicalVolume.hh
LXeScintSD::EndOfEvent
virtual void EndOfEvent(G4HCofThisEvent *)
Definition:
LXeScintSD.cc:99
G4double
double G4double
Definition:
G4Types.hh:76
LXeScintHit.hh
Definition of the LXeScintHit class.
pos
static const G4double pos
Definition:
G4ElectroNuclearCrossSection.cc:66
LXeScintSD::PrintAll
virtual void PrintAll()
Definition:
LXeScintSD.cc:111
LXeScintSD::ProcessHits
virtual G4bool ProcessHits(G4Step *aStep, G4TouchableHistory *)
Definition:
LXeScintSD.cc:72
G4String
Definition:
G4String.hh:45
source
geant4.10.03.p02
examples
extended
optical
LXe
src
LXeScintSD.cc
Generated on Tue Nov 28 2017 21:43:15 for Geant4 by
1.8.5