File indexing completed on 2025-08-03 08:11:32
0001 #ifndef __BBCCHECK_H__
0002 #define __BBCCHECK_H__
0003
0004 #include <fun4all/SubsysReco.h>
0005 #include <string>
0006 #include <vector>
0007 #include <map>
0008 #include <TFile.h>
0009
0010
0011 class PHCompositeNode;
0012 class EventHeader;
0013 class MbdOut;
0014 class MbdPmtContainer;
0015 class Gl1Packet;
0016 class TFile;
0017 class TTree;
0018 class TDatabasePDG;
0019 class TRandom3;
0020 class TH1;
0021 class TH2;
0022 class TGraphErrors;
0023 class TF1;
0024 class TCanvas;
0025
0026
0027
0028 class BbcCheck: public SubsysReco
0029 {
0030 public:
0031
0032
0033 BbcCheck(const std::string &name="BbcCheck");
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_run(const int r) { f_run = r; }
0051
0052 private:
0053
0054
0055 void CheckDST(PHCompositeNode *topNode);
0056
0057 int Getpeaktime(TH1 *h);
0058 void process_gl1( PHCompositeNode *topNode );
0059 void process_zdc( PHCompositeNode *topNode );
0060 void process_emcal( PHCompositeNode *topNode );
0061 void process_ohcal( PHCompositeNode *topNode );
0062 void process_ihcal( PHCompositeNode *topNode );
0063
0064
0065 std::string _savefname;
0066 TFile* _savefile;
0067
0068 int nprocessed{0};
0069
0070
0071 TTree* _tree{ nullptr };
0072 TTree* _tree2{ nullptr };
0073 Int_t f_run;
0074 Int_t f_evt;
0075 Short_t f_cross;
0076 Int_t f_ch;
0077 Float_t f_qmean;
0078 Float_t f_qmerr;
0079
0080 ULong64_t f_rtrig{0};
0081 ULong64_t f_ltrig{0};
0082 ULong64_t f_strig{0};
0083
0084 Float_t f_bimp;
0085 Int_t f_ncoll;
0086 Int_t f_npart;
0087 Float_t f_vx;
0088 Float_t f_vy;
0089 Float_t f_vz;
0090 Float_t f_vt;
0091 Short_t f_bbcn[2];
0092 Float_t f_bbcq[2];
0093 Float_t f_bbct[2];
0094 Float_t f_bbcte[2];
0095 Float_t f_bz;
0096 Float_t f_bbct0;
0097
0098 TH1 *h_bbcq[128];
0099 TGraphErrors *g_bbcq[128];
0100 TH1 *h_bbcqtot[2];
0101 TH1 *h_bbcqsum;
0102 TH2 *h2_bbcqsum;
0103
0104 TH1 *h2_bbcqtot_bz[2];
0105 TH2 *h2_bbcqsum_bz;
0106
0107 TH1 *h_emcale;
0108 TH1 *h_emcaltimecut;
0109 TH1 *h_ohcale;
0110 TH1 *h_ohcaltimecut;
0111 TH1 *h_ihcale;
0112 TH1 *h_ihcaltimecut;
0113 TH1 *h_zdce;
0114 TH1 *h_zdcse{nullptr};
0115 TH1 *h_zdcne{nullptr};
0116 TH1 *h_zdctimecut;
0117 TH1 *h_bz;
0118 TH1 *h_bztrig[5];
0119 TH2 *h2_tt;
0120 TH2 *h2_tq;
0121 TH2 *h2_slew[128];
0122 TH1 *h_cross;
0123
0124 std::vector<uint64_t> mbdtrigbits;
0125
0126 TCanvas *c_bbct;
0127 TH1 *hevt_bbct[2];
0128 TF1 *gaussian;
0129
0130 TH1 *h_bpmt_bad;
0131
0132 std::map<int,int> _pids;
0133
0134
0135 TRandom3* _rndm;
0136 Float_t _tres;
0137
0138
0139 void GetNodes(PHCompositeNode *);
0140
0141
0142 EventHeader* _evtheader;
0143 MbdOut* _mbdout;
0144 MbdPmtContainer* _mbdpmts;
0145 Gl1Packet* _gl1raw;
0146
0147 };
0148
0149 #endif