Skip to content

Commit

Permalink
Corrected source location
Browse files Browse the repository at this point in the history
  • Loading branch information
samdejong86 committed Mar 28, 2018
1 parent bc21755 commit 79a7764
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion include/Commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ std::vector<std::string> UICommands(){
std::vector<std::string> commands;

commands.push_back("/gps/particle neutron");
commands.push_back("/gps/pos/centre 0.0 0.0 0.0 cm");
commands.push_back("/gps/pos/centre -3.5 -8.5 -9.8 cm");
commands.push_back("/gps/ang/type iso");
commands.push_back("/gps/pos/type Point");
commands.push_back("/gps/ene/type Arb");
Expand Down
8 changes: 8 additions & 0 deletions include/EventAction.hh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public:
inline void leftWall();
inline void leftObject(int n);
inline void crossedSphere(int n);
inline void setPID(int PID);

void setdataNtuple(int n) {dataNtuple=n;}
void setGeoNtuple(int n) {geoNtuple=n;}
Expand All @@ -63,6 +64,8 @@ private:
int dataNtuple;
int geoNtuple;

int ParticleID;

G4double ePostGraphite;

//number of channels and objects
Expand Down Expand Up @@ -143,6 +146,11 @@ inline void EventAction::crossedSphere(int n){
nCrossedRadii[n] += 1/(4*3.14159*pow(diffusionRadii[n],2));
}

inline void EventAction::setPID(int PID){
if(PID==2112)
ParticleID=PID;
}


#endif

Expand Down
5 changes: 3 additions & 2 deletions src/EventAction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,11 @@ void EventAction::EndOfEventAction( const G4Event* eve)
analysisManager->FillNtupleDColumn(dataNtuple, 5, tubeY);
analysisManager->FillNtupleDColumn(dataNtuple, 6, tubeZ);

analysisManager->FillNtupleIColumn(dataNtuple, 7, ParticleID);

for(int i=0; i<nobj; i++){
if(leftObj[i]==1) analysisManager->FillNtupleIColumn(dataNtuple, 7+i, 1);
else analysisManager->FillNtupleIColumn(dataNtuple, 7+i, 0);
if(leftObj[i]==1) analysisManager->FillNtupleIColumn(dataNtuple, 8+i, 1);
else analysisManager->FillNtupleIColumn(dataNtuple, 8+i, 0);
}

for(int i=0; i<nChannels; i++)
Expand Down
1 change: 1 addition & 0 deletions src/RunAction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ RunAction::RunAction(DetectorConstruction* detConstruction)
analysisManager->CreateNtupleDColumn(dataNtuple,"he3TubeYPos");
analysisManager->CreateNtupleDColumn(dataNtuple,"he3TubeZPos");

analysisManager->CreateNtupleIColumn(dataNtuple, "ParticleID");



Expand Down
7 changes: 5 additions & 2 deletions src/SteppingAction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,13 @@ void SteppingAction::UserSteppingAction(const G4Step* aStep)


int PDG=a1Track->GetDefinition()->GetPDGEncoding();

fEventAction->setPID(PDG);

if(fabs(pre_posn.x())<cubeSize&&fabs(pre_posn.y())<cubeSize&&fabs(pre_posn.z())<cubeSize){
if(fabs(post_posn.x())>cubeSize||fabs(post_posn.y())>cubeSize||fabs(post_posn.z())>cubeSize){
if(PDG==2112) fEventAction->leftGraphite(a1Track->GetKineticEnergy());
if(PDG==2112)
fEventAction->leftGraphite(a1Track->GetKineticEnergy());
}
}

Expand Down Expand Up @@ -89,7 +92,7 @@ void SteppingAction::UserSteppingAction(const G4Step* aStep)
//if the particle leaves one of the objects
for(int i=0; i<nobj; i++){
if ( post_volume == fDetConstruction->GetphysiMisc(i)) {
fEventAction->leftObject(i);
if(PDG==2112) fEventAction->leftObject(i);
}

}
Expand Down
2 changes: 1 addition & 1 deletion xml/miscObjects.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
G4_POLYETHYLENE
</Material>
<TieToHe3Tubes>
1
0
</TieToHe3Tubes>
<he3TubeChannel>
0
Expand Down

0 comments on commit 79a7764

Please sign in to comment.