File indexing completed on 2025-12-16 09:19:51
0001 #ifndef CALORECO_RAWCLUSTERBUILDERTEMPLATE_H
0002 #define CALORECO_RAWCLUSTERBUILDERTEMPLATE_H
0003
0004 #include <fun4all/SubsysReco.h>
0005
0006 #include <globalvertex/GlobalVertex.h>
0007
0008 #include <string>
0009
0010 class PHCompositeNode;
0011 class RawClusterContainer;
0012 class RawTowerGeomContainer;
0013 class BEmcRec;
0014 class TowerInfo;
0015 class RawTower;
0016
0017 class RawClusterBuilderTemplate : public SubsysReco
0018 {
0019 public:
0020 explicit RawClusterBuilderTemplate(const std::string& name = "RawClusterBuilderTemplate");
0021 ~RawClusterBuilderTemplate() override;
0022
0023 int InitRun(PHCompositeNode* topNode) override;
0024 int process_event(PHCompositeNode* topNode) override;
0025 void Detector(const std::string& d);
0026
0027 void SetCylindricalGeometry();
0028 void SetPlanarGeometry();
0029 void PrintGeometry() { bPrintGeom = true; }
0030 void PrintCylGeom(RawTowerGeomContainer* towergeom, const std::string& fname) const;
0031 void SetProfileProb(bool pprob) { bProfProb = pprob; }
0032 void SetProbNoiseParam(float rn) { fProbNoiseParam = rn; }
0033
0034 void set_threshold_energy(const float e) { _min_tower_e = e; }
0035 void set_peakthreshold_energy(const float e) { _min_peak_e = e; }
0036 void setEnergyNorm(const float norm) { fEnergyNorm = norm; }
0037 void checkenergy(const int i = 1) { chkenergyconservation = i; }
0038 void LoadProfile(const std::string& fname);
0039
0040 void set_UseTowerInfo(const int useMode)
0041 {
0042 m_UseTowerInfo = useMode;
0043 }
0044
0045 void set_ApplyTowerSelection(bool b)
0046 {
0047 m_do_tower_selection = b;
0048 }
0049
0050 void set_UseAltZVertex(const int useAltZMode)
0051 {
0052 m_UseAltZVertex = useAltZMode;
0053 }
0054
0055 void set_UseCorrectPosition(const bool useCorrectPosition);
0056
0057 void set_UseCorrectShowerDepth(const bool useCorrectShowerDepth);
0058
0059 void set_UseDetailedGeometry(const bool useDetailedGeometry);
0060
0061 void setOutputClusterNodeName(const std::string& inpNodenm)
0062 {
0063 m_outputnodename = inpNodenm;
0064 }
0065
0066 void setTowerGeomNodeName(const std::string& name)
0067 {
0068 m_TowerGeomNodeName = name;
0069 }
0070
0071
0072
0073 void setInputTowerNodeName(const std::string& inpNodenm)
0074 {
0075 m_inputnodename = inpNodenm;
0076 }
0077
0078 void set_min_cluster_E_saved(float min_cluster_E) { m_min_cluster_e = min_cluster_E; }
0079
0080 void set_vertex_type(GlobalVertex::VTXTYPE type)
0081 {
0082 m_vertex_type = type;
0083 }
0084
0085 void setSubclusterSplitting(bool doSubClusterSplitting)
0086 {
0087 m_subclustersplitting = doSubClusterSplitting;
0088 }
0089
0090
0091
0092 private:
0093 void CreateNodes(PHCompositeNode* topNode);
0094 static bool Cell2Abs(RawTowerGeomContainer* towergeom, float phiC, float etaC, float& phi, float& eta);
0095 bool IsAcceptableTower(TowerInfo *tower) const;
0096 bool IsAcceptableTower(RawTower *tower) const;
0097
0098 RawClusterContainer* _clusters{nullptr};
0099
0100
0101 BEmcRec* bemc{nullptr};
0102 float fEnergyNorm{1.};
0103
0104 float _min_tower_e{0.020};
0105 float _min_peak_e{0.200};
0106 int chkenergyconservation{0};
0107
0108 std::string detector;
0109 std::string ClusterNodeName;
0110
0111 int BINX0{0};
0112 int NBINX{0};
0113 int BINY0{0};
0114 int NBINY{0};
0115
0116 bool bPrintGeom{false};
0117 bool bProfProb{false};
0118 float fProbNoiseParam{0.04};
0119
0120 GlobalVertex::VTXTYPE m_vertex_type{GlobalVertex::MBD};
0121
0122 int m_UseTowerInfo{0};
0123
0124 bool m_do_tower_selection{true};
0125
0126 std::string m_towerInfo_nodename;
0127
0128
0129 bool m_UseDetailedGeometry {true};
0130
0131
0132
0133 int m_UseAltZVertex{1};
0134
0135
0136
0137
0138
0139 float m_min_cluster_e{0.0};
0140
0141 bool m_subclustersplitting{true};
0142
0143 std::string m_inputnodename;
0144 std::string m_outputnodename;
0145 std::string m_TowerGeomNodeName;
0146 };
0147
0148 #endif