# Presentation: 132806

## Collimation Simulations at BNL

- Ray Fliller
- Nikolay Malitsky
- Angelika Drees

## Goal

-  Realistic simulation of collimation system and beam loss distribution including the following effects:

- Scattering in collimator jaw.
- Apertures
- Detector background due to collimation.

- Beam Direction

- Scraper Location

- Beam Losses

## Specification of Apertures

- A database is maintained that includes ALL machine apertures, down to each and every bellows and tee.  A PERL script reads this database to insert this information into lattice file.

- Apertures are specified as markers in drifts, or body of magnets

## Programs used at BNL for Collimator simulation

- Teapot – used to track particles around accelerator.  Part of UAL framework.
- K2 – used to track protons in collimator.  Not part of UAL.
- ACCSIM – used to track protons in collimator.  Part of UAL.

- K2 and ACCSIM simulate protons ONLY.  Heavy Ions are not simulated at all.  Our simulations assume scrapers are perfect absorbers.

## UAL Architecture

- K2

- PERL Module

## Particle Distribution After Scraper

- Scraper aperture

- Scraper
- Survivors

- Beam

- Scraper simulated with K2

## Secondary Halo Simulation

- At scraper

- 10 m downstream

- Distribution of particles that pass through scraper.  1% make it.

- Secondary Halo after scraper.

- Beam

## STAR and PHENIX backgrounds

- Blue Background:  STAR PHENIX

- Yellow Background: STAR PHENIX

- January 11, 2004 Store 4235 – New Collimation System

- BRAHMS and PHOBOS below scale.

## Simulation of Loss Distribution

- When a particle hits an aperture in TEAPOT, it is flagged as lost. However, the location and turn number were not recorded.
- The old solution was to loop over the particle distribution after tracking though the element and write to file the loss location and turn number. – Two loops where one will do - Slooooow.
- A better  solution is to have a *LostCollector*.  This collector records the particle:

- Number for identification
- Phase space coordinates
- Turn of loss
-  s Coordinate of loss

- In the tracking loop.  This can be written to an ASCII file for later analysis

## Caveat Emptor!

- The PERL API  requires not only writing the LostCollector, but also an interface so PERL can access it.  This was necessary for K2 as well.

- Solution is to remove the PERL interface.  If the UAL source is written in C++, write the simulation in it!

-  Debugging nightmare.

## UAL/ROOT Architecture

- Additions/edits to tracking UAL do not need a new interface.
- No need to learn different interface and language for each step.
- Go from simulation to pictures in the same C++ program.
- No intermediate ASCII files, no conversion between file formats.
- Allows user to use their own code in the process.

## Simulated Beam Losses

- TEAPOT tracks the particles in lattice, records lost particles
- ACCSIM track particles in scrapers
- ROOT draws the graphs, saves the particle distributions and the graph!

## Different Codes / Same Results??

- However, in the end we “compute” with experiments and the codes should agree with them. Question: *Can we properly simulate the scattering physics in the collimator?*

- Physicists generally distrust any code they didn’t write (and sometimes the codes they did!)....
-  Codes modeling the same thing can have different results because:

- More or less physics.
- The physics is uncertain.
- Same physics, different computation method.
- Different approximations made.
- C++ vs. FORTRAN
- ......

## Comparison of ACCSIM and K2

- Each code simulates Bethe-Bloch energy loss, multiple Coulomb scattering and inelastic nuclear scattering (at least to the point that it can occur – secondaries are not simulated).  K2 has diffractive scattering as well.

- Test input distribution - 100k particles

## Comparison of ACCSIM and K2: Output

- K2 angle distributions have larger tails. Approximately 50 particles in the K2 tail are not shown  The energy distributions are different.  K2 has a much larger tail, 3% of the particles in the K2 tail have p/p<-12x103.

## Summary

- Simulations of loss distributions have been done using K2, ACCSIM, and TEAPOT.  Experiments remain to be analyzed.
- UAL provides ability to simulate loss distributions, including collimator scattering with ACCSIM.
- UAL/ROOT provides the ability analyze simulation results without the need to learn multiple interfaces to multiple programs.
- Questions remain about which programs accurately simulate the physics of proton scattering in the collimator.
- What about Heavy Ion scattering??