-
Notifications
You must be signed in to change notification settings - Fork 1
/
detector.cc~
32 lines (21 loc) · 1.06 KB
/
detector.cc~
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "detector.hh"
MySensitiveDetector::MySensitiveDetector(G4String name) : G4VSensitiveDetector(name)
{}
MySensitiveDetector::~MySensitiveDetector()
{}
// Introduction of the sensitive detector informations
G4bool MySensitiveDetector::ProcessHits(G4Step *aStep, G4TouchableHistory *ROHist)
{
G4Track *track = aStep -> GetTrack();
track -> SetTrackStatus(fStopAndKill);
G4StepPoint *preStepPoint = aStep -> GetPreStepPoint(); // when photon enters the detector
G4StepPoint *postStepPoint = aStep -> GetPostStepPoint(); // when the photon exits the detector
G4ThreeVector posPhoton = preStepPoint -> GetPosition();
//G4cout << "Photon position: " << posPhoton << G4endl;
const G4VTouchable *touchable = aStep -> GetPreStepPoint() -> GetTouchable();
//G4int copyNo = touchable -> GetCopyNumber();
//G4cout << "Copy number : " << copyNo << G4endl;
G4VPhysicalVolume *physVol = touchable -> GetVolume();
G4ThreeVector posDetector = physVol -> GetTranslation();
G4cout << "Detector position: " << posDetector << G4endl;
}