LDMX Software
hcal::MyClusterWeight Class Reference

Computes the weight (distance) between two Hcal clusters. More...

#include <MyClusterWeight.h>

Public Types

using ClusterType = recon::WorkingCluster<ldmx::HcalHit>
 

Public Member Functions

double operator() (const ClusterType &a, const ClusterType &b)
 Compute the weight between two clusters.
 

Detailed Description

Computes the weight (distance) between two Hcal clusters.

The weight is used by TemplatedClusterFinder to decide which clusters to merge. Smaller weights indicate clusters that should be merged first. The weight is based on both transverse and longitudinal separation.

Definition at line 23 of file MyClusterWeight.h.

Member Typedef Documentation

◆ ClusterType

Member Function Documentation

◆ operator()()

double hcal::MyClusterWeight::operator() ( const ClusterType & a,
const ClusterType & b )
inline

Compute the weight between two clusters.

Parameters
aFirst cluster
bSecond cluster
Returns
Weight value (smaller = should merge first)

Definition at line 34 of file MyClusterWeight.h.

34 {
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 }

References recon::WorkingCluster< HitType >::centroidX(), recon::WorkingCluster< HitType >::centroidY(), recon::WorkingCluster< HitType >::centroidZ(), and recon::WorkingCluster< HitType >::energy().


The documentation for this class was generated from the following file: