Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #ifndef G4HISTOS_G4HITNTUPLE_H
0002 #define G4HISTOS_G4HITNTUPLE_H
0003 
0004 #include <fun4all/SubsysReco.h>
0005 
0006 #include <map>
0007 #include <set>
0008 #include <string>
0009 #include <vector>
0010 
0011 // Forward declerations
0012 class Fun4AllHistoManager;
0013 class PHCompositeNode;
0014 class TFile;
0015 class TH1;
0016 class TNtuple;
0017 
0018 class G4HitNtuple : public SubsysReco
0019 {
0020  public:
0021   //! constructor
0022   G4HitNtuple(const std::string &name = "G4HitNtuple", const std::string &filename = "G4HitNtuple.root");
0023 
0024   //! destructor
0025   ~G4HitNtuple() override;
0026 
0027   //! full initialization
0028   int Init(PHCompositeNode *) override;
0029 
0030   //! event processing method
0031   int process_event(PHCompositeNode *) override;
0032 
0033   //! end of run method
0034   int End(PHCompositeNode *) override;
0035 
0036   void AddNode(const std::string &name, const int detid = 0);
0037 
0038  protected:
0039   int nblocks;
0040   Fun4AllHistoManager *hm;
0041   std::vector<TH1 *> nhits;
0042   std::vector<TH1 *> eloss;
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   TNtuple *ntup;
0048   TFile *outfile;
0049 };
0050 
0051 #endif