Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:15:18

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef TRACKCLUSTEREVALUATOR_H
0004 #define TRACKCLUSTEREVALUATOR_H
0005 
0006 #include <fun4all/SubsysReco.h>
0007 #include <trackbase/TrkrDefs.h>
0008 #include <Acts/Definitions/Algebra.hpp>
0009 
0010 #include <string>
0011 #include <vector>
0012 #include <map>
0013 #include <set>
0014 
0015 class PHCompositeNode;
0016 class TrkrClusterContainer;
0017 class SvtxTrackMap;
0018 class PHG4TruthInfoContainer;
0019 class SvtxEvalStack;
0020 class SvtxTrack;
0021 class TTree;
0022 class TFile;
0023 
0024 class TrackClusterEvaluator : public SubsysReco
0025 {
0026  public:
0027   TrackClusterEvaluator(const std::string &name = "TrackClusterEvaluator");
0028 
0029   virtual ~TrackClusterEvaluator();
0030 
0031   int Init(PHCompositeNode *topNode) override;
0032   int InitRun(PHCompositeNode *topNode) override;
0033   int process_event(PHCompositeNode *topNode) override;
0034   int ResetEvent(PHCompositeNode *topNode) override;
0035   int EndRun(const int runnumber) override;
0036   int End(PHCompositeNode *topNode) override;
0037   int Reset(PHCompositeNode * /*topNode*/) override;
0038 
0039   void setProcess(const int proc) { m_proc = proc; }
0040   void setnEvent(const int nevent) { m_nevent = nevent; }
0041   void trackMapName(std::string name) { m_trackMapName = name; }
0042   void outfileName(std::string name) { m_outfilename = name; }
0043   void scanForPrimaries(bool scan) { m_scanForPrimaries = scan; }
0044   void scanForEmbedded(bool scan) { m_scanForEmbedded = scan; }
0045   void trackMatch(bool match) { m_trackMatch = match; }
0046   void Print(const std::string &what = "ALL") const override;
0047 
0048  private:
0049   int getNodes(PHCompositeNode *topNode);
0050   void processTruthTracks(PHCompositeNode *topNode);
0051   void processRecoTracks(PHCompositeNode *topNode);
0052   void setupTrees();
0053   void clearVectors();
0054   void resetTreeValues();
0055 
0056   PHG4TruthInfoContainer *m_truthContainer = nullptr;
0057   TrkrClusterContainer *m_clusterContainer = nullptr;
0058   SvtxTrackMap *m_trackMap = nullptr;
0059   SvtxEvalStack *m_svtxevalstack = nullptr;
0060   std::string m_trackMapName = "SvtxTrackMap";
0061 
0062   bool m_scanForEmbedded = true;
0063   bool m_scanForPrimaries = true;
0064   bool m_trackMatch = true;
0065 
0066   int m_proc = 0;
0067   int m_nevent = 1;
0068   TFile *m_outfile = nullptr;
0069   std::string m_outfilename = "TrackClusterEvaluator.root";
0070   TTree *m_recotree = nullptr;
0071   TTree *m_truthtree = nullptr;
0072   TTree *m_duplicatetree = nullptr;
0073 
0074   int event = -9999;
0075   int gflavor = -9999;
0076   int gntracks = -9999;
0077   int gtrackID = -9999;
0078   int gnmaps = -9999;
0079   int gnintt = -9999;
0080   int gntpc = -9999;
0081   int gnmms = -9999;
0082   float gpx = -9999;
0083   float gpy = -9999;
0084   float gpz = -9999;
0085   float gpt = -9999;
0086   float geta = -9999;
0087   float gphi = -9999;
0088   float gvx = -9999;
0089   float gvy = -9999;
0090   float gvz = -9999;
0091   float gvt = -9999;
0092   int gembed = -9999;
0093   int gprimary = -9999;
0094   int isDuplicate = -9999;
0095   std::vector<TrkrDefs::cluskey> gclusterkeys;
0096   std::vector<float> tgclusterx, tgclustery, tgclusterz, tclusterx, tclustery, tclusterz;
0097   std::vector<float> gclusterx, gclustery, gclusterz, gclusterrphierr, gclusterzerr;
0098   int trackID = -9999;
0099   float px = -9999;
0100   float py = -9999;
0101   float pz = -9999;
0102   float pt = -9999;
0103   float eta = -9999;
0104   float phi = -9999;
0105   int charge = -9999;
0106   float quality = -9999;
0107   int nmaps = -9999;
0108   int nintt = -9999;
0109   int ntpc = -9999;
0110   int nmms = -9999;
0111   float dca3dxy = -9999;
0112   float dca3dz = -9999;
0113   float pcax = -9999;
0114   float pcay = -9999;
0115   float pcaz = -9999;
0116   int matchedTrackID = -9999;
0117   
0118   int dtrackID = -9999;
0119   float dpx = -9999;
0120   float dpy = -9999;
0121   float dpz = -9999;
0122   float dpt = -9999;
0123   float deta = -9999;
0124   float dphi = -9999;
0125   int dcharge = -9999;
0126   float dquality = -9999;
0127   int dnmaps = -9999;
0128   int dnintt = -9999;
0129   int dntpc = -9999;
0130   int dnmms = -9999;
0131   float ddca3dxy = -9999;
0132   float ddca3dz = -9999;
0133   float dpcax = -9999;
0134   float dpcay = -9999;
0135   float dpcaz = -9999;
0136   std::vector<TrkrDefs::cluskey> dclusterkeys;
0137   std::vector<float> dclusterx, dclustery, dclusterz;
0138   std::vector<float> dclusterrphierr, dclusterzerr;
0139 
0140   std::vector<TrkrDefs::cluskey> clusterkeys;
0141   std::vector<float> clusterx, clustery, clusterz, clusterrphierr, clusterzerr;
0142   std::vector<unsigned int> matchedRecoTracksID;
0143 
0144  
0145 };
0146 
0147 #endif  // TRACKCLUSTEREVALUATOR_H