BOSS 7.1.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Hough.h
Go to the documentation of this file.
1#ifndef HOUGHSPACE_H
2#define HOUGHSPACE_H
3
4#include "GaudiKernel/Algorithm.h"
5#include "GaudiKernel/NTuple.h"
6#include "GaudiKernel/INTupleSvc.h"
13#include <string>
14#include <vector>
15#include <map>
16#include "TH2D.h"
17#include "TF1.h"
18#include "TGraph.h"
19#include <fstream>
20
21#include "CLHEP/Alist/AList.h"
22#include "MdcGeom/MdcDetector.h"
23#include "BField/BField.h"
27//#include "CLHEP/Matrix/Vector.h"
28
33
36#include "HepPDT/ParticleDataTable.hh"
40#include "TrkBase/TrkRecoTrk.h"
42class IBesTimerSvc;
43class BesTimer;
44
45class MdcHoughFinder:public Algorithm {
46 public:
47 MdcHoughFinder(const std::string& name, ISvcLocator* pSvcLocator);
48 StatusCode initialize();
49 StatusCode execute();
50 StatusCode finalize();
51 StatusCode beginRun();
52 StatusCode bookTuple();
53
54 private:
55 int GetMcInfo();
56 MdcDigiVec prepareDigi();
57 void dumpHoughHitList(const HoughHitList&);
58 void dumpHoughMap(const HoughMap& );
59 void diffMap(const HoughMap& ,const HoughMap&);
60 void Leastfit(vector<double>, vector<double>,double&,double&);
61 int storeTracks(RecMdcTrackCol*& a,RecMdcHitCol*& b,vector<RecMdcTrack*>& vec_trackPatTds);
62 void clearMem(MdcTrackList& list1,MdcTrackList& list2);
63 void compareHough(MdcTrackList& mdcTrackList);
64 int comparePatTsf(MdcTrackList& tracklist, RecMdcTrackCol* trackList_tds);
65 int arbitrateHits(vector<MdcTrack*>& , MdcTrackParams );
66 //int judgeHit(MdcTrackList& list ,const vector<HoughTrack>& tracklist);
67 int judgeHit(MdcTrackList& list , vector<MdcTrack*>& tracklist);
68 int judgeChargeTrack(MdcTrackList& list1 , MdcTrackList& list2);
69
70//declare property
71 std::string m_pdtFile;
72 HepPDT::ParticleDataTable* m_particleTable;
73 std::map< int, const HepVector > g_tkParTruth;
74 HepPoint3D g_firstHit;
75 double t_d0;
76 double t_z0;
77 double t_tanl;
78 double t_p;
79 double t_pt;
80 double t_cos;
81
82 int m_filter;
83 std::string m_evtFile;
84 int m_debug;
85 int m_debugMap;
86 int m_debug2D;
87 int m_debug3D;
88 int m_debugTrack;
89 int m_debugStereo;
90 int m_debugZs;
91 int m_debugArbHit;
92
93 bool m_hist;
94 bool m_keepBadTdc;
95 bool m_dropHot;
96 bool m_keepUnmatch;
97 bool m_combineTracking;
98 int m_removeBadTrack;
99 double m_dropTrkDrCut;
100 double m_dropTrkDzCut;
101 double m_dropTrkPtCut;
102 double m_dropTrkChi2Cut;
103
104 int m_inputType;
105 double m_mapCharge;
106 int m_useHalf;
107 int m_mapHit;
108 int m_nBinTheta;
109 int m_nBinRho;
110 double m_rhoRange;
111 int m_npart;
112 int m_n2;
113 double m_peakWidth;
114 double m_peakHigh;
115 double m_hitPro;
116
117 int m_recpos;
118 int m_recneg;
119 int m_combine;
120 double m_z0Cut_compareHough;
121
122
123 //data member
124 int t_eventNum;
125 int t_runNum;
126 BField* m_bfield;
127 double m_bunchT0;
128 TrkContextEv* m_context;
129 const MdcCalibFunSvc* m_mdcCalibFunSvc;
130 RawDataProviderSvc* m_rawDataProviderSvc;
131 MdcGeomSvc* m_mdcGeomSvc;
132 IMagneticFieldSvc* m_pIMF;
133 const MdcPrintSvc* m_mdcPrintSvc;
134 IBesTimerSvc* m_timersvc;
135 BesTimer* m_timer_all;
136
137 //Ntuple
138 NTuple::Tuple* ntuple_evt;
139 NTuple::Item<int> m_eventNum;
140 NTuple::Item<int> m_runNum;
141 NTuple::Item<int> m_nHit;
142 NTuple::Item<int> m_nSig_Axial;
143 NTuple::Array<int> m_layer;
144 NTuple::Array<int> m_cell;
145 NTuple::Array<double> m_x;
146 NTuple::Array<double> m_y;
147 NTuple::Array<double> m_z;
148 NTuple::Array<double> m_u;
149 NTuple::Array<double> m_v;
150 NTuple::Array<double> m_r;
151 NTuple::Array<double> m_uTruth;
152 NTuple::Array<double> m_vTruth;
153 NTuple::Array<double> m_rTruth;
154 NTuple::Array<double> m_xTruth;
155 NTuple::Array<double> m_yTruth;
156 NTuple::Array<double> m_type;
157
158 NTuple::Array<double> m_deltaD;
159 NTuple::Array<double> m_flt;
160 NTuple::Array<double> m_drift;
161 NTuple::Array<double> m_driftTruth;
162 NTuple::Array<int> m_slant;
163
164 NTuple::Item<int> m_xybinNum;
165 NTuple::Item<double> m_xybinMax;
166 NTuple::Array<double> m_xybinNL;
167 NTuple::Array<double> m_xybinRL;
168 NTuple::Array<double> m_xybinS;
169
170 NTuple::Item<double> m_theta_left;
171 NTuple::Item<double> m_theta_right;
172 NTuple::Item<double> m_rho_down;
173 NTuple::Item<double> m_rho_up;
174 NTuple::Item<double> m_rho;
175 NTuple::Item<double> m_theta;
176 NTuple::Item<double> m_rho_line;
177 NTuple::Item<double> m_theta_line;
178 NTuple::Item<double> m_height;
179 NTuple::Item<double> m_aver;
180 NTuple::Item<double> m_sigma;
181
182 NTuple::Item<int> m_exit_multiturn;
183
184 NTuple::Item<int> m_nMap1Pk;
185 NTuple::Item<int> m_nMap1Tk;
186 NTuple::Item<int> m_nMap2Pk;
187 NTuple::Item<int> m_nMap2Tk;
188 NTuple::Array<double> m_PkRho1;
189 NTuple::Array<double> m_PkRho2;
190 NTuple::Array<double> m_PkTheta1;
191 NTuple::Array<double> m_PkTheta2;
192 NTuple::Array<double> m_TkRho1;
193 NTuple::Array<double> m_TkRho2;
194 NTuple::Array<double> m_TkTheta1;
195 NTuple::Array<double> m_TkTheta2;
196
197 NTuple::Item<int> m_nMaxLayerSlant;
198 NTuple::Array<double> m_MaxLayerSlant;
199 NTuple::Array<double> m_MaxLayer;
200 NTuple::Item<int> m_nNoMaxLayerSlant;
201 NTuple::Array<double> m_NoMaxLayerSlant;
202 NTuple::Array<int> m_NoMaxLayerid;
203
204 NTuple::Item<int> m_MapMax;
205 NTuple::Item<int> m_nMapPk;
206 NTuple::Array<int> m_PeakOrder;
207 NTuple::Array<double> m_PeakRho;
208 NTuple::Array<double> m_PeakTheta;
209 NTuple::Array<double> m_PeakHeight;
210 NTuple::Array<double> m_PeakHit;
211 NTuple::Array<double> m_PeakHitA;
212 NTuple::Item<int> m_nMapTrk;
213 NTuple::Array<double> m_TrackRho;
214 NTuple::Array<double> m_TrackTheta;
215 NTuple::Array<double> m_TrackHitA;
216 //rec - charge
217 //global 2D
218 NTuple::Item<int> m_nTrk2D_neg;
219 NTuple::Array<double> m_pt2D_neg;
220 NTuple::Array<double> m_nHit2D_neg;
221 NTuple::Array<double> m_chi2_2D_neg;
222 //global 3D
223 NTuple::Item<int> m_nTrk3D_neg;
224 NTuple::Array<double> m_tanl_neg;
225 NTuple::Array<double> m_tanl3D_neg;
226 NTuple::Array<double> m_z0_neg;
227 NTuple::Array<double> m_z0_3D_neg;
228 NTuple::Array<double> m_pro_neg;
229 NTuple::Array<double> m_pt3D_neg;
230 NTuple::Array<double> m_nHit3D_neg;
231 NTuple::Array<double> m_chi2_3D_neg;
232
233
234 //mc
235 //NTuple::Item<int> m_nTrkMC;
236 NTuple::Item<double> m_pidTruth;
237 NTuple::Item<double> m_costaTruth;
238 NTuple::Item<double> m_ptTruth;
239 NTuple::Item<double> m_pzTruth;
240 NTuple::Item<double> m_pTruth;
241 NTuple::Item<double> m_qTruth;
242 NTuple::Item<double> m_drTruth;
243 NTuple::Item<double> m_phi0Truth;
244 NTuple::Item<double> m_omegaTruth;
245 NTuple::Item<double> m_dzTruth;
246 NTuple::Item<double> m_tanl_mc;
247 NTuple::Item<double> m_rho_mc;
248 NTuple::Item<double> m_theta_mc;
249
250 NTuple::Item<double> m_time;
251
252 NTuple::Tuple* ntuplehit;
253 NTuple::Item<int> m_evt_stereo;
254 NTuple::Item<int> m_run_stereo;
255 NTuple::Item<double> m_cos_stereo;
256 NTuple::Item<double> m_tanlTruth_stereo;
257 NTuple::Item<double> m_ncir_stereo;
258 NTuple::Item<double> m_npair_stereo;
259 NTuple::Item<double> m_tanl_stereo;
260 NTuple::Item<double> m_tanl3D_stereo;
261 NTuple::Item<double> m_z0_stereo;
262 NTuple::Item<double> m_z03D_stereo;
263 NTuple::Item<int> m_nHit_axial;
264 NTuple::Array<int> m_axial_layer;
265 NTuple::Array<int> m_axial_wire;
266 NTuple::Array<double> m_axial_deltaD;
267 NTuple::Array<double> m_axial_flt;
268 NTuple::Item<int> m_nHit_stereo;
269 NTuple::Array<int> m_stereo_layer;
270 NTuple::Array<int> m_stereo_wire;
271 NTuple::Array<int> m_stereo_style;
272 NTuple::Array<double> m_stereo_z0;
273 NTuple::Array<double> m_stereo_z1;
274 NTuple::Array<double> m_stereo_s0;
275 NTuple::Array<double> m_stereo_s1;
276 NTuple::Array<double> m_stereo_z;
277 NTuple::Array<double> m_stereo_s;
278 NTuple::Array<double> m_stereo_sTruth;
279 NTuple::Array<double> m_stereo_zTruth;
280 NTuple::Array<double> m_stereo_deltaZ;
281 NTuple::Array<int> m_stereo_nsol;
282 NTuple::Array<double> m_stereo_disToCir;
283 NTuple::Array<int> m_stereo_cirlist;
284 NTuple::Array<int> m_stereo_ambig;
285 NTuple::Array<int> m_stereo_ambig_truth;
286
287};
288bool more_pt(const HoughTrack* tracka,const HoughTrack* trackb);
289#endif
bool more_pt(const HoughTrack *tracka, const HoughTrack *trackb)
Definition: Hough.cxx:955
std::vector< MdcDigi * > MdcDigiVec
ObjectVector< RecMdcHit > RecMdcHitCol
Definition: RecMdcHit.h:99
ObjectVector< RecMdcTrack > RecMdcTrackCol
Definition: RecMdcTrack.h:79
StatusCode execute()
Definition: Hough.cxx:243
StatusCode initialize()
Definition: Hough.cxx:137
StatusCode beginRun()
Definition: Hough.cxx:128
StatusCode finalize()
Definition: Hough.cxx:616
StatusCode bookTuple()
Definition: Hough.cxx:1328
const double b
Definition: slope.cxx:9