Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:18:34

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef PHACTSTRACKCLUSTERASSOCIATOR_H
0004 #define PHACTSTRACKCLUSTERASSOCIATOR_H
0005 
0006 #include <fun4all/SubsysReco.h>
0007 #include <trackbase_historic/SvtxTrack.h>
0008 
0009 #include <map>
0010 #include <string>
0011 #include <vector>
0012 
0013 class PHCompositeNode;
0014 class SvtxTrackMap;
0015 class SvtxVertexMap;
0016 class SvtxVertex;
0017 class RawCluster;
0018 class RawClusterContainer;
0019 class TowerInfoContainer;
0020 class RawTowerGeomContainer;
0021 class SvtxTrackCaloClusterMap;
0022 
0023 class PHTrackClusterAssociator : public SubsysReco
0024 {
0025  public:
0026   PHTrackClusterAssociator(const std::string& name = "PHTrackClusterAssociator");
0027 
0028   int InitRun(PHCompositeNode* topNode) override;
0029   int process_event(PHCompositeNode* topNode) override;
0030   int ResetEvent(PHCompositeNode* topNode) override;
0031   int End(PHCompositeNode* topNode) override;
0032 
0033   void setCaloRadius(const std::string& name, double rad)
0034   {
0035     m_caloRadii.insert(std::make_pair(name, rad));
0036   }
0037 
0038  private:
0039   int getNodes(PHCompositeNode* topNode);
0040   int createNodes(PHCompositeNode* topNode);
0041   int getCaloNodes(PHCompositeNode* topNode, const int caloLayer);
0042   int matchTracks(PHCompositeNode* topNode, const int caloLayer);
0043   RawCluster* getCluster(double phi, double eta, SvtxVertex* vertex);
0044   SvtxTrackMap* m_trackMap = nullptr;
0045   SvtxVertexMap* m_vertexMap = nullptr;
0046 
0047   /// Objects to hold calorimeter information. There are
0048   /// only 3 calo layers
0049   const static int m_nCaloLayers = 3;
0050   std::vector<std::string> m_caloNames = {"CEMC", "HCALIN", "HCALOUT"};
0051 
0052   /// An optional map that allows projection to an arbitrary radius
0053   /// Results are written to the SvtxTrack based on the provided CAL_LAYER
0054   std::map<std::string, float> m_caloRadii;
0055 
0056   RawTowerGeomContainer* m_towerGeomContainer = nullptr;
0057   TowerInfoContainer* m_towerContainer = nullptr;
0058   RawClusterContainer* m_clusterContainer = nullptr;
0059 
0060   SvtxTrackCaloClusterMap* m_trackClusterMap = nullptr;
0061 
0062   bool m_useCemcPosRecalib = false;
0063   bool m_calosAvailable = true;
0064 };
0065 
0066 #endif  // PHACTSTRACKCLUSTERASSOCIATOR_H