Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2026-08-30 08:14:26

0001 #ifndef TPCCALIB_STRIPEMATCHING_HELPERS_H
0002 #define TPCCALIB_STRIPEMATCHING_HELPERS_H
0003 
0004 #include "StripeMatchingTypes.h"
0005 
0006 #include <array>
0007 #include <utility>
0008 #include <vector>
0009 
0010 class TFile;
0011 class TH2;
0012 class TObject;
0013 
0014 // Keep a phi difference inside [-pi, pi].
0015 double wrap_delta_phi(double dphi);
0016 
0017 // Distance in the local (R, R*dphi) plane.
0018 double distance_Rdphi(double phi1, double r1, double phi2, double r2);
0019 
0020 // Median and MAD helpers for robust fit scales.
0021 double median_value(std::vector<double> values);
0022 double robust_mad_sigma(const std::vector<double> &values, double fallback);
0023 
0024 // ROOT object and histogram helpers.
0025 void safe_write_object(TObject *obj);
0026 TH2 *load_detached_histogram(TFile *file, const char *histogram_name);
0027 
0028 // Removes stripe candidates with too few nearby neighbors.
0029 void filter_isolated_stripes(const std::vector<std::array<double, 3>> &input, std::vector<std::array<double, 3>> &output);
0030 
0031 // Returns {cleaned histogram, radial gap centers}.
0032 std::pair<TH2 *, std::vector<double>> clean_laminations(TH2 *histogram);
0033 
0034 #endif