LDMX Software
MyClusterWeight.h
Go to the documentation of this file.
1
5#ifndef HCAL_MYCLUSTERWEIGHT_H_
6#define HCAL_MYCLUSTERWEIGHT_H_
7
8#include <cmath>
9
10#include "Hcal/Event/HcalHit.h"
12
13namespace hcal {
14
24 public:
26
34 double operator()(const ClusterType& a, const ClusterType& b) {
35 // Moliere radius of detector, roughly. In mm (TODO: tune for Hcal)
36 double rmol = 10.00;
37 // Lateral shower development in mm (TODO: tune for Hcal)
38 double dzchar = 100.0;
39
40 double a_e = a.energy();
41 double a_x = a.centroidX();
42 double a_y = a.centroidY();
43 double a_z = a.centroidZ();
44
45 double b_e = b.energy();
46 double b_x = b.centroidX();
47 double b_y = b.centroidY();
48 double b_z = b.centroidZ();
49
50 double dijz;
51 if (a_e >= b_e) {
52 dijz = b_z - a_z;
53 } else {
54 dijz = a_z - b_z;
55 }
56
57 // Transverse difference
58 double dij_t = std::sqrt(std::pow(a_x - b_x, 2) + std::pow(a_y - b_y, 2));
59
60 // Transverse weight
61 double weight_t = std::exp(std::pow(dij_t / rmol, 2)) - 1;
62 // Longitudinal weight
63 double weight_z = std::exp(std::abs(dijz) / dzchar) - 1;
64
65 // Return the highest of the two weights
66 return std::max(weight_t, weight_z);
67 }
68};
69
70} // namespace hcal
71
72#endif // HCAL_MYCLUSTERWEIGHT_H_
Class that stores Stores reconstructed hit information from the HCAL.
In-memory tool for working on clusters during reconstruction.
Computes the weight (distance) between two Hcal clusters.
double operator()(const ClusterType &a, const ClusterType &b)
Compute the weight between two clusters.
An in-memory representation of a cluster being built during reconstruction.
double centroidY() const
Get the centroid Y position (energy-weighted).
double centroidX() const
Get the centroid X position (energy-weighted).
double centroidZ() const
Get the centroid Z position (energy-weighted).
double energy() const
Get the total energy of the cluster.