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