Initialize COMMONS.
Loop along TPC tracks at the calorimeter face.
Loops along ECAL and HCAL hits to select and collect hits at the two cell distances from predicted helix for ECAL and three cell distances for HCAL.
Hits analysis along the track.
The case when it was not found any hits around the core (at the first shell), the core energy is less then input energy and the input energy is more then 5 GeV. Such a case has unknown nature and core cluster is voluntary replaced with exact energy if it is less then 3 GeV.
Next case: the energy collected at the first shell plus track core is in range around input energy. All hits are getting the hard assignment to this track.
Next case is the hypothesis when the hadron track has a MIP in every layer of ECAL (track has no hadron interaction in ECAL), then energy has to be in range. It has to be exactly muon-like energy deposition in ECAL with almost all energy deposition in HCAL. All hits are getting the hard assignment to this track.
If a new ECAL hit collection energy is less then 0.8 of ECAL-MIP (= 1 GeV for now, taking into account the Landau tail) or no one ECAL hit was added. This means that the track was alone, there is not any gamma shower around it and three electronic cell sizes around helix is enough to collect all HCAL energy. Then energy has to be in range. All hits are getting the hard assignment to this track.
Next TPC tracks at the calorimeter face.