  The CALICE Semi-Digital Hadronic CALorimeter (SDHCAL) prototype using Glass
Resistive Plate Chambers as a sensitive medium is the first technological
prototype of a family of high-granularity calorimeters developed by the CALICE
collaboration to equip the experiments of future leptonic colliders. It was
exposed to beams of hadrons, electrons and muons several times in the CERN PS
and SPS beamlines between 2012 and 2018. We present here a new method of
particle identification within the SDHCAL using the Boosted Decision Trees
(BDT) method applied to the data collected in 2015. The performance of the
method is tested first with Geant4-based simulated events and then on the data
collected by the SDHCAL in the energy range between 10 and 80~GeV with 10~GeV
energy steps. The BDT method is then used to reject the electrons and muons
that contaminate the SPS hadron beams.
