File indexing completed on 2025-08-03 08:11:32
0001 #ifndef __BBCSTUDY_H__
0002 #define __BBCSTUDY_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 MbdPmtContainer;
0016 class MbdGeom;
0017 class TFile;
0018 class TTree;
0019 class TDatabasePDG;
0020 class TRandom3;
0021 class TH1;
0022 class TH2;
0023 class TF1;
0024 class TCanvas;
0025
0026
0027
0028 class BBCStudy: public SubsysReco
0029 {
0030 public:
0031
0032
0033 BBCStudy(const std::string &name="BBCStudy");
0034
0035
0036 int Init(PHCompositeNode *);
0037
0038
0039 int InitRun(PHCompositeNode *);
0040
0041
0042 int process_event(PHCompositeNode *);
0043
0044
0045 int End(PHCompositeNode *);
0046
0047
0048 void set_savefile(const char *f) { _savefname = f; }
0049
0050 void set_tres(const Float_t tr) { _tres = tr; }
0051
0052 private:
0053
0054
0055 void CheckDST(PHCompositeNode *topNode);
0056
0057
0058 std::string _savefname;
0059 TFile* _savefile;
0060
0061 int nprocessed{0};
0062
0063
0064 TTree* _tree;
0065 Int_t f_evt;
0066 Float_t f_bimp;
0067 Int_t f_ncoll;
0068 Int_t f_npart;
0069 Float_t f_vx;
0070 Float_t f_vy;
0071 Float_t f_vz;
0072 Float_t f_vt;
0073 Short_t f_bbcn[2];
0074 Float_t f_bbcq[2];
0075 Float_t f_bbct[2];
0076 Float_t f_bbcte[2];
0077 Float_t f_bbcz;
0078 Float_t f_bbct0;
0079
0080 TH1* h_bbcq[128];
0081 TH1* h_bbcqtot[2];
0082 TH2* h2_bbcqtot;
0083 TH1* h_ztrue;
0084 TH1* h_tdiff;
0085 TH2* h2_tdiff_ch;
0086
0087 TCanvas *c_bbct;
0088 TH1 *hevt_bbct[2];
0089 TF1 *gaussian;
0090
0091 std::map<int,int> _pids;
0092
0093
0094 TDatabasePDG* _pdg;
0095 TRandom3* _rndm;
0096 Float_t _tres;
0097
0098
0099 void GetNodes(PHCompositeNode *);
0100
0101
0102 PHG4TruthInfoContainer* _truth_container;
0103 PHG4HitContainer* _bbchits;
0104 EventHeader* _evtheader;
0105 MbdOut* _bbcout;
0106 MbdPmtContainer* _bbcpmts;
0107 MbdGeom* _bbcgeom;
0108
0109 };
0110
0111 #endif