File indexing completed on 2025-12-19 09:15:56
0001 #ifndef STREAK_ANALYZER_H
0002 #define STREAK_ANALYZER_H
0003
0004 #include <phool/PHCompositeNode.h>
0005 #include <phool/getClass.h>
0006
0007 #include <TMath.h>
0008 #include <string>
0009 #include <vector>
0010 #include <cmath>
0011
0012 namespace streak {
0013
0014 struct Config {
0015
0016 std::string photon_node = "PHOTONCLUSTER_CEMC";
0017 std::vector<std::string> jet_nodes = {
0018
0019 "AntiKt_unsubtracted_r04",
0020 };
0021
0022
0023
0024
0025 float et_min = 10.0f;
0026 float weta_min = 0.7f;
0027
0028
0029 bool apply_dijet_veto = true;
0030 float jet_pt_min = 10.0f;
0031 float back_to_back_min_dphi = TMath::Pi()/2;
0032
0033 bool verbose = false;
0034 };
0035
0036 class StreakAnalyzer {
0037 public:
0038 explicit StreakAnalyzer(const Config& cfg = Config()) : m_cfg(cfg) {}
0039 bool isStreakEvent(PHCompositeNode* topNode, std::string* why = nullptr) const;
0040
0041 private:
0042 Config m_cfg;
0043
0044
0045 static inline float dphi_abs(float a, float b) {
0046 float d = a - b;
0047 while (d > TMath::Pi()) d -= 2.f*TMath::Pi();
0048 while (d <= -TMath::Pi()) d += 2.f*TMath::Pi();
0049 return std::fabs(d);
0050 }
0051
0052
0053 bool pass_cluster_selection(PHCompositeNode* topNode, std::string* why) const;
0054 bool pass_dijet_veto(PHCompositeNode* topNode, std::string* why) const;
0055 };
0056
0057
0058
0059
0060 inline bool isStreakEvent(PHCompositeNode* topNode, const Config& cfg = Config(), std::string* why = nullptr) {
0061 return StreakAnalyzer(cfg).isStreakEvent(topNode, why);
0062 }
0063
0064 }
0065
0066 #endif