00001
00002
00003
00004 #ifndef BDSOutput_h
00005 #define BDSOutput_h
00006
00007 #include "BDSGlobalConstants.hh"
00008 #include "BDSSampler.hh"
00009 #include "BDSSamplerHit.hh"
00010 #include "BDSSamplerSD.hh"
00011 #include "BDSEnergyCounterHit.hh"
00012
00013 #include "BDSLWCalorimeter.hh"
00014 #include "BDSLWCalorimeterHit.hh"
00015
00016 #include "G4TrajectoryContainer.hh"
00017 #include "G4Trajectory.hh"
00018
00019 #include <fstream>
00020 #include <vector>
00021
00022 #ifdef USE_ROOT
00023 #include "TROOT.h"
00024 #include "TH1F.h"
00025 #include "TNtuple.h"
00026 #include "TFile.h"
00027 #include "TTree.h"
00028 #endif
00029
00030 const G4int _ASCII = 0;
00031 const G4int _ROOT = 1;
00032 const G4int _ASCII_ROOT = 2;
00033
00034
00035 class BDSOutput {
00036
00037 public:
00038 BDSOutput();
00039 BDSOutput(G4int format);
00040
00041 void SetFormat(G4int format);
00042 void Init(G4int FileNum);
00043 ~BDSOutput();
00044
00045 void WriteHits(BDSSamplerHitsCollection*);
00046 void WriteEnergyLoss(BDSEnergyCounterHitsCollection*);
00047 G4int WriteTrajectory(TrajectoryVector* TrajVec);
00048
00049 void Echo(G4String str);
00050
00051 G4int Commit(G4int FileNum);
00052
00053
00054
00055
00056 #ifdef USE_ROOT
00057 TFile* theRootOutputFile;
00058 TTree *theLWCalorimeterTree;
00059
00060 TH1F *EnergyLossHisto;
00061 TNtuple *EnergyLossNtuple;
00062 #endif
00063
00064 G4int nSamplers;
00065 G4double zMax;
00066
00067 std::vector <G4String> SampName;
00068 private:
00069 G4int format;
00070 ofstream of;
00071
00072
00073 float x0,xp0,y0,yp0,z0,zp0,E0,t0;
00074 float x,xp,y,yp,z,zp,E,t;
00075 float X,Xp,Y,Yp,Z,Zp,s,weight;
00076 int part,nev, pID, theID, track_id;
00077
00078
00079 };
00080
00081 extern BDSOutput bdsOutput;
00082 #endif