README.session1 for GlueX Tutorial Jan. 7, 2011 12/8/2010 DL The goals of this session are: A. Generate events with the genr8 program B. Generate events with the bggen program (pythia) C. Run hdgeant (+mcsmear) to simulate the events =========================================================== ------------------------------------------------- A. Generate events with the genr8 program ------------------------------------------------- 1. Copy genr8 input file to working directory > cp $HALLD_HOME/src/programs/Simulation/genr8/InputFiles/rho.input ./ 2. Run genr8 to generate 1k events > genr8 -M1000 -Agen_rho.ascii < rho.input 3. Convert from ascii format to HDDM using genr8_2_hddm > genr8_2_hddm gen_rho.ascii > mv output.hddm gen_rho.hddm 4. Check the distribution of "thrown" particles using mcthrown_hists plugin and root > hd_root -PPLUGINS=mcthrown_hists gen_rho.hddm -o gen_rho.root > root gen_rho.root ... root [1] TBrowser t {double-click gen_rho.root} {double-click THROWN} {double click any histo to display contents} ------------------------------------------------- B. Generate events with the bggen program (pythia) ------------------------------------------------- 1. Build bggen (it's not built by default) > make -C $HALLD_HOME/src/programs/Simulation/bggen 2. Copy contents of bggen's "run" directory to working directory > cp $HALLD_HOME/src/programs/Simulation/bggen/run/* ./ 3. The fort.15 and run.ffr files are identical config. files, but only fort.15 is read in. Edit this file to generate only 10k events. While there, set it to only write out HDDM formatted events. > nedit fort.15 {change 395000 on TRIG line to 10000} {"1" under ntuple on WROUT line to "0"} 4. Run bggen. Use full path to avoid confusion with Linux util of same name. > $HALLD_HOME/bin/$BMS_OSNAME/bggen 5. Check contents of file by redoing A.4 but using bggen.hddm as input. ------------------------------------------------- C. Run hdgeant followed by mcsmear to simulate the events ------------------------------------------------- 1. Copy example configuration file for hdgeant from hdgeant source directory > cp $HALLD_HOME/src/programs/Simulation/HDGeant/control.in ./ 2. Edit control.in file to read genr8 made events. Turn off EM background generation. > nedit control.in {remove "c" from INFILE line and change input filename to 'gen_rho.hddm'} {put "c" as first character of BEAM line} {change OUTFILE from 'hdgeant.hddm' to 'sim_rho.hddm'} {put "c" as first character of BGRATE line} {put "c" as first character of BGGATE line} 3. Run hdgeant followed by mcsmear > hdgeant > mcsmear sim_rho.hddm You should now have a file named "sim_rho_smeared.hddm". Note that if you set the value of POSTSMEAR to "1" in the control.in file then hdgeant will run mcsmear automaically for you after it is done. Setting DELETEUNSMEARED will delete the file that contains only unsmeared values. This is safe since the unsmeared values are also copied to the smeared file and so are available there.