Even though the frequency of bunch crossings at the interaction point inside LHCb is 40MHz, only about 10MHz of events will have some particles from the proton-proton collision inside the acceptance of the detector.
The rate of events with all the particles from a B decay contained in LHCb corresponds to about 15kHz. However, the rate of the specific B meson decays that are interesting for physics analysis is a small fraction of that, amounting to a total of a few Hz.
The event rate that can be recorded is limited by the offline computing capacity to about 2kHz. The LHCb trigger aims to provide the highest efficiency for interesting B decays (and some control decays like those of the J/psi) within the allowed rate of 2kHz. It is organized in two levels.
1. Level Zero (L0)
The Level-0 trigger is implemented in custom electronics, and it reduces the rate to 1MHz. It makes use of the fact that particles from a B decay have a higher transverse momentum with respect to the particle beam axis (pT) than particles coming directly from the primary proton-proton interaction.
L0 makes use of those sub-detectors in which high-pT particles can be selected at the high rate required: the calorimeters and the muon system. In addition, it uses two dedicated silicon layers of the VELO to perform a simplified vertex reconstruction, which allows events with multiple proton-proton interactions to be rejected, for which it is especially difficult to reconstruct and analyze B meson decays.
2. High Level Trigger (HLT)
The HLT algorithm runs in a farm of 1000 16-core computers, and it has access to full detector information. It is divided in two sub-levels: HLT1, with an output rate of a few tens of kHz, and HLT2, which outputs the 2kHz that are recorded.
HLT1 is based on the concept of regions of interest: it confirms the high-pT L0 candidate particles with the addition of information from other detectors, using only the regions around the candidate direction when possible. In particular, information from the tracking stations and VELO is added. This allows particles to be selected according to another property that characterize particles from B decays: their high impact parameter to the proton-proton interaction vertex. This is due to the relatively long life-time of B mesons: they typically fly 1cm away from the proton-proton interaction before they decay. As soon as a candidate is not confirmed in a sub-detector, the event is discarded.
At the rate that HLT2 is executed, it is possible to run a complete reconstruction of the events, by using tracks in the VELO as seeds for the rest of the tracking. Displaced vertices away from the primary proton-proton interaction are searched for, as indications of B decays. Two types of selections are applied: inclusive and exclusive. Inclusive selections aim to collect decays of resonances which are useful for calibration and likely to have been produced in a B decay (D*, J/psi, etc). Exclusive selections are specifically designed to provide the highest possible efficiency for fully-reconstructed B decays of interest, using all available information, including the mass and vertex quality and separation for the B candidate and the intermediate resonances.