Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-12-18 09:20:29

0001 #ifndef G4HISTOS_G4TOWERNTUPLE_H
0002 #define G4HISTOS_G4TOWERNTUPLE_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 G4TowerNtuple : public SubsysReco
0019 {
0020  public:
0021   //! constructor
0022   G4TowerNtuple(const std::string &name = "G4TowerNtuple", const std::string &filename = "G4TowerNtuple.root");
0023 
0024   //! destructor
0025   ~G4TowerNtuple() 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 std::string &twrtype, const int detid);
0037 
0038  private:
0039   Fun4AllHistoManager *hm{nullptr};
0040   std::vector<TH1 *> nhits;
0041   std::vector<TH1 *> eloss;
0042   //  std::vector<TH2 *> nhit_edep;
0043   std::string m_filename;
0044   std::set<std::string> m_node_postfix;
0045   std::map<std::string, std::string> m_tower_type;
0046   std::map<std::string, int> m_detid;
0047   TNtuple *ntup{nullptr};
0048   TFile *outfile{nullptr};
0049 };
0050 
0051 #endif