Notes about how to install and run D. Schulte's GUINEA_PIG VZ, 031111 1. This program simulates the beam-beam interaction in linear colliders, including beamstrahlung, coherent and incoherent pair production, hadron pairs, hadron jets and other features. The reference about implemented stuff is Daniel's thesis. 2. The code uses longitudinal slices and passes them through each other. The E&M fields are calculated self-consistently by an FFT algorithm. 3. Presently the FFTW-2 library is used for the field calculation and should be installed on the computer one ueses to compile guinea_pig. You need to edit the FFTW_HOME variable in the makefile to reflect the location of fftw library. 4. One file named fourtrans2.c was missing. It is needed for the FFTW interface of the program. The location of the fftw.h header file needs to be adapted to your system in file fourtrans2.c. 5. There was a problem in file.d, where a linebreak in a macro was not accepted by the preprocessor of gcc-3.3. That was easy to fix by just using a very long single line. Then the compile by just calling "make guinea" went through allright. The executable is called guinea. 6. The display program is generated by typing "make gpv" and this worked without problem. 7. Running GUINEA_PIG: + See the appendix of Daniel's thesis for a brief introduction + First prepare the file acc.dat. It needs to have two sections: * $ACCELERATOR:: Here the default parameters of the simulation are defined. Here is an example from the file that came along --- $ACCELERATOR:: clic {energy=1500.0;particles=0.4;beta_x=8.0;beta_y=0.1; sigma_x=65.0;sigma_y=0.7;sigma_z=35.0;espread=0.001; dist_z=0;f_rep=100.0;n_b=154; charge_sign=-1; scale_step=1.0; waist_x=0.0;waist_y=0.0; offset_x=0.0;offset_y=0.0; angle_x=0.0;angle_y=0.0;} --- Things to remember are that the energy is in GeV, the number of particles in 1e10, the transverse sigmas and offsets in nm, the emittances are normalized in units of 1e-6, beta functions are in mm. The longitudinal parameters sigma_z and waist_x/y are in microns. * $PARAMETERS:: Here other parameters, relevant for the simulation are defined such as the grid size, the number of macro_particles and things to calculate or to omit. --- {n_x=64;n_y=128;n_z=41;n_t=1;n_m=50000;cut_x=3.0*sigma_x.1; cut_y=6.0*sigma_y.1;cut_z=3*sigma_z.1;pair_ecut=0e-3; rndm_load=0;rndm_save=0;do_photons=1;do_coherent=1;grids=7; charge_sign=-1;do_dump=0;dump_particle=100;dump_step=1;} --- Some of the more important parameters are: - electron_ratio=0.1 part of the electron usd for the calculation of luminosity and background spectrum. - photon_ratio=0.1 - do_photons=1 (store the photons for background calculation) - photon_ratio=0.1 (percentage of photons that are stored) - do_hadrons=1 (hadron pairs) - do_jets=1 (minijets) - do_pairs=1 ( ) - do_eloss=1 (energy loss due to beamstrahlung) - do_espread=1 (use particle's energy spread) - do_isr=1 (initial state radiation) - do_compt=1 (soft bremsstrahlung particles) - do_coherent=1 ( ) - store_beam=1 save the particle coordinates - store_photons=1 save the photon coordinates See the appendix of Daniel's thesis for details. + The program is then run by typing guinea output.dat on the command line. and are the labels of the sections in the file acc.dat, discussed previously. the last commandline argument is the output file name that will contain all results. An example is guinea clic film dummy.dat 8. Postprocessing with gpv The guinea run generates several output files. The most important is the one specified as the last argument on the command line when running guinea. In the example above that was "dummy.dat" That file contains all the histograms with the beam and photon parameters. Running gpv dummy.dat provides a list of all parameters that are stored in the file dummy.dat. One of the entries is the horizontal angle of the electron beam called e_vx_1. The histogram can be extracted by typing gpv dummy.dat e_vx_1 which results in a file called e_vx_1.dat that has two columns and can be easily displayed in xmgr or gnuplot by doing xmgr e_vx_1.dat Other parameters that are not stored as histograms, such as the total luminosity are also stored in the dummy.dat file. They are extracted by e.g. gpv dummy.dat lumi_ee and result in a single line to stdout that displays the value. 9. Crossing angle Initially I get "no charge in slice" and I guess I have to make the grid bigger. Does that make the FFT field calculations more unstable, if the grid is highly rectangular, i.e. the horizontal and vertical dimensions are very different? Daniel wrote in an email that CLIC will use crab-crossing and therefore the crossing angle can be set to zero degrees. This will make the calculations quicker, because the grid can be kept small. When specifying a crossing angle on does not need to specify an offset in order to make the beams collide head on. It is, however, necessary to make the grid large enough to contain the beams during their passage. 10. Current CLIC parameters sigma_x/y 60/0.7 nm beta_x/y 8/0.1 mm sigma_z 35 um crossing angle 20 mrad momentum spread 0.003 rms 11. Contents of the Histograms in the output file (dummy.dat in this example) lumi_ee (Histogram of Luminosity of e+-e- collisions vs. cms energy) lumi_eg (Histogram of Luminosity of e-gamma vs. cms energy) lumi_ge (Histogram of Luminosity of gamma-g vs. cms energy) lumi_gg (Histogram of Luminosity of gamma-gamma vs. cms energy) photon_h_e_1 photon_h_e_2 (Angular Distribution of photons[rad] ) photon_v_e_1 (h : horizontal v: vertical ) photon_v_e_2 (1: beam 1 2: beam 2 ) photon_h_n_1 (e: Total Energy n: Total number ) photon_h_n_2 photon_v_n_1 photon_v_n_2 photon_e_1 (Histogram of photon energies from beam 1) photon_e_2 (Histogram of photon energies from beam 2) e_vx_1 (Histogram of horizontal electron angles, beam 1!) e_vy_1 (Histogram of vertical electron angles, beam 1!) e_eng_1 (Energie of electrons after collision, beam 1) electron_0 (Incoherent Pairs, not automatically calculated) electron_1 electron_2 *phot_spec2 (Photon spectrum versus energy, ???) *lumi_gg_1 (something versus energy, ???) *lumi_gg_2 (something versus energy, ???) *l_gg (something versus energy, ???) compt_eng (low energy particles due to Compton scattering) bhabha (same for Bhabha, maybe need to be fixed) *low (???) *log_gg_0 (???) *log_gg_1 (all zeros, ???) *log_gg_2 (all zeros, ???) pairs_lin (all incoherent pairs in different format than above) coherent_pairs (Energy distribution of the coherent pairs) lumi_ep (electron-electron luminosity in e+e-collision due to coherent pairs production (I think)) *p_eng_1 (something versus energy???) *e_spec (energy distribution of the electrons) *p_spec (energy distribution of the positrons, from pairs???) Daniel says, he has to look up the entries with asterisks. 12. Format of beam[12].dat file The format of the beam[12].dat file is different from the one described in the Daniel's thesis which is Energy[GeV] x'[rad] y'[rad] what are the last three values? I looked in the source and found a possible interpretation E[GeV] x[um] y[um] z[um] x'[urad] y'[urad] This looks consistent with the #defines at the beginning of guinea_pig.c, where XYPOS and ZPOS are defined, but SPIN is not. 13. Format of coh[12].dat file The file coh[1].dat contain the coherent pairs and the format seems to be the same as in the beam[12].dat file. 14. Format of photon.dat file The file format is presumably E[GeV] x'[rad] y'[rad] Note that the photons coming from beam 2 are labelled by having their energy negative.