Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:12:37

0001 #ifndef __JETENERGIES_H__
0002 #define __JETENERGIES_H__
0003 
0004 //===============================================
0005 /// \file JetEnergies.h
0006 /// \brief copy of JetEvaluator.h that will add the energy absorbed by the plug door and the black hole to the list of items in the generated truth jet ntuple
0007 
0008 // VERY IMPORTANT: In order to get the flux return energy the Flux Return must be set to active in the G4Setup file otherwise this may not work
0009 
0010 /// \Original author Michael P. McCumber
0011 /// \Modifiying author David Kapukchyan
0012 //===============================================
0013 
0014 #include <g4eval/JetEvalStack.h>
0015 
0016 #include <fun4all/SubsysReco.h>
0017 #include <phool/PHCompositeNode.h>
0018 #include <g4main/PHG4HitContainer.h>
0019 
0020 #include <TNtuple.h>
0021 #include <TFile.h>
0022 
0023 #include <string>
0024 
0025 //class PHG4HitContainer;
0026 
0027 /// \class JetEnergies
0028 ///
0029 /// \This is from the old JetEvaluator.h file
0030 /// \brief Compares reconstructed jets to truth jets
0031 ///
0032 /// Plan: This module will trace the jet constituents to
0033 /// the greatest contributor Monte Carlo jet and then
0034 /// test one against the other.
0035 ///
0036 class JetEnergies : public SubsysReco {
0037 
0038  public:
0039  
0040   JetEnergies(const std::string &name = "JETENERGIES",
0041            const std::string &recojetname = "AntiKt_Tower_r0.3",
0042            const std::string &truthjetname = "AntiKt_Truth_r0.3",
0043            const std::string &filename = "g4eval_jets.root");
0044   virtual ~JetEnergies() {};
0045         
0046   int Init(PHCompositeNode *topNode);
0047   int InitRun(PHCompositeNode *topNode);
0048   int process_event(PHCompositeNode *topNode);
0049   int End(PHCompositeNode *topNode);
0050 
0051   void set_strict(bool b) {_strict = b;}
0052   
0053  private:
0054 
0055   float GetTotalEnergy(PHG4HitContainer* hit_object);
0056 
0057   std::string _recojetname;
0058   std::string _truthjetname;
0059   
0060   unsigned long _ievent;
0061 
0062   JetEvalStack* _jetevalstack;
0063   
0064   //----------------------------------
0065   // evaluator output ntuples
0066 
0067   bool _strict;
0068   unsigned int _errors;
0069   
0070   bool _do_recojet_eval;
0071   bool _do_truthjet_eval;
0072   
0073   TNtuple *_ntp_recojet;
0074   TNtuple *_ntp_truthjet;
0075 
0076   // evaluator output file
0077   std::string _filename;
0078   TFile *_tfile;
0079 
0080   //For some reason this declaration has to go here
0081   PHG4HitContainer* _FluxReturn_plus_hit_container;
0082   PHG4HitContainer* _FluxReturn_minus_hit_container;
0083   PHG4HitContainer* _BH_1_hit_container;
0084   PHG4HitContainer* _BH_Forward_hit_container;
0085   PHG4HitContainer* _BH_Negative_hit_container;
0086 
0087   // subroutines
0088   void printInputInfo(PHCompositeNode *topNode);    ///< print out the input object information (debugging upstream components)
0089   void fillOutputNtuples(PHCompositeNode *topNode); ///< dump the evaluator information into ntuple for external analysis
0090   void printOutputInfo(PHCompositeNode *topNode);   ///< print out the ancestry information for detailed diagnosis
0091 };
0092 
0093 #endif // __JETENERGIES_H__