Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-03 08:17:00

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; }  // Prints it at InitRun time
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   {  // 0 only old tower, 1 only new (TowerInfo based),
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   {  // 0 use global vtx, 1 only bbcout bbczvtx, 2 use NO zvtx[set to 0], 3 use MC truth vertex
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   // !!! note :  next fn NOT implemented for RawTowers
0072   // only TowerInfo  mode
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 setSubclusterSplitting(bool doSubClusterSplitting)
0081   {
0082     m_subclustersplitting = doSubClusterSplitting;
0083   }
0084 
0085   
0086 
0087  private:
0088   void CreateNodes(PHCompositeNode* topNode);
0089   static bool Cell2Abs(RawTowerGeomContainer* towergeom, float phiC, float etaC, float& phi, float& eta);
0090   bool IsAcceptableTower(TowerInfo *tower) const;
0091   bool IsAcceptableTower(RawTower *tower) const;
0092 
0093   RawClusterContainer* _clusters{nullptr};
0094   //  BEmcProfile *_emcprof;
0095 
0096   BEmcRec* bemc{nullptr};
0097   float fEnergyNorm{1.};
0098 
0099   float _min_tower_e{0.020};
0100   float _min_peak_e{0.200};
0101   int chkenergyconservation{0};
0102 
0103   std::string detector;
0104   std::string ClusterNodeName;
0105 
0106   int BINX0{0};
0107   int NBINX{0};
0108   int BINY0{0};
0109   int NBINY{0};
0110 
0111   bool bPrintGeom{false};
0112   bool bProfProb{false};
0113   float fProbNoiseParam{0.04};
0114 
0115   GlobalVertex::VTXTYPE m_vertex_type{GlobalVertex::MBD};
0116 
0117   int m_UseTowerInfo{0};  // 0 only old tower, 1 only new (TowerInfo based),
0118 
0119   bool m_do_tower_selection{true};
0120 
0121   std::string m_towerInfo_nodename;
0122 
0123 
0124   bool m_UseDetailedGeometry {false};
0125   // Use a more detailed calorimeter geometry
0126   // Only available for CEMC
0127 
0128   int m_UseAltZVertex{1};
0129   // 0 - use GlobalVtxMap
0130   // 1 - use BbcReco ZVtx
0131   // 2 - use NO zvertex (zvtx = 0)
0132   // 3 - use truth MC zvertex
0133 
0134   float m_min_cluster_e{0.0};
0135 
0136   bool m_subclustersplitting{true};
0137 
0138   std::string m_inputnodename;
0139   std::string m_outputnodename;
0140   std::string m_TowerGeomNodeName;
0141 };
0142 
0143 #endif /* RawClusterBuilderTemplate_H__ */