LDMX Software
hcal::MyClusterWeight Class Reference

Public Member Functions

double operator() (const WorkingCluster &a, const WorkingCluster &b)
 

Detailed Description

Definition at line 11 of file MyClusterWeight.h.

Member Function Documentation

◆ operator()()

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

Definition at line 13 of file MyClusterWeight.h.

15 { // returns weighting function, where smallest
16 // weights will be combined first
17
18 double rmol = 10.00; // Moliere radius_ of detector, roughly. In mm TODO
19 double dzchar = 100.0; // lateral shower development in mm TODO
20
21 double a_e = a.centroid().E();
22 double a_x = a.centroid().Px();
23 double a_y = a.centroid().Py();
24 double a_z = a.centroid().Pz();
25
26 double b_e = b.centroid().E();
27 double b_x = b.centroid().Px();
28 double b_y = b.centroid().Py();
29 double b_z = b.centroid().Pz();
30
31 double dijz;
32 if (a_e >= b_e) {
33 // differences in Z
34 dijz = b_z - a_z;
35 } else {
36 dijz = a_z - b_z;
37 }
38
39 // Transverse Difference
40 double dij_t = pow(pow(a_x - b_x, 2) + pow(a_y - b_y, 2), 0.5);
41 // Trans --> massive
42 double weight_t = exp(pow(dij_t / rmol, 2)) - 1;
43 // Long
44 double weight_z = (exp(abs(dijz) / dzchar) - 1);
45
46 // Return the highest of the two weights
47 if (weight_t <= weight_z) {
48 return weight_z;
49 } else {
50 return weight_t;
51 }
52 }

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