LDMX Software
ecal::MyClusterWeight Class Reference

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

#include <MyClusterWeight.h>

Public Types

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

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 Ecal 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 ecal::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
36 double rmol = 10.00;
37 // Characteristic cluster longitudinal variable in mm
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 double dij_t = std::sqrt(std::pow(a_x - b_x, 2) + std::pow(a_y - b_y, 2));
58
59 double weight_t = std::exp(std::pow(dij_t / rmol, 2)) - 1;
60 double weight_z = std::exp(std::abs(dijz) / dzchar) - 1;
61
62 // Return the highest of the two weights
63 return std::max(weight_t, weight_z);
64 }

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: