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
ExExChSensitiveDetector.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
//
28
//
29
30
#include "
ExExChSensitiveDetector.hh
"
31
#include "
ExExChSensitiveDetectorHit.hh
"
32
#include "G4HCofThisEvent.hh"
33
#include "
G4TouchableHistory.hh
"
34
#include "
G4Track.hh
"
35
#include "
G4Step.hh
"
36
#include "
G4SDManager.hh
"
37
#include "
G4Navigator.hh
"
38
#include "
G4ios.hh
"
39
40
ExExChSensitiveDetector::ExExChSensitiveDetector
(
G4String
name
):
41
G4VSensitiveDetector
(name){
42
G4String
HCname;
43
collectionName
.
insert
(HCname=
"collection"
);
44
fHCID = -1;
45
}
46
47
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
48
49
ExExChSensitiveDetector::~ExExChSensitiveDetector
(){
50
}
51
52
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
53
54
void
ExExChSensitiveDetector::Initialize
(
G4HCofThisEvent
*HCE){
55
fHitsCollection =
56
new
ExExChSensitiveDetectorHitsCollection
(
SensitiveDetectorName
,
57
collectionName
[0]);
58
if
(fHCID<0){
59
fHCID =
G4SDManager::GetSDMpointer
()->
GetCollectionID
(fHitsCollection);
60
}
61
HCE->
AddHitsCollection
(fHCID,fHitsCollection);
62
}
63
64
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
65
66
G4bool
ExExChSensitiveDetector::ProcessHits
(
G4Step
*aStep,
67
G4TouchableHistory
*){
68
69
if
(aStep->
GetTrack
()->
GetTrackID
()>1)
return
true
;
70
71
G4StepPoint
* postStepPoint = aStep->
GetPostStepPoint
();
72
if
(!(postStepPoint->
GetStepStatus
() ==
fGeomBoundary
))
return
true
;
73
74
G4StepPoint
* preStepPoint = aStep->
GetPreStepPoint
();
75
76
G4TouchableHistory
* theTouchable =
77
(
G4TouchableHistory
*)(preStepPoint->
GetTouchable
());
78
G4VPhysicalVolume
* thePhysical = theTouchable->
GetVolume
(0);
79
G4int
copyNo = thePhysical->
GetCopyNo
();
80
81
G4ThreeVector
worldPos = preStepPoint->
GetPosition
();
82
83
ExExChSensitiveDetectorHit
* aHit =
84
new
ExExChSensitiveDetectorHit
(copyNo);
85
aHit->
SetLayerID
(copyNo);
86
aHit->
SetWorldPos
(worldPos);
87
88
fHitsCollection->
insert
(aHit);
89
return
true
;
90
}
91
92
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
93
94
void
ExExChSensitiveDetector::EndOfEvent
(
G4HCofThisEvent
*
/*HCE*/
){
95
}
96
97
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
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
ExExChSensitiveDetectorHitsCollection
G4THitsCollection< ExExChSensitiveDetectorHit > ExExChSensitiveDetectorHitsCollection
Definition:
ExExChSensitiveDetectorHit.hh:77
ExExChSensitiveDetectorHit::SetWorldPos
void SetWorldPos(G4ThreeVector xyz)
Definition:
ExExChSensitiveDetectorHit.hh:72
G4SDManager::GetCollectionID
G4int GetCollectionID(G4String colName)
Definition:
G4SDManager.cc:135
G4TouchableHistory::GetVolume
G4VPhysicalVolume * GetVolume(G4int depth=0) const
G4Track.hh
G4StepPoint
Definition:
G4StepPoint.hh:68
G4VPhysicalVolume
Definition:
G4VPhysicalVolume.hh:82
G4StepPoint::GetStepStatus
G4StepStatus GetStepStatus() const
G4VSensitiveDetector
Definition:
G4VSensitiveDetector.hh:50
ExExChSensitiveDetector::Initialize
virtual void Initialize(G4HCofThisEvent *HCE)
Definition:
ExExChSensitiveDetector.cc:54
G4Step.hh
G4THitsCollection::insert
G4int insert(T *aHit)
Definition:
G4THitsCollection.hh:105
G4StepPoint::GetTouchable
const G4VTouchable * GetTouchable() const
ExExChSensitiveDetectorHit.hh
Definition of the ExExChSensitiveDetectorHit class.
G4int
int G4int
Definition:
G4Types.hh:78
ExExChSensitiveDetector::ExExChSensitiveDetector
ExExChSensitiveDetector(G4String name)
Definition:
ExExChSensitiveDetector.cc:40
G4Step::GetPreStepPoint
G4StepPoint * GetPreStepPoint() const
ExExChSensitiveDetector::~ExExChSensitiveDetector
virtual ~ExExChSensitiveDetector()
Definition:
ExExChSensitiveDetector.cc:49
G4CollectionNameVector::insert
void insert(G4String str)
Definition:
G4CollectionNameVector.hh:42
G4SDManager.hh
G4StepPoint::GetPosition
const G4ThreeVector & GetPosition() const
G4bool
bool G4bool
Definition:
G4Types.hh:79
ExExChSensitiveDetector::ProcessHits
virtual G4bool ProcessHits(G4Step *aStep, G4TouchableHistory *ROhist)
Definition:
ExExChSensitiveDetector.cc:66
G4Step
Definition:
G4Step.hh:76
G4Track::GetTrackID
G4int GetTrackID() const
G4HCofThisEvent::AddHitsCollection
void AddHitsCollection(G4int HCID, G4VHitsCollection *aHC)
Definition:
G4HCofThisEvent.cc:57
ExExChSensitiveDetector.hh
Definition of the ExExChSensitiveDetector class.
fGeomBoundary
Definition:
G4StepStatus.hh:54
G4TouchableHistory
Definition:
G4TouchableHistory.hh:53
G4Step::GetPostStepPoint
G4StepPoint * GetPostStepPoint() const
G4SDManager::GetSDMpointer
static G4SDManager * GetSDMpointer()
Definition:
G4SDManager.cc:40
G4ios.hh
G4VPhysicalVolume::GetCopyNo
virtual G4int GetCopyNo() const =0
ExExChSensitiveDetectorHit::SetLayerID
void SetLayerID(G4int z)
Definition:
ExExChSensitiveDetectorHit.hh:70
ExExChSensitiveDetectorHit
Definition:
ExExChSensitiveDetectorHit.hh:45
G4HCofThisEvent
Definition:
G4HCofThisEvent.hh:64
ExExChSensitiveDetector::EndOfEvent
virtual void EndOfEvent(G4HCofThisEvent *HCE)
Definition:
ExExChSensitiveDetector.cc:94
G4VSensitiveDetector::collectionName
G4CollectionNameVector collectionName
Definition:
G4VSensitiveDetector.hh:99
G4Navigator.hh
G4Step::GetTrack
G4Track * GetTrack() const
G4String
Definition:
G4String.hh:45
source
geant4.10.03.p02
examples
extended
exoticphysics
channeling
src
ExExChSensitiveDetector.cc
Generated on Tue Nov 28 2017 21:43:13 for Geant4 by
1.8.5