Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #ifndef QA_QAG4SIMULATIONTPC_H
0002 #define QA_QAG4SIMULATIONTPC_H
0003 
0004 #include <g4eval/SvtxEvalStack.h>  // for SvtxEvalStack
0005 
0006 #include <trackbase/ClusterErrorPara.h>
0007 #include <trackbase/TrkrDefs.h>
0008 
0009 #include <fun4all/SubsysReco.h>
0010 
0011 #include <map>
0012 #include <memory>
0013 #include <set>
0014 #include <string>
0015 
0016 class PHCompositeNode;
0017 class PHG4Hit;
0018 class PHG4HitContainer;
0019 class PHG4TruthInfoContainer;
0020 class TrkrClusterContainer;
0021 class TrkrClusterHitAssoc;
0022 class TrkrHitTruthAssoc;
0023 class SvtxEvalStack;
0024 class ActsGeometry;
0025 
0026 /// \class QAG4SimulationTpc
0027 class QAG4SimulationTpc : public SubsysReco
0028 {
0029  public:
0030   /// constructor
0031   QAG4SimulationTpc(const std::string& name = "QAG4SimulationTpc");
0032 
0033   int InitRun(PHCompositeNode* topNode) override;
0034   int process_event(PHCompositeNode* topNode) override;
0035 
0036  private:
0037   /// common prefix for QA histograms
0038   std::string get_histo_prefix() const;
0039 
0040   std::unique_ptr<SvtxEvalStack> m_svtxEvalStack;
0041   PHG4TruthInfoContainer* m_truthContainer;
0042 
0043   /// load nodes
0044   int load_nodes(PHCompositeNode*);
0045 
0046   /// evaluate clusters
0047   void evaluate_clusters();
0048 
0049   // get geant hits associated to a cluster
0050   using G4HitSet = std::set<PHG4Hit*>;
0051   G4HitSet find_g4hits(TrkrDefs::cluskey) const;
0052 
0053   /// true if histograms are initialized
0054   bool m_initialized = false;
0055 
0056   /// Acts tracking geometry for surface lookup
0057   ActsGeometry* m_tGeometry = nullptr;
0058 
0059   /// cluster map
0060   TrkrClusterContainer* m_cluster_map = nullptr;
0061 
0062   /// clusters to hit association
0063   TrkrClusterHitAssoc* m_cluster_hit_map = nullptr;
0064 
0065   /// hit to g4hit association
0066   TrkrHitTruthAssoc* m_hit_truth_map = nullptr;
0067 
0068   /// g4 hits
0069   PHG4HitContainer* m_g4hits_tpc = nullptr;
0070 
0071   /// list of relevant layers
0072   /* it is filled at Init stage. It should not change for the full run */
0073   std::set<int> m_layers;
0074   std::multimap<int, int> m_layer_region_map;
0075   ClusterErrorPara _ClusErrPara;
0076 };
0077 
0078 #endif