Skip to content

Commit

Permalink
Add counter for any other leaking particle
Browse files Browse the repository at this point in the history
Add counter in SpectrumAnalyzer for every other particle type not
considered before.
  • Loading branch information
lopezzot committed Aug 28, 2023
1 parent 8ccf989 commit 3b34705
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/SpectrumAnalyzer.hh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class SpectrumAnalyzer
inline void ClearEventFields()
{
neutronScore = 0.;
protonScore = 0., pionScore = 0., gammaScore = 0., electronScore = 0.;
protonScore = 0., pionScore = 0., gammaScore = 0., electronScore = 0., othersScore = 0.;
}
void FillEventFields() const;
// Step-wise methods
Expand All @@ -63,6 +63,7 @@ class SpectrumAnalyzer
G4double pionScore;
G4double gammaScore;
G4double electronScore;
G4double othersScore;

// Scoring quantities
inline static G4double GetMomentum(const G4Step* step)
Expand Down
3 changes: 3 additions & 0 deletions src/SpectrumAnalyzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ void SpectrumAnalyzer::CreateNtupleAndScorer(const G4String scName)
AM->CreateNtupleDColumn("pionScore");
AM->CreateNtupleDColumn("gammaScore");
AM->CreateNtupleDColumn("electronScore");
AM->CreateNtupleDColumn("othersScore");
AM->FinishNtuple();

// Define scorer type
Expand All @@ -58,6 +59,7 @@ void SpectrumAnalyzer::FillEventFields() const
AM->FillNtupleDColumn(ntupleID, 2, pionScore);
AM->FillNtupleDColumn(ntupleID, 3, gammaScore);
AM->FillNtupleDColumn(ntupleID, 4, electronScore);
AM->FillNtupleDColumn(ntupleID, 5, othersScore);
AM->AddNtupleRow(ntupleID);
}

Expand All @@ -81,6 +83,7 @@ void SpectrumAnalyzer::Analyze(const G4Step* step)
electronScore += val;
}
else {
othersScore += val;
}

#ifdef DEBUG
Expand Down

0 comments on commit 3b34705

Please sign in to comment.