File indexing completed on 2026-05-23 08:13:54
0001
0002
0003 #ifndef EMCALSHOWERSHAPES_H
0004 #define EMCALSHOWERSHAPES_H
0005
0006 #include "JetQADefs.h"
0007
0008 #include <fun4all/SubsysReco.h>
0009
0010 #include <limits>
0011 #include <string>
0012
0013 class Fun4AllHistoManager;
0014 class PHCompositeNode;
0015 class RawCluster;
0016 class RawTowerGeom;
0017 class RawTowerGeomContainer;
0018 class TH1;
0019 class TH2;
0020 class TowerInfoContainer;
0021 class TriggerAnalyzer;
0022
0023 class EMCalShowerShapes : public SubsysReco
0024 {
0025 public:
0026 EMCalShowerShapes(const std::string &modulename = "EMCalShowerShapes", const std::string &inputnode = "CLUSTERINFO_CEMC", const std::string &histtag = "");
0027 ~EMCalShowerShapes() override;
0028
0029 int Init(PHCompositeNode *topNode) override;
0030 int InitRun(PHCompositeNode *topNode) override;
0031 int process_event(PHCompositeNode *topNode) override;
0032
0033
0034
0035
0036 void Print(const std::string &what = "ALL") const override;
0037
0038 void SetTrgToSelect(const uint32_t trig = JetQADefs::GL1::MBDNSPhoton1)
0039 {
0040 m_doTrgSelect = true;
0041 m_trgToSelect = trig;
0042 }
0043
0044 void SetHistTag(const std::string& tag)
0045 {
0046 m_histtag = tag;
0047 }
0048
0049 void SetApplyMbdZvtxCut(const bool apply)
0050 {
0051 m_doMbdZvtxCut = apply;
0052 }
0053
0054 void SetMbdZvtxMax(const float maxz)
0055 {
0056 m_mbdZvtxMax = maxz;
0057 }
0058
0059 void SetApplyClusterEtaCut(const bool apply)
0060 {
0061 m_doClusterEtaCut = apply;
0062 }
0063
0064 void SetApplyClusterETCut(const bool apply)
0065 {
0066 m_doClusterETCut = apply;
0067 }
0068
0069 void SetClusterEtaMax(const float maxeta)
0070 {
0071 m_clusterEtaMax = maxeta;
0072 }
0073
0074 private:
0075 struct ShowerShapeData
0076 {
0077 float e11 {std::numeric_limits<float>::quiet_NaN()};
0078 float e33 {std::numeric_limits<float>::quiet_NaN()};
0079 float e55 {std::numeric_limits<float>::quiet_NaN()};
0080 float e77 {std::numeric_limits<float>::quiet_NaN()};
0081 float e32 {std::numeric_limits<float>::quiet_NaN()};
0082 float e35 {std::numeric_limits<float>::quiet_NaN()};
0083 float weta {std::numeric_limits<float>::quiet_NaN()};
0084 float wphi {std::numeric_limits<float>::quiet_NaN()};
0085 float weta_cogx {std::numeric_limits<float>::quiet_NaN()};
0086 float wphi_cogx {std::numeric_limits<float>::quiet_NaN()};
0087 float detamax {std::numeric_limits<float>::quiet_NaN()};
0088 float dphimax {std::numeric_limits<float>::quiet_NaN()};
0089 float mean_time {std::numeric_limits<float>::quiet_NaN()};
0090 float iso04_emcal {std::numeric_limits<float>::quiet_NaN()};
0091 };
0092
0093 bool LoadEMCalNodes(PHCompositeNode *topNode);
0094 float GetVertexZ(PHCompositeNode *topNode) const;
0095 bool CalculateShowerShapes(RawCluster* cluster, float cluster_eta, float cluster_phi, float cluster_et, float vertex_z, ShowerShapeData& data) const;
0096 double GetTowerEta(RawTowerGeom* tower_geom, double vx, double vy, double vz) const;
0097 double DeltaR(double eta1, double phi1, double eta2, double phi2) const;
0098 float CalculateLayerET(float seed_eta, float seed_phi, float radius, TowerInfoContainer* towerContainer, RawTowerGeomContainer* geomContainer, float vertex_z) const;
0099
0100 TriggerAnalyzer* m_analyzer {nullptr};
0101 Fun4AllHistoManager* m_manager {nullptr};
0102 TowerInfoContainer* m_emc_tower_container {nullptr};
0103 RawTowerGeomContainer* m_geomEM {nullptr};
0104 std::string m_modulename;
0105 std::string m_inputnode;
0106 std::string m_histtag;
0107 uint32_t m_trgToSelect;
0108 bool m_doTrgSelect;
0109 bool m_reportedMissingClusterNode {false};
0110 bool m_reportedMissingCaloNodes {false};
0111 float m_shape_min_tower_E {0.070F};
0112 bool m_doMbdZvtxCut {true};
0113 float m_mbdZvtxMax {60.0F};
0114 bool m_doClusterEtaCut {true};
0115 float m_clusterEtaMax {0.7F};
0116 bool m_doClusterETCut {true};
0117 float m_clusterETMin {5.0F};
0118
0119 TH1* h_cluster_et {nullptr};
0120 TH1* h_e11oe33 {nullptr};
0121 TH1* h_e33oe55 {nullptr};
0122 TH1* h_e55oe77 {nullptr};
0123 TH1* h_e32oe35 {nullptr};
0124 TH1* h_weta {nullptr};
0125 TH1* h_wphi {nullptr};
0126 TH1* h_weta_cogx {nullptr};
0127 TH1* h_wphi_cogx {nullptr};
0128 TH1* h_detamax {nullptr};
0129 TH1* h_dphimax {nullptr};
0130 TH1* h_mean_time {nullptr};
0131 TH1* h_iso04_emcal {nullptr};
0132 TH2* h_weta_vs_et {nullptr};
0133 TH2* h_wphi_vs_et {nullptr};
0134 };
0135
0136 #endif