HOWTO run the semi-parametric Monte Carlo

From GlueXWiki
Revision as of 11:43, 26 February 2009 by Davidl (Talk | contribs) (Fixed a few typos)

Jump to: navigation, search

Introduction

The Hall-D software contains code for doing semi-parametric Monte Carlo simulations of the GlueX detector. The simulations are semi-parametric in the sense that they use resolution tables derived from full ab initio, hit-based, GEANT simulations with reconstruction. The resolutions are used to smear generated values and apply efficiency cuts. The resulting data can then be analyzed as though it were fully reconstructed GEANT data.

The motivation for this is two fold:

  • Charged particle track-finding and fitting with PID for multi-track events is not mature enough at this point to be effective in studying the GlueX detector response to physics channels with mutl-particle final states.
  • The parametric MC can be run much faster (~100 times) allowing quicker investigation of physics involving rare reactions where backgrounds may be serious issues.

The system works by looking up efficiencies and resolutions tabulated in the form of 2-D histograms inside of ROOT files. A plugin called hdparsim can be attached to any DANA program along with a couple of command line parameters to indicate that the plugin should be used to provide the "reconstructed" particles. Input files are in the same HDDM format used to feed generated events into the Hall-D GEANT simulation. However, in this case, the hdgeant simulator is bypassed and the generated events passed directly into the analysis program.


Obtaining the source

The source code for hdparsim is kept in the Hall-D subversion repository and can be obtained via:

svn co https://halldsvn.jlab.org/repos/trunk/src/programs/Simulation/plugins/hdparsim


However, you will need to have a DANA program (such as hd_root) to attach the plugin to when it is run. Information on how to download a complete set of Hall-D source can be found in the "HOWTO get started with Hall-D Software" HOWTO and instructions on using pre-compiled binaries on the JLab CUE system can be found in the "HOWTO get started with Hall-D Software on the JLab CUE" HOWTO.

Assuming you have setup your environment according to one of the HOWTO documents mentioned above, you should just need do a "make" in the hdparsim source directory. Note that this requires the CURL library which is present on most Linux systems.


Data tables

The hdparsim plugin will need to have the appropriate data tables (ROOT files) present in the directory it is being run in for it to work. The plugin uses the CURL library to download these automatically if they are not already present when the program is started so there is no need to download them "by hand". However, for the purposes of documentation, they can be found here:


Running an hdparsim simulation

Up to 3 arguments must be added to the command line in order to use hdparsim. These are shown in the example below which uses pythia (contained in the bggen program) to generate events and hd_root + hdparsim to process them.

Example: Using hdparsim to process hadronic reaction events generated by PYTHIA

# First, run bggen to generate some events 
cd $HALLD_HOME/src/progams/Simulation/bggen/run
#
# -- you may want to edit some configuration files for bggen here ---
#
$HALLD_HOME/bin/$BMS_OSNAME/bggen   # use full path since an unrelated binary called "bggen" exists on many Linux systems

# Second, run hd_root with the hdparsim plugin attached to process
# the events. We add the invariant_mass plugin to actually generate 
# some histograms (see src/programs/Analysis/plugin/invariant_mass_hists)
hd_root --plugin=hdparsim --plugin=invariant_mass_hists -PDEFTAG:DParticle=HDParSim -PDEFTAG:DPhoton=HDParSim  bggen.hddm

The command line arguments -PDEFTAG:DParticle=HDParSim and -PDEFTAG:DPhoton=HDParSim tell the system to use the HDParSim factory as the default when obtaining DParticle and DPhoton objects respectively.

NOTE on Configuring PYTHIA

It should be noted that the default configuration for PYTHIA as manifest in the config. files kept in the bggen/run directory is to allow GEANT to decay most of the particles that it knows how to rather than having PYTHIA do the decay. This is not useful for the case of πos for example since hdparsim cannot smear a πo itself , but only the resulting photons from its decay (i.e. the particles that are actually detected). As such, you will want to tell PYTHIA to decay these for you. This is done by editing the file pythia-geant.map and inserting a "-" (minus) in front of the GEANT id numbers you wish to have PYTHIA decay for you.

Looking at the results

The resulting histograms from the above example will be in the file hd_root.root in a directory called "INV_MASS".