2026-07-072026-07-07http://salesiana.dossiersoluciones.com/handle/123456789/200921We suggest a method which improves the precision of studies of the primary composition of ultra-high-energy cosmic rays. Two principal ingredients of the method are (1) comparison of the observed and simulated parameters for individual showers, without averaging over arrival directions and (2) event-by-event selection of simulated showers by the physical observables and not by the reconstructed primary parameters. A detailed description of the algorithm is presented and illustrated by several examples.27 pages, 6 figures; v2: 30 pages, journal versionAstrophysicsTowards event-by-event studies of the ultrahigh-energy cosmic-ray compositiontext