Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify SpectrumAnalyzer #56

Merged
merged 1 commit into from
Sep 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions include/SpectrumAnalyzer.hh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
// Instead of coding it in the simulation, create a singleton
// and manage its usage with (#ifdef) compiler definition.

#ifdef ATLTileCalTB_LEAKANALYSIS

#ifndef SpectrumAnalyzer_h
# define SpectrumAnalyzer_h

Expand Down Expand Up @@ -86,5 +88,6 @@ class SpectrumAnalyzer
};

#endif // SpectrumAnalyzer_h
#endif // ATLTileCalTB_LEAKANALYSIS

//**************************************************
10 changes: 9 additions & 1 deletion src/SpectrumAnalyzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// \start date: 28 August 2023
//**************************************************

#ifdef ATLTileCalTB_LEAKANALYSIS

// Includers from project files
//
#include "SpectrumAnalyzer.hh"
Expand Down Expand Up @@ -40,15 +42,19 @@ void SpectrumAnalyzer::CreateNtupleAndScorer(const G4String scName)
scorerName = scName;
if (scorerName == "te") {
scorer = GetTE;
G4cout<<"SpectrumAnalyzer scoring total energy"<<G4endl;
}
if (scorerName == "momentum") {
else if (scorerName == "momentum") {
scorer = GetMomentum;
G4cout<<"SpectrumAnalyzer scoring momentum"<<G4endl;
}
else if (scorerName == "ke") {
scorer = GetKE;
G4cout<<"SpectrumAnalyzer scoring kinetic energy"<<G4endl;
}
else {
scorer = GetTE;
G4cout<<"SpectrumAnalyzer scoring total energy"<<G4endl;
} // default case
}

Expand Down Expand Up @@ -107,4 +113,6 @@ void SpectrumAnalyzer::Analyze(const G4Step* step)
#endif
}

#endif // ATLTileCalTB_LEAKANALYSIS

//**************************************************