File indexing completed on 2025-08-05 08:16:28
0001
0002 #ifndef CLUSTERISO_CLUSTERISO_H
0003 #define CLUSTERISO_CLUSTERISO_H
0004
0005 #include <fun4all/SubsysReco.h>
0006
0007 #include <CLHEP/Vector/ThreeVector.h>
0008
0009 #include <cmath>
0010 #include <string>
0011
0012 class PHCompositeNode;
0013 class RawTowerGeom;
0014 class TowerInfo;
0015
0016
0017
0018
0019
0020
0021
0022
0023 class ClusterIso : public SubsysReco
0024 {
0025 public:
0026
0027
0028
0029
0030 ClusterIso(const std::string&, float eTCut, int coneSize, bool do_subtracted, bool do_unsubtracted);
0031
0032 int Init(PHCompositeNode*) override;
0033 int process_event(PHCompositeNode*) override;
0034 int End(PHCompositeNode*) override;
0035
0036 void seteTCut(float x);
0037 void setConeSize(int x);
0038 float geteTCut();
0039
0040 int getConeSize();
0041 CLHEP::Hep3Vector getVertex();
0042 void set_use_towerinfo(bool usetowerinfo)
0043 {
0044 m_use_towerinfo = usetowerinfo;
0045 };
0046
0047 void set_cluster_node_name(const std::string& name)
0048 {
0049 m_cluster_node_name = name;
0050 }
0051
0052 private:
0053 double getTowerEta(RawTowerGeom* tower_geom, double vx, double vy, double vz);
0054 bool IsAcceptableTower(TowerInfo* tower);
0055 float m_eTCut{};
0056 float m_coneSize{};
0057 float m_vx;
0058 float m_vy;
0059 float m_vz;
0060 bool m_do_subtracted;
0061 bool m_do_unsubtracted;
0062 bool m_use_towerinfo = true;
0063 std::string m_cluster_node_name = "CLUSTERINFO_CEMC";
0064 };
0065
0066
0067
0068
0069
0070
0071
0072 inline float deltaR(float eta1, float eta2, float phi1, float phi2)
0073 {
0074 float deta = eta1 - eta2;
0075 float dphi = phi1 - phi2;
0076 if (dphi > M_PI) dphi -= 2 * M_PI;
0077 if (dphi < -1 * M_PI) dphi += 2 * M_PI;
0078 return sqrt(deta * deta + dphi * dphi);
0079 }
0080
0081 #endif