Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TpcRawDataTree.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TpcRawDataTree.h
1 // Tell emacs that this is a C++ source
2 // -*- C++ -*-.
3 #ifndef TpcRawDataTree_H
4 #define TpcRawDataTree_H
5 
6 #include <fun4all/SubsysReco.h>
7 #include <tpc/TpcMap.h>
8 
9 #include <stdint.h>
10 #include <string>
11 #include <vector>
12 
13 class PHCompositeNode;
14 class TFile;
15 class TTree;
16 class TH1F;
17 class TH2F;
18 
20 class TpcRawDataTree : public SubsysReco
21 {
22  public:
23  explicit TpcRawDataTree(const std::string &fname = "TpcRawDataTree.root");
24 
25  ~TpcRawDataTree() override {}
26 
32  int InitRun(PHCompositeNode *topNode) override;
33 
37  int process_event(PHCompositeNode *topNode) override;
38 
40  int End(PHCompositeNode *topNode) override;
41 
42  void AddPacket(int packet)
43  {
44  m_packets.push_back(packet);
45  }
46  void includeXYPos(bool doInclude)
47  {
48  m_includeXYPos = doInclude;
49  }
50 
51 
52  protected:
54  std::vector<int> m_packets;
56 
57  private:
58  bool m_includeXYPos = true;
60  TFile * m_file = nullptr;
61  TTree * m_SampleTree = nullptr;
62  TTree * m_PacketTree = nullptr;
63  TTree * m_TaggerTree = nullptr;
64  //TTree * R1_map = nullptr;
65  //TTree * R2_map = nullptr;
66  //TTree * R3_map = nullptr;
67  TH1F * R1_hist = nullptr;
68  TH1F * R2_hist = nullptr;
69  TH1F * R3_hist = nullptr;
70  TH1F * TotalFEE = nullptr;
71  TH1F * TotalFEEsampa = nullptr;
72  TH1F * TotalFRAME = nullptr;
73  TH1F * checksumError_fee = nullptr;
74  TH1F * checksumError_feesampa = nullptr;
75  TH1F * checksumError_frame = nullptr;
76  TH2F * R1_time = nullptr;
77  TH2F * R2_time = nullptr;
78  TH2F * R3_time = nullptr;
79 
81 
82  int m_packet = 0;
83  int m_frame = 0;
85  int m_maxFEECount = 0;
86  int m_nSamples = 0;
87  int m_fee = 0;
88  int m_sampaAddress = 0;
89  int m_sampaChannel = 0;
90  int m_Channel = 0;
91  int m_BCO = 0;
92  int m_checksum = 0;
93  int m_checksumError = 0;
94  int side = 0;
95  double m_xPos = 0.;
96  double m_yPos = 0.;
97 
99  uint16_t m_tagger_type = 0;
100  uint8_t m_is_endat = 0;
101  uint8_t m_is_lvl1 = 0;
102  uint64_t m_bco = 0;
103  uint32_t m_lvl1_count = 0;
104  uint32_t m_endat_count = 0;
105  uint64_t m_last_bco = 0;
106  uint8_t m_modebits = 0;
107 
108  std::vector<unsigned short> m_adcSamples;
109 
110  int FEE_R[26]={2, 2, 1, 1, 1, 3, 3, 3, 3, 3, 3, 2, 2, 1, 2, 2, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3};
111  int FEE_map[26]={3, 2, 5, 3, 4, 0, 2, 1, 3, 4, 5, 7, 6, 2, 0, 1, 0, 1, 4, 5, 11, 9, 10, 8, 6, 7};
112 };
113 
114 #endif // TpcRawDataTree_H