ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
|
#include <geant4/tree/geant4-10.6-release/examples/extended/parameterisations/Par02/include/Par02Output.hh>
Public Types | |
enum | SaveType { eNoSave, eSaveMC, eSaveTracker, eSaveEMCal, eSaveHCal } |
Indicates to which ntuple to save the information. More... | |
Public Member Functions | |
void | SetFileName (G4String name) |
G4String | GetFileName () |
void | AppendName (G4bool app) |
void | StartAnalysis (G4int runID) |
void | EndAnalysis () |
void | CreateNtuples () |
void | CreateHistograms () |
void | SaveTrack (SaveType aWhatToSave, G4int aPartID, G4int aPDG, G4ThreeVector aVector, G4double aResolution=0, G4double aEfficiency=1, G4double aEnergy=0) |
void | FillHistogram (G4int HNo, G4double value) const |
~Par02Output () | |
Static Public Member Functions | |
static Par02Output * | Instance () |
Protected Member Functions | |
Par02Output () | |
A default, protected constructor (due to singleton pattern). | |
Private Attributes | |
G4String | fFileName |
A name of the output root file. | |
G4bool | fFileNameWithRunNo |
If true, a run number should be added to the file. Default: false. | |
Static Private Attributes | |
static Par02Output * | fPar02Output = 0 |
The pointer to the only Par02Output class object. | |
static G4ThreadLocal G4int | fCurrentNtupleId = 0 |
Current ntuple Id. | |
static G4ThreadLocal G4int | fCurrentID = 0 |
Handling the saving to the file.
A singleton class that manages creation, writing to and closing of the Root output file.
Definition at line 42 of file Par02Output.hh.
View newest version in sPHENIX GitHub at line 42 of file Par02Output.hh
Indicates to which ntuple to save the information.
Definition at line 46 of file Par02Output.hh.
View newest version in sPHENIX GitHub at line 46 of file Par02Output.hh
Par02Output::~Par02Output | ( | ) |
Definition at line 53 of file Par02Output.cc.
View newest version in sPHENIX GitHub at line 53 of file Par02Output.cc
References G4ToolsAnalysisManager::Instance().
|
protected |
A default, protected constructor (due to singleton pattern).
Definition at line 47 of file Par02Output.cc.
View newest version in sPHENIX GitHub at line 47 of file Par02Output.cc
References fFileName.
Referenced by Instance().
Sets fFileNameWithRunNo that indicates whether to add the run number to the file name.
app | If add the run number. |
Definition at line 74 of file Par02Output.cc.
View newest version in sPHENIX GitHub at line 74 of file Par02Output.cc
References fFileNameWithRunNo.
void Par02Output::CreateHistograms | ( | ) |
Creates histograms to combine information from all the events in the run. To be called for each run in Par02RunAction.
Definition at line 145 of file Par02Output.cc.
View newest version in sPHENIX GitHub at line 145 of file Par02Output.cc
References G4VAnalysisManager::CreateH1(), G4ToolsAnalysisManager::Instance(), G4VAnalysisManager::SetH1XAxisTitle(), and G4VAnalysisManager::SetH1YAxisTitle().
Referenced by Par02RunAction::BeginOfRunAction().
void Par02Output::CreateNtuples | ( | ) |
Creates Ntuples used to store information about particle (its ID, PDG code, energy deposits, etc.). To be called for each event in Par02EventAction.
Definition at line 107 of file Par02Output.cc.
View newest version in sPHENIX GitHub at line 107 of file Par02Output.cc
References G4UIcommand::ConvertToString(), fCurrentNtupleId, G4RunManager::GetCurrentEvent(), G4RunManager::GetRunManager(), and G4ToolsAnalysisManager::Instance().
Referenced by Par02EventAction::BeginOfEventAction().
void Par02Output::EndAnalysis | ( | ) |
Calls the G4AnalysisManager::Instance(). It writes to the output file and close it.
Definition at line 99 of file Par02Output.cc.
View newest version in sPHENIX GitHub at line 99 of file Par02Output.cc
References G4VAnalysisManager::CloseFile(), G4ToolsAnalysisManager::Instance(), and G4VAnalysisManager::Write().
Referenced by Par02RunAction::EndOfRunAction().
Fills the histogram.
HNo | Number of a histogram (decided by the order of creation in CreateHistograms(), the first one is 0). |
value | A value to be filled into the histogram. |
Definition at line 218 of file Par02Output.cc.
View newest version in sPHENIX GitHub at line 218 of file Par02Output.cc
References G4VAnalysisManager::FillH1(), and G4ToolsAnalysisManager::Instance().
Referenced by Par02FastSimModelEMCal::DoIt(), Par02FastSimModelHCal::DoIt(), and Par02FastSimModelTracker::DoIt().
G4String Par02Output::GetFileName | ( | ) |
Gets the file name of the output root file.
Definition at line 80 of file Par02Output.cc.
View newest version in sPHENIX GitHub at line 80 of file Par02Output.cc
References fFileName.
|
static |
Allows the access to the unique Par02Output object.
Definition at line 59 of file Par02Output.cc.
View newest version in sPHENIX GitHub at line 59 of file Par02Output.cc
References fPar02Output, and Par02Output().
Referenced by Par02EventAction::BeginOfEventAction(), Par02RunAction::BeginOfRunAction(), Par02FastSimModelEMCal::DoIt(), Par02FastSimModelHCal::DoIt(), Par02FastSimModelTracker::DoIt(), Par02RunAction::EndOfRunAction(), Par02RunAction::Par02RunAction(), Par02TrackingAction::PostUserTrackingAction(), and Par02RunAction::~Par02RunAction().
void Par02Output::SaveTrack | ( | SaveType | aWhatToSave, |
G4int | aPartID, | ||
G4int | aPDG, | ||
G4ThreeVector | aVector, | ||
G4double | aResolution = 0 , |
||
G4double | aEfficiency = 1 , |
||
G4double | aEnergy = 0 |
||
) |
Saves the information about the particle (track).
aWhatToSave | enum indicating what kind of information to store (in which ntuple). |
aPartID | A unique ID within event (taken Geant TrackID). |
aPDG | A PDG code of a particle. |
aVector | A vector to be stored (particle momentum in tracker or position of energy deposit in calorimeter). |
aResolution | A resolution of the detector that was used. |
aEfficiency | An efficiency of the detector that was used. |
aEnergy | An energy deposit (for calorimeters only: Par02Output::SaveType::eEMCal or Par02Output::SaveType::eHCal). |
Definition at line 161 of file Par02Output.cc.
View newest version in sPHENIX GitHub at line 161 of file Par02Output.cc
References G4VAnalysisManager::AddNtupleRow(), eNoSave, eSaveEMCal, eSaveHCal, eSaveMC, eSaveTracker, fCurrentID, fCurrentNtupleId, G4VAnalysisManager::FillNtupleDColumn(), G4VAnalysisManager::FillNtupleIColumn(), G4cout, G4endl, G4ToolsAnalysisManager::Instance(), CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().
Referenced by Par02TrackingAction::PostUserTrackingAction().
Sets the file name of the output root file.
name | The name of the file. |
Definition at line 68 of file Par02Output.cc.
View newest version in sPHENIX GitHub at line 68 of file Par02Output.cc
References fFileName.
Referenced by Par02RunAction::Par02RunAction().
Calls the G4AnalysisManager::Instance(). It sets the file name of the output file based on fFileName and fFileNameWithRunNo and opens the file.
runID | A run number (to be added to file name if fFileNameWithRunNo is true). |
Definition at line 86 of file Par02Output.cc.
View newest version in sPHENIX GitHub at line 86 of file Par02Output.cc
References G4UIcommand::ConvertToString(), fFileName, fFileNameWithRunNo, G4ToolsAnalysisManager::Instance(), G4VAnalysisManager::OpenFile(), G4VAnalysisManager::SetFileName(), and G4VAnalysisManager::SetVerboseLevel().
Referenced by Par02RunAction::BeginOfRunAction().
|
staticprivate |
A control value of particle ID to ensure that data saved to various ntuples match the same particle. It is set when Monte Carlo information is saved and checked for all the detectors.
Definition at line 128 of file Par02Output.hh.
View newest version in sPHENIX GitHub at line 128 of file Par02Output.hh
Referenced by SaveTrack().
|
staticprivate |
Current ntuple Id.
Definition at line 117 of file Par02Output.hh.
View newest version in sPHENIX GitHub at line 117 of file Par02Output.hh
Referenced by CreateNtuples(), and SaveTrack().
|
private |
A name of the output root file.
Definition at line 120 of file Par02Output.hh.
View newest version in sPHENIX GitHub at line 120 of file Par02Output.hh
Referenced by GetFileName(), Par02Output(), SetFileName(), and StartAnalysis().
|
private |
If true, a run number should be added to the file. Default: false.
Definition at line 123 of file Par02Output.hh.
View newest version in sPHENIX GitHub at line 123 of file Par02Output.hh
Referenced by AppendName(), and StartAnalysis().
|
staticprivate |
The pointer to the only Par02Output class object.
Definition at line 114 of file Par02Output.hh.
View newest version in sPHENIX GitHub at line 114 of file Par02Output.hh
Referenced by Instance().