Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TPCPedestalCalibration.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TPCPedestalCalibration.h
1 // Tell emacs that this is a C++ source
2 // -*- C++ -*-.
3 #ifndef TPCPedestalCalibration_H
4 #define TPCPedestalCalibration_H
5 
6 #include <fun4all/SubsysReco.h>
7 #include <cdbobjects/CDBTTree.h>
8 #include <sphenixnpc/CDBUtils.h>
9 
10 #include <string>
11 #include <vector>
12 
13 class PHCompositeNode;
14 class TFile;
15 class TTree;
16 
18 {
19  public:
20  explicit TPCPedestalCalibration(const std::string &name = "TPCPedestalCalibration.root");
21 
23 
24  int InitRun(PHCompositeNode *topNode) override;
25 
26  int process_event(PHCompositeNode *topNode) override;
27 
28  int EndRun(const int runnumber) override;
29 
30  void CDBInsert();
31 
32  int End(PHCompositeNode *topNode) override;
33 
34  void AddPacket(int packet)
35  {
36  m_packets.push_back(packet);
37  }
38 
39  void SetSector(int sectorNum)
40  {
41  m_sector = sectorNum;
42  }
43 
44  void InsertCDBTTree(const std::string &username) // username for CDB record of who uploaded the file
45  {
46  m_writeToCDB = true;
48  }
49 
51  {
52  CDBUtils *uti = new CDBUtils();
53  uti->createGlobalTag(username);
54  }
55 
56  protected:
58  std::vector<int> m_packets{1001};
59 
60  private:
63  CDBTTree * m_cdbttree = nullptr;
64 
65  int m_BCO = 0;
66  int m_packet = 0;
68  int m_nSamples = 0;
69  int m_fee = 0;
70  int m_Channel = 0;
71  std::vector<unsigned short> m_adcSamples;
72 
73  float m_aveADCFeeChannel[26][256];
74  float m_stdADCFeeChannel[26][256];
75  float m_countsADCFeeChannel[26][256];
76  int m_aliveArrayFeeChannel[26][256];
77 
79  bool m_firstBCO = true;
80  int m_isAlive = 1;
81  float m_pedMean = 0;
82  float m_pedStd = 0;
83  int m_sector = 0;
84  int m_outFEE = 99;
85  int m_chan = 999;
86  int m_module = 9;
87  int m_slot = 99;
88 
89  int mod_arr[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};
90  int slot_arr[26] = {5,6,1,3,2,12,10,11,9,8,7,1,2,4,8,7,6,5,4,3,1,3,2,4,6,5};
91 };
92 
93 #endif // TPCPedestalCalibration_H