EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PrtOpBoundaryProcess.cxx
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PrtOpBoundaryProcess.cxx
1 #include "PrtOpBoundaryProcess.h"
2 
3 #include "G4EicDircDetector.h"
4 #include <Geant4/G4ios.hh>
5 //#include <Geant4/G4TouchableHandle.hh>
6 
8  : G4OpBoundaryProcess()
9 {}
10 
11 G4VParticleChange* PrtOpBoundaryProcess::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep)
12 {
13  G4StepPoint* pPreStepPoint = aStep.GetPreStepPoint();
14  G4StepPoint* pPostStepPoint = aStep.GetPostStepPoint();
15 
16  //G4TouchableHandle touch = pPreStepPoint->GetTouchableHandle();
17  //G4TouchableHandle touchpost = pPostStepPoint->GetTouchableHandle();
18 
19  // get volume of the current step
20  //G4VPhysicalVolume *volume = pPreStepPoint->GetPhysicalVolume();
21  //G4VPhysicalVolume *volume_post = pPostStepPoint->GetPhysicalVolume();
22 
23  /*G4String vol_name = volume->GetName();
24 
25  G4cout << "vol name = " << vol_name << G4endl;
26 
27  int whichactive_int = m_Detector->IsInDetector(volume);
28  //int whichactive_int_post = m_Detector->IsInDetector(volume_post);
29  //int whichactive_int = G4EicDircDetector::IsInDetector(volume);
30 
31  //bool whichactive = (whichactive_int == 3);
32  */
33  G4VParticleChange* particleChange = G4OpBoundaryProcess::PostStepDoIt(aTrack, aStep);
34 
35  //if(whichactive_int == 1)
36 
37  // int parentId = aTrack.GetParentID();
38  // std::cout<<"parentId "<<parentId <<std::endl;
39  // if(parentId==1) particleChange->ProposeTrackStatus(fStopAndKill);
40 
41  //double endofbar = 0.5*(4200+4*0.05); //1250/2.;
42 
43  // LUT
44  /*if(PrtManager::Instance()->GetRunType() == 1 && pPostStepPoint->GetPosition().z() > pPreStepPoint->GetPosition().z()){
45  if(PrtManager::Instance()->GetEvType() != 1 ) particleChange->ProposeTrackStatus(fStopAndKill);
46  if(pPreStepPoint->GetPosition().z() > endofbar) particleChange->ProposeTrackStatus(fStopAndKill);
47  }*/
48 
49  if(aStep.GetPostStepPoint()->GetPhysicalVolume()->GetName()=="wExpVol" && pPostStepPoint->GetPosition().z() > pPreStepPoint->GetPosition().z()){
50  particleChange->ProposeTrackStatus(fStopAndKill);
51  }
52 
53  if(aStep.GetPreStepPoint()->GetPhysicalVolume()->GetName()=="wLens3" && pPostStepPoint->GetPosition().z() > pPreStepPoint->GetPosition().z()){
54  particleChange->ProposeTrackStatus(fStopAndKill);
55  }
56 
57 
58  // kill photons outside bar and prizm
59  if(GetStatus() == FresnelRefraction
60  && aStep.GetPostStepPoint()->GetPhysicalVolume()->GetName()=="wDirc"){
61  particleChange->ProposeTrackStatus(fStopAndKill);
62  }
63 
64  if((aStep.GetPreStepPoint()->GetPhysicalVolume()->GetName()=="wLens1"
65  || aStep.GetPreStepPoint()->GetPhysicalVolume()->GetName()=="wLens2")
66  && aStep.GetPostStepPoint()->GetPhysicalVolume()->GetName()=="wDirc"){
67  particleChange->ProposeTrackStatus(fStopAndKill);
68  }
69 
70  // // black edge of the lens3
71  // if((aStep.GetPreStepPoint()->GetPhysicalVolume()->GetName()=="wLens3"
72  // && aStep.GetPostStepPoint()->GetPhysicalVolume()->GetName()=="wDirc")
73  // || (aStep.GetPreStepPoint()->GetPhysicalVolume()->GetName()=="wLens3"
74  // && aStep.GetPostStepPoint()->GetPhysicalVolume()->GetName()=="wLens3")){
75  // particleChange->ProposeTrackStatus(fStopAndKill);
76  // }
77 
78 
79  if(aStep.GetPreStepPoint()->GetPhysicalVolume()->GetName()=="wLens1"
80  && aStep.GetPostStepPoint()->GetPhysicalVolume()->GetName()=="wLens1"){
81  particleChange->ProposeTrackStatus(fStopAndKill);
82  }
83  if(aStep.GetPreStepPoint()->GetPhysicalVolume()->GetName()=="wLens2"
84  && aStep.GetPostStepPoint()->GetPhysicalVolume()->GetName()=="wLens2"){
85  particleChange->ProposeTrackStatus(fStopAndKill);
86  }
87 
88 
89  return particleChange;
90 
91 }