File indexing completed on 2026-10-15 08:17:16
0001
0002
0003 #ifndef SINGLETRACKAN_H
0004 #define SINGLETRACKAN_H
0005
0006 #include <fun4all/SubsysReco.h>
0007
0008 #include <string>
0009 #include <array>
0010
0011 class PHCompositeNode;
0012 class TTree;
0013 class TH1F;
0014 class TFile;
0015
0016 class SingleTrackAN : public SubsysReco
0017 {
0018 public:
0019
0020 SingleTrackAN(const std::string &name = "SingleTrackAN");
0021
0022 ~SingleTrackAN() override;
0023
0024
0025
0026
0027
0028
0029 int Init(PHCompositeNode *topNode) override;
0030
0031
0032
0033
0034
0035
0036 int InitRun(PHCompositeNode *topNode) override;
0037
0038
0039
0040
0041 int process_event(PHCompositeNode *topNode) override;
0042
0043
0044 int ResetEvent(PHCompositeNode *topNode) override;
0045
0046
0047 int EndRun(const int runnumber) override;
0048
0049
0050 int End(PHCompositeNode *topNode) override;
0051
0052
0053 int Reset(PHCompositeNode * ) override;
0054
0055 void Print(const std::string &what = "ALL") const override;
0056
0057 void set_output_filename(const std::string &filename) { m_output_filename = filename; }
0058
0059 private:
0060
0061 std::string m_output_filename = "SingleTrackAN.root";
0062
0063
0064
0065
0066
0067 int bunchnum;
0068 int sphnxbunchnum;
0069 int multiplicity;
0070 int crossing;
0071
0072
0073 static const int NBUNCHES = 120;
0074 int xingshift;
0075 int spinPatternBlue[NBUNCHES] = {0};
0076 int spinPatternYellow[NBUNCHES] = {0};
0077 int trackBunch = 0;
0078 int bspin = 0;
0079 int yspin = 0;
0080 float bpol;
0081 float bpolerr;
0082 float ypol;
0083 float ypolerr;
0084
0085
0086 std::array<double, 120> bunchnumber_lumi{0.};
0087
0088 double lumi{0.};
0089
0090
0091
0092 float p;
0093 float pt;
0094 float pz;
0095 float xf;
0096 float eta;
0097 float phi;
0098 float quality;
0099 float charge;
0100
0101
0102
0103 int candidate_crossing;
0104 uint64_t bco;
0105 uint64_t bcowindowlow;
0106 uint64_t bcowindowhigh;
0107 bool usable_bco_tag;
0108 bool doublecount;
0109
0110
0111 TTree *singleTrackTree = nullptr;
0112 TTree *runTree = nullptr;
0113
0114
0115 TH1F *hbunchnum = nullptr;
0116 TH1F *hsphnxbunchnum = nullptr;
0117 TH1F *hmultiplicity = nullptr;
0118 TH1F *hcrossing = nullptr;
0119 TH1F *htrackBunch = nullptr;
0120 TH1F *hbspin = nullptr;
0121 TH1F *hyspin = nullptr;
0122
0123 TFile *outfile;
0124
0125
0126
0127
0128
0129 };
0130
0131 #endif