Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BBCStudy.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file BBCStudy.h
1 #ifndef __BBCSTUDY_H__
2 #define __BBCSTUDY_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 PHG4HitContainer;
13 class EventHeader;
14 class MbdOut;
15 class MbdPmtContainer;
16 class MbdGeom;
17 class TFile;
18 class TTree;
19 class TDatabasePDG;
20 class TRandom3;
21 class TH1;
22 class TH2;
23 class TF1;
24 class TCanvas;
25 
26 
27 //Brief: basic TTree and histogram creation for sim evaluation
28 class BBCStudy: public SubsysReco
29 {
30 public:
31 
32  //Default constructor
33  BBCStudy(const std::string &name="BBCStudy");
34 
35  //Initialization, called for initialization
36  int Init(PHCompositeNode *);
37 
38  //Initialization at start of every run
39  int InitRun(PHCompositeNode *);
40 
41  //Process Event, called for each event
43 
44  //End, write and close files
45  int End(PHCompositeNode *);
46 
47  //Change output filename
48  void set_savefile(const char *f) { _savefname = f; }
49 
50  void set_tres(const Float_t tr) { _tres = tr; }
51 
52 private:
53 
54  //
55  void CheckDST(PHCompositeNode *topNode);
56 
57  //output filename
59  TFile* _savefile;
60 
61  int nprocessed{0}; // num events processed
62 
63  //Output
64  TTree* _tree;
65  Int_t f_evt;
66  Float_t f_bimp; // impact parameter
67  Int_t f_ncoll; // number n-n collisions
68  Int_t f_npart; // number participants
69  Float_t f_vx; // true x vertex of collision point
70  Float_t f_vy; // true y vertex
71  Float_t f_vz; // true z vertex
72  Float_t f_vt; // true start time
73  Short_t f_bbcn[2]; // num hits for each arm (north and south)
74  Float_t f_bbcq[2]; // total charge (currently npe) in each arm
75  Float_t f_bbct[2]; // time in arm
76  Float_t f_bbcte[2]; // earliest hit time in arm
77  Float_t f_bbcz; // z-vertex
78  Float_t f_bbct0; // start time
79 
80  TH1* h_bbcq[128]; // q in each tube
81  TH1* h_bbcqtot[2]; // total q in bbc arms
82  TH2* h2_bbcqtot; // north q vs south q
83  TH1* h_ztrue; // true z-vertex
84  TH1* h_tdiff; // time diff between estimated and real time
85  TH2* h2_tdiff_ch; // time diff by channel
86 
87  TCanvas *c_bbct; // Canvas to
88  TH1 *hevt_bbct[2]; // time in each bbc, per event
89  TF1 *gaussian;
90 
91  std::map<int,int> _pids; // PIDs of tracks in the BBC
92 
93  //
94  TDatabasePDG* _pdg;
95  TRandom3* _rndm;
96  Float_t _tres; // time resolution of one channel
97 
98  //Get all the nodes
99  void GetNodes(PHCompositeNode *);
100 
101  //Node pointers
108 
109 };
110 
111 #endif //* __BBCSTUDY_H__ *//