This thesis presents a search for a heavy scalar and a heavy pseudoscalar Higgs boson decaying into a top quark and a top antiquark. The used data was collected by the CMS experiment at the LHC at an energy of √s=13 TeV during 2016, 2017 and 2018 corresponding to an integrated luminosity of 138 fb⁻¹. The Higgs bosons are electrically neutral, have masses ranging from 400 GeV up to 1000 GeV and the top quarks, into which the Higgs bosons decay, are assumed to further decay dileptonically. The invariant mass of the top quarks together with two spin correlation observables are obtained from the full reconstruction of the two top four-momenta. The reconstruction has a resolution of around 25 % on the invariant mass. The obtained constraints on the coupling strength between the Higgs bosons and the top quarks depend on the Higgs boson mass and exclude coupling modifiers above the range 1.1 to 2.0 for the scalar boson and 0.95 to 1.5 for the pseudoscalar boson.The limited resolution of the reconstruction is improved by a novel neural-network-based approach fully replacing the classic approach. The network is trained on SM data and specifically crafted data, devoid of assumptions from an underlying model. The network is seen to reach a resolution of around 15 % on the invariant mass, almost twice as good as the classic approach. It is shown that the crafted data training improves performance over a broad mass spectrum, where SM events are not prominent.Furthermore, the thesis includes a detailed overview of the upgrade and commissioning of the Fast Beam Condition Monitor of the CMS detector, measuring luminosity and beam-induced background. The commissioning was finalized in 2022 together with the startup of the LHC. Its first results are shown. The luminosity measurement is expected to be used in future analyses of many years to follow.