File indexing completed on 2025-08-05 08:16:26
0001 #ifndef RAWCLUSTERCNNCLASSIFIER_H
0002 #define RAWCLUSTERCNNCLASSIFIER_H
0003
0004 #include <fun4all/SubsysReco.h>
0005
0006 #include <phool/onnxlib.h>
0007
0008 class PHCompositeNode;
0009 class RawClusterContainer;
0010
0011 class RawClusterCNNClassifier : public SubsysReco
0012 {
0013 public:
0014 RawClusterCNNClassifier(const std::string &name = "RawClusterCNNClassifier");
0015
0016 ~RawClusterCNNClassifier() override;
0017
0018 int Init(PHCompositeNode *topNode) override;
0019
0020 int process_event(PHCompositeNode *topNode) override;
0021
0022 int End(PHCompositeNode *topNode) override;
0023
0024 void Print(const std::string &what = "ALL") const override;
0025
0026 void set_modelPath(const std::string &modelPath) { m_modelPath = modelPath; }
0027
0028 void set_inputNodeName(const std::string &inputNodeName) { m_inputNodeName = inputNodeName; }
0029
0030 void set_outputNodeName(const std::string &outputNodeName) { m_outputNodeName = outputNodeName; }
0031
0032 void set_towerNodeName(const std::string &towerNodeName) { m_towerNodeName = towerNodeName; }
0033
0034 void set_min_cluster_e(const float min_cluster_e) { m_min_cluster_e = min_cluster_e; }
0035
0036 private:
0037 Ort::Session *onnxmodule{nullptr};
0038 const int inputDimx{5};
0039 const int inputDimy{5};
0040 const int inputDimz{1};
0041 const int outputDim{1};
0042
0043 const float minET{3};
0044
0045 std::string m_modelPath{"/sphenix/u/shuhang98/core_patch/coresoftware/offline/packages/CaloReco/functional_model.onnx"};
0046
0047 std::string m_inputNodeName{"CLUSTERINFO_CEMC"};
0048 std::string m_outputNodeName{"CLUSTERINFO_CEMC_CNN"};
0049 std::string m_towerNodeName{"TOWERINFO_CALIB_CEMC"};
0050
0051 bool inplace{false};
0052
0053 RawClusterContainer *_clusters{nullptr};
0054
0055 float m_min_cluster_e{3};
0056
0057 void CreateNodes(PHCompositeNode* topNode);
0058
0059
0060 };
0061
0062 #endif