Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fnumin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Jeffrey Gao
fnumin
Commits
d4192ab0
Commit
d4192ab0
authored
4 years ago
by
jwspence
Browse files
Options
Downloads
Patches
Plain Diff
Modified PrimaryGeneratorAction to read both PID and energy from text dump file
parent
5a9bc324
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
run1.mac
+1
-1
1 addition, 1 deletion
run1.mac
src/PrimaryGeneratorAction.cc
+8
-5
8 additions, 5 deletions
src/PrimaryGeneratorAction.cc
src/StackingAction.cc
+10
-10
10 additions, 10 deletions
src/StackingAction.cc
test.txt
+10000
-10000
10000 additions, 10000 deletions
test.txt
with
10019 additions
and
10016 deletions
run1.mac
+
1
−
1
View file @
d4192ab0
...
@@ -10,6 +10,6 @@
...
@@ -10,6 +10,6 @@
#/process/list
#/process/list
#/tracking/verbose 1
#/tracking/verbose 1
/run/beamOn
4
/run/beamOn
10
#/run/particle/dumpList
#/run/particle/dumpList
This diff is collapsed.
Click to expand it.
src/PrimaryGeneratorAction.cc
+
8
−
5
View file @
d4192ab0
...
@@ -320,8 +320,7 @@ void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
...
@@ -320,8 +320,7 @@ void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
// FASERnu text read:
// FASERnu text read:
float
tmp1
,
tmp2
,
tmp3
,
tmp4
;
float
tmp1
,
tmp2
;
int
i1
,
i2
,
i3
;
bool
start
=
false
;
bool
start
=
false
;
string
line
;
string
line
;
while
(
getline
(
*
source
,
line
)
)
{
while
(
getline
(
*
source
,
line
)
)
{
...
@@ -342,11 +341,15 @@ void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
...
@@ -342,11 +341,15 @@ void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
start = true;
start = true;
}*/
}*/
else
if
(
start
)
{
else
if
(
start
)
{
sscanf
(
line
.
data
(),
"%f"
,
&
tmp1
);
sscanf
(
line
.
data
(),
"%f %f"
,
&
tmp1
,
&
tmp2
);
fParticleGun
->
SetParticleDefinition
(
fElectron
);
if
(
tmp1
==
11
)
fParticleGun
->
SetParticleDefinition
(
fElectron
);
else
if
(
tmp1
==-
11
)
fParticleGun
->
SetParticleDefinition
(
fPositron
);
else
if
(
tmp1
==
13
)
fParticleGun
->
SetParticleDefinition
(
fMuonM
);
else
fParticleGun
->
SetParticleDefinition
(
fMuonP
);
//printf("Xin: %f\n",tmp1);
//printf("Xin: %f\n",tmp1);
fParticleGun
->
SetParticleEnergy
(
tmp
1
*
GeV
);
fParticleGun
->
SetParticleEnergy
(
tmp
2
*
GeV
);
fParticleGun
->
SetParticleMomentumDirection
(
G4ThreeVector
(
0
,
0
,
1
));
fParticleGun
->
SetParticleMomentumDirection
(
G4ThreeVector
(
0
,
0
,
1
));
fParticleGun
->
SetParticlePosition
(
G4ThreeVector
(
0
,
0
,
-
worldZHalfLength
));
fParticleGun
->
SetParticlePosition
(
G4ThreeVector
(
0
,
0
,
-
worldZHalfLength
));
fParticleGun
->
GeneratePrimaryVertex
(
anEvent
);
fParticleGun
->
GeneratePrimaryVertex
(
anEvent
);
...
...
This diff is collapsed.
Click to expand it.
src/StackingAction.cc
+
10
−
10
View file @
d4192ab0
...
@@ -47,29 +47,29 @@ int flag = 0;
...
@@ -47,29 +47,29 @@ int flag = 0;
G4ClassificationOfNewTrack
G4ClassificationOfNewTrack
StackingAction
::
ClassifyNewTrack
(
const
G4Track
*
track
)
StackingAction
::
ClassifyNewTrack
(
const
G4Track
*
track
)
{
{
// std::cout << "Calling ClassifyNewTrack" << std::endl;
G4cout
<<
"flag = "
<<
flag
<<
G4endl
;
//
G4cout << "flag = " << flag << G4endl;
G4cout
<<
"Tracks: Total: "
<<
stackManager
->
GetNTotalTrack
()
<<
" Urgent: "
<<
stackManager
->
GetNUrgentTrack
()
<<
" Waiting: "
<<
stackManager
->
GetNWaitingTrack
()
<<
" Postponed: "
<<
stackManager
->
GetNPostponedTrack
()
<<
G4endl
;
//
G4cout << "Tracks: Total: " << stackManager->GetNTotalTrack() << " Urgent: " << stackManager->GetNUrgentTrack() << " Waiting: " << stackManager->GetNWaitingTrack() << " Postponed: " << stackManager->GetNPostponedTrack() << G4endl;
G4cout
<<
"TrackID = "
<<
track
->
GetTrackID
()
<<
" ParentID = "
<<
track
->
GetParentID
()
<<
" Particle = "
<<
track
->
GetParticleDefinition
()
->
GetParticleName
()
<<
G4endl
;
//
G4cout << "TrackID = " << track->GetTrackID() << " ParentID = " << track->GetParentID() << " Particle = " << track->GetParticleDefinition()->GetParticleName() << G4endl;
//keep primary particle
//keep primary particle
if
(
flag
==
0
)
return
fPostpone
;
if
(
flag
==
0
)
return
fPostpone
;
//kill secondary neutrino
//kill secondary neutrino
// if (track->GetDefinition() == G4NeutrinoE::NeutrinoE()) return fKill;
else
return
fUrgent
;
else
return
fUrgent
;
}
}
void
StackingAction
::
NewStage
()
void
StackingAction
::
NewStage
()
{
{
G4cout
<<
"Calling NewStage()"
<<
G4endl
;
//
G4cout << "Calling NewStage()" << G4endl;
G4cout
<<
"Tracks: Total: "
<<
stackManager
->
GetNTotalTrack
()
<<
" Urgent: "
<<
stackManager
->
GetNUrgentTrack
()
<<
" Waiting: "
<<
stackManager
->
GetNWaitingTrack
()
<<
" Postponed: "
<<
stackManager
->
GetNPostponedTrack
()
<<
G4endl
;
//
G4cout << "Tracks: Total: " << stackManager->GetNTotalTrack() << " Urgent: " << stackManager->GetNUrgentTrack() << " Waiting: " << stackManager->GetNWaitingTrack() << " Postponed: " << stackManager->GetNPostponedTrack() << G4endl;
}
}
void
StackingAction
::
PrepareNewEvent
()
void
StackingAction
::
PrepareNewEvent
()
{
{
G4cout
<<
"flag = "
<<
flag
<<
G4endl
;
G4cout
<<
"flag = "
<<
flag
<<
G4endl
;
G4cout
<<
"Calling PrepareNewEvent()"
<<
G4endl
;
//
G4cout << "Calling PrepareNewEvent()" << G4endl;
G4cout
<<
"Tracks: Total: "
<<
stackManager
->
GetNTotalTrack
()
<<
" Urgent: "
<<
stackManager
->
GetNUrgentTrack
()
<<
" Waiting: "
<<
stackManager
->
GetNWaitingTrack
()
<<
" Postponed: "
<<
stackManager
->
GetNPostponedTrack
()
<<
G4endl
;
//
G4cout << "Tracks: Total: " << stackManager->GetNTotalTrack() << " Urgent: " << stackManager->GetNUrgentTrack() << " Waiting: " << stackManager->GetNWaitingTrack() << " Postponed: " << stackManager->GetNPostponedTrack() << G4endl;
if
(
stackManager
->
GetNPostponedTrack
()
>
0
)
flag
=
1
;
if
(
stackManager
->
GetNPostponedTrack
()
>
0
)
flag
=
1
;
else
flag
=
0
;
else
flag
=
0
;
G4cout
<<
"flag = "
<<
flag
<<
G4endl
;
//
G4cout << "flag = " << flag << G4endl;
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
This diff is collapsed.
Click to expand it.
test.txt
+
10000
−
10000
View file @
d4192ab0
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment