File indexing completed on 2025-08-03 08:11:31
0001 #ifndef __MBDSTUDY_H__
0002 #define __MBDSTUDY_H__
0003
0004 #include <fun4all/SubsysReco.h>
0005 #include <string>
0006 #include <map>
0007 #include <TFile.h>
0008
0009
0010 class PHCompositeNode;
0011 class PHG4HitContainer;
0012 class PHG4TruthInfoContainer;
0013 class EventHeader;
0014 class MbdOut;
0015 class TFile;
0016 class TTree;
0017 class TDatabasePDG;
0018 class TRandom3;
0019 class TH1;
0020 class TH2;
0021 class TF1;
0022 class TCanvas;
0023
0024
0025
0026 class MBDStudy: public SubsysReco
0027 {
0028 public:
0029
0030
0031 MBDStudy(const std::string &name="MBDStudy");
0032
0033
0034 int Init(PHCompositeNode *);
0035
0036
0037 int InitRun(PHCompositeNode *);
0038
0039
0040 int process_event(PHCompositeNode *);
0041
0042
0043 int End(PHCompositeNode *);
0044
0045
0046 void set_savefile(const char *f) { _savefname = f; }
0047
0048 void set_tres(const Float_t tr) { _tres = tr; }
0049
0050 private:
0051
0052
0053 void CheckDST(PHCompositeNode *topNode);
0054
0055
0056 std::string _savefname;
0057 TFile* _savefile;
0058
0059 int nprocessed{0};
0060
0061
0062 TTree* _tree;
0063 Int_t f_evt;
0064 Float_t f_bimp;
0065 Int_t f_ncoll;
0066 Int_t f_npart;
0067 Float_t f_vx;
0068 Float_t f_vy;
0069 Float_t f_vz;
0070 Float_t f_vt;
0071 Short_t f_mbdn[2];
0072 Float_t f_mbdq[2];
0073 Float_t f_mbdt[2];
0074 Float_t f_mbdte[2];
0075 Float_t f_mbdz;
0076 Float_t f_mbdt0;
0077
0078 TH1* h_mbdq[128];
0079 TH1* h_mbdqtot[2];
0080 TH2* h2_mbdqtot;
0081 TH1* h_ztrue;
0082 TH1* h_tdiff;
0083 TH2* h2_tdiff_ch;
0084
0085 TCanvas *c_mbdt;
0086 TH1 *hevt_mbdt[2];
0087 TF1 *gaussian;
0088
0089 std::map<int,int> _pids;
0090
0091
0092 TDatabasePDG* _pdg;
0093 TRandom3* _rndm;
0094 Float_t _tres;
0095
0096
0097 void GetNodes(PHCompositeNode *);
0098
0099
0100 PHG4TruthInfoContainer* _truth_container;
0101 PHG4HitContainer* _mbdhits;
0102 EventHeader* _evtheader;
0103
0104 };
0105
0106 #endif