BOSS 7.0.3
BESIII Offline Software System
Loading...
Searching...
No Matches
Reconstruction/MdcHoughFinder/MdcHoughFinder-00-00-12/MdcHoughFinder/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"
7#include "MdcGeomSvc/IMdcGeomSvc.h"
8#include "MdcGeomSvc/MdcGeoWire.h"
9#include "MdcGeomSvc/MdcGeoLayer.h"
10#include "RawDataProviderSvc/IRawDataProviderSvc.h"
11#include "RawDataProviderSvc/RawDataProviderSvc.h"
12#include "MagneticField/IMagneticFieldSvc.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"
24#include "MdcCalibFunSvc/MdcCalibFunSvc.h"
25#include "MdcUtilitySvc/MdcUtilitySvc.h"
26#include "MdcPrintSvc/MdcPrintSvc.h"
27//#include "CLHEP/Matrix/Vector.h"
28
29#include "MdcHoughFinder/HoughHit.h"
30#include "MdcHoughFinder/HoughHitList.h"
31#include "MdcHoughFinder/HoughGlobal.h"
32#include "MdcHoughFinder/HoughMap.h"
33
34#include "MdcRecEvent/RecMdcTrack.h"
35#include "MdcRecEvent/RecMdcHit.h"
36#include "HepPDT/ParticleDataTable.hh"
37#include "MdcTrkRecon/MdcTrack.h"
38#include "MdcTrkRecon/MdcTrackParams.h"
39#include "MdcTrkRecon/MdcTrackList.h"
40#include "TrkBase/TrkRecoTrk.h"
41#include "TrkFitter/TrkContextEv.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_d1;
114 double m_d2;
115 double m_peakWidth;
116 double m_peakHigh;
117 double m_hitPro;
118
119 int m_recpos;
120 int m_recneg;
121 int m_combine;
122 double m_z0Cut_compareHough;
123
124
125 //data member
126 int t_eventNum;
127 int t_runNum;
128 BField* m_bfield;
129 double m_bunchT0;
130 TrkContextEv* m_context;
131 const MdcCalibFunSvc* m_mdcCalibFunSvc;
132 RawDataProviderSvc* m_rawDataProviderSvc;
133 MdcGeomSvc* m_mdcGeomSvc;
134 IMagneticFieldSvc* m_pIMF;
135 const MdcPrintSvc* m_mdcPrintSvc;
136 IBesTimerSvc* m_timersvc;
137 BesTimer* m_timer_all;
138
139 //Ntuple
140 NTuple::Tuple* ntuple_evt;
141 NTuple::Item<int> m_eventNum;
142 NTuple::Item<int> m_runNum;
143 NTuple::Item<int> m_nHit;
144 NTuple::Item<int> m_nSig_Axial;
145 NTuple::Array<int> m_layer;
146 NTuple::Array<int> m_cell;
147 NTuple::Array<double> m_x;
148 NTuple::Array<double> m_y;
149 NTuple::Array<double> m_z;
150 NTuple::Array<double> m_u;
151 NTuple::Array<double> m_v;
152 NTuple::Array<double> m_r;
153 NTuple::Array<double> m_uTruth;
154 NTuple::Array<double> m_vTruth;
155 NTuple::Array<double> m_rTruth;
156 NTuple::Array<double> m_xTruth;
157 NTuple::Array<double> m_yTruth;
158 NTuple::Array<double> m_type;
159
160 NTuple::Array<double> m_deltaD;
161 NTuple::Array<double> m_flt;
162 NTuple::Array<double> m_drift;
163 NTuple::Array<double> m_driftTruth;
164 NTuple::Array<int> m_slant;
165
166 NTuple::Item<int> m_xybinNum;
167 NTuple::Item<double> m_xybinMax;
168 NTuple::Array<double> m_xybinNL;
169 NTuple::Array<double> m_xybinRL;
170 NTuple::Array<double> m_xybinS;
171
172 NTuple::Item<double> m_theta_left;
173 NTuple::Item<double> m_theta_right;
174 NTuple::Item<double> m_rho_down;
175 NTuple::Item<double> m_rho_up;
176 NTuple::Item<double> m_rho;
177 NTuple::Item<double> m_theta;
178 NTuple::Item<double> m_rho_line;
179 NTuple::Item<double> m_theta_line;
180 NTuple::Item<double> m_height;
181 NTuple::Item<double> m_aver;
182 NTuple::Item<double> m_sigma;
183
184 NTuple::Item<int> m_exit_multiturn;
185
186 NTuple::Item<int> m_nMap1Pk;
187 NTuple::Item<int> m_nMap1Tk;
188 NTuple::Item<int> m_nMap2Pk;
189 NTuple::Item<int> m_nMap2Tk;
190 NTuple::Array<double> m_PkRho1;
191 NTuple::Array<double> m_PkRho2;
192 NTuple::Array<double> m_PkTheta1;
193 NTuple::Array<double> m_PkTheta2;
194 NTuple::Array<double> m_TkRho1;
195 NTuple::Array<double> m_TkRho2;
196 NTuple::Array<double> m_TkTheta1;
197 NTuple::Array<double> m_TkTheta2;
198
199 NTuple::Item<int> m_nMaxLayerSlant;
200 NTuple::Array<double> m_MaxLayerSlant;
201 NTuple::Array<double> m_MaxLayer;
202 NTuple::Item<int> m_nNoMaxLayerSlant;
203 NTuple::Array<double> m_NoMaxLayerSlant;
204 NTuple::Array<int> m_NoMaxLayerid;
205
206 NTuple::Item<int> m_MapMax;
207 NTuple::Item<int> m_nMapPk;
208 NTuple::Array<int> m_PeakOrder;
209 NTuple::Array<double> m_PeakRho;
210 NTuple::Array<double> m_PeakTheta;
211 NTuple::Array<double> m_PeakHeight;
212 NTuple::Array<double> m_PeakHit;
213 NTuple::Array<double> m_PeakHitA;
214 NTuple::Item<int> m_nMapTrk;
215 NTuple::Array<double> m_TrackRho;
216 NTuple::Array<double> m_TrackTheta;
217 NTuple::Array<double> m_TrackHitA;
218 //rec - charge
219 //global 2D
220 NTuple::Item<int> m_nTrk2D_neg;
221 NTuple::Array<double> m_pt2D_neg;
222 NTuple::Array<double> m_nHit2D_neg;
223 NTuple::Array<double> m_chi2_2D_neg;
224 //global 3D
225 NTuple::Item<int> m_nTrk3D_neg;
226 NTuple::Array<double> m_tanl_neg;
227 NTuple::Array<double> m_tanl3D_neg;
228 NTuple::Array<double> m_z0_neg;
229 NTuple::Array<double> m_z0_3D_neg;
230 NTuple::Array<double> m_pro_neg;
231 NTuple::Array<double> m_pt3D_neg;
232 NTuple::Array<double> m_nHit3D_neg;
233 NTuple::Array<double> m_chi2_3D_neg;
234
235
236 //mc
237 //NTuple::Item<int> m_nTrkMC;
238 NTuple::Item<double> m_pidTruth;
239 NTuple::Item<double> m_costaTruth;
240 NTuple::Item<double> m_ptTruth;
241 NTuple::Item<double> m_pzTruth;
242 NTuple::Item<double> m_pTruth;
243 NTuple::Item<double> m_qTruth;
244 NTuple::Item<double> m_drTruth;
245 NTuple::Item<double> m_phi0Truth;
246 NTuple::Item<double> m_omegaTruth;
247 NTuple::Item<double> m_dzTruth;
248 NTuple::Item<double> m_tanl_mc;
249 NTuple::Item<double> m_rho_mc;
250 NTuple::Item<double> m_theta_mc;
251
252 NTuple::Item<double> m_time;
253
254 NTuple::Tuple* ntuplehit;
255 NTuple::Item<int> m_evt_stereo;
256 NTuple::Item<int> m_run_stereo;
257 NTuple::Item<double> m_cos_stereo;
258 NTuple::Item<double> m_tanlTruth_stereo;
259 NTuple::Item<double> m_ncir_stereo;
260 NTuple::Item<double> m_npair_stereo;
261 NTuple::Item<double> m_tanl_stereo;
262 NTuple::Item<double> m_tanl3D_stereo;
263 NTuple::Item<double> m_z0_stereo;
264 NTuple::Item<double> m_z03D_stereo;
265 NTuple::Item<int> m_nHit_axial;
266 NTuple::Array<int> m_axial_layer;
267 NTuple::Array<int> m_axial_wire;
268 NTuple::Array<double> m_axial_deltaD;
269 NTuple::Array<double> m_axial_flt;
270 NTuple::Item<int> m_nHit_stereo;
271 NTuple::Array<int> m_stereo_layer;
272 NTuple::Array<int> m_stereo_wire;
273 NTuple::Array<int> m_stereo_style;
274 NTuple::Array<double> m_stereo_z0;
275 NTuple::Array<double> m_stereo_z1;
276 NTuple::Array<double> m_stereo_s0;
277 NTuple::Array<double> m_stereo_s1;
278 NTuple::Array<double> m_stereo_z;
279 NTuple::Array<double> m_stereo_s;
280 NTuple::Array<double> m_stereo_sTruth;
281 NTuple::Array<double> m_stereo_zTruth;
282 NTuple::Array<double> m_stereo_deltaZ;
283 NTuple::Array<int> m_stereo_nsol;
284 NTuple::Array<double> m_stereo_disToCir;
285 NTuple::Array<int> m_stereo_cirlist;
286 NTuple::Array<int> m_stereo_ambig;
287 NTuple::Array<int> m_stereo_ambig_truth;
288
289};
290bool more_pt(const HoughTrack* tracka,const HoughTrack* trackb);
291#endif
ObjectVector< RecMdcHit > RecMdcHitCol
ObjectVector< RecMdcTrack > RecMdcTrackCol
bool more_pt(const HoughTrack *tracka, const HoughTrack *trackb)
Definition: Hough.cxx:960
StatusCode execute()
StatusCode initialize()
StatusCode beginRun()
MdcHoughFinder(const std::string &name, ISvcLocator *pSvcLocator)
StatusCode finalize()
StatusCode bookTuple()