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