# Difference between revisions of "Beam Backgrounds"

It is very important to study the impact that backgrounds due to beam running conditions will have to the detector and any measurement. This was a hard lesson learned from past experiments (i.e. transition from HERA to HERA-II). Simulations have begun to investigate these issues as the interaction region and machine parameters are being designed. In this way, experiments can be proactive in ensuring that the machine design will not be adverse to physics in terms of background load. Two major sources of background that need to be studies are backgrounds due to protons in the beam interacting with residual gas in the beam pipe (beam-gas) and photons arising from synchrotron radiation due to the electron beam.

## Beam-gas Backgrounds

Presented below is the current status of the beam-gas studies and includes some useful code developed, as well as tips to continue these studies into the future. The basic workflow of the simulations studies can be summarized in the following steps: Background event generation → tracking through IR magnets and interaction with material in the IR → normalizing background rates by considering running conditions → compare to expected rates of physics measurements and see what areas of the detector will be impacted the most from the background. The steps described are detailed in individual sections below.

### Background Event Generation

The first question one may ask is what is the dominant species of nuclei present in the residual beam gas. The vacuum experts at RHIC were consulted. The vacuum condition existing currently at RHIC are a good starting place for these studies. It was stated that roughly 90% of the gas is H2, with heavier gases making up the remaining content. Thus the current studies focus on p+H2 collisions. The Monte Carlo package DPMJet is used to generate these events. The steering file used to generate the events used in the simulation can be found at /direct/eic+u/rmpetti/workarea/MCgenerators/dpmjet3-32BIT/pH.inp. The file format for the output of DPMJet for hadronic collisions is a bit different from that for DIS type events. Thus an afterburner macro has been written to massage the output so that it can be imported directly into EicRoot. This macro only keeps final state particles, so all ancestry information is lost (this is not needed for this current study anyway). Also the information regarding the impact parameter of the collision, number of participant nucleons, etc., will also not be propagated through to EicRoot. This information is also not needed for the background rates studies. The transformation macro can be found at /direct/eic+u/rmpetti/workarea/MCgenerators/dpmjet3-32BIT/pA_background/hijingFaker.C. The output of this macro can be put directly into EicRoot as detailed in the next section.

One of the pursuits of the study is to investigate where along the beam path collisions can occur and still cause a significant number of particles from the collision to hit the detector. Thus it is necessary to generate events so that the vertex position of the background events occur all along the beam path trajectory. The displaced vertex is applied to the events with the hijingFaker.C macro referenced above. In addition to taking the original DPMJet generated event record file as an argument, the macro also takes in a ROOT file containing a single EicRoot event (output of running /direct/eic+u/rmpetti/workarea/backgroundStudies/beamGas/macros/simulation_beamPath_rr.C for example) encoding the path of the beam via the simulated track. The information about the track contained in the TGeoTrack branch (and class) is used to reference beam's path. To generate this beam path, an anti-proton is generated originating at the end of the detector (z = -4.5 m currently) moving in the opposite direction of the beam.

The hijingFaker.C macro will randomly select a position along the beam path (so assumes a uniform distribution along this path). This means that the vertex is displaced from the original simulated file in both x (transverse and horizontal to the beam) and z (along the beam). The angle of the emitted particles from the collision are also rotated by the angle the proton makes along the beam path.

### EicRoot Simulation

The next step in the simulation workflow is tracking the background events through the interaction region magnets. An example script that runs this step can be found at /direct/eic+u/rmpetti/workarea/backgroundStudies/beamGas/macros/simulation_rr.C, with the details of the function calls within described in the EicRoot simulation page. This step tracks all the particles in the event through the interaction region magnets.

### Visualizing and Processing of Results

Some code has been developed to visualize various aspects of the simulation. Firstly, one may be interested in the relative distribution of the various species of particles produced in the p+A collisions. The macro /direct/eic+u/rmpetti/workarea/backgroundStudies/beamGas/macros/plotParticleDists.C will do this for you. The macro takes in the TTree produced by the previous simulation step.

The macro /direct/eic+u/rmpetti/workarea/backgroundStudies/beamGas/macros/trackParticlesOutsideBeamPipe.C will run over the TTree from the simulation output, loop over all the tracks in each event, and determine which tracks make it into a fiducial volume representing the main detector. In this process, the macro will produce several histograms used for diagnostics and visualizations. This includes a 2D histogram (h_vert_z_vs_x) that contains the number of particles that originate from each vertex along the beam, showing where most of the background hitting the detector originates from. A similar histogram with the x vertex axis replaced with energy is also produced (h_vert_vs_energy). The macro /direct/eic+u/rmpetti/workarea/backgroundStudies/beamGas/macros/draw_closerLookAtVertices.C will take the file containing this histogram and will plot the 2D histograms combined with the magnet apertures (read in from the lattice files contained found in the repository for example) for a complete visual of the situation. The macro plot_1D_acc.C in the same directory will produce a similar plot, but projected into one dimension along the beam axis.

### Normalization Procedure for Rate Estimates

In order to get a realistic estimate of the expected rates due to the beam-gas background, the yields extracted from the thus produced simulations need to be normalized. The factors that must be known for the normalization include the level of vacuum (or the gas density), the cross section for the p+A interaction, and the proton current in the machine. The beam-gas collisions is essentially a fixed target collision with a proton hitting a "fixed" gas molecule. The luminosity for this can be estimated from $\displaystyle{ L = \Phi \rho l }$, where L is the luminosity, Φ is the proton flux (obtained by the beam current), ρ is the (transverse) gas density, and l is the longitudinal length of the gas. Then the rate can be obtained by multiplying the luminosity by the cross section of the interaction. This rate can then be used as a scaling factor to the generated per event yields from the previous section. Then these rates can be compared to the expected rates from physics events to get a feeling for how bad the impact of the background will be on the measurement.

The macro /direct/eic+u/rmpetti/workarea/backgroundStudies/beamGas/macros/makeStoBplots.C will produce plots overlaying the expected rate of background in the detector with rate of DIS physics events in the detector as a function of the particle energy. In addition to taking the output TTrees from the background simulation, the macro will also take in EICTrees produced from a physics Monte Carlo generator (for example PYTHIA), which will also be normalized from the expected luminosity that will be delivered by the machine design multiplied by the cross section.