00001 //---------------------------------------------------------------------------// 00002 //Description: In charge of ProcessCounting 00003 //Author: Wu Chen(wuchen@mail.ihep.ac.cn) 00004 //Created: 17 Oct, 2012 00005 //Comment: 00006 //---------------------------------------------------------------------------// 00007 00008 #ifndef ProcessCountingSvc_h 00009 #define ProcessCountingSvc_h 1 00010 00011 #include "myglobals.hh" 00012 00013 #include <string> 00014 #include <vector> 00015 00016 class G4Event; 00017 class G4Step; 00018 00019 class ProcessCountingSvc 00020 { 00021 public: 00022 ProcessCountingSvc(); 00023 ~ProcessCountingSvc(); 00024 00025 static ProcessCountingSvc* GetProcessCountingSvc(); 00026 00027 void SetBranch(); 00028 00029 void ReadOutputCard(G4String filename); 00030 00031 void SetValue(const G4Step*); 00032 00033 void Initialize(); 00034 00035 void InitialStep(const G4Step*); 00036 00037 void AddASDI(G4String); 00038 00039 void AddPSDI(G4String); 00040 00041 //=> Access 00042 G4String GetVolName(){return VolName;} 00043 00044 private: 00045 00046 void ReSet(); 00047 void ShowOutCard(); 00048 void CheckFilter(const G4Step*); 00049 void CheckTrack(const G4Step*); 00050 00051 static ProcessCountingSvc* fProcessCountingSvc; 00052 00053 //for output setting 00054 bool flag_nSteps; 00055 bool flag_pid; 00056 bool flag_tid; 00057 bool flag_nSec; 00058 bool flag_time; 00059 bool flag_stepL; 00060 bool flag_prePx; 00061 bool flag_prePy; 00062 bool flag_prePz; 00063 bool flag_postPx; 00064 bool flag_postPy; 00065 bool flag_postPz; 00066 bool flag_dTheta; 00067 bool flag_dE; 00068 bool flag_edepT; 00069 bool flag_edepN; 00070 bool flag_edepI; 00071 bool flag_e; 00072 bool flag_preX; 00073 bool flag_preY; 00074 bool flag_preZ; 00075 bool flag_postX; 00076 bool flag_postY; 00077 bool flag_postZ; 00078 bool flag_charge; 00079 bool flag_particleName; 00080 bool flag_process; 00081 bool flag_ASDI_msc; 00082 bool flag_ASDI_hPairProd; 00083 bool flag_ASDI_ProtonInelastic; 00084 bool flag_ASDI_hBrems; 00085 bool flag_ASDI_hIoni; 00086 bool flag_ASDI_hadElastic; 00087 bool flag_ASDI_ionIoni; 00088 bool flag_ASDI_Decay; 00089 bool flag_ASDI_Transportation; 00090 bool flag_ASDI_eBrem; 00091 bool flag_ASDI_eIoni; 00092 bool flag_PSDI_eBrem; 00093 bool flag_PSDI_msc; 00094 bool flag_PSDI_hPairProd; 00095 bool flag_PSDI_ProtonInelastic; 00096 bool flag_PSDI_hBrems; 00097 bool flag_PSDI_hIoni; 00098 bool flag_PSDI_hadElastic; 00099 bool flag_PSDI_ionIoni; 00100 bool flag_PSDI_Decay; 00101 bool flag_PSDI_Transportation; 00102 bool flag_PSDI_eIoni; 00103 bool flag_volume; 00104 //for filter 00105 G4String VolName; 00106 bool PASSEDFILTER; 00107 bool m_Switch; 00108 double m_minp; 00109 double m_mine; 00110 int m_maxnSteps; 00111 double m_mint; 00112 double m_maxt; 00113 std::vector<G4String> m_Volumes; 00114 int m_maxnTracks; 00115 std::vector<int> m_TrackIDs; 00116 //For root objects 00117 int m_nSteps; 00118 std::vector<int> m_pid; 00119 std::vector<int> m_tid; 00120 std::vector<int> m_nSec; 00121 std::vector<double> m_time; 00122 std::vector<double> m_stepL; 00123 std::vector<double> m_prePx; 00124 std::vector<double> m_prePy; 00125 std::vector<double> m_prePz; 00126 std::vector<double> m_postPx; 00127 std::vector<double> m_postPy; 00128 std::vector<double> m_postPz; 00129 std::vector<double> m_dTheta; 00130 std::vector<double> m_dE; 00131 std::vector<double> m_edepT; 00132 std::vector<double> m_edepN; 00133 std::vector<double> m_edepI; 00134 std::vector<double> m_e; 00135 std::vector<double> m_preX; 00136 std::vector<double> m_preY; 00137 std::vector<double> m_preZ; 00138 std::vector<double> m_postX; 00139 std::vector<double> m_postY; 00140 std::vector<double> m_postZ; 00141 std::vector<std::string> m_particleName; 00142 std::vector<int> m_charge; 00143 std::vector<std::string> m_process; 00144 std::vector<int> m_ASDI_msc; 00145 std::vector<int> m_ASDI_hPairProd; 00146 std::vector<int> m_ASDI_ProtonInelastic; 00147 std::vector<int> m_ASDI_hBrems; 00148 std::vector<int> m_ASDI_hIoni; 00149 std::vector<int> m_ASDI_hadElastic; 00150 std::vector<int> m_ASDI_ionIoni; 00151 std::vector<int> m_ASDI_Decay; 00152 std::vector<int> m_ASDI_Transportation; 00153 std::vector<int> m_ASDI_eBrem; 00154 std::vector<int> m_ASDI_eIoni; 00155 std::vector<int> m_PSDI_eBrem; 00156 std::vector<int> m_PSDI_eIoni; 00157 std::vector<int> m_PSDI_msc; 00158 std::vector<int> m_PSDI_hPairProd; 00159 std::vector<int> m_PSDI_ProtonInelastic; 00160 std::vector<int> m_PSDI_hBrems; 00161 std::vector<int> m_PSDI_hIoni; 00162 std::vector<int> m_PSDI_hadElastic; 00163 std::vector<int> m_PSDI_ionIoni; 00164 std::vector<int> m_PSDI_Decay; 00165 std::vector<int> m_PSDI_Transportation; 00166 std::vector<std::string> m_volume; 00167 std::string unitName_time; 00168 std::string unitName_stepL; 00169 std::string unitName_prePx; 00170 std::string unitName_prePy; 00171 std::string unitName_prePz; 00172 std::string unitName_postPx; 00173 std::string unitName_postPy; 00174 std::string unitName_postPz; 00175 std::string unitName_dTheta; 00176 std::string unitName_dE; 00177 std::string unitName_edepT; 00178 std::string unitName_edepN; 00179 std::string unitName_edepI; 00180 std::string unitName_e; 00181 std::string unitName_preX; 00182 std::string unitName_preY; 00183 std::string unitName_preZ; 00184 std::string unitName_postX; 00185 std::string unitName_postY; 00186 std::string unitName_postZ; 00187 double unit_time; 00188 double unit_stepL; 00189 double unit_prePx; 00190 double unit_prePy; 00191 double unit_prePz; 00192 double unit_postPx; 00193 double unit_postPy; 00194 double unit_postPz; 00195 double unit_dTheta; 00196 double unit_dE; 00197 double unit_edepT; 00198 double unit_edepN; 00199 double unit_edepI; 00200 double unit_e; 00201 double unit_preX; 00202 double unit_preY; 00203 double unit_preZ; 00204 double unit_postX; 00205 double unit_postY; 00206 double unit_postZ; 00207 }; 00208 00209 #endif 00210