49 fFileName =
"DefaultOutput.root";
55 delete G4AnalysisManager::Instance();
61 if ( ! fPar02Output ) {
76 fFileNameWithRunNo = aApp;
89 if ( fFileNameWithRunNo ) {
95 analysisManager->
OpenFile( fFileName );
102 analysisManager->
Write();
113 fCurrentNtupleId = analysisManager->CreateNtuple( evName, evName );
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" );
141 analysisManager->FinishNtuple( fCurrentNtupleId );
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 ) {
175 fCurrentID = aPartID;
179 if ( aPartID != fCurrentID )
G4cout <<
180 " Wrong particle - trying to save Tracker information of different particle"
190 if ( aPartID != fCurrentID )
G4cout <<
191 " Wrong particle - trying to save EMCal information of different particle"
202 if ( aPartID != fCurrentID )
G4cout <<
203 " Wrong particle - trying to save HCal information of different particle"
221 analysisManager->
FillH1( aHistNo, aValue );
void AppendName(G4bool app)
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")
void SetVerboseLevel(G4int verboseLevel)
static G4String ConvertToString(G4bool boolVal)
G4bool SetFileName(const G4String &fileName)
G4bool OpenFile(const G4String &fileName="")
void FillHistogram(G4int HNo, G4double value) const
Par02Output()
A default, protected constructor (due to singleton pattern).
G4bool FillNtupleIColumn(G4int id, G4int value)
G4GLOB_DLL std::ostream G4cout
G4bool FillNtupleDColumn(G4int id, G4double value)
Definition of the Par02Output class.
SaveType
Indicates to which ntuple to save the information.
static Par02Output * Instance()
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)
void StartAnalysis(G4int runID)
static G4RunManager * GetRunManager()
G4bool FillH1(G4int id, G4double value, G4double weight=1.0)
void SetFileName(G4String name)
const G4Event * GetCurrentEvent() const
G4bool SetH1XAxisTitle(G4int id, const G4String &title)