forked from eic/fun4all_eicdetectors
/
PrtOpBoundaryProcess.cxx
91 lines (67 loc) · 3.48 KB
/
PrtOpBoundaryProcess.cxx
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#include "PrtOpBoundaryProcess.h"
#include "G4EicDircDetector.h"
#include <Geant4/G4ios.hh>
//#include <Geant4/G4TouchableHandle.hh>
PrtOpBoundaryProcess::PrtOpBoundaryProcess()
: G4OpBoundaryProcess()
{}
G4VParticleChange* PrtOpBoundaryProcess::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep)
{
G4StepPoint* pPreStepPoint = aStep.GetPreStepPoint();
G4StepPoint* pPostStepPoint = aStep.GetPostStepPoint();
//G4TouchableHandle touch = pPreStepPoint->GetTouchableHandle();
//G4TouchableHandle touchpost = pPostStepPoint->GetTouchableHandle();
// get volume of the current step
//G4VPhysicalVolume *volume = pPreStepPoint->GetPhysicalVolume();
//G4VPhysicalVolume *volume_post = pPostStepPoint->GetPhysicalVolume();
/*G4String vol_name = volume->GetName();
G4cout << "vol name = " << vol_name << G4endl;
int whichactive_int = m_Detector->IsInDetector(volume);
//int whichactive_int_post = m_Detector->IsInDetector(volume_post);
//int whichactive_int = G4EicDircDetector::IsInDetector(volume);
//bool whichactive = (whichactive_int == 3);
*/
G4VParticleChange* particleChange = G4OpBoundaryProcess::PostStepDoIt(aTrack, aStep);
//if(whichactive_int == 1)
// int parentId = aTrack.GetParentID();
// std::cout<<"parentId "<<parentId <<std::endl;
// if(parentId==1) particleChange->ProposeTrackStatus(fStopAndKill);
//double endofbar = 0.5*(4200+4*0.05); //1250/2.;
// LUT
/*if(PrtManager::Instance()->GetRunType() == 1 && pPostStepPoint->GetPosition().z() > pPreStepPoint->GetPosition().z()){
if(PrtManager::Instance()->GetEvType() != 1 ) particleChange->ProposeTrackStatus(fStopAndKill);
if(pPreStepPoint->GetPosition().z() > endofbar) particleChange->ProposeTrackStatus(fStopAndKill);
}*/
if(aStep.GetPostStepPoint()->GetPhysicalVolume()->GetName()=="wExpVol" && pPostStepPoint->GetPosition().z() > pPreStepPoint->GetPosition().z()){
particleChange->ProposeTrackStatus(fStopAndKill);
}
if(aStep.GetPreStepPoint()->GetPhysicalVolume()->GetName()=="wLens3" && pPostStepPoint->GetPosition().z() > pPreStepPoint->GetPosition().z()){
particleChange->ProposeTrackStatus(fStopAndKill);
}
// kill photons outside bar and prizm
if(GetStatus() == FresnelRefraction
&& aStep.GetPostStepPoint()->GetPhysicalVolume()->GetName()=="wDirc"){
particleChange->ProposeTrackStatus(fStopAndKill);
}
if((aStep.GetPreStepPoint()->GetPhysicalVolume()->GetName()=="wLens1"
|| aStep.GetPreStepPoint()->GetPhysicalVolume()->GetName()=="wLens2")
&& aStep.GetPostStepPoint()->GetPhysicalVolume()->GetName()=="wDirc"){
particleChange->ProposeTrackStatus(fStopAndKill);
}
// // black edge of the lens3
// if((aStep.GetPreStepPoint()->GetPhysicalVolume()->GetName()=="wLens3"
// && aStep.GetPostStepPoint()->GetPhysicalVolume()->GetName()=="wDirc")
// || (aStep.GetPreStepPoint()->GetPhysicalVolume()->GetName()=="wLens3"
// && aStep.GetPostStepPoint()->GetPhysicalVolume()->GetName()=="wLens3")){
// particleChange->ProposeTrackStatus(fStopAndKill);
// }
if(aStep.GetPreStepPoint()->GetPhysicalVolume()->GetName()=="wLens1"
&& aStep.GetPostStepPoint()->GetPhysicalVolume()->GetName()=="wLens1"){
particleChange->ProposeTrackStatus(fStopAndKill);
}
if(aStep.GetPreStepPoint()->GetPhysicalVolume()->GetName()=="wLens2"
&& aStep.GetPostStepPoint()->GetPhysicalVolume()->GetName()=="wLens2"){
particleChange->ProposeTrackStatus(fStopAndKill);
}
return particleChange;
}