BOSS 7.1.1
BESIII Offline Software System
Loading...
Searching...
No Matches
MdcCalib.h
Go to the documentation of this file.
1#ifndef MDCCALIB_H
2#define MDCCALIB_H
3
4
9
12
18
19#include "GaudiKernel/NTuple.h"
20#include "GaudiKernel/INTupleSvc.h"
21
22#include "TROOT.h"
23#include "TFile.h"
24#include "TObjArray.h"
25#include "TH1F.h"
26#include "TF1.h"
27#include "TTree.h"
28#include "TFolder.h"
29#include "TGraph.h"
30
31#include <fstream>
32#include <vector>
33#include <map>
34
35//const double pi = 3.14159265;
36class MdcCalib {
37public:
38 MdcCalib();
39 virtual ~MdcCalib();
40 virtual void initialize(TObjArray* hlist, IMdcGeomSvc* mdcGeomSvc,
41 IMdcCalibFunSvc* mdcFunSvc, IMdcUtilitySvc* mdcUtilitySvc) = 0;
42
43 virtual void setParam(MdcCalParams& param) = 0;
44 virtual int fillHist(MdcCalEvent* event) = 0;
45 virtual int updateConst(MdcCalibConst* calconst) = 0;
46 virtual void printCut() const = 0;
47 virtual void clear() = 0;
48
49private:
50 int getHresId(int lay, int entr, int lr, int bin) const;
51 int calDetEffi();
52 bool getCellTrkPass(MdcCalEvent* event, int iTrk, int cellTrkPass[]);
53
54 MdcCalParams m_param;
55
56 TObjArray* m_hlist;
57 IMdcGeomSvc* m_mdcGeomSvc;
58 IMdcCalibFunSvc* m_mdcFunSvc;
59 IMdcUtilitySvc* m_mdcUtilitySvc;
60
61 int m_nEvt;
62 int m_cut1;
63 int m_nTrkAfTrkCut;
64 int m_cut2;
65 int m_cut3;
66 int m_cut4;
67 int m_cut5;
68 int m_cut6;
69 int m_cut7;
70 int m_nTrkCal;
71
72 int m_nlayer;
73 int m_nEntr[43];
74 int m_nBin[MdcCalNLayer];
75 bool fgReadWireEff;
76
77 bool m_layBound[MdcCalNLayer];
78
79 /* for calculating efficiency */
80/* int m_nTrk[43]; */
81/* int m_nGoodHit[43]; */
82 bool m_fgGoodWire[43][288];
83 TH1F* m_effNtrk;
84 TH1F* m_effNtrkRecHit;
85
86 /* calculating efficiency without the impact of track fitting */
87 int m_hitNum[43][2];
88
89 /* for track cut */
90 bool m_fgIni;
91 double m_docaMax[MdcCalNLayer];
92
93 /* for calculating hitphi */
94 double m_radii[MdcCalNLayer];
95 double m_xe[MdcCalTotCell];
96 double m_ye[MdcCalTotCell];
97 double m_ze[MdcCalTotCell];
98 double m_xw[MdcCalTotCell];
99 double m_yw[MdcCalTotCell];
100 double m_zw[MdcCalTotCell];
101
102 TFolder* m_fdcom;
103
104 TH1F* m_hresAllInc;
105 TH1F* m_hresAllExc;
106 TH1F* m_hresAllAve;
107
108 TH1F* m_hresInnInc;
109 TH1F* m_hresInnExc;
110
111 TH1F* m_hresStpInc;
112 TH1F* m_hresStpExc;
113
114 TH1F* m_hresOutInc;
115 TH1F* m_hresOutExc;
116
117 TH1F* m_hresAllExcUp;
118 TH1F* m_hresAllExcDw;
119 TH1F* m_hresInnExcUp;
120 TH1F* m_hresInnExcDw;
121 TH1F* m_hresStpExcUp;
122 TH1F* m_hresStpExcDw;
123 TH1F* m_hresOutExcUp;
124 TH1F* m_hresOutExcDw;
125
126 TFolder* m_fdResQ;
127 TH1F* m_hresAveAllQ[14];
128 TH1F* m_hresAveOutQ[14];
129 TH1F* m_hresAveLayQ[43][14];
130
131 TH1F* m_hratio;
132
133 TH1F* m_hTes[10];
134 TH1F* m_hbbTrkFlg;
135 TH1F* m_hTesAll;
136 TH1F* m_hTesGood;
137 TH1F* m_hTesAllFlag;
138 TH1F* m_hTesRec;
139 TH1F* m_hTesCalFlag;
140 TH1F* m_hTesCalUse;
141
142 TH1F* m_hnRawHit;
143
144 TH1F* m_hpt;
145 TH1F* m_hpMax;
146 TH1F* m_hpMaxCms;
147 TH1F* m_hptPos;
148 TH1F* m_hptNeg;
149
150 TH1F* m_hp;
151 TH1F* m_hp_cms;
152 TH1F* m_hpPos;
153 TH1F* m_hpNeg;
154 TH1F* m_hpPoscms;
155 TH1F* m_hpNegcms;
156
157 //results after four momentum cut
158 TH1F* m_hp_cut;
159
160 TH1F* m_hnTrk;
161 TH1F* m_hnTrkCal;
162 TH1F* m_hnhitsRec;
163 TH1F* m_hnhitsRecInn;
164 TH1F* m_hnhitsRecStp;
165 TH1F* m_hnhitsRecOut;
166 TH1F* m_hnhitsCal;
167 TH1F* m_hnhitsCalInn;
168 TH1F* m_hnhitsCalStp;
169 TH1F* m_hnhitsCalOut;
170 TH1F* m_wirehitmap;
171 TH1F* m_layerhitmap;
172 TH1F* m_hchisq;
173
174 // histogram for distribution of noise
175 TH1F* m_hnoisephi;
176 TH1F* m_hnoiselay;
177 TH1F* m_hnoisenhits;
178
179 TH1F* m_hdr;
180 TH1F* m_hphi0;
181 TH1F* m_hkap;
182 TH1F* m_hdz;
183 TH1F* m_htanl;
184 TH1F* m_hcosthe;
185 TH1F* m_hcostheNeg;
186 TH1F* m_hcosthePos;
187
188 TH1F* m_hx0;
189 TH1F* m_hy0;
190 TH1F* m_hdelZ0;
191 TGraph* m_grX0Y0;
192 int m_nGrPoint;
193
194 TH1F* m_hitEffAll;
195 TH1F* m_hitEffRaw;
196 TH1F* m_hitEffRec;
197
198 /* X-T ntuple */
199 int m_nEvtNtuple;
200 NTuple::Tuple* m_xtTuple[MdcCalNLayer];
201 NTuple::Item<long> m_cel[MdcCalNLayer];
202 NTuple::Item<long> m_lr[MdcCalNLayer];
203 NTuple::Item<long> m_run[MdcCalNLayer];
204 NTuple::Item<long> m_evt[MdcCalNLayer];
205 NTuple::Item<double> m_doca[MdcCalNLayer];
206 NTuple::Item<double> m_dm[MdcCalNLayer];
207 NTuple::Item<double> m_tdr[MdcCalNLayer];
208 NTuple::Item<double> m_tdc[MdcCalNLayer];
209 NTuple::Item<double> m_entr[MdcCalNLayer];
210 NTuple::Item<double> m_zhit[MdcCalNLayer];
211 NTuple::Item<double> m_qhit[MdcCalNLayer];
212 NTuple::Item<double> m_p[MdcCalNLayer];
213 NTuple::Item<double> m_pt[MdcCalNLayer];
214 NTuple::Item<double> m_phi0[MdcCalNLayer];
215 NTuple::Item<double> m_tanl[MdcCalNLayer];
216 NTuple::Item<double> m_hitphi[MdcCalNLayer];
217
218 /* histograms drift time */
219 TFolder* m_fdTime;
220 TH1F* m_htraw[MdcCalNLayer];
221 TH1F* m_htdr[MdcCalNLayer];
222 TH1F* m_htdrlr[MdcCalNLayer][2];
223
224 /* histograms of adc */
225 TFolder* m_fdAdc;
226 TH1F* m_hadc[MdcCalNLayer];
227
228 /* histograms for spatial resolution */
229 TFolder* m_fdres;
230 TH1F* m_hresInc[MdcCalNLayer];
231 TH1F* m_hreslrInc[MdcCalNLayer][2];
232 TH1F* m_hresExc[MdcCalNLayer];
233 TH1F* m_hreslrExc[MdcCalNLayer][2];
234 TH1F* m_hresphi[MdcCalNLayer][20];
235
236 TFolder* m_fdresAve;
237 TH1F* m_hresAve[MdcCalNLayer];
238 TH1F* m_hreslrAve[MdcCalNLayer][2];
239
240 /* histograms for momentum vs phi */
241 static const int NPhiBin = 20;
242 static const int NThetaBin = 9;
243 double m_phiWid;
244 double m_theWid;
245 TFolder* m_fdmomPhi;
246 //in experimental reference frame
247 TH1F* m_ppPhi[NPhiBin];
248 TH1F* m_pnPhi[NPhiBin];
249 TH1F* m_ppThe[NThetaBin];
250 TH1F* m_pnThe[NThetaBin];
251 TH1F* m_ppThePhi[NThetaBin][NPhiBin];
252 TH1F* m_pnThePhi[NThetaBin][NPhiBin];
253
254 //in CMS
255 TH1F* m_ppPhiCms[NPhiBin];
256 TH1F* m_pnPhiCms[NPhiBin];
257 TH1F* m_ppTheCms[NThetaBin];
258 TH1F* m_pnTheCms[NThetaBin];
259 TH1F* m_ppThePhiCms[NThetaBin][NPhiBin];
260 TH1F* m_pnThePhiCms[NThetaBin][NPhiBin];
261
262 /* ntuple for cosmic-ray */
263 NTuple::Tuple* m_cosmic;
264 NTuple::Item<double> m_pUpcos;
265 NTuple::Item<double> m_pDwcos;
266 NTuple::Item<double> m_ptUpcos;
267 NTuple::Item<double> m_ptDwcos;
268 NTuple::Item<double> m_phiUpcos;
269 NTuple::Item<double> m_phiDwcos;
270 NTuple::Item<double> m_drUpcos;
271 NTuple::Item<double> m_drDwcos;
272 NTuple::Item<double> m_dzUpcos;
273 NTuple::Item<double> m_dzDwcos;
274 NTuple::Item<double> m_ctheUpcos;
275 NTuple::Item<double> m_ctheDwcos;
276 NTuple::Item<long> m_nhitUpcos;
277 NTuple::Item<long> m_nhitDwcos;
278 NTuple::Item<long> m_chargecos;
279 NTuple::Item<long> m_tesFlagcos;
280 NTuple::Item<double> m_tescos;
281
282 /* histograms for spatial resolution vs distance */
283 double m_dwid;
284 TFolder* m_fdres2d;
285 std::map<int, int> m_mapr2d;
286 std::vector<TH1F*> m_hr2dInc;
287 std::vector<TH1F*> m_hr2dExc;
288
289 TFolder* m_fdres2t;
290 TH1F* m_hr2t[MdcCalNLayer][MdcCalNENTRXT][2][45];
291
292 /* for the index of resolution histograms */
293 static const int HRESLAYER_INDEX = 10;
294 static const int HRESLAYER_MASK = 0xFC00;
295
296 static const int HRESENTRA_INDEX = 7;
297 static const int HRESENTRA_MASK = 0x380;
298
299 static const int HRESLR_INDEX = 5;
300 static const int HRESLR_MASK = 0x60;
301
302 static const int HRESBIN_INDEX = 0;
303 static const int HRESBIN_MASK = 0x1F;
304};
305
307 m_param = param;
308}
309
310#endif /* MDCCALIB_H */
*******INTEGER m_nBinMax INTEGER m_NdiMax !No of bins in histogram for cell exploration division $ !Last vertex $ !Last active cell $ !Last cell in buffer $ !No of sampling when dividing cell $ !No of function total $ !Flag for random ceel for $ !Flag for type of for WtMax $ !Flag which decides whether vertices are included in the sampling $ entire domain is hyp !Maximum effective eevents per bin
Definition FoamA.h:85
const int MdcCalNLayer
Definition MdcCalParams.h:6
const int MdcCalNENTRXT
const int MdcCalTotCell
Definition MdcCalParams.h:9
virtual void printCut() const =0
virtual void clear()=0
Definition MdcCalib.cxx:80
virtual ~MdcCalib()
Definition MdcCalib.cxx:77
virtual void initialize(TObjArray *hlist, IMdcGeomSvc *mdcGeomSvc, IMdcCalibFunSvc *mdcFunSvc, IMdcUtilitySvc *mdcUtilitySvc)=0
Definition MdcCalib.cxx:214
virtual int updateConst(MdcCalibConst *calconst)=0
virtual int fillHist(MdcCalEvent *event)=0
Definition MdcCalib.cxx:730
virtual void setParam(MdcCalParams &param)=0
Definition MdcCalib.h:306