HOWTO perform a triplet polarimeter simulation

From GlueXWiki
Jump to: navigation, search

Generation and simulation

The analyzing power of the triplet polarimeter (TPOL) is determined using the hdgeant4 simulation program by the following three-step procedure.

  1. A sample of beam photons from the GlueX radiator is generated over a limited spectral range, typically just the energy range of the tagger microscope and above. The coherent bremsstrahlung photon beam generator built into hdgeant4 is used for this. It gives a physically realistic photon transverse beam intensity profile incident on the collimator, with the proper correlation between energy and angle built in. Check the following lines in control.in to make sure they are properly configured, then generate your sample using the simple command "hdgeant4".
    • INFIle 'xxx' - make sure this line is commented out
    • TRIG 1000000 - set this to the number of events you want to generate
    • RUNG 51500 - or whatever run you want to simulate
    • BEAM 12. 9.0 8.0 76.00 0.005 4.e-9 50.e-6 0.5e-3 - check the comments in control.in for the meaning of these fields
    • GENBEAM 'postconv' - very important, make sure this line is there and not commented out
    • OUTFile 'my_tpol_gen.hddm' - or whatever you want to name the output file
    • RNDM - if you are generating your sample in multiple batch jobs, make this unique for each job
    • BGRATE - make sure this line is commented out
    • TRAJ - make sure this line is commented out to prevent explosive growth of your output file
    • CUTS - make sure this line is commented out to prevent the pairs/triplets from being pruned
    • ... - the remaining lines don't matter much, leave the defaults
  2. The sample of pairs/triplets that were generated by GENBEAM 'postconv' in step 1 now needs to be pruned. First of all, there are a lot of pairs with a low energy electron or positron that is outside the acceptance of the pair spectrometer. Second, the sample contains a lot of events above the coherent edge which are useless to simulate in the TPOL because they are not polarized. Third, you probably want to look them over before investing in all of the cpu cycles that are needed to simulate them. Write your own ROOT macro to apply minimal cuts to satisfy the pair spectrometer trigger, throw away the ones above the coherent peak, and make various plots to make sure they look like they should. You will write your filtered event sample to a new file, here named my_tpol_filtered.hddm. Below you will find a couple of simple examples of ROOT macros to illustrate how to write your own filter.
  3. The filtered sample of generated pairs/triplets now needs to be simulated. For this, a new control.in configuration is needed. Once these edits are in place, simulate your generated sample with the command 'hdgeant4'. This will take a while, so you may want to subdivide your sample and run on the OSG. A large number of events will be needed to get the 0.1% statistical accuracy you will want on the analyzing power.
    • INFIle 'my_tpol_filtered.hddm' - make sure this line is present and enabled
    • TRIG 1000000000 - set this to greater than the number of events in your input file
    • RUNG 51500 - or whatever run you want to simulate
    • BEAM 12. 9.0 8.0 76.00 0.005 4.e-9 50.e-6 0.5e-3 - check the comments in control.in for the meaning of these fields
    • BGRATE - if you want to simulate out-of-time tags, see associated comments in control.in for how to set this
    • BGGATE - ditto
    • GENBEAM 'postconv' - very important, make sure this line is NOT there or IS commented out
    • OUTFile 'my_tpol_sim.hddm' - or whatever you want to name the output file
    • RNDM - if you are generating your sample in multiple batch jobs, make this unique for each job
    • TRAJ - make sure this line is commented out to prevent explosive growth of your output file
    • CUTS - make sure this line is commented out to prevent the pairs/triplets from being pruned
    • ... - the remaining lines don't matter much, leave the defaults

Analysis

Analysis of the simulation results should be done using the same code as is used to analyze the real data from the TPOL. Instructions for that are beyond the scope of this document.

Example macros

  • postconv.py - select events from postconv.hddm that should be simulated for a triplet polarimeter simulation.
  • postsim.py - skim the results of a triplet polarimeter beam simulation for events that pass a minimal trigger requiring at least one triplet polarimeter hit and a coincidence in the pair spectrometer.
  • count.py - reads simulation output (hddm) files and writes a ROOT tree containing the information needed to do an asymmetry measurement. It also contains simple methods for estimating the TPOL asymmetry based on the simulation results.
  • epairXS.py - a simple ROOT utility for fitting the TPOL rate spectrum and estimating the asymmetry.