Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BbcCheck.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file BbcCheck.h
1 #ifndef __BBCCHECK_H__
2 #define __BBCCHECK_H__
3 
4 #include <fun4all/SubsysReco.h>
5 #include <string>
6 #include <map>
7 #include <TFile.h>
8 
9 //Forward declerations
10 class PHCompositeNode;
11 class EventHeader;
12 class MbdOut;
13 class MbdPmtContainer;
14 class TFile;
15 class TTree;
16 class TDatabasePDG;
17 class TRandom3;
18 class TH1;
19 class TH2;
20 class TGraphErrors;
21 class TF1;
22 class TCanvas;
23 
24 
25 //Brief: basic TTree and histogram creation for sim evaluation
26 class BbcCheck: public SubsysReco
27 {
28 public:
29 
30  //Default constructor
31  BbcCheck(const std::string &name="BbcCheck");
32 
33  //Initialization, called for initialization
34  int Init(PHCompositeNode *);
35 
36  //Initialization at start of every run
37  int InitRun(PHCompositeNode *);
38 
39  //Process Event, called for each event
41 
42  //End, write and close files
43  int End(PHCompositeNode *);
44 
45  //Change output filename
46  void set_savefile(const char *f) { _savefname = f; }
47 
48  void set_run(const int r) { f_run = r; }
49 
50 private:
51 
52  //
53  void CheckDST(PHCompositeNode *topNode);
54 
55  int Getpeaktime(TH1 *h);
56  void process_zdc( PHCompositeNode *topNode );
57  void process_emcal( PHCompositeNode *topNode );
58  void process_ohcal( PHCompositeNode *topNode );
59  void process_ihcal( PHCompositeNode *topNode );
60 
61  //output filename
63  TFile* _savefile;
64 
65  int nprocessed{0}; // num events processed
66 
67  //Output
68  TTree* _tree;
69  Int_t f_run;
70  Int_t f_evt;
71  Int_t f_ch;
72  Float_t f_qmean;
73  Float_t f_qmerr;
74 
75  Float_t f_bimp; // impact parameter
76  Int_t f_ncoll; // number n-n collisions
77  Int_t f_npart; // number participants
78  Float_t f_vx; // true x vertex of collision point
79  Float_t f_vy; // true y vertex
80  Float_t f_vz; // true z vertex
81  Float_t f_vt; // true start time
82  Short_t f_bbcn[2]; // num hits for each arm (north and south)
83  Float_t f_bbcq[2]; // total charge (currently npe) in each arm
84  Float_t f_bbct[2]; // time in arm
85  Float_t f_bbcte[2]; // earliest hit time in arm
86  Float_t f_bbcz; // z-vertex
87  Float_t f_bbct0; // start time
88 
89  TH1 *h_bbcq[128]; // q in each tube
90  TGraphErrors *g_bbcq[128]; // q in each tube
91  TH1 *h_bbcqtot[2]; // total q in bbc arms
92  TH1 *h_bbcqsum; // total q in bbc arms
93  TH2 *h2_bbcqsum; // north q vs south q
94 
95  TH1 *h_emcale;
97  TH1 *h_ohcale;
99  TH1 *h_ihcale;
101  TH1 *h_zdce;
103  TH1 *h_bz;
104 
105  TCanvas *c_bbct; // Canvas to
106  TH1 *hevt_bbct[2]; // time in each bbc, per event
107  TF1 *gaussian;
108 
109  std::map<int,int> _pids; // PIDs of tracks in the BBC
110 
111  //
112  TRandom3* _rndm;
113  Float_t _tres; // time resolution of one channel
114 
115  //Get all the nodes
116  void GetNodes(PHCompositeNode *);
117 
118  //Node pointers
122 
123 };
124 
125 #endif //* __BBCCHECK_H__ *//