Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2026-08-31 08:21:42

0001 #ifndef TPC_POLYCLUSTERRESIDUALS_H
0002 #define TPC_POLYCLUSTERRESIDUALS_H
0003 
0004 #include <fun4all/SubsysReco.h>
0005 
0006 #include <string>
0007 #include <vector>
0008 
0009 class Tpc_PolyTrackContainer;
0010 class Tpc_PolyTrackVertexContainer;
0011 class PHCompositeNode;
0012 class TFile;
0013 class TTree;
0014 class Tpc_PolyClusterContainer;
0015 
0016 class Tpc_PolyClusterResiduals : public SubsysReco
0017 {
0018  public:
0019   explicit Tpc_PolyClusterResiduals(const std::string& name = "Tpc_PolyClusterResiduals",
0020                                     const std::string& outfilename = "tpc_polycluster_residuals.root");
0021   ~Tpc_PolyClusterResiduals() override;
0022 
0023   int Init(PHCompositeNode*) override;
0024   int process_event(PHCompositeNode*) override;
0025   int End(PHCompositeNode*) override;
0026 
0027   void setClusterNodeName(const std::string& n) { m_clusterNodeName = n; }
0028   void setTpc_PolyTrackNodeName(const std::string& n) { m_finalTrackNodeName = n; }
0029   void setTpc_PolyTrackVertexNodeName(const std::string& n) { m_finalTrackVertexNodeName = n; }
0030   void setOutputFileName(const std::string& n) { m_outfilename = n; }
0031   void setMagneticFieldTesla(double b) { m_magneticFieldTesla = b; }
0032   void setMinPt(double v) { m_minPt = v; }
0033   void setMaxPt(double v) { m_maxPt = v; }
0034   void setMinTpcClusters(unsigned int v) { m_minTpcClusters = v; }
0035   void setMaxTpcClusters(unsigned int v) { m_maxTpcClusters = v; }
0036   void setUseStraightLineTracks(bool v) { m_useStraightLineTracks = v; }
0037 
0038  private:
0039   bool get_nodes(PHCompositeNode* topNode);
0040   void reset_tree_values();
0041 
0042   std::string m_outfilename;
0043   std::string m_clusterNodeName;
0044   std::string m_finalTrackNodeName;
0045   std::string m_finalTrackVertexNodeName;
0046 
0047   double m_magneticFieldTesla{1.4};
0048   double m_minPt{0.0};
0049   double m_maxPt{1.0e30};
0050   unsigned int m_minTpcClusters{0};
0051   unsigned int m_maxTpcClusters{0xffffffffu};
0052   bool m_useStraightLineTracks{false};
0053 
0054   unsigned int m_evt{0};
0055   TFile* m_outfile{nullptr};
0056   TTree* m_tree{nullptr};
0057   Tpc_PolyClusterContainer* m_clusters{nullptr};
0058   Tpc_PolyTrackContainer* m_finalTracks{nullptr};
0059   Tpc_PolyTrackVertexContainer* m_finalTrackVertices{nullptr};
0060 
0061   unsigned int m_event{0};
0062   unsigned int m_finalTrackId{0};
0063   unsigned int m_sourceClusterId{0};
0064   unsigned int m_sourceAssembledTrackId{0};
0065   int m_side{0};
0066   unsigned int m_ntpcClusters{0};
0067   int m_fitStatus{0};
0068   double m_pt{0.0};
0069   double m_px{0.0};
0070   double m_py{0.0};
0071   double m_pz{0.0};
0072   double m_eta{0.0};
0073   double m_theta{0.0};
0074   double m_charge{0.0};
0075   double m_chi2{0.0};
0076   double m_ndf{0.0};
0077   double m_quality{0.0};
0078   double m_dedx{0.0};
0079   double m_vertexX{0.0};
0080   double m_vertexY{0.0};
0081   double m_vertexZ{0.0};
0082   double m_vertexR{0.0};
0083   double m_pcaX{0.0};
0084   double m_pcaY{0.0};
0085   double m_pcaZ{0.0};
0086   double m_zDCA{0.0};
0087   double m_rDCA{0.0};
0088   double m_rDCAZero{0.0};
0089   double m_R{0.0};
0090   double m_rzSlope{0.0};
0091   std::vector<unsigned int> m_clusterIndex;
0092   std::vector<unsigned int> m_sector;
0093   std::vector<unsigned int> m_layer;
0094   std::vector<double> m_clusterX;
0095   std::vector<double> m_clusterY;
0096   std::vector<double> m_clusterZ;
0097   std::vector<double> m_clusterR;
0098   std::vector<double> m_clusterPhi;
0099   std::vector<double> m_clusterAdc;
0100   std::vector<unsigned int> m_clusterPadSize;
0101   std::vector<double> m_stateX;
0102   std::vector<double> m_stateY;
0103   std::vector<double> m_stateZ;
0104   std::vector<double> m_stateZDca;
0105   std::vector<double> m_stateR;
0106   std::vector<double> m_statePhi;
0107   std::vector<double> m_deltaPhi;
0108   std::vector<double> m_residualRPhi;
0109   std::vector<double> m_residualZ;
0110 };
0111 
0112 #endif