Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-03 08:15:53

0001 #ifndef SVTXEVALUATOR_HAIWANG_H__
0002 #define SVTXEVALUATOR_HAIWANG_H__
0003 
0004 //===============================================
0005 /// \file SvtxEvaluatorHaiwang.h
0006 /// \brief Compares reconstructed tracks to truth particles
0007 /// \author Michael P. McCumber (revised SVTX version)
0008 //===============================================
0009 
0010 
0011 #include <fun4all/SubsysReco.h>
0012 
0013 #include <string>
0014 
0015 class PHCompositeNode;
0016 
0017 class SvtxEvalStack;
0018 class TFile;
0019 class TNtuple;
0020 
0021 /// \class SvtxEvaluatorHaiwang
0022 ///
0023 /// \brief Compares reconstructed tracks to truth particles
0024 ///
0025 /// Plan: This module will trace the reconstructed tracks back to
0026 /// the greatest contributor Monte Carlo particle and then
0027 /// test one against the other.
0028 ///
0029 class SvtxEvaluatorHaiwang : public SubsysReco {
0030   
0031 public:
0032  
0033   SvtxEvaluatorHaiwang(const std::string &name = "SVTXEVALUATOR",
0034                 const std::string &filename = "g4eval.root");
0035   virtual ~SvtxEvaluatorHaiwang() {}
0036         
0037   int Init(PHCompositeNode *topNode);
0038   int InitRun(PHCompositeNode *topNode);
0039   int process_event(PHCompositeNode *topNode);
0040   int End(PHCompositeNode *topNode);
0041 
0042   void set_strict(bool b) {_strict = b;}
0043   
0044   void do_vertex_eval(bool b) {_do_vertex_eval = b;}
0045   void do_gpoint_eval(bool b) {_do_gpoint_eval = b;}
0046   void do_g4hit_eval(bool b) {_do_g4hit_eval = b;}
0047   void do_hit_eval(bool b) {_do_hit_eval = b;}
0048   void do_cluster_eval(bool b) {_do_cluster_eval = b;}
0049   void do_gtrack_eval(bool b) {_do_gtrack_eval = b;}
0050   void do_track_eval(bool b) {_do_track_eval = b;}
0051 
0052   void scan_for_embedded(bool b) {_scan_for_embedded = b;}
0053   
0054  private:
0055 
0056   unsigned int _ievent;
0057 
0058   // eval stack
0059   SvtxEvalStack* _svtxevalstack;
0060   
0061   //----------------------------------
0062   // evaluator output ntuples
0063 
0064   bool _strict;
0065   unsigned int _errors;
0066   
0067   bool _do_vertex_eval;
0068   bool _do_gpoint_eval;
0069   bool _do_g4hit_eval;
0070   bool _do_hit_eval;
0071   bool _do_cluster_eval;
0072   bool _do_gtrack_eval;
0073   bool _do_track_eval;
0074 
0075   bool _scan_for_embedded;
0076   
0077   TNtuple *_ntp_vertex;
0078   TNtuple *_ntp_gpoint;
0079   TNtuple *_ntp_g4hit;
0080   TNtuple *_ntp_hit;
0081   TNtuple *_ntp_cluster;
0082   TNtuple *_ntp_gtrack;
0083   TNtuple *_ntp_track;
0084 
0085   // evaluator output file
0086   std::string _filename;
0087   TFile *_tfile;
0088 
0089   // output subroutines
0090   void fillOutputNtuples(PHCompositeNode* topNode); ///< dump the evaluator information into ntuple for external analysis
0091   void printInputInfo(PHCompositeNode* topNode);    ///< print out the input object information (debugging upstream components)
0092   void printOutputInfo(PHCompositeNode* topNode);   ///< print out the ancestry information for detailed diagnosis
0093 };
0094 
0095 #endif // SVTXEVALUATOR_HAIWANG_H__