pp2pp GEANT4 simulation
pp2pp simulation is built around GEANT4 simulation package. Running this simulation requires us to migrate away from the familiar root4star interface and begin running simulation in afs. Several example macros have been implemented. The GEANT4 event record is saved in a ROOT file at the end of the simulation run. Beamline geometry is read automatically from TWISS files, which are the output from MAD-X, listing all the elements along the beamline, and stating for each element the s coordinate,
the associated optics functions and the kicks. Magnetic fields, ideal dipole and quadrupole magnets with all its imperfections up to the sextupole terms in multipole expansion are simulated in the same way as in MAD-X, so the coefficients of this expansion are also read from TWISS files. Kickers are implemented as a point like change of particle trajectory.
RP geometry is fixed according to drawings and measurements. Additionally, there is implemented an auxiliary (hidden) vacuum plane in front of the horizontal RP and in the place of VPD. It can be used as a perfect resolution detector and a beam monitor. Any energy deposit in sillicon strips and scintillator is stored and used for digitization of the detector respond. We have also implemented the simulation of optical photons in scintillators, so it is possible to have the information about time-of-hit. ADC is the energy deposition. Output information includes:
1. Silicon strip clusters in a format of StMuRpsCollection used for muDST production;
2. True level information: scattered protons momenta, collision vertex, time;
3. Additional information: proton positions in front of horizontal RP’s and in the place of VPD's.
First, obtain the simulation by downloading it from this site (pp2pp_v_xx.tar.gz) and unpack it to a location of your choice.
The next step is to set the environmental variables:
Additionaly you may have to use Cern Root from afs:
After a configuration, you can start using pp2pp simulation.
A. Running pp2pp simulation interactively
Running the simulation is straightforward. Simply do...
You would get something like this.
Let's generate 3 elastic events. To run a program, use the following command:
B. Run program pp2pp in batch mode
To run a program in batch mode just simply do:
We have implemented several macros, showing how to run pp2pp simulation in various modes.
1. Elastic events - elastic.mac
2. Quasi-elastic mode - qelastic.mac
Generate quasi-elastic events - proton on the one side of the Interaction Point and resonance on the other side.
3. Read events from file:
3.1 singleFile.mac - each line in a file should look like this: px py pz Vx Vy Vz
3.2 doubleFile.mac - each line in a file should look like this: px1 py1 pz1 px2 py2 pz2 Vx Vy Vz
3.3 hepMC.mac - simulate events generated with HepMC.
3.4 starsim.mac - read and simulate events generated with starsim.
1. Silicon strip clusters in a format of StMuRpsCollection used for muDST production;
2. True level information: scattered protons momenta, collision vertex, time;
3. Additional information: proton positions in front of horizontal RP’s and in the place of VPD's.
First, obtain the simulation by downloading it from this site (pp2pp_v_xx.tar.gz) and unpack it to a location of your choice.
The next step is to set the environmental variables:
$ cd /path/to/pp2pp
$ source newStart.sh
Additionaly you may have to use Cern Root from afs:
$source /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.00/x86_64-slc5-gcc43-opt/root/bin/thisroot.csh
After a configuration, you can start using pp2pp simulation.
A. Running pp2pp simulation interactively
Running the simulation is straightforward. Simply do...
$pp2pp-build/pp2pp
You would get something like this.
Let's generate 3 elastic events. To run a program, use the following command:
/run/beamOn 3
B. Run program pp2pp in batch mode
To run a program in batch mode just simply do:
$pp2pp-build/pp2pp macro.mac
We have implemented several macros, showing how to run pp2pp simulation in various modes.
1. Elastic events - elastic.mac
/run/initialize
#setting the mode of generation (elastic_TM for using transport matrices instead of GEANT4 transport)
/PP2PP/generator/mode elastic
#/PP2PP/generator/mode elastic_TM
#setting values of physical parameters (program's default shown)
#-t should be in [GeV^2/c^2], B slope in [c^2/GeV^2]
/PP2PP/generator/elastic/tMin 0.001
/PP2PP/generator/elastic/tMax 0.037
/PP2PP/generator/elastic/rho 0.13
/PP2PP/generator/elastic/bSlope 14.5
#values of x0, y0, xSigma and ySigma should be given in [mm]
/PP2PP/generator/elastic/x0 0.0
/PP2PP/generator/elastic/xSigma 1.0
/PP2PP/generator/elastic/y0 0.0
/PP2PP/generator/elastic/ySigma 1.0
#values of z and zSigma should be given in [m]
/PP2PP/generator/elastic/z0 0.0
/PP2PP/generator/elastic/zSigma 0.7
#values of time0 and timeSigma should be given in [ns]
/PP2PP/generator/elastic/time0 0.0
/PP2PP/generator/elastic/timeSigma 2.33
#value of angular beam divergence in [rad]
/PP2PP/generator/elastic/angBeamDiv 56e-6
#setting the multi-bucket bunch structure simluation (by default multiBucketBunch=0 (not simulated))
#in case of multiBucketBunch=1 values of zSigma and timeSigma are not used
/PP2PP/generator/elastic/multiBucketBunch 1
/PP2PP/generator/elastic/setBucketAmplitudes Y 0.04158 0.377161 0.729316 0.398103 0.070309
/PP2PP/generator/elastic/setBucketAmplitudes B 0.0412431 0.430405 0.832144 0.401495 0.0573226
/PP2PP/generator/elastic/setBucketDistance Y 4.22494
/PP2PP/generator/elastic/setBucketDistance B 4.11313
/PP2PP/generator/elastic/setBucketWidth Y 1.73054
/PP2PP/generator/elastic/setBucketWidth B 1.68032
#setting number of geometry setup (numbering like at https://drupal.star.bnl.gov/STAR/system/files/pp2ppRuns2009_updated.pdf)
/PP2PP/geometry/alignmentVersion 0
/PP2PP/geometry/setNumber 6
#/PP2PP/geometry/runNumber 10183035
#setting the production of secondary particles in the beampipe (default off)
/PP2PP/generator/secondaries/secondariesProduction 1
#setting the simulation of PMT response (default off)
/PP2PP/processing/TAC_parametrisation 1
/PP2PP/processing/TAC_cutoff 1
#running 50000 events
/run/beamOn 50000
2. Quasi-elastic mode - qelastic.mac
Generate quasi-elastic events - proton on the one side of the Interaction Point and resonance on the other side.
/run/initialize
#setting the mode of generation
/PP2PP/generator/mode elastic
#/PP2PP/generator/mode elastic_TM
#N^+(1440)
/PP2PP/generator/elastic/Resonance 12212
#setting values of physical parameters (program's default shown)
#-t should be in [GeV^2/c^2], B slope in [c^2/GeV^2]
/PP2PP/generator/elastic/tMin 0.001
/PP2PP/generator/elastic/tMax 0.037
/PP2PP/generator/elastic/rho 0.13
/PP2PP/generator/elastic/bSlope 14.5
#values of x0, y0, xSigma and ySigma should be given in [mm]
/PP2PP/generator/elastic/x0 0.0
/PP2PP/generator/elastic/xSigma 1.0
/PP2PP/generator/elastic/y0 0.0
/PP2PP/generator/elastic/ySigma 1.0
#values of z and zSigma should be given in [m]
/PP2PP/generator/elastic/z0 0.0
/PP2PP/generator/elastic/zSigma 0.7
#values of time0 and timeSigma should be given in [ns]
/PP2PP/generator/elastic/time0 0.0
/PP2PP/generator/elastic/timeSigma 2.33
#value of angular beam divergence in [rad]
/PP2PP/generator/elastic/angBeamDiv 56e-6
#setting the multi-bucket bunch structure simluation (by default multiBucketBunch=0 (not simulated))
#in case of multiBucketBunch=1 values of zSigma and timeSigma are not used
/PP2PP/generator/elastic/multiBucketBunch 1
/PP2PP/generator/elastic/setBucketAmplitudes Y 0.3 2.0 5.0 2.0 0.3
/PP2PP/generator/elastic/setBucketAmplitudes B 0.3 2.0 5.0 2.0 0.3
/PP2PP/generator/elastic/setBucketDistance Y 4.0
/PP2PP/generator/elastic/setBucketDistance B 4.0
/PP2PP/generator/elastic/setBucketWidth Y 1.5
/PP2PP/generator/elastic/setBucketWidth B 1.5
#setting number of geometry setup (numbering like at https://drupal.star.bnl.gov/STAR/system/files/pp2ppRuns2009_updated.pdf)
/PP2PP/geometry/alignmentVersion 0
/PP2PP/geometry/setNumber 6
#/PP2PP/geometry/runNumber 10183035
#setting the production of secondary particles in the beampipe (default off)
/PP2PP/generator/secondaries/secondariesProduction 0
/tracking/verbose 0
#running 10000 events
/run/beamOn 10000
3. Read events from file:
3.1 singleFile.mac - each line in a file should look like this: px py pz Vx Vy Vz
#Events will be read from file: ProtonMomentum.txt
/run/initialize
/PP2PP/generator/mode singleFile
#setting number of geometry setup (numbering like at https://drupal.star.bnl.gov/STAR/system/files/pp2ppRuns2009_updated.pdf)
/PP2PP/geometry/alignmentVersion 0
/PP2PP/geometry/setNumber 6
#running all events from file
/PP2PP/generator/beamOn -1
3.2 doubleFile.mac - each line in a file should look like this: px1 py1 pz1 px2 py2 pz2 Vx Vy Vz
#Events will be read from file: ProtonMomentum.txt
/run/initialize
/PP2PP/generator/mode doubleFile
#setting number of geometry setup (numbering like at https://drupal.star.bnl.gov/STAR/system/files/pp2ppRuns2009_updated.pdf)
/PP2PP/geometry/alignmentVersion 0
/PP2PP/geometry/setNumber 6
#running 2000 events
#/run/beamOn 2000
#running all events from file
/PP2PP/generator/beamOn -1
3.3 hepMC.mac - simulate events generated with HepMC.
#Events will be read from file: hepmcout.dat
/run/initialize
/PP2PP/generator/mode hepMC
#setting number of geometry setup (numbering like at https://drupal.star.bnl.gov/STAR/system/files/pp2ppRuns2009_updated.pdf)
/PP2PP/geometry/alignmentVersion 1
/PP2PP/geometry/setNumber 6
#running 15 events
/run/beamOn 15
3.4 starsim.mac - read and simulate events generated with starsim.
#Events will be read from file: pythia8.starsim.root
/run/initialize
/PP2PP/generator/mode starsim
/PP2PP/generator/elastic/multiBucketBunch 1
/PP2PP/generator/elastic/setBucketAmplitudes Y 0.04158 0.377161 0.729316 0.398103 0.070309
/PP2PP/generator/elastic/setBucketAmplitudes B 0.0412431 0.430405 0.832144 0.401495 0.0573226
/PP2PP/generator/elastic/setBucketDistance Y 4.22494
/PP2PP/generator/elastic/setBucketDistance B 4.11313
/PP2PP/generator/elastic/setBucketWidth Y 1.73054
/PP2PP/generator/elastic/setBucketWidth B 1.68032
/PP2PP/geometry/alignmentVersion 1
#setting number of geometry setup (numbering like at https://drupal.star.bnl.gov/STAR/system/files/pp2ppRuns2009_updated.pdf)
/PP2PP/geometry/setNumber 0
#generate only events with eta > 4 or eta < -4 (default off)
#/PP2PP/generator/starsim/etaLimit 4
/PP2PP/generator/secondaries/secondariesProduction 0
/PP2PP/processing/TAC_parametrisation 1
/PP2PP/processing/TAC_cutoff 1
#running 50 events
/run/beamOn 50
#/PP2PP/generator/beamOn -1
Groups:
- lukfulek's blog
- Login or register to post comments