Toward polarized antiprotons: Machine development for spin-filtering experiments

The paper describes the commissioning of the experimental equipment and the machine studies required for the first spin-filtering experiment with protons at a beam kinetic energy of $49.3\,$MeV in COSY. The implementation of a low-$\beta$ insertion made it possible to achieve beam lifetimes of $\tau_{\rm{b}}=8000\,$s in the presence of a dense polarized hydrogen storage-cell target of areal density $d_{\rm t}=(5.5\pm 0.2)\times 10^{13}\,\mathrm{atoms/cm^{2}}$. The developed techniques can be directly applied to antiproton machines and allow for the determination of the spin-dependent $\bar{p}p$ cross sections via spin filtering.

The paper describes the commissioning of the experimental equipment and the machine studies required for the first spin-filtering experiment with protons at a beam kinetic energy of 49.3 MeV in COSY. The implementation of a low-β insertion made it possible to achieve beam lifetimes of τ b = 8000 s in the presence of a dense polarized hydrogen storage-cell target of areal density dt = (5.5 ± 0.2) × 10 13 atoms/cm 2 . The developed techniques can be directly applied to antiproton machines and allow for the determination of the spin-dependentpp cross sections via spin filtering.

I. INTRODUCTION
Already in 1968 it was realized that by means of a spin filter using an internal polarized hydrogen target, polarized high-energy proton beams could be produced at the 30 GeV ISR 1 at CERN [1]. Since more efficient methods to provide polarized beams had already been invented, the idea of using a spin filter was revisited only in 1982 to polarize antiprotons at LEAR 2 of CERN [2]. At the 1985 workshop at Bodega Bay, CA, USA, a number of different techniques were discussed to provide stored beams of antiprotons [3]. Among them spin filtering was rated practical and promising.
Spin filtering and related mechanisms leading to a polarization build-up in a stored beam were discussed in great detail at the Daresbury workshop in 2007 [4], and in a WE-Heraeus seminar in 2008 at Bad Honnef, Germany [5]. In the framework of the FILTEX collaboration, polarization build-up in an initially unpolarized beam was observed for the first time using 23 MeV protons stored in the TSR 3 at Heidelberg, interacting with polarized hydrogen atoms in a storage-cell target [6]. (A detailed description of the experimental effort is given in [7][8][9], up-to-date results are summarized in [10].) The renewed interest in experiments with polarized antiprotons aims at the production of a polarized antiproton beam at the HESR 4 [11] of FAIR 5 [12] at Darmstadt, Germany. In 2003, a Letter of Intent for a variety of spin-physics experiments with polarized antiprotons was proposed by the PAX 6 collaboration [13]. In 2005 the PAX collaboration submitted a technical proposal to the QCD program committee of FAIR, suggesting as an upgrade for HESR a double-polarized antiproton-proton collider to study, among other subjects, the transversity distribution of the proton [14,15].
Polarizing a stored beam by spin-flip in e − p (or e +p ) scattering [16] presents an advantage, because contrary to spin filtering, beam particles are not lost. Triggered by the PAX proposal, the theory of spin-flip interactions was radically revised, leading to negligibly small cross sections for proton-electron scattering [17][18][19][20]. In a recent experiment performed at COSY 7 [21], the e − p spinflip cross sections were indeed shown to be too small to allow for the efficient production of polarized antiprotons based on e +p interactions [10,22].
Polarizing antiprotons by spin filtering, using the spindependent part of the nucleon-nucleon interaction, remains the only viable method, up to now experimentally confirmed for a stored beam of protons and a polarized hydrogen gas target [6,7]. Theoretical considerations for beams of antiprotons have meanwhile been extended fromp H interactions [23,24] top D [25] andp 3 He [26].
In order to complement the Heidelberg TSR spinfiltering experiment by a second measurement, and to commission the experimental setup for the proposedpp experiment at the AD 8 of CERN [27], a spin-filtering experiment was performed in 2011 at COSY. The experiment confirmed that only pp scattering contributes to the polarization build-up [28]. At a beam kinetic energy of T = 49.3 MeV, slightly above the COSY injection energy of T = 45 MeV, precise pd analyzing power data for the beam polarization measurement are available [29].
The spin-filtering method exploits the spin-dependence of the total hadronic cross section [30], where σ 0 is the spin-independent, σ 1 the spin-dependent part, and Q is the nuclear polarization of the target. The positive (negative) signs denote parallel (antiparallel) orientation of the spins of beam and target protons. The number of beam protons with spin orientation parallel (antiparallel) to that of the target spins is denoted by N ↑ (N ↓ ). One can safely neglect the numerically minuscule spin-flip cross section. Then the decrease of the total number of beam particles as function of time from the initial values N ↑ (t = 0) = N ↓ (t = 0) = N tot (t = 0)/2 is described by 6 Polarized Antiproton eXperiments, http://collaborations. fz-juelich.de/ikp/pax/ 7 COoler SYnchrotron and storage ring 8 Antiproton Decelerator where τ b = (f d t σ b ) −1 and τ 1 = (Qd t fσ 1 ) −1 . (3) Here d t is the areal target gas density and f the revolution frequency determined by the beam momentum and the ring circumference. Furthermore, σ b = σ 0 + σ C combines σ 0 and single Coulomb scattering σ C in the target, the latter for scattering angles larger than the acceptance angle Θ acc of the machine. For single Coulomb scattering and small values of Θ acc , the beam lifetime τ b ∝ σ −1 C ∝ Θ 2 acc ∝ β −1 (see Sec. II B). Therefore the betatron function (or β-function) at the target should be small in order to achieve a long beam lifetime.
The polarization build-up in the stored, circulating beam is given by It depends on the spin-dependent removal of particles. The effective removal cross section in Eq. (1) depends on the machine acceptance,σ 1 = σ 1 (Θ > Θ acc ), and consequently so does the achievable beam polarization, as illustrated, e.g., in Fig. 15 of Ref. [24].
In the present paper, the development effort, including a variety of measurements is described, necessary to prepare the COSY storage ring and the experimental equipment for the spin-filtering experiments [28,31]. The paper is organized as follows: • Section II presents the essential components of the COSY ring, in particular its lattice and the electron cooler (II A), followed by the requirements to the low-β insertion at the position of the polarized gas target, and its realization (II B).
• Section III describes the internal polarized hydrogen storage-cell target (III A), the coil system to produce the magnetic holding field at the storage cell (III B), and the vacuum system around the polarized target (III C).
• In Sec. IV the equipment employed for beam diagnosis is described, comprising beam current transformer, H 0 monitor, ionization profile monitor, beam-position monitor, movable frame system for acceptance measurements, and beam-polarimeter setup.
• Section V describes the betatron tune mapping (Sec. V A), and orbit adjustment (Sec. V B) to provide long beam lifetime for the spin-filtering experiments.
• Section VI highlights the commissioning of the lowβ insertion, including the determination of the βfunction at the target.
• Section VII presents the measurements of the beam widths (VII A) at the location of the internal target, the beam emittance (VII B), and the determination of the machine acceptance and the acceptance angle at the target position (VII C).
• In Sec. VIII the efforts are described to optimize the beam lifetime by means of closed orbit correction and tune adjustment. Space-charge effects (VIII A) and vacuum considerations are discussed as well (VIII B).
• In Sec. IX it is explained how the beam was set up for the experiments (IX A) and how a typical measurement cycle looked like (IX B). In addition, the measurement of the beam polarization lifetime (IX C) and the efficiency of the RF spin flipper are described (IX D).
• Section X summarizes the main results.

II. COSY ACCELERATOR AND STORAGE RING
The synchrotron and storage ring COSY accelerates and stores unpolarized and polarized proton or deuteron beams in the momentum range between 0.3 GeV/c and 3.65 GeV/c. COSY has a racetrack design with two 180 • arc sections connected by 40 m long straight sections. It is operated as cooler storage ring with internal targets (ANKE 9 , WASA 10 , PAX 6 ) or with an extracted beam (see Fig. 1, bottom panel). Beam cooling, i.e., reducing the momentum spread of the beam and shrinking the transverse equilibrium phase space, is realized by electron cooling up to proton-beam momenta of 0.6 GeV/c [32], and by stochastic cooling for proton momenta above 1.5 GeV/c [33].
Polarized proton and deuteron beams are routinely delivered to experiments over the whole momentum range [34]. Polarized beams from the ion source are preaccelerated in the cyclotron JULIC [35], injected and accelerated in COSY without significant loss of polarization. Imperfection and intrinsic depolarization resonances are overcome by well-established procedures [36][37][38]. When the polarization lifetime is by orders of magnitude longer than the spin filtering periods required, it becomes feasible to polarize an originally unpolarized beam by filtering, as was confirmed in a dedicated experiment [28], described in Sec. IX.

A. COSY lattice and electron cooler
The COSY lattice is designed to provide flexibility with respect to ion-optical settings [39] in order to fulfill the FIG. 1. Bottom panel: Floor plan of the COSY facility. The 24 dipole magnets are given in red, the quadrupole magnets in blue except those around the PAX target point (PAX-TP) and the 100 keV electron cooler which are given in green. The quadrupole magnets of COSY are combined into quadrupole families, each consisting of four magnets with a common current supply. There are eight families for the telescopic straight sections (QT1 to QT8, middle panel) and six for the arcs (QU1 to QU6, top panel). The PAX quadrupoles of the lowβ insertion at the PAX-TP are combined to an outer pair (PAX1) and an inner pair (PAX2). requirements for internal and external experiments. Each of the arcs is composed of three mirror-symmetric unit cells (U) consisting of four dipole magnets (O), two horizontally focusing (F) and two horizontally defocusing quadrupole magnets (D). Each of the six unit cells has a DOFO-OFOD structure (see Fig. 1, top panel). The two inner (and outer) quadrupole magnets of each unit cell are connected to the inner (and outer) pair of the opposite unit cell located in the other arc, thereby six quadrupole families arise (QU1 to QU6). A symmetric operation of all unit cells leads to a sixfold symmetry of the β-functions [40].
The straight sections are composed of two mirror- symmetric telescopic (T) arrangements with two quadrupole triplets, each consisting of four quadrupoles, either operated in FDDF or DFFD mode. Thereby, a 2π phase advance and 1:1 imaging over the complete straight section is achieved, decoupling to first order the arcs from the straight sections [39], and providing three possible locations per straight section for internal target experiments with adjustable β-functions in the center of the triplets. Figure 2 (top panel) shows the horizontal (x) and vertical (y) β-functions, β x and β y , and the dispersion D for a typical setting of COSY used at injection. The basic parameters of COSY are listed in Table I. The straight sections can be made free of dispersion by breaking the sixfold symmetry with a specific setting of the six arc quadrupole families (see Fig. 2, bottom panel). This dispersion-free D = 0 setting is advantageous for the operation of the storage-cell target, therefore it has been chosen during the spin-filtering experiments. A non-zero dispersion causes a displacement of a particle with a relative momentum deviation ∆p p from the reference orbit, and the deviation from the ideal orbit is given by [41] x where s is the position along the reference orbit and s = 0 is located at the beginning of the straight section, where the PAX-TP is located.
The COSY electron cooler (see Fig. 1) is used to compensate multiple small-angle Coulomb scattering and energy loss in the target and the residual gas in the machine. It provided stable beam emittance and beam energy during the spin-filtering experiment. It was designed for elec- tron energies up to 100 keV, thus enabling phase-space cooling up to a proton-beam kinetic energy of 183.6 MeV [42]. Its main parameters are listed in Table II. Two short solenoids located in the 8 m long drift region in front and behind the electron cooler (see Fig. 7 of Ref. [43]) and operated with reversed polarity to that in the drift solenoid compensate phase-space coupling and avoid spin rotation in the case of polarized beams. The field strengths are adjusted such that B · dl over the cooler magnets and the compensating solenoids equals zero. The main drift solenoid was typically operated at magnetic fields of B = 50 − 80 mT.
Beams of small emittance, as produced by electron cooling, tend to develop coherent betatron oscillations which lead to beam loss [42]. The transverse feedback system of COSY [44,45] was used to avoid these instabilities. In a storage ring, the geometrical machine acceptance 11 [41] is defined by and the acceptance angle Θ acc [46], by where a is the free aperture along the ring. At the kinetic energy of T p = 49.3 MeV of the spin-filtering experiment, the beam lifetime (Eq. (3)) is dominated by the Coulomb scattering loss on the target gas and the residual gas in the ring; the hadronic losses amount to about 10% of the total loss cross section σ b (see Sec. VIII B). The Coulomb-loss cross section can be derived by integration of the differential Rutherford cross section, for scattering angles larger than Θ acc [47], Z gas and Z i are the atomic numbers of the target (or residual) gas and the ion beam, respectively, β L and γ L are the relativistic Lorentz factors, and r i = r e m e /m i is the classical ion radius. The beam lifetime due to single Coulomb scattering, 11 Throughout this paper µm is used as unit of machine acceptance and beam emittance, equivalent to mm mrad. is inversely proportional to the β-function and the gas density. Therefore, especially the β-functions at the PAX-TP should be made small, because of the high densities. It turns out that for a given target-gas cell an optimal value for the β-function at the cell center exists. The β-function in a symmetric drift space is described by where s is the distance from the cell center, and β 0 is the β-function at the center. The machine acceptance for a storage cell of diameter d and length l as function of β 0 is therefore given by and A(β 0 ) reaches a maximum for β 0 = l/2. A storage cell of d = 9.6 mm and l = 400 mm is used to maximize the target areal density in the experiment (see Sec. III A). For the specified cell the maximum acceptance is A(β 0 = 0.2 m) ≈ 58 m (see Fig. 3). The standard COSY lattice (D = 0) provides geometrical acceptances of about A x ≈ (75 mm) 2 /25 m = 225 µm and A y ≈ (30 mm) 2 /20 m = 45 µm (see Fig. 2 and Table I), thus with the smallest β-functions of about 3 m, the given storage cell would restrict the machine acceptance to A(β 0 = 3 m) ≈ 8 µm.
To obtain the required small β-functions, a low-β insertion consisting of four additional quadrupole magnets (blue in Fig. 4), formerly used at CELSIUS [48], was installed in the drift space in front and behind the target. The quadrupole magnets are arranged in a doublet structure (DF-FD), where the D and F magnets are powered by separate power supplies. When the doublets are operated, the four regular COSY quadrupole families in this straight section are reduced in strength to maintain its telescopic nature. Thus the other magnets in the machine do not require any readjustment.
Precise positioning of the beam inside the storage cell was provided by horizontal and vertical steerer coils, which were mounted because of space restrictions on the yokes of the adjacent quadrupole magnets up-and downstream of the low-β insertion.
Based on the COSY lattice using the standard magnet settings, a calculation of the optical functions was carried out with the MAD 12 program, version 8 [49]. The results, obtained with the PAX magnets switched ON and OFF, are shown in Fig. 5, indicating that β x and β y at the target point can be reduced by more than one order of magnitude, with minimal values of β x,y ≈ 0.3 m. The commissioning of the low-β section, including the measurement of β x and β y , is described in Sec. VI.

Methodical Accelerator Design
Reduced β-functions at the target, however, are accompanied by increased ones up-and downstream, reaching values of about 33 m (see Fig. 5, bottom panel). Therefore, excellent vacuum conditions have to be maintained also in these regions to avoid adversely affecting the beam lifetime.

A. Polarized atomic beam source and storage cell
The polarized internal target (PIT) consists of the atomic beam source (ABS), which was developed for the TSR spin-filtering experiment [9,50], later on used in the HERMES experiment at DESY [51,52], and now modified for spin-filtering at COSY, a storage cell [53], a socalled Breit-Rabi polarimeter (BRP) [54], and a Target Gas Analyzer (TGA) [55]. H 0 atoms in a single hyperfinestate are prepared in the ABS and injected into a thinwalled storage cell. A fraction of the gas diffuses from the cell through a side tube into the diagnostic system, where the BRP determines the atomic polarization and the TGA the relative fraction of atoms and molecules. A magnetic guide-field system defines the quantization axis for the target polarization, which can be oriented along the x (outward), y (up), or s (along beam) direction, or any superposition thereof (see Sec. III B). The gas load into the target chamber and the neighboring sections causes beam losses due to the interaction of beam particles with the residual gas. A dedicated pumping system, described in Sec. III C, was developed to minimize these losses.
The storage cell (see Fig. 6, label 1) increases the dwell time of the polarized atomic gas in the interaction region with the beam and enhances the areal target density compared to a free atomic jet by about two orders in magnitude. The cell was made from aluminum and coated with Teflon 13 to reduce depolarization and recombina-  (3) to protect the cell from heat radiation during activation of the NEG pumps (4), COSY beam (5), guide field compensation coils (6), and magnetic guide field coils (7).
tion [56]. Under the assumption of linear decrease of the gas density from the center to the open ends the areal target-gas density is given by where I [s −1 ] is the intensity of the injected beam from the ABS, l [cm] the total length of the storage tube and C tot the total conductance of the storage cell.
where T [K] is the temperature and M [u] the molar mass.
The total conductance C tot of the storage cell is given by the sum of all conductances with respect to the cell center. For a storage-cell tube (l = 400 mm, d = 9.6 mm), a feeding tube from the ABS (l = 100 mm, d = 9.6 mm), and the extraction tube to the target polarimeter (l = 380 mm, d = 9.6 mm), the conductance of the storage cell yields C tot = 2 · C 1 2 cell + C feed + C extract = 12.15 /s. With an intensity from the ABS injected into the feeding tube of I = 3.3 · 10 16 s −1 [51], an areal density of d t = 5.45 · 10 13 cm −2 is expected. During the spin-filtering experiment, in good agreement with the estimate given above, a target density of [28]  was deduced from the shift of the orbit frequency of the coasting beam caused by the energy loss in the target gas (see Sec. IV B) [8,58].

B. Holding field coil system
The operation of the polarized target requires a coil system providing guide fields of about 1 mT [59] in order to define the orientation of the target polarization and allowing to reverse it in short sequence. The polarization of the gas atoms is known to be fully reversed within about 10 ms after switching the polarity of the magnetic field (see Fig. 11 of [60]). A system of coils, providing fields in transverse (x, y) and longitudinal (s) directions, was installed on the target chamber (see Fig. 6).
Additional coils installed on the up-and downstream ends of the target chamber (see Fig. 6) made sure that the horizontal and sideways field integrals B x,y ds vanish (see Fig. 7), thereby avoiding that the beam positions in the rest of the machine are affected. Holding field and compensation coils require only a single power supply.
A measurement of the magnetic field B y in the center of the target chamber using a Hall probe yielded B y↓ = −1.08 ± 0.03 mT and B y↑ = 1.10±0.03 mT, pointing down-and upward, respectively. This result is in good agreement with the calculated magnetic field of 1.0 to 1.1 mT inside the storage cell based on the coil geometry shown in Fig. 6, using the Amperes 14 program.
The vertical magnetic guide field causes a deflection of the proton beam in horizontal direction. Accord- ing to F x = q( v s × B y ), for a beam at experiment energy the expected change of the beam position at the target center between both polarities (B y = ±1mT) is ∆x ≈ 0.28 mm. A measurement of the beam displacement using the movable frame system (see Sec. IV D) resulted in ∆x = x B y↑ − x B y↓ = (0.33 ± 0.04) mm, confirming independently the magnetic holding field strength of |B y↑,↓ | ≈ 1 mT. The quality of the magnetic compensation scheme was determined using the dispersion-free setting (D = 0) of the telescopes by measuring the horizontal orbit difference ∆x = x B y↑ − x B y↓ for reversed vertical magnetic holding fields (B y↑ and B y↓ ) using the beam position monitors (see Sec. IV). Small orbit differences in the arcs of ∆x ≤ 0.9 mm, and in the straight sections of ∆x ≤ 0.2 mm were observed (see Fig. 8), yielding satisfactory stability of the beam position in the machine.
The largest orbit displacements occur in the arcs, where the dispersion reaches values of D ≈ 15 m (see Fig. 2, bottom panel). It is interesting to note that according to Eq. (5), the observed orbit difference in the arcs apparently correspond to a relative momentum change of |∆p/p| ≈ 10 −5 , which is probably due to a change of the proton-beam position inside the electron cooler beam, when the magnetic holding field changes from B y↑ to B y↓ .

C. Vacuum system around the target
The atomic beam source injected about 3.3 · 10 16 H 0 /s (one hyperfine state) into the target chamber, thus generated a significant gas load in the region around the PAX target. In the up-and downstream areas where the betatron functions are large (see Sec. II B), and therefore the acceptance angles are small, single scattering on the residual gas causes beam losses that limit the beam lifetime. In order to minimize these losses, a complex vacuum system was installed. It consists of 1. ten NEG cartridges 15 installed below the target chamber, providing a nominal pumping speed of 10 × 1900 /s for H 2 (see Fig. 6), 2. NEG coating of the beam pipes up-and downstream of the target region with a nominal pumping speed of 2 × 5000 /s [61]., 3. flow limiters with an inner diameter of 19 mm and a length of 80 mm (see Fig. 6) installed at the entrance and exit of the target chamber in order to minimize the gas flow from the target into the adjacent sections without a restriction of the machine acceptance, and 4. one turbo pump 16 with a nominal pumping speed of 1200 /s for H 2 installed below the target chamber, primarily used during the activation of the NEG pumps.
The NEG coating and the NEG cartridges were activated by heating up to 230 • C and 450 • C, respectively, making use of the possibility that the entire low-β section is made bakeable. Assuming a gas flow of about 3.3 · 10 16 H 0 /s, during operation of the target, approximately one activation per week is required. A jalousie with mirror plates is mounted above the NEG cartridges in order to minimize the heat radiation into the target chamber during activation. The jalousie is closed during heating and opened for pumping. In addition, fast closing valves 17 were installed at the up-and downstream ends of the target chamber, which are capable to seal the section off the rest of the ring during bake-out, or in case of a sudden vacuum break.
The vacuum system enabled a base pressure of 2 · 10 −10 mbar in the target chamber and less than 10 −11 mbar in the adjacent sections when the polarized target is switched off. During operation of the polarized target the pressure never exceeded about 10 −7 mbar in the target chamber and 10 −9 mbar in the adjacent NEGcoated vacuum tubes.

IV. BEAM DIAGNOSTIC TOOLS
Various beam diagnostics systems, available at COSY, were used to perform the studies described in this paper. 15  A beam current transformer (BCT) measures the current of the circulating ion beam. The BCT electronics is based on the DCCT principle (DC current transformer) [62] and can be set to deliver 1 V or alternatively 0.1 V output signal for 1 mA of beam current. The BCT signal forms the basis for the measurement of the beam lifetime, which was determined from a continuous record of the beam current as function of time, fitted by an exponential.

B. Beam position monitors
The beam position monitors (BPM) at COSY are of the electrostatic type. Each BPM consists of two pairs of electrodes, providing sensitivity along the x and y direction. The electrodes, diagonally cut from a cylindrical or rectangular stainless steel tube, are matched to the size of the beam tubes in the straight and arc sections (see Table I) [63].
A bunch of charged particles passing through the device induces a voltage change that depends on the distance of the beam to the electrodes. The voltage difference at both electrodes ∆ = U 1 − U 2 , divided by the voltage sum = U 1 + U 2 determines the beam position. A Fourier analysis of ∆ as function of time allows one to extract the transverse Fourier components of the beam spectrum, which are used to determine the betatron tunes Q x and Q y (described in more detail in Sec. V A).
The sum signal recorded with an unbunched beam was used to determine the longitudinal Fourier components of the beam spectrum, from which the revolution frequency f and the momentum spread ∆p were obtained.
The beam-energy loss, caused by the interaction of the beam with the residual gas in the machine and the target gas, leads to a change of the revolution frequency per unit of time, and is used to determine the target density (see Eq. (7) of Ref. [58]).

C. Stripline unit
The stripline unit of COSY uses four electrodes mounted azimuthally at 45 • with respect to the x and y direction to excite coherent betatron oscillations [64]. The unit is powered with a frequency-swept sine wave voltage. The coherent betatron oscillations of the beam as function of the exciting frequency are recorded with a BPM, and Fourier-analyzed to yield the fractional betatron tune, as described in Sec. V A.
FIG. 9. Movable system with three frames of orifice cross section wx × wy ≈ 25 mm × 20 mm, at the upstream (label 2), center (1), and downstream position (3) of the storage cell, and one tube of 9.6 mm inner diameter and 400 mm length. The system is movable in horizontal (x) and vertical (y) direction perpendicular to the beam while the beam is passing through one of the apertures.

D. Movable frame system
A frame system was installed at the PAX target position consisting of three frames and a tube (see Fig. 9) [65]. The widths of each frame were determined with a precision of 1 µm with a coordinate measuring machine. With the beam passing through one of the orifices, by moving the system along the x or the y direction and by simultaneously measuring the beam lifetime, the machine acceptance angles Θ x and Θ y at the upstream end, the center and the downstream end of the storage cell were determined (see Sec. VII C). The tube was utilized to precisely align the proton beam at the target prior to the installation of the storage cell.

E. Ionization profile monitor
An ionization profile monitor (IPM), developed in cooperation with GSI 18 , provides a fast and reliable nondestructive beam profile and position measurement [66]. The interaction of the stored beam with the residual gas produces ions which are guided to a position-sensitive detector by transverse electric fields. The ion detection is based on an arrangement consisting of Micro Channel Plates (MCP), where secondary electrons are produced, a phosphor screen to produce light, and a CCD camera to detect the light. The system enables a continuous recording of the beam width during the cycle with a resolution of 0.1 mm [67]. The measured distribution of ions is fitted by a Gaussian (see Fig. 10). The resulting beam widths 2σ x,y are used to calculate the 2σ beam emittances, where the β x,y represent the β-functions in the horizontal and vertical plane at the location of the IPM.

F. H 0 monitor
A small fraction of protons and electrons recombines in the electron cooler to neutral H 0 atoms, which are not deflected in the magnetic elements. The H 0 monitor [68], located at the end of the cooler straight section, records the H 0 beam profile using a multiwire proportional chamber, while scintillators are used to determine the intensity of the H 0 beam. In particular, the H 0 beam intensity provides an indispensable tool to properly set up the electron cooler and to monitor its performance.

G. Beam polarimeter (ANKE)
The beam polarization after spin filtering was measured using pd elastic scattering, described in detail in [10,28]. The ANKE deuterium cluster-jet target [69] provides target densities of about 1.5·10 14 deuterons per cm 2 . Elastically scattered particles were detected in the Silicon Tracking Telescopes (STTs) [70] located left and right of the cluster target at the ANKE interaction point (see Fig. 1), allowing the determination of the beam polarization from the measured left-right asymmetry and the analyzing power of pd elastic scattering [29].

V. BETATRON TUNE AND ORBIT ADJUSTMENT
Before the actual commissioning of the low-β section could be approached, suitable betatron tune settings and corrections to the machine orbit had to be carried out, in order to provide good starting conditions for further optimization of the machine with respect to the beam lifetime (Sec. V A).
In the following section in particular the mapping of the betatron tunes under different conditions, and the coupling of the horizontal and vertical phase-space are discussed. The implemented closed orbit correction procedures aimed at a reduction of the local acceptance limitations in the machine in order to optimize the beam lifetime (Sec. V B).

A. Betatron tune mapping
The particles circulating in COSY with frequency f perform betatron oscillations in the horizontal (x) and vertical (y) plane which are induced by the focusing strength of the quadrupole magnets in the ring. To first order the betatron motion constitutes a sinusoidal wave with frequency f βx,y = f · Q x,y , where Q x,y denotes the betatron tunes (or working point), i.e., the number of betatron oscillations per turn, given by Here ∆ψ x,y = ψ x,y (s + C) − ψ x,y (s) is the phase change per revolution, and C the ring circumference. At COSY, in order to analyze the betatron tune of the machine, a network analyzer is used to induce coherent transverse betatron oscillations of the beam by powering the stripline unit (see Sec. IV C) with a frequencyswept sine wave voltage, covering the frequency range of a sideband. These oscillations are detected by a positionsensitive pickup and the output signals are analyzed with a spectrum analyzer. The resulting spectrum consists of a series of lower (−) and upper (+) betatron sidebands at each revolution harmonic n with center frequencies of where f denotes the average revolution frequency. Since the betatron motion is sampled by the pickup once per turn, the measured spectrum provides only information about the fractional tune q x,y = frac(Q x,y ), where Q x,y = int(Q x,y ) + q x,y . The fractional tune is deduced from the peak value of both sideband frequencies, and the revolution frequency is found by adding them. Inserting the resulting value for f into Eq. (17) yields q x and q y . Because of the symmetry in a synchrotron like COSY, the magnetic structure after each full turn merges into itself. Consequently, the forces on the beam recur periodically, and therefore, the betatron tunes should be irrational numbers in order to avoid betatron resonances that can lead to an expansion of the beam or even to beam loss. The resonance condition is given by In order to increase the beam lifetime a search for the optimal betatron tunes was performed for several machine settings, and to this end, different tune combinations (Q x , Q y ) were investigated. In this procedure, called tune-mapping, the currents in the quadrupole magnet families QU1-3-5 and QU2-4-6 were varied in the range of ±3%, while the beam lifetime was determined from an exponential fit to the beam current using the BCT signal (see Sec. IV A).
The betatron tune scans, carried out with D = 0 setting of COSY, showed a large variation in the beam lifetime by a factor six in a rather small region of betatron tunes (see Fig. 11). Maximum beam lifetimes were observed close to the standard COSY working point of Q x = 3.58 and Q y = 3.62. This is in good agreement with tracking calculations carried out for COSY using MAD-X [49]. The impact of the third and sixth order machine resonances on the beam lifetime is clearly visible, as shown in Fig. 12.
An early investigation of the COSY beam lifetime as function of the betatron tunes (Q x , Q y ) had confirmed that the beam lifetime increased with decreasing tune split ∆Q split = Q x − Q y (see Fig. 11), as mentioned in [71]. Coupling between the horizontal and vertical betatron oscillations leads to a rotation of the eigenvectors of the transverse oscillations, thus the difference resonance ∆Q split = 0 cannot be reached. Betatron motions can be coupled through solenoidal and skew-quadrupole fields. The latter arise for instance from quadrupole rolls and feed-downs from higher-order multipoles caused by an off-axis beam orbit [72]. The observed tune split ∆Q split = 0.014 (shown in Fig. 12) cannot be attributed to phase-space coupling induced by the main and the two compensation solenoids of the electron cooler, because they were operated in compensation mode (see Sec. II A).
Applying additional corrections, using the COSY sextupole magnets of proper polarity, led to a reduced coupling and yielded ∆Q split ≈ 0.006 (see red data points in Fig. 12). This indicated that the coupling might originate from sextupole components in the fields of the dipole magnets which affect the beam in an off-axis position. This conclusion was confirmed in later measurements, performed to commission the low-β insertion (see Fig. 15), which showed that a comparably small ∆Q split could be reached without sextupole corrections by applying instead a closed orbit correction. An independent measurement at COSY with a 232.8 MeV deuteron beam [73] arrived at the same conclusion. Starting with a distorted orbit at the acceptance limit yielded ∆Q split = 0.011, and by applying a careful closed orbit correction, the coupling was decreased by about a factor of four to ∆Q split = 0.003.
The achieved tune splits correspond to a small linear coupling in the machine, which is neglected in later considerations.

B. Closed orbit correction
Due to misalignment or field errors of magnets, the real orbit in a machine deviates from the ideal one. In regions where the β-functions are large, these deviations lead to local restrictions of the machine aperture, and thus reduce the lifetime of the beam. A closed orbit correction scheme, based on the orbit response matrix (ORM), was implemented to increase the machine acceptance and to improve the beam lifetime [74,75]. In addition, the orbit correction allows one to specify boundary conditions such as the beam position at the target or the electron cooler.
The entries R u s,i of the ORM reflect changes of the orbit deviation u(s) (u = x or y) measured with a BPM at a position s in the ring, which is caused by a change in the deflection strength Θ u (i) of a correction-dipole magnet at a position i affecting the beam in horizontal (u = x) or vertical (u = y) direction. For x or y these quantities are connected by the relation where depends on the transverse tune Q u , on the β-function at beam position monitors and correction-dipole magnets, and on the phase advance between the positions s and i, denoted by ψ u,s→i . The ORM can either be calculated for the beam optics of the ring or measured. Here, the latter method was applied. When M horizontal (x) and vertical (y) BPMs and N x and N y correcting elements are installed, then Eq. (19) is replaced by where Θ u is a vector of N x or N y components, u is a vector of M components, and R u is a M×N x or M×N y matrix with the calculated elements R u s,i . For M ≥ N x , N y , which was fulfilled in the present studies, the horizontal and vertical closed orbit corrections were derived by variation of the Θ u (i) kick angles to find the minimum quadratic residual | R u · Θ u − u | 2 [74][75][76]. This method was used in the present studies. Another possibility uses the inversion of the ORM, where the appropriate settings are calculated from Θ u = R −1 u. This method is usually faster, though it should be noted that an inversion of the matrix R is not always possible.
The closed orbit correction procedure for COSY was tested for the first time in January of 2009 within the framework of a PAX beam time and was further optimized since then with the aim to achieve longer beam lifetimes at injection energy. The measurement of the ORM made use of up to N y = 17 vertical orbit correction dipole magnets for the measurement of the vertical ORM. 20 horizontal orbit correction dipole magnets, two horizontal back-leg windings at the ANKE dipole magnets, and both compensation dipole magnets next to the electron cooler toroid magnets were used for the determination of the horizontal ORM, i.e., N x = 24. Depending on their availability, up to M = 31 beam position monitors were employed. The above required M ≥ N x , N y was always fulfilled. Phase-space coupling was neglected in these measurements. The beam was deflected in both transverse planes by changing the current of a particular correction dipole magnet by about 5%. The orbit changes at the BPMs, normalized to the variation of the current correspond to the entries of the ORM. In spite of the longer computation time a χ 2 minimization was used to determine the correction angle kicks Θ u (i).
A typical example of a closed orbit correction with two iterations is displayed in Fig. 13. The vertical COSY orbit usually shows smaller deviations than the horizontal one. For the horizontal orbit correction, the initial deviations of up to 35 mm could be decreased to less than 10 mm. Closed-orbit corrections, carried out more recently in 2011, exhibit deviations of less than 3 mm.

VI. COMMISSIONING OF LOW-β INSERTION
Prior to the polarization build-up measurements, the low-β insertion (see Sec. II B) was commissioned in a dedicated beam time. The aim was to achieve betatron amplitudes at the target center of about β x,y ≈ 0.3 m without significant reduction of the beam lifetime. MAD calculations [49] verified that the PAX low-β quadrupoles have to provide 10 to 40 times larger focusing strengths than the regular COSY quadrupole magnets in order to achieve the required small β-functions at the target. Horizontal or vertical displacements of the beam in the strong low-β magnets would cause large orbit excursions along the ring. Therefore, a careful closed orbit correction (see Sec. V B) and selection of a reasonable working point (see Sec. V A) were carried out prior to the commissioning to avoid beam losses when the low-β quadrupole magnets are operated.
The goal to operate the low-β insertion while maintaining the telescopic features of the straight section was accomplished using as a starting point a regular COSY optics setting at T p = 45 MeV, with dispersion D = 0 and low-β section switched off. Subsequently, the fields of the low-β quadrupole magnets were increased stepwise in strength, while those of the COSY quadrupoles in the same straight section were reduced in strength such that the betatron tunes remained constant. Figure 14 displays the current in the COSY quadrupole families QT1-QT4 vs the current in the PAX low-β magnets found in this process. The MAD model was used to calculate the βfunction at the center point of the insertion (see Fig. 14, right scale). The strengths of the low-β PAX quadrupole magnets were reduced in the calculation by an empirical value of 4% to achieve stable solutions in the lattice The data were fitted with a hyperbola, and the slopes of the asymptotes |∆Qx,y/∆k| were used to determine the βfunctions. ∆Q split is a measure of coupling in the machine.

calculations.
In order to verify the validity of the lattice model, the β-functions at the PAX quadrupoles were experimentally determined by changing the quadrupole strength and measuring the tune change of the machine. The quadrupole focusing strength k = 1 Bρ ∂By ∂x = 1 Bρ ∂Bx ∂y is given by the magnetic rigidity Bρ = 0.977 Tm for the chosen kinetic energy of T p = 45 MeV and the magnetic field gradient. The latter is expressed by ∂By ∂x = ∂Bx ∂y = g · I, where g = 0.0197 Tm −1 A −1 denotes the currentspecific gradient and I is the operating current. The four PAX quadrupole magnets are powered pairwise. Therefore, the tunes are measured either as a function of the focusing strength, i.e., the operating current of the inner pair (PAX2, Fig. 15) or of the outer pair (PAX1). The current of the inner pair was modified in steps of 1 A from 181.4 A to 199.4 A, corresponding to the range k = 3.658 m −2 to k = 4.021 m −2 . The values for the outer pair are steps of 0.5 A from 181.7 A to 188.2 A, corresponding to the range k = 3.664 m −2 to k = 3.795 m −2 .
In Fig. 15 the measured tunes Q x and Q y are displayed as function of the quadrupole strength of the outer pair (PAX1, bottom panel) and the inner pair (PAX2, top panel). According to Ref. [77], the functional form of Q x,y (k) is described by a hyperbola. The hyperbolic fits also yield the tune split of ∆Q split = 0.0085 ± 0.0010, obtained from a weighted average using the outer and the inner quadrupole pair. This constitutes an independent evidence for the presence of slight coupling in the machine, as discussed already in Sec. V A. The crossing points of the asymptotes at Q = 3.611 for the inner pair and Q = 3.613 for the outer pair agree within the error of Q split as it has to be.
The ion-optics matrix formalism for a change of the quadrupole focusing strength ∆k yields a tune shift [41,78] where β x,y (s) is the position-dependent β-function and l is the effective length of the field of the quadrupole magnet. For small ∆k, β x,y (s) can be replaced by β x,y , which yields The absolute value takes into account that the β-function has to be positive, remembering that a quadrupole focuses in one plane (∆Q x,y > 0 for ∆k > 0) and defocuses in the other plane (∆Q y,x < 0 for ∆k > 0). To determine the average values β x and β y in the magnets of the inner and outer pair with the use of Eq. 23, the values of | ∆Q/∆k | are the absolute values of the four slopes of the asymptotes of the hyperbolas of Fig. 15. The effective length of a single PAX quadrupole magnet, measured as 0.442 m, for each of the pairs yields l = 0.884 m. The resulting β x and β y are shown in Fig. 16 together with the result of the model calculation which yields a reasonable agreement (see Table III) with the measured data and β x = 0.31 m and β y = 0.46 m at the center of the target. From a comparison of measured and calculated betatron functions an uncertainty of about 10% is estimated for the β-functions obtained from the MAD model.

VII. BEAM SIZE, BEAM EMITTANCE, MACHINE ACCEPTANCE, AND TARGET ACCEPTANCE ANGLE
The polarization build-up cross sectionσ 1 depends on the acceptance angle Θ acc at the target location, as explained in Sec. I. Therefore, in order to determineσ 1 , it is necessary to measure Θ acc . The measurement made use of the fact that when an object is placed at a distance smaller than the maximum allowed extension of the local phase-space ellipse, the machine acceptance is reduced, and therefore the beam lifetime as well [65,79].
In the subsequent section, we first describe the determination of the beam width at the target, since it may have some bearing on the machine acceptance extracted from a measurement with the scraper system, described in Sec. IV D. The actual acceptance measurements, including the determination of Θ acc and a discussion of possible systematic errors, are described in Sec. VII C.

A. Measurement of the beam widths at the target
The beam widths along the PAX target were determined by moving each the three rectangular frames (shown in Fig. 9) with constant speed through the proton beam. The decrease of the beam current was recorded with the BCT (see Sec. IV A). A typical result of such a frame scan is shown in Fig. 17. The remaining beam intensity as function of the frame position is obtained from converting the measured time into the distance from the start position, using the constant velocity of the frame movement of v x = v y = (1.65 ± 0.02) mm/s.
The measured beam profile constitutes half of an inverted Gaussian when the beam itself has a Gaussian profile [80]. Assuming no coupling in the machine (see Sec. V A), a scraper moving along x (or y) direction removes only those particles from the (x, x ) (or (y, y )) phase space for which the betatron amplitudes are larger than the distance from the beam center to the edge of the scraper (see Fig. 1

of Ref. [65]).
A cooled and stored beam exhibits a two-dimensional Gaussian distribution in transverse phase space where the density distribution of the betatron amplitude ρ β in e.g., the (x, x ) plane [80,81] is given by The measured beam intensity as a function of frame position can be written as [65], Here I 0 is the beam intensity with the frame in nominal position, µ x is the beam center, and σ x describes the beam width in x-direction. Because the beam intensity decreases exponentially before intercepting the frame, the following function was fitted to the measured beam intensity dependence, shown in Fig. 17, in order to determine σ x and σ y by the same procedure. Although with coupling or dispersion at the frame position, the functional form is more complicated [82], good agreement with the data was achieved using Eq. (27). The beam widths were determined for all three frames of the scraper system with the D = 0 setting (see Sec. II A) at T p = 45 MeV. Horizontally, the frames could be moved in positive and negative direction, while the vertical measurements were only feasible by moving the frames upward, because in case of the downward movement the beam could not be completely removed due to space limitation.
The beam width 2σ x and 2σ y for each frame were determined by averaging the results of two independent measurements. In case of the horizontal measurement 2σ x additionally includes averaging the results from both x-direction measurements. The results are listed in Table IV. Unfortunately, the vertical measurement at the target center (s = 0 mm) showed distortions that made the result inconsistent. The measurements confirm that the beam width 2σ x is smallest at the cell center and as expected, knowing the β-functions, increases symmetrically toward the up-and downstream ends of the storage cell. The appropriate β-functions at the location of each frame were obtained from the validated MAD model (see Sec. VI) and are given in Table IV. The averaged horizontal and vertical beam widths are 2σ x = 1.03 ± 0.01 mm and 2σ y = 0.67 ± 0.02 mm. In terms of these beam widths, the walls of the storage cell (r cell = 4.8 mm) are at least ten standard deviations away from the center of the beam.

B. Determination of the beam emittance
The values of the β-functions allow one to determine the 2σ beam emittance for each measurement from Eq. (15). Weighted averaging of the resulting three horizontal emittances yields and of the two vertical emittances yields The given uncertainties arise from the uncertainty of the frame velocity, the statistical errors of the fit, and the estimated uncertainty of 10% on the β-functions, given in Table IV.
C. Determination of Ax, Ay, and Θacc at the target The acceptance of a storage ring is defined in Eq. (6). At every point in the ring, the acceptance A x,y corresponds to a (horizontal and vertical) phase-space ellipse [72]. When at some point along the orbit, a restriction (frame) is moved into the machine acceptance, e.g., in horizontal (x) direction, the maximum (x, x ) phase-space ellipse, representing the machine acceptance at that location, is intercepted, and accordingly the beam lifetime is reduced (see Fig. 18). Every particle orbits on an individual phase-space ellipses in (x, x ) and (y, y ), and all ellipses at a specific location in the ring have the same shape [76]. While the insertion of the frame presents initially only a limitation of the x coordinate, because of the betatron motion, also the x coordinate is affected. Therefore, measuring the beam lifetime as function of the frame position was employed to determine the machine acceptance and the acceptance angle at the target.
The total beam lifetime due to single Coulomb scattering is found to be (see Eqs. (9) and (7)) [46], where c is a constant during the measurement, β x and β y are the average horizontal and vertical β-functions along the ring, and the x-and y-acceptance is either given by the ring acceptance A ring x,y or the acceptance defined by the frame position A frame x,y = a 2 x,y /β x,y (see Eq. (6)), whichever is smaller. Here a x,y are the distances of the restriction to the beam center and β x,y are the β-functions at the location of the frame.
In the following, the acceptance measurement in xdirection is exemplified (see Fig. 19). The measurement begins with the frame horizontally and vertically centered on the beam (x = 0). During the horizontal movement of the frame A y is constant. As long as the frame does not limit the machine acceptance (|x| ≤ |x 2 |), the beam lifetime is not affected (part III in Fig. 19). When the frame moves into the machine acceptance (|x 2 | ≤ |x| ≤ |x 1 |), A x and therefore the beam lifetime become smaller (parts II and IV). Reaching a position of |x| ≥ |x 1 | the measured beam lifetime vanishes (parts I and V). Theoretically, the beam lifetime should vanish to zero, when the frame reaches the center of the beam, corresponding to a position of |x| = w x /2, where w x is the measured frame width (see Sec. IV D). Based on these considerations the following fit function, using Eq. (30), is formulated, y , x 1 , and x 2 are fit parameters. The machine acceptance is determined from the distance between x 2 and the beam center by The offset of the beam with respect to the center of the frame can be determined with a typical uncertainty of 0.1 mm. For clarity, the offset parameter has been omitted in Eq. (31), but is taken into account in the actual fitting function. Monte-Carlo simulations of an acceptance measurement using realistic phase-space distributions at the PAX target position showed good agreement between simulated data and the fit function (Eq. (31)) for typical beam sizes at the target (see Sec. VII A).
The acceptance measurements with the movable frame system (see Sec. IV D, Fig. 9) were carried out for all four edges of each of the three rectangular frames. Moving each frame individually into the machine acceptance, while recording the beam lifetime, allowed one to determine the machine acceptance angles at the entrance of the storage cell (s = −200 mm), at the center (s = 0 mm), and at the exit (s = +200 mm). A measurement carried out in the presence of the ANKE cluster target (see Sec. IV G) showed good agreement of the resulting acceptances.
The acquired dataset enabled a precise determination of the machine acceptance, the acceptance angle in horizontal and vertical direction, and of the total acceptance angle Θ acc (Eq. 7) at the target. During the measurements the beam intensity was in the range of (7.5 − 10) · 10 9 circulating unpolarized cooled protons at injection energy of 45 MeV, with the PAX low-β section switched on and the initial beam lifetime of about 3700 s.
During injection the frame was horizontally and vertically centered on the beam. After injection and cooling, the frame was moved in horizontal (vertical) direction and the resulting beam lifetime was recorded. An example of a measurement with frame 1, located at the target center, is shown in Fig. 20. The uncertainties of the beam lifetimes τ b are of the order of 100 s, chosen to yield reduced χ 2 of approximately unity for the fits.
All fits indicate that the beam lifetime actually vanishes before the frame edge intercepts the beam center.  This is equivalent to stating that the observed width at the base (τ b = 0) is smaller than the frame width (see Sec. IV D), thus |x 1 | + δ x = w x /2 and |y 1 | + δ y = w y /2 (see Fig. 20), where the discrepancy δ x (δ y ) is of the order of 1.0 ± 0.1 mm (0.5 ± 0.1 mm). Possibly, small beam oscillations of unknown origin are responsible for this observation. It should be noted that the approach of measuring the machine acceptance with a rectangular frame is sensitive to such effects, while this is not the case for a single-sided scraper measurement. Therefore, in the latter case, the machine acceptance might be underestimated.
The results for A x , A y , Θ x , Θ y , and Θ acc using Eqs. (6) and (7) are listed in Table V. The total acceptance angle at the target position amounts to Θ acc = (6.45 ± 0.27) mrad .
The given uncertainty includes the error of the fit as well as an estimated 10% uncertainty of the β-functions.
The determined horizontal and vertical machine acceptances of A x = 31.2 ± 2.5 µm and A y = 15.7 ± 1.8 µm (see Table V) are significantly smaller than the simple geometrical acceptances estimated from the standard COSY lattice and the dimensions of the beam pipe (see Sec. II B). This is the case, because the beam lifetime is likewise impaired by dynamic effects through processes that act on long time scales, caused by nonlinear external fields [83]. Therefore, by the presented method one determines the relevant machine acceptance for spin-filtering experiments.

VIII. BEAM LIFETIME OPTIMIZATION
This section describes further machine investigations carried out at COSY aiming at an enlargement of the beam lifetime toward τ b ≈ 10000 s, necessary to determine the spin-dependent cross sectionσ 1 of the polarization build-up during a few weeks of beam time. The starting point of the optimization is marked by a beam lifetime of τ b = 800 s, reached in 2007 for an electron cooled proton beam at injection energy without target [68].
Different processes contribute to the beam lifetime, such as betatron resonances, the Coulomb interaction with the residual gas and the target, intrabeam scattering, and hadronic interactions. Particle loss due to betatron resonances can be minimized by the choice of a suitable working point, also required for the commis-sioning of the low-β insertion (see Sec. V A). Coulomb interactions on the target and the residual gas comprise • energy loss, causing particle losses at the longitudinal acceptance, • emittance growth due to multiple small-angle scattering, causing losses at the transverse acceptance, and • immediate loss of ions in a single collision where the scattering angle is larger than the transverse acceptance angle of the machine.
Energy loss and emittance growth can to a large extent be compensated by electron cooling (see Sec. II A). The beam lifetime due to single Coulomb losses was improved by the closed orbit correction procedure (see Sec. V B).
Investigations of beam lifetime restrictions caused by space-charge effects are discussed here in Sec. VIII A, while the contributions to the beam lifetime from the residual gas in the machine and from the target are elucidated in Sec. VIII B.

A. Space-charge effects
When a machine is optimized for maximum beam lifetimes, space-charge effects as fundamental collective processes in beams of high intensity usually have to be considered. In the presence of electron cooling, where small emittances are achieved, space-charge effects are, however, already visible at low beam intensities.
Studying space-charge effects and their impact on particle losses implies studying the effect of the beam emittance on the beam lifetime. For a constant beam intensity the space charge decreases with increasing beam emittance. The manipulation of the beam emittance was achieved by decreasing the cooling performance of the electron cooler. Both the horizontal and vertical electron beam steerers at the drift solenoids of the cooler were used to tilt the electron beam relative to the proton beam, whereby the cooling force was reduced.
The beam emittance was determined using the ionization profile monitor (IPM) (Sec. IV E), located in one of the COSY arcs. The detected beam profiles, shown in Fig. 10, were fitted by a Gaussian, providing the beam widths. In Fig. 21 the expansion of the beam size is illustrated. The beam was completely cooled to widths of about 2σ x = 3.2 mm (continuous red line) and 2σ y = 2.0 mm (dashed blue line) and then expanded to a larger equilibrium beam size by tilting the electron beam.
Using the appropriate β-functions from the MAD model at the location of the IPM (β x = 12.6 m and β y = 9.6 m), allows one to determine the 2σ beam emittance x and y using Eq. (15). The obtained beam lifetimes are plotted in Fig. 22 (blue symbols) vs the fourdimensional beam emittance [84] (see footnote 11 ) where it should be noted that the actual definition of the combined beam emittance is of minor importance. The beam lifetime increased with increasing beam emittance and an improvement from τ b = 6300 s to 9200 s was achieved. For emittances > 3 µm 2 , corresponding to electron beam tilt angles of ≥ 0.3 mrad, the cooling performance was very poor, therefore, two data points were omitted from the analysis.
In the following we discuss the observed increase of the beam lifetime with increasing beam emittance in terms of tune shifts. The Coulomb force between charged particles in a beam causes repulsion, which leads to defocusing in both transverse planes and therefore to a reduction of the tune Q.
For a non-uniform charge distribution, the defocusing space-charge force is not linear with respect to the transverse coordinates. Therefore, each individual particle experiences a different tune shift. This betatron amplitude-dependent detuning, called tune spread, represents a certain area in the tune diagram. Assuming a Gaussian beam distribution, the incoherent tune shifts of the central particles in the beam, i.e., the maximal tune shifts, in the horizontal and vertical phase-space are described by [85] ∆Q inc x,y = − Here r 0 is the classical proton radius, N is the number of particles in the accelerator, β L and γ L are the Lorentz factors, x,y denote the horizontal and vertical emittances, respectively, and B f is the bunching factor. For an unbunched beam as used in the experiment B f = 1. The form factor F x,y , which can be derived from Lasletts image coefficients for incoherent tune shifts [86], was set to unity because the beam energy is small.
The tune measurement technique at COSY, based on the excitation of coherent transverse oscillations of the beam (see Sec. V A), however, is insensitive to incoherent tune shifts. The calculated incoherent tune shift |∆Q inc x,y | decreases with increasing beam emittance (Eq. (35)), the associated area in the tune diagram shrinks, fewer betatron resonances are excited, and therefore the observed beam lifetime increases. This theoretical consideration is consistent with the results shown in Fig. 22. For the smallest achieved beam emittances of about = 0.2 µm 2 , the maximum tune shift amounts to |∆Q inc x,y | ≈ 0.1, thus with a nominal tune of Q x,y = 3.6 strong second-order betatron resonances at Q x,y = 3.5 are intercepted.

B. Contributions from vacuum to beam lifetime
In this section, the different contributions to the beam lifetime from the machine vacuum and the PAX target are discussed. In order to minimize the beam losses due to the gas load from the ABS in the PAX target chamber and the adjacent up-and downstream sections, a dedicated vacuum system (see Sec. III C) was implemented.
The contributions to the total beam lifetime can be written as where τ cell denotes the single-scattering losses in the storage cell, τ lowβ the ones from the gas load elsewhere inside the low-β section, and τ ring is the contribution from the ring, independent of whether the PAX target was on or off. After setting up the proton beam at T p = 49.3 MeV (described in Sec. IX), a maximal beam lifetime of τ ring ≈ 12000 s was achieved without gas feed to the storage cell of the target setup. When the gas feeding was switched on, typical total beam lifetimes of about τ b ≈ 8000 s were routinely provided during the spin-filtering experiments (see Fig. 23).
The beam lifetime from single-scattering losses at the target, caused by those mechanisms that cannot be compensated by electron cooling, i.e., hadronic (σ 0 ) and single Coulomb scattering (σ C ), is given by where f ≈ 508 kHz denotes the revolution frequency. The total hadronic cross section σ 0 = 59.8 mb was extracted from the SAID database [87], and the Coulomb loss cross section (Eq. (8)) was determined from the machine acceptance angle at the target, Θ acc = 6.45 ± 0.27 mrad (see Table V), yielding σ C = 677.6 mb. The resulting beam lifetime from Eq. (37) yields τ cell = 48500 s with d t = 5.5 · 10 13 cm −2 (Eq. (14)). The contribution from single-scattering loss outside the The goal of the machine development was to provide a routine to set up COSY for the spin-filtering experiments. This routine (see Sec. IX A) and the measurement cycles (see Sec. IX B) are described below. Major requirements for the experiment were beam intensities of about 1 · 10 10 protons and long beam and polarization lifetimes. Dedicated cycles were set up to measure the beam polarization lifetime (see Sec. IX C), and the efficiency of the RF spin flipper (see Sec. IX D) that enables the application of the cross-ratio method [88] within each cycle by reversing the beam polarization.  24. Sequence of two spin-filtering cycles. During the polarization build-up the polarized internal target and the holding field were switched on, with ABS chopper open, and magnetic holding field along the y axis. The BRP was used to measure the target polarization. After spin filtering the ABS chopper was closed and the ANKE cluster target together with the ANKE DAQ were switched on to measure the proton-beam polarization. The electron-cooler current was increased to compensate for larger energy losses due to the thicker cluster target. During the measurement period the beam polarization was flipped several times to minimize systematic effects. The holding field polarity was reversed after each spin-filtering cycle. the electron cooler was increased from I e = 50 mA to 100 mA. Reversing the beam polarization during this period, utilizing the spin flipper [90], allowed one to determine the induced beam polarization within each cycle, thereby reducing systematic errors.

C. Measurement of the polarization lifetime
In order to avoid depolarization of the beam during spin filtering, the betatron tunes were set far away from depolarizing resonances [40]. These arise when the horizontal and vertical tunes, the orbit frequency, and the synchrotron frequency, or combinations thereof, are synchronous with the spin tune. The spin tune ν s , the number of precessions of the spin vector around the vertical axis per beam revolution in the ring, is defined as where G = 5.585 694713 (46) [91] is the proton anomalous magnetic moment, and γ L the Lorentz factor. In a strong focusing synchrotron like COSY, two different types of first-order spin resonances are excited. Imperfection resonances are caused by magnetic field errors and misalignments of the magnets, for which the condition is given by γ L G = k, with k ∈ N. Intrinsic resonances are excited by horizontal fields due to vertical focusing. For these the condition is given by γ L G = kP ±Q y , where P is the super-periodicity of the lattice, and Q y the vertical tune. Higher-order resonances can depolarize a stored beam as well, when the condition ν s = k ± lQ x ± mQ y , with k, l, m ∈ Z is fulfilled.
The polarisation lifetime τ P was measured in order to assess its effect on the final beam polarization after spin filtering. Fig. 25 shows schematically the cycle setup. The beam was injected into COSY and accelerated to T p = 49.3 MeV exactly in the same way as for the spinfiltering cycle, the only difference being that a polarized beam with P ≈ 0.75 was injected, provided by the polarized ion source of COSY (see Sec. II). The initial beam polarization P i was determined during a time period of t 1 = 300 s using the beam polarimeter at the ANKE target place (see Sec. IV G). Subsequently, the cluster tar- get was switched off for t 2 = 5000 s in order to minimize beam losses. The measurement of the final polarization P f lasted for t 3 = 940 s. The durations of the measurement periods were optimized to yield the smallest relative errors in τ P and to reach equal statistical errors of the beam polarization during both sequences. The beam polarization lifetime was determined by evaluating where the initial and the final beam polarizations were averaged over the measurement periods t 1 and t 3 , respectively. Taking these measurement periods into account, the time difference between both polarization measurements is given by ∆t = t 2 + t 1 + t 3 = 5496 s, where t 1 and t 3 account for the exponential decrease of the event rate within each measurement period. With P i = 0.746 ± 0.003 and P f = 0.731 ± 0.003 [92], the determination of the polarization lifetime yielded τ P = (2.7 ± 0.8) · 10 5 s .
Therefore, the polarization losses during the spin-filtering experiments with filter times of t filter = 12000 s and 16000 s did not exceed 6%.

D. Efficiency of RF spin flipper
During the polarization measurement period at the end of each filtering cycle, the beam polarization was flipped several times to enable the determination of the beam polarization within each cycle using the cross-ratio method [88], whereby systematic errors are cancelled to first order. The spin flips were generated using a so-called Froissart-Stora frequency sweep induced with an RF solenoid [90,93]. The RF frequency was swept over the precession frequency of the proton spin and flips the spin resonantly at the frequency f RF = f 0 · (γ L G ± k), which yielded for k = −4, f RF = 0.9615 MHz. The frequency ramp from 0.9605 MHz to 0.9625 MHz was carried out in 2.5 s, therefore the effect on the duty cycle was negligible.
The spin flip efficiency, where P i,f are the initial and final polarizations, was determined in order to be able to correct for polarization losses and to adjust the number of flips n flip within the measurement period. The dedicated cycle to determine the spin-flip efficiency, shown schematically in Fig. 26, yielded the smallest relative error in ε flip . It begins with the injection and acceleration of a polarized proton beam to T p = 49.3 MeV, followed by a polarization measurement lasting for about 50 s. Subsequently, the cluster target was switched off and n flip = 99 spin flips were performed within a time period of 300 s. Finally, the beam polarization was measured again for about 100 s. The measurements of ε flip during the experiment phase, each lasting for about two hours, yielded ε flip = 0.9872 ± 0.0001 .
During the initial spin-filtering measurements the number of spin flips was two. Thus, the polarization loss due to the spin-flipper never exceeded 3%.

X. CONCLUSION
In this paper we present the machine development for the spin-filtering experiments carried out at COSY [28]. The prime objective was to provide a long beam lifetime in the presence of a polarized hydrogen gas target. To this end a dedicated low-β section consisting of two quadrupole doublets was implemented at the PAX target place. The optimization of the beam lifetime included the search for optimal working points, closed orbit corrections, optimization of electron cooling, and the minimization of the β-functions at the PAX target.
The low-β insertion lead to β-functions of (β x , β y ) = (0.31 ± 0.03 m, 0.46 ± 0.05 m) at the center of the polarized storage cell target, presenting a reduction of about a factor of ten compared to the situation before. Hence, single Coulomb scattering as the dominating loss mechanism for cooled beams was reduced by the same factor. In addition, this allowed us to use a narrow storage cell of diameter d = 9.6 mm and length l = 400 mm with a areal target-gas density of d t = (5.5 ± 0.2) · 10 13 atoms/cm 2 .
Special care of the vacuum conditions in and around the target chamber was taken through the installation of a sophisticated pumping system together with flow limiters at the entrance and exit of the chamber. The beam lifetime caused by the target region with an injected gas flow of 3.3 · 10 16H /s contributed by only one third to the total beam lifetime of τ b = 8000 s, while the contribution of the machine itself was twice as large.
In order to improve the systematics of the spin-filtering experiment, an RF spin flipper was utilized to reverse the polarization of the stored beam after spin filtering.
The spin-flip efficiency determined in dedicated cycles amounted to ε flip = 0.9872 ± 0.0001, and the polarization loss due to the spin-flipper never exceeded 3%. In addition, the polarization lifetime was determined in dedicated cycles, yielding τ P = (2.7 ± 0.8) · 10 5 s, thus for the spin-filtering experiments at COSY with spin-filtering times of t filter = 12000 s and 16000 s, the polarization loss due to a finite polarization lifetime did not exceed 6%.
The interplay of the investigations presented in this paper fulfilled the demanding beam conditions for the first spin-filtering experiment at COSY. The presented results comprise a recipe about how to set up a beam for spin-filtering experiments in a storage ring, directly applicable for the anticipated spin-filtering studies with antiprotons at the AD of CERN [27].