55 delete G4AnalysisManager::Instance();
102 analysisManager->
Write();
115 analysisManager->CreateNtupleIColumn(
"particleID" );
116 analysisManager->CreateNtupleIColumn(
"PID" );
117 analysisManager->CreateNtupleDColumn(
"MC_pX" );
118 analysisManager->CreateNtupleDColumn(
"MC_pY" );
119 analysisManager->CreateNtupleDColumn(
"MC_pZ" );
121 analysisManager->CreateNtupleDColumn(
"tracker_res" );
122 analysisManager->CreateNtupleDColumn(
"tracker_eff" );
123 analysisManager->CreateNtupleDColumn(
"tracker_pX" );
124 analysisManager->CreateNtupleDColumn(
"tracker_pY" );
125 analysisManager->CreateNtupleDColumn(
"tracker_pZ" );
127 analysisManager->CreateNtupleDColumn(
"emcal_res" );
128 analysisManager->CreateNtupleDColumn(
"emcal_eff" );
129 analysisManager->CreateNtupleDColumn(
"emcal_X" );
130 analysisManager->CreateNtupleDColumn(
"emcal_Y" );
131 analysisManager->CreateNtupleDColumn(
"emcal_Z" );
132 analysisManager->CreateNtupleDColumn(
"emcal_E" );
134 analysisManager->CreateNtupleDColumn(
"hcal_res" );
135 analysisManager->CreateNtupleDColumn(
"hcal_eff" );
136 analysisManager->CreateNtupleDColumn(
"hcal_X" );
137 analysisManager->CreateNtupleDColumn(
"hcal_Y" );
138 analysisManager->CreateNtupleDColumn(
"hcal_Z" );
139 analysisManager->CreateNtupleDColumn(
"hcal_E" );
149 analysisManager->
CreateH1(
"Pdiff",
"momentum smeared in tracker", 100, 0.8, 1.2 );
152 analysisManager->
CreateH1(
"EMCalEdiff",
"energy smeared in EMCal", 100, 0.8, 1.2 );
155 analysisManager->
CreateH1(
"HCalEdiff",
"energy smeared in HCal", 100, 0.0, 2.0 );
166 switch( aWhatToSave ) {
180 " Wrong particle - trying to save Tracker information of different particle"
191 " Wrong particle - trying to save EMCal information of different particle"
203 " Wrong particle - trying to save HCal information of different particle"
221 analysisManager->
FillH1( aHistNo, aValue );
static G4ThreadLocal G4int fCurrentNtupleId
Current ntuple Id.
void AppendName(G4bool app)
Sets fFileNameWithRunNo that indicates whether to add the run number to the file name.
G4String fFileName
A name of the output root file.
void EndAnalysis()
Calls the G4AnalysisManager::Instance(). It writes to the output file and close it.
G4int CreateH1(const G4String &name, const G4String &title, G4int nbins, G4double xmin, G4double xmax, const G4String &unitName="none", const G4String &fcnName="none", const G4String &binSchemeName="linear")
CLHEP::Hep3Vector G4ThreeVector
static G4ThreadLocal G4int fCurrentID
A control value of particle ID to ensure that data saved to various ntuples match the same particle...
void CreateNtuples()
Creates Ntuples used to store information about particle (its ID, PDG code, energy deposits...
void SetVerboseLevel(G4int verboseLevel)
void CreateHistograms()
Creates histograms to combine information from all the events in the run. To be called for each run i...
static G4String ConvertToString(G4bool boolVal)
G4bool SetFileName(const G4String &fileName)
G4bool OpenFile(const G4String &fileName="")
void FillHistogram(G4int HNo, G4double value) const
Fills the histogram.
Par02Output()
A default, protected constructor (due to singleton pattern).
G4bool FillNtupleIColumn(G4int id, G4int value)
G4GLOB_DLL std::ostream G4cout
Handling the saving to the file.
G4bool FillNtupleDColumn(G4int id, G4double value)
G4String GetFileName()
Gets the file name of the output root file.
Definition of the Par02Output class.
SaveType
Indicates to which ntuple to save the information.
static Par02Output * Instance()
Allows the access to the unique Par02Output object.
G4bool SetH1YAxisTitle(G4int id, const G4String &title)
void 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).
void StartAnalysis(G4int runID)
Calls the G4AnalysisManager::Instance(). It sets the file name of the output file based on fFileName ...
static G4RunManager * GetRunManager()
G4bool FillH1(G4int id, G4double value, G4double weight=1.0)
static Par02Output * fPar02Output
The pointer to the only Par02Output class object.
G4bool fFileNameWithRunNo
If true, a run number should be added to the file. Default: false.
void SetFileName(G4String name)
Sets the file name of the output root file.
const G4Event * GetCurrentEvent() const
G4bool SetH1XAxisTitle(G4int id, const G4String &title)