Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #include "PH3DVertexing.h"
0002 
0003 #include <trackbase_historic/SvtxTrackMap.h>
0004 #include <globalvertex/SvtxVertexMap.h>
0005 
0006 //#include <trackbase/TrkrClusterContainer.h>
0007 
0008 #include <fun4all/Fun4AllReturnCodes.h>
0009 #include <fun4all/SubsysReco.h>                // for SubsysReco
0010 
0011 #include <phool/getClass.h>
0012 #include <phool/phool.h>                       // for PHWHERE
0013 
0014 #include <iostream>                            // for operator<<, basic_ostream
0015 
0016 using namespace std;
0017 
0018 PH3DVertexing::PH3DVertexing(const std::string& name)
0019   : SubsysReco(name)
0020     //  , _cluster_map(nullptr)
0021   , _vertex_map(nullptr)
0022   , _track_map(nullptr)
0023 {
0024 }
0025 
0026 int PH3DVertexing::InitRun(PHCompositeNode* topNode)
0027 {
0028   return Setup(topNode);
0029 }
0030 
0031 int PH3DVertexing::process_event(PHCompositeNode* /*topNode*/)
0032 {
0033   return Process();
0034 }
0035 
0036 int PH3DVertexing::Setup(PHCompositeNode* topNode)
0037 {
0038   int ret = GetNodes(topNode);
0039   if (ret != Fun4AllReturnCodes::EVENT_OK) return ret;
0040 
0041   return Fun4AllReturnCodes::EVENT_OK;
0042 }
0043 
0044 int PH3DVertexing::GetNodes(PHCompositeNode* topNode)
0045 {
0046   //---------------------------------
0047   // Get Objects off of the Node Tree
0048   //---------------------------------
0049 
0050   //  _cluster_map = findNode::getClass<SvtxClusterMap>(topNode, "SvtxClusterMap");
0051   /*_cluster_map = findNode::getClass<TrkrClusterContainer>(topNode, "TRKR_CLUSTERS");
0052   if (!_cluster_map)
0053   {
0054     cerr << PHWHERE << " ERROR: Can't find node TRKR_CLUSTERS" << endl;
0055     return Fun4AllReturnCodes::ABORTEVENT;
0056   }
0057   */
0058   _vertex_map = findNode::getClass<SvtxVertexMap>(topNode, "SvtxVertexMap");
0059   if (!_vertex_map)
0060   {
0061     cerr << PHWHERE << " ERROR: Can't find SvtxVertexMap." << endl;
0062     return Fun4AllReturnCodes::ABORTEVENT;
0063   }
0064 
0065   _track_map = findNode::getClass<SvtxTrackMap>(topNode, "SvtxTrackMap");
0066   if (!_track_map)
0067   {
0068     cerr << PHWHERE << " ERROR: Can't find SvtxTrackMap." << endl;
0069     return Fun4AllReturnCodes::ABORTEVENT;
0070   }
0071 
0072   return Fun4AllReturnCodes::EVENT_OK;
0073 }