Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #ifndef G4HISTOS_G4SNGLTREE_H
0002 #define G4HISTOS_G4SNGLTREE_H
0003 
0004 #include "G4EvtTree.h"
0005 
0006 #include <fun4all/SubsysReco.h>
0007 
0008 #include <map>
0009 #include <set>
0010 #include <string>
0011 
0012 // Forward declarations
0013 class PHCompositeNode;
0014 class PHG4HitContainer;
0015 class TFile;
0016 class TTree;
0017 
0018 class G4SnglTree : public SubsysReco
0019 {
0020  public:
0021   //! constructor
0022   G4SnglTree(const std::string &name = "G4SnglTree", const std::string &filename = "G4SnglTree.root");
0023 
0024   //! destructor
0025   ~G4SnglTree() override {}
0026 
0027   //! full initialization
0028   int Init(PHCompositeNode *) override;
0029 
0030   //! event processing method
0031   int process_event(PHCompositeNode *) override;
0032 
0033   //! hit processing method
0034   int process_hit(PHG4HitContainer *hits, const std::string &dName, int detid, int &nhits);
0035 
0036   //! end of run method
0037   int End(PHCompositeNode *) override;
0038 
0039   void AddNode(const std::string &name, const int detid = 0);
0040 
0041  protected:
0042   int nblocks;
0043   //  std::vector<TH2 *> nhit_edep;
0044   std::string _filename;
0045   std::set<std::string> _node_postfix;
0046   std::map<std::string, int> _detid;
0047 
0048   TTree *g4tree;
0049   G4EvtTree mG4EvtTree{};
0050   TFile *outfile;
0051 };
0052 
0053 #endif