File indexing completed on 2025-12-17 09:21:56
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
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
0022 G4HitNtuple(const std::string &name = "G4HitNtuple", const std::string &filename = "G4HitNtuple.root");
0023
0024
0025 ~G4HitNtuple() override;
0026
0027
0028 int Init(PHCompositeNode *) override;
0029
0030
0031 int process_event(PHCompositeNode *) override;
0032
0033
0034 int End(PHCompositeNode *) override;
0035
0036 void AddNode(const std::string &name, const int detid = 0);
0037
0038 private:
0039 Fun4AllHistoManager *hm{nullptr};
0040 std::vector<TH1 *> nhits;
0041 std::vector<TH1 *> eloss;
0042
0043 std::string _filename;
0044 std::set<std::string> _node_postfix;
0045 std::map<std::string, int> _detid;
0046 TNtuple *ntup{nullptr};
0047 TFile *outfile{nullptr};
0048 };
0049
0050 #endif