Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:19:51

0001 #ifndef CALORECO_RAWCLUSTERCNNCLASSIFIER_H
0002 #define CALORECO_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   void set_modelPath(const std::string &modelPath) { m_modelPath = modelPath; }
0023 
0024   void set_inputNodeName(const std::string &inputNodeName) { m_inputNodeName = inputNodeName; }
0025 
0026   void set_outputNodeName(const std::string &outputNodeName) { m_outputNodeName = outputNodeName; }
0027 
0028   void set_towerNodeName(const std::string &towerNodeName) { m_towerNodeName = towerNodeName; }
0029 
0030   void set_min_cluster_e(const float min_cluster_e) { m_min_cluster_e = min_cluster_e; }
0031 
0032  private:
0033   void CreateNodes(PHCompositeNode* topNode);
0034 
0035   Ort::Session *onnxmodule{nullptr};
0036   const int inputDimx{5};
0037   const int inputDimy{5};
0038   const int inputDimz{1};
0039   const int outputDim{1};
0040 
0041   const float minET{3};
0042 
0043   std::string m_modelPath;//{"/sphenix/u/shuhang98/core_patch/coresoftware/offline/packages/CaloReco/functional_model.onnx"};
0044 
0045   std::string m_inputNodeName{"CLUSTERINFO_CEMC"};
0046   std::string m_outputNodeName{"CLUSTERINFO_CEMC_CNN"};
0047   std::string m_towerNodeName{"TOWERINFO_CALIB_CEMC"};
0048 
0049   bool inplace{false};
0050 
0051   RawClusterContainer *_clusters{nullptr};
0052 
0053   float m_min_cluster_e{3};
0054 
0055 };
0056 
0057 #endif