Difference between revisions of "Monte Carlo code"

From GlueXWiki
Jump to: navigation, search
Line 32: Line 32:
  
 
outFileName mcOut.root        //The output file name
 
outFileName mcOut.root        //The output file name
 +
 
nToGen      1000000          //The number of events to generate
 
nToGen      1000000          //The number of events to generate
 +
 
inFileName triplet.e500.root  //The input file name
 
inFileName triplet.e500.root  //The input file name
 +
 
cThickness 35                  //Converter thickness in microns
 
cThickness 35                  //Converter thickness in microns
 +
 
nBeams    3                  //Number of beams: 1->triplet, 2->pair, 3->triplet+pair
 
nBeams    3                  //Number of beams: 1->triplet, 2->pair, 3->triplet+pair
 +
 
innerR    1.1                //Inner radius in cm
 
innerR    1.1                //Inner radius in cm
 +
 
outerR    3.5                //Outer radius in cm
 
outerR    3.5                //Outer radius in cm
 +
 
thetaMax  45                  //Max theta in degrees
 
thetaMax  45                  //Max theta in degrees
 +
 
xOffset    0.0                //Beam x-offset (mm)
 
xOffset    0.0                //Beam x-offset (mm)
 +
 
yOffset    0.0                //Beam y-offset (mm)
 
yOffset    0.0                //Beam y-offset (mm)
 +
 
spotRadius 4.2                //Beam spot radius (mm)
 
spotRadius 4.2                //Beam spot radius (mm)
 +
 
magVal    0                  //Mag field in gauss
 
magVal    0                  //Mag field in gauss
  
  
 
* Look at the command line options. Type: 'mamiConfig -h'
 
* Look at the command line options. Type: 'mamiConfig -h'

Revision as of 13:14, 16 January 2013

The goal of this wiki is to give enough information so that someone could install, run, and modify the triplet polarimeter Monte Carlo code.

This is a work in progress

Mami MC code

The Mami MC code is set up to represent the triplet polarimeter expected to be used at Mami

Prerequisites

To install and run the Monte Carlo you will need to have installed:

  • ROOT
  • GEANT (I have version 4.9.5)

For the GEANT code you will need to modify the analysis.gmk file to include the lines

  • CPPFLAGS +=$(shell root-config --cflags)
  • ROOTLIBS = $(shell root-config --nonew --libs)
  • EXTRALIBS += $(ROOTLIBS)

where the environment variable ROOTLIBS points to your ROOT libraries

Download and run the MC code

The MC code can be found here (mamiConfig.tar)

  • Extract the files. Type: 'tar xf mamiConfig.tar'
  • Change directory. Type: 'cd mamiConfig'
  • Source the env.csh file (assumes you are using csh as your shell). Type: 'source env.csh'
  • Make the executable. Type: 'make'

Using mamiConfig

There are many parameters that the user can control. The default settings of the parameters can be found in the file mcDefaults.conf. The entries in the file mcDefaults.conf are self explanatory. Here is an example of a mcDefaults.conf file:

outFileName mcOut.root //The output file name

nToGen 1000000 //The number of events to generate

inFileName triplet.e500.root //The input file name

cThickness 35 //Converter thickness in microns

nBeams 3 //Number of beams: 1->triplet, 2->pair, 3->triplet+pair

innerR 1.1 //Inner radius in cm

outerR 3.5 //Outer radius in cm

thetaMax 45 //Max theta in degrees

xOffset 0.0 //Beam x-offset (mm)

yOffset 0.0 //Beam y-offset (mm)

spotRadius 4.2 //Beam spot radius (mm)

magVal 0 //Mag field in gauss


  • Look at the command line options. Type: 'mamiConfig -h'