34 def calculate_charges_and_path_lengths_for_one_type(clusters, mc_particle):
35 """Return lists of charges and path lengths for the clusters associated with an MCParticle"""
36 charge_list = []
37 path_length_list = []
38
40
41 momentum = mc_particle.getMomentum()
42 position = mc_particle.getProductionVertex()
43 charge = mc_particle.getCharge()
45 helix =
Belle2.Helix(position, momentum, charge, b_field)
46
47 for cluster in clusters:
48
49 calibrated_charge = tools.getCalibratedCharge(cluster)
50 path_length = tools.getPathLength(cluster, helix)
51
52 charge_list.append(calibrated_charge)
53 path_length_list.append(path_length)
54
55 return charge_list, path_length_list, list(np.divide(charge_list, path_length_list))
56
static void getField(const double *pos, double *field)
return the magnetic field at a given position.