source: SuperB-LAL/trunk/slacExperiment_USBWC-CRT/mergeCRTandUSB/src/crtFileStr.hh

Last change on this file was 14, checked in by narnaud, 14 years ago

Initial commit

File size: 5.1 KB
RevLine 
[14]1#ifndef crtFileStr_hh
2#define crtFileStr_hh
3
4//root
5#include <TROOT.h>
6#include <TChain.h>
7#include <TFile.h>
8#include <TH1D.h>
9#include <TH2D.h>
10
11using namespace std;
12
13// NA: constant shift needed to get the time axis properly
14// labelled with the format MM/DD HH:MM
15//const Double_t timeShiftForProperDisplay = 36000.0;
16const Double_t timeShiftForProperDisplay = 32400.0;
17
18class crtBox;
19class crtTrk;
20class TRandom3;
21
22class crtFileStr {
23public :
24
25  crtFileStr();
26  ~crtFileStr();
27  Int_t  GetEntry(Long64_t entry);
28  Long64_t LoadTree(Long64_t entry);
29  void  Init(TTree *tree);
30  void  Loop(TString outputRootHistFile);
31  void  crtHodoscopeDataTest(TString outputRootHistFile);
32  void  Show(Long64_t entry = -1);
33
34  TRandom3 *_rnd;
35 
36  ////////////////New Functions//////////////////////
37  void addFilesToChain(string name);
38  void PrintEventInfo(Int_t evI);
39  void GetUnixTime(Double_t *unixTimeCRT, Int_t Nmax, Int_t &nEv);
40  void GetDataToMerge();
41  void GetDataFromDetectors();
42  void GetHodoscopePositions();
43  void GetHodoscopePositionsMyAlgo();
44  void GetTrkDirectionCos();
45  void saveUnixTime2File(TString fileN);
46  Bool_t CheckDistInTime();
47  void GetDataRate();//ev/s
48  Int_t getTrkMomID();
49  Double_t GetRelativeRunTime();
50
51  void initHistos_H1D(TH1D *h1D1[4],string h1name, string h1Title,
52                      Int_t Nbin, Float_t Vmin, Float_t Vmax);
53  void initHistos_H2D(TH2D *h2D1[4],string h2name, string h2Title,
54                      Int_t Nbin1, Float_t Vmin1, Float_t Vmax1,
55                      Int_t Nbin2, Float_t Vmin2, Float_t Vmax2);
56  void initHistosHodoX_H1D(TH1D *h1D1[55],string h1name, string h1Title,
57                           Int_t Nbin, Float_t Vmin, Float_t Vmax);
58  void initHistosHodoY_H1D(TH1D *h1D1[27],string h1name, string h1Title,
59                           Int_t Nbin, Float_t Vmin, Float_t Vmax);
60  /////////////////////////////////////////////////////
61 
62  /////////////////////////
63  crtBox *_boxfTOF;
64  crtBox *_boxfTOF_Bot;
65  crtBox *_boxQuartzS;
66  crtTrk *_trk;
67  /////////////////////////
68
69  Double_t _timeStopUnix;
70  Double_t _timeStartUnix;
71  Double_t _Rate;
72  Int_t _timeStart_hour;
73  Int_t _timeStart_min;
74  Double_t _relativeRunTime;
75
76  Bool_t _hodoStatus;
77
78  Double_t _x1;
79  Double_t _x2;
80  Double_t _y1;
81  Double_t _y2;
82
83  Double_t _trkTheta;
84  Double_t _trkPhi;
85  Int_t _trkMomID;
86
87  Double_t _cx;
88  Double_t _cy;
89  Double_t _cz;
90  ////////////////Data from detectors/////////
91
92  //trigger T1, T2
93  Int_t trig1A[4];//ADC
94  Int_t trig2A[4];//ADC
95  Int_t trig1T[4];//TDC
96  Int_t trig2T[4];//TDC
97  //stack counter information
98  Int_t stack1A[4];//ADC
99  Int_t stack2A[4];//ADC
100  Int_t stack3A[4];//ADC
101  Int_t stack4A[4];//ADC
102  Int_t stack1T[4];//TDC
103  Int_t stack2T[4];//TDC
104  Int_t stack3T[4];//TDC
105  Int_t stack4T[4];//TDC
106  //hodoscope
107  Int_t hodo1X[55];
108  Int_t hodo2X[55];
109  Int_t hodo1Y[27];
110  Int_t hodo2Y[27];
111  //quartz start counter
112  Int_t start1T[4];
113  Int_t start1A[4];//ADC information pulled out form tdc11 which is wery strange
114  ////////////////////////////////////////////
115
116  TTree          *fChain;
117  Int_t           fCurrent;
118 
119  // Declaration of leaf types
120  Double_t        time_CRT;
121  Int_t           tdc1_CRT[8];
122  Int_t           tdc2_CRT[8];
123  Int_t           tdc3_CRT[8];
124  Int_t           adc1_CRT[12];
125  Int_t           adc2_CRT[12];
126  Int_t           scl1_CRT[4];
127  Int_t           tdc4_CRT[32];
128  Int_t           tdc5_CRT[32];
129  Int_t           tdc6_CRT[32];
130  Int_t           tdc7_CRT[32];
131  Int_t           tdc8_CRT[32];
132  Int_t           tdc9_CRT[32];
133  Int_t           scl2_CRT[12];
134  Int_t           scl3_CRT[12];
135  Int_t           tdc10_CRT[16];
136  Int_t           tdc11_CRT[16];
137  Int_t           adc3_CRT[12];
138  Int_t           tdc12_CRT[8];
139  Float_t         temp_fDIRC[7][4];
140  Float_t         rovdd_fDIRC[7][4];
141  Int_t           row_fDIRC[7][4][16];
142  Int_t           col_fDIRC[7][4][16];
143  Int_t           rowref_fDIRC[7][4];
144  Int_t           colref_fDIRC[7][4];
145  Int_t           scaler_fDIRC[7][4][16];
146  Int_t           scalerref_fDIRC[7][4];
147  Int_t           placeholder1_fDIRC[7][4][8];
148  Int_t           placeholder2_fDIRC[7][4][8];
149  Float_t         adc_fdirc_fDIRC[7][4][16];
150  Float_t         tdc_fdirc_fDIRC[7][4][16];
151 
152  // List of branches
153  TBranch        *b_time;   //!
154  TBranch        *b_tdc1;   //!
155  TBranch        *b_tdc2;   //!
156  TBranch        *b_tdc3;   //!
157  TBranch        *b_adc1;   //!
158  TBranch        *b_adc2;   //!
159  TBranch        *b_scl1;   //!
160  TBranch        *b_tdc4;   //!
161  TBranch        *b_tdc5;   //!
162  TBranch        *b_tdc6;   //!
163  TBranch        *b_tdc7;   //!
164  TBranch        *b_tdc8;   //!
165  TBranch        *b_tdc9;   //!
166  TBranch        *b_scl2;   //!
167  TBranch        *b_scl3;   //!
168  TBranch        *b_tdc10;   //!
169  TBranch        *b_tdc11;   //!
170  TBranch        *b_adc3;   //!
171  TBranch        *b_tdc12;   //!
172  TBranch        *b_temp;   //!
173  TBranch        *b_rovdd;   //!
174  TBranch        *b_row;   //!
175  TBranch        *b_col;   //!
176  TBranch        *b_rowref;   //!
177  TBranch        *b_colref;   //!
178  TBranch        *b_scaler;   //!
179  TBranch        *b_scalerref;   //!
180  TBranch        *b_placeholder1;   //!
181  TBranch        *b_placeholder2;   //!
182  TBranch        *b_adc_fdirc;   //!
183  TBranch        *b_tdc_fdirc;   //!
184 
185
186};
187
188#endif
Note: See TracBrowser for help on using the repository browser.