Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:17:56

0001 #ifndef G4EVAL_JETEVALUATOR_H
0002 #define G4EVAL_JETEVALUATOR_H
0003 
0004 //===============================================
0005 /// \file JetEvaluator.h
0006 /// \brief Compares reconstructed jets to truth jets
0007 /// \author Michael P. McCumber
0008 //===============================================
0009 
0010 #include <fun4all/SubsysReco.h>
0011 
0012 #include <string>
0013 
0014 class JetEvalStack;
0015 class PHCompositeNode;
0016 class TFile;
0017 class TNtuple;
0018 
0019 /// \class JetEvaluator
0020 ///
0021 /// \brief Compares reconstructed jets to truth jets
0022 ///
0023 /// Plan: This module will trace the jet constituents to
0024 /// the greatest contributor Monte Carlo jet and then
0025 /// test one against the other.
0026 ///
0027 class JetEvaluator : public SubsysReco
0028 {
0029  public:
0030   JetEvaluator(const std::string &name = "JETEVALUATOR",
0031                const std::string &recojetname = "AntiKt_Tower_r0.3",
0032                const std::string &truthjetname = "AntiKt_Truth_r0.3",
0033                const std::string &filename = "g4eval_jets.root");
0034   ~JetEvaluator() override{};
0035 
0036   int Init(PHCompositeNode *topNode) override;
0037   int process_event(PHCompositeNode *topNode) override;
0038   int End(PHCompositeNode *topNode) override;
0039 
0040   void set_strict(bool b) { _strict = b; }
0041 
0042  private:
0043   std::string _recojetname;
0044   std::string _truthjetname;
0045 
0046   unsigned long _ievent = 0;
0047 
0048   JetEvalStack *_jetevalstack = nullptr;
0049 
0050   //----------------------------------
0051   // evaluator output ntuples
0052 
0053   bool _strict = false;
0054 
0055   bool _do_recojet_eval = true;
0056   bool _do_truthjet_eval = true;
0057 
0058   TNtuple *_ntp_recojet = nullptr;
0059   TNtuple *_ntp_truthjet = nullptr;
0060 
0061   // evaluator output file
0062   std::string _filename;
0063   TFile *_tfile = nullptr;
0064 
0065   // subroutines
0066   void printInputInfo(PHCompositeNode *topNode);     ///< print out the input object information (debugging upstream components)
0067   void fillOutputNtuples(PHCompositeNode *topNode);  ///< dump the evaluator information into ntuple for external analysis
0068   void printOutputInfo(PHCompositeNode *topNode);    ///< print out the ancestry information for detailed diagnosis
0069 };
0070 
0071 #endif  // G4EVAL_JETEVALUATOR_H