Geant4 simulation The present version of the code is based on the original implementation by Heejong Kim, Eric Oberla, Eugene Hwang and includes detailed information on the particles and interactions in separate Trees for the two Gammas, electrons and optical photons. The code at present resides in /cdf/s7/carla/psec/PET/mcp33, it will eventually go to a repository. A setup file is in /cdf/s7/carla/psec/PET/setup_PET_sim.sh (csh). It needs to be edited for each user. The driver is mcp33.cc, and the GEANT4 related code is in the include and src directories. ---- Detector definition. The detector consists of two components on each side of a gamma source. Each has a scintllator volume, with a MPC on each side, four in total. The gamma origin and direction are defined in the mac file, at present (x,y,z) = (0,0,0) and the cosine (0,0,1). Other geometrical parameneter are defined in Detector.cc. The transverse dimensions ( slab_x and slab_y) are +/-400mm and +/-300mm respectively. The thickness of the scintillator is 140mm. Z positions for the components are defined in the table below, that also indicates the length of each component (stepL). TotL is the distance from the gammas source. abs(Z)(mm) stepL TotL NextVolume ProcName ----------------------------------------------------------------- 0 0 0 exp_hall initStep 200 200 200 ground_0_0 Transportation 200 0.025 200 isolator_0_0 Transportation 200 0.4 200 tl_0_0 Transportation 200 0.035 200 space1_0_0 Transportation 201 1.02 201 mcp_0_0 Transportation 207 5.08 207 space0_0_0 Transportation 208 1.02 208 photocathode_0_0 Transportation 208 0.0508 208 glass_0_0 Transportation 209 1.52 209 light_guide_up_0_0 Transportation 209 0.0254 209 scint_slab_up_0_0_0 Transportation 349 140 349 light_guide_up_0_1 Transportation 349 0.0254 349 glass_0_1 Transportation 351 1.52 351 photocathode_0_1 Transportation 351 0.0508 351 space0_0_1 Transportation 352 1.02 352 mcp_0_1 Transportation 357 5.08 357 space1_0_1 Transportation 358 1.02 358 tl_0_1 Transportation 358 0.035 358 isolator_0_1 Transportation 358 0.4 358 ground_0_1 Transportation 358 0.025 358 exp_hall Transportation 1e+03 642 1e+03 OutOfWorld Transportation ----- Code. The file /cdf/s7/carla/psec/PET/mcp33/pet.C has code for reading the ntuple: for each event it creates vectors with the information for Gammas, electrons and optical photons. If it's useful these vectors can be written to a separate file. The variables are defined in the include file mcp33.hh: #ifndef mcp33_H #define mcp33_H 1 const int MaxNCerenkovPh = 100000; const int MaxNSteps = 100; const int MaxNEl = 100; // G4String filename; struct event { int trkind; int evtn; int NPh; int NGamma; int NstepG1; int NstepG2; int Gammaid[2]; int NEl; // optical photons tree int phevtn[MaxNCerenkovPh]; int ph_id[MaxNCerenkovPh]; // track id int phMo[MaxNCerenkovPh]; // mother int phProc_start[MaxNCerenkovPh]; // process name, start of track int phProc_end[MaxNCerenkovPh]; // process name, end of track double phx_orig[MaxNCerenkovPh]; // coord. of origin of track double phy_orig[MaxNCerenkovPh]; double phz_orig[MaxNCerenkovPh]; double phen_orig[MaxNCerenkovPh]; // energy. at origin of track double phtl_orig[MaxNCerenkovPh]; // local time double phtg_orig[MaxNCerenkovPh]; // global time double phMomx_orig[MaxNCerenkovPh]; // components of momentum double phMomy_orig[MaxNCerenkovPh]; double phMomz_orig[MaxNCerenkovPh]; double phx_i[MaxNCerenkovPh]; // coord. of initial (_i) point of track double phy_i[MaxNCerenkovPh]; // for a given step double phz_i[MaxNCerenkovPh]; double phen_i[MaxNCerenkovPh]; // energy double phtl_i[MaxNCerenkovPh]; double phtg_i[MaxNCerenkovPh]; double phMomx_i[MaxNCerenkovPh]; double phMomy_i[MaxNCerenkovPh]; double phMomz_i[MaxNCerenkovPh]; double phx_e[MaxNCerenkovPh]; // coord. of end (_e) point of track double phy_e[MaxNCerenkovPh]; double phz_e[MaxNCerenkovPh]; double phen_e[MaxNCerenkovPh]; double phtl_e[MaxNCerenkovPh]; // local time double phtg_e[MaxNCerenkovPh]; // global time double phMomx_e[MaxNCerenkovPh]; double phMomy_e[MaxNCerenkovPh]; double phMomz_e[MaxNCerenkovPh]; double phpolx[MaxNCerenkovPh]; // polarization double phpoly[MaxNCerenkovPh]; double phpolz[MaxNCerenkovPh]; int ph_nsteps[MaxNCerenkovPh]; // number of steps for the track // first Gamma (G1****) int G1evtn[MaxNSteps]; int G1_id[MaxNSteps]; // track id int G1Mo[MaxNSteps]; // mother double G1_xi[MaxNSteps]; // coordinates of beginning of step double G1_yi[MaxNSteps]; double G1_zi[MaxNSteps]; double G1_eni[MaxNSteps]; // energy at beginning of step double G1_tgi[MaxNSteps]; // global time double G1Momx_i[MaxNSteps]; // components of momentum (direction - check) double G1Momy_i[MaxNSteps]; double G1Momz_i[MaxNSteps]; double G1_xe[MaxNSteps]; // coordinates of endof step double G1_ye[MaxNSteps]; double G1_ze[MaxNSteps]; double G1_ene[MaxNSteps]; double G1_tendep[MaxNSteps]; // total energy deposited double G1_tge[MaxNSteps]; double G1Momx_e[MaxNSteps]; double G1Momy_e[MaxNSteps]; double G1Momz_e[MaxNSteps]; int G1nstep[MaxNSteps]; int GProc_endG1[MaxNSteps]; // code for process (see GetProc in Tracking or SteppingAction // second Gamma (G2****) int G2evtn[MaxNSteps]; int G2_id[MaxNSteps]; int G2Mo[MaxNSteps]; double G2_xi[MaxNSteps]; double G2_yi[MaxNSteps]; double G2_zi[MaxNSteps]; double G2_eni[MaxNSteps]; double G2_tgi[MaxNSteps]; double G2Momx_i[MaxNSteps]; double G2Momy_i[MaxNSteps]; double G2Momz_i[MaxNSteps]; double G2_xe[MaxNSteps]; double G2_ye[MaxNSteps]; double G2_ze[MaxNSteps]; double G2_ene[MaxNSteps]; double G2_tendep[MaxNSteps]; double G2_tge[MaxNSteps]; double G2Momx_e[MaxNSteps]; double G2Momy_e[MaxNSteps]; double G2Momz_e[MaxNSteps]; int G2nstep[MaxNSteps]; int GProc_endG2[MaxNSteps]; // electrons int Eevtn[MaxNEl]; int E_id[MaxNEl]; // track id int EMo[MaxNEl]; // mother int EProc_start[MaxNEl]; // process name, start of track int EProc_end[MaxNEl]; // process name, end of track double Ex_i[MaxNEl]; double Ey_i[MaxNEl]; double Ez_i[MaxNEl]; double Een_i[MaxNEl]; double Etl_i[MaxNEl]; double Etg_i[MaxNEl]; double Ex_e[MaxNEl]; double Ey_e[MaxNEl]; double Ez_e[MaxNEl]; double Een_e[MaxNEl]; double Etl_e[MaxNEl]; double Etg_e[MaxNEl]; double EMomx_i[MaxNEl]; double EMomy_i[MaxNEl]; double EMomz_i[MaxNEl]; double EMomx_e[MaxNEl]; double EMomy_e[MaxNEl]; double EMomz_e[MaxNEl]; double Epolx[MaxNEl]; double Epoly[MaxNEl]; double Epolz[MaxNEl]; int E_nsteps[MaxNEl]; };