CGEM BOSS 6.6.5.f
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#include "MdcHoughFinder/HoughTrackList.h"
34
35#include "MdcRecEvent/RecMdcTrack.h"
36#include "MdcRecEvent/RecMdcHit.h"
37#include "HepPDT/ParticleDataTable.hh"
38#include "MdcTrkRecon/MdcTrack.h"
39#include "MdcTrkRecon/MdcTrackParams.h"
40#include "MdcTrkRecon/MdcTrackList.h"
41#include "TrkBase/TrkRecoTrk.h"
42#include "TrkFitter/TrkContextEv.h"
43#include "CgemGeomSvc/CgemGeomSvc.h"
44#include "CgemCalibFunSvc/CgemCalibFunSvc.h"
45#include "TrackUtil/Helix.h"
46class IBesTimerSvc;
47class BesTimer;
48
49class MdcHoughFinder:public Algorithm {
50 public:
51 MdcHoughFinder(const std::string& name, ISvcLocator* pSvcLocator);
52 StatusCode initialize();
53 StatusCode execute();
54 StatusCode finalize();
55 StatusCode beginRun();
56 StatusCode bookTuple();
57
58 private:
59 int GetMcInfo();
60 MdcDigiVec prepareDigi();
61 void dumpHoughHitList(const HoughHitList&);
62 void dumpHoughMap(const HoughMap& );
63 void dumpHoughTrack( HoughTrack&, int , int );
64 void dumpHoughTrack( RecMdcTrackCol* trackList_tds );
65 void dumpHitOnTrack( HoughTrack&);
66 void dumpHitOnTrack( RecMdcTrackCol* trackList_tds);
67 void diffMap(const HoughMap& ,const HoughMap&);
68 void Leastfit(vector<double>, vector<double>,double&,double&);
69 int storeTracks(RecMdcTrackCol*& a,RecMdcHitCol*& b,vector<RecMdcTrack*>& vec_trackPatTds);
70 int storeTracks(RecMdcTrackCol* trackList, RecMdcHitCol* hitList, HoughTrackList& houghTrackList);
71 void clearMem(MdcTrackList& list1,MdcTrackList& list2);
72 void compareHough(MdcTrackList& mdcTrackList);
73 int comparePatTsf(MdcTrackList& tracklist, RecMdcTrackCol* trackList_tds);
74 int arbitrateHits(vector<MdcTrack*>& , MdcTrackParams );
75 //int judgeHit(MdcTrackList& list ,const vector<HoughTrack>& tracklist);
76 int judgeHit(MdcTrackList& list , vector<MdcTrack*>& tracklist);
77 int judgeChargeTrack(MdcTrackList& list1 , MdcTrackList& list2);
78 void printTrack(MdcTrackList& mdcTrackList);
79 void printTrack(vector<MdcTrack*> vec_MdcTrack);
80
81//declare property
82 std::string m_pdtFile;
83 HepPDT::ParticleDataTable* m_particleTable;
84 std::map< int, const HepVector > g_tkParTruth;
85 HepPoint3D g_firstHit;
86 Helix* m_helix;
87 double t_d0;
88 double t_z0;
89 double t_tanl;
90 double t_q;
91 double t_p;
92 double t_pt;
93 double t_cos;
94 double t_phi;
95 double t_omega;
96
97 int m_filter;
98 std::string m_evtFile;
99 int m_debug;
100 int m_debugMap;
101 int m_debug2D;
102 int m_debug3D;
103 int m_debugTrack;
104 int m_debugPeak;
105 int m_debugStereo;
106 int m_debugZs;
107 int m_debugArbHit;
108 int m_printflag;
109
110 int m_hist;
111 bool m_keepBadTdc;
112 bool m_dropHot;
113 bool m_keepUnmatch;
114 bool m_combineTracking;
115 int m_removeBadTrack;
116 double m_dropTrkDrCut;
117 double m_dropTrkDzCut;
118 double m_dropTrkPtCut;
119 double m_dropTrkChi2Cut;
120
121 int m_inputType;
122 double m_mapCharge;
123 int m_useHalf;
124 int m_mapHit;
125 int m_nBinTheta;
126 int m_nBinRho;
127 double m_rhoRange;
128 int m_npart;
129 int m_n2;
130 double m_d1;
131 double m_d2;
132 double m_peakWidth;
133 double m_peakHigh;
134 double m_hitPro;
135
136 int m_recpos;
137 int m_recneg;
138 int m_combine;
139 double m_z0Cut_compareHough;
140 bool m_cgem;
141 bool m_skipMDCIT;
142 bool m_globalfit;
143 int m_recMethod;
144 double m_factor2D;
145 double m_factor3D;
146 vector<double> m_cut_2D;
147 vector<double> m_cut_3D;
148 int m_maxGapLength;
149 int m_nHitDeleted;
150 int m_nPoint3D;
151 int m_nPoint2D;
152 double m_nRMS;
153 int m_fillMap;
154 //int m_cgemfit;
155
156
157 //data member
158 int m_event;
159 int m_run;
160 BField* m_bfield;
161 double m_bunchT0;
162 TrkContextEv* m_context;
163 const MdcCalibFunSvc* m_mdcCalibFunSvc;
164 RawDataProviderSvc* m_rawDataProviderSvc;
165 MdcGeomSvc* m_mdcGeomSvc;
166 CgemGeomSvc* m_cgemGeomSvc;
167 CgemCalibFunSvc* m_cgemCalibFunSvc;
168 IMagneticFieldSvc* m_pIMF;
169 const MdcPrintSvc* m_mdcPrintSvc;
170 IBesTimerSvc* m_timersvc;
171 BesTimer* m_timer_all;
172
173 //Ntuple
174 NTuple::Tuple* ntuple_hit;
175 NTuple::Item<int> m_hit_run;
176 NTuple::Item<int> m_hit_evt;
177 NTuple::Item<int> m_hit_nhit;
178 NTuple::Array<int> m_hit_hitid;
179 NTuple::Array<int> m_hit_layer;
180 NTuple::Array<int> m_hit_wire;
181 NTuple::Array<double> m_hit_x;
182 NTuple::Array<double> m_hit_y;
183 NTuple::Array<double> m_hit_z;
184 NTuple::Array<double> m_hit_driftdist;
185 NTuple::Array<double> m_hit_drifttime;
186 NTuple::Array<int> m_hit_flag;
187 NTuple::Array<double> m_hit_truth_x;
188 NTuple::Array<double> m_hit_truth_y;
189 NTuple::Array<double> m_hit_truth_z;
190 NTuple::Array<double> m_hit_truth_drift;
191 NTuple::Array<int> m_hit_truth_ambig;
192
193 NTuple::Tuple* ntuple_hot;
194 NTuple::Item<int> m_hot_run;
195 NTuple::Item<int> m_hot_evt;
196 NTuple::Item<int> m_hot_trk;
197 NTuple::Item<int> m_hot_nhot;
198 NTuple::Array<int> m_hot_hitid;
199 NTuple::Array<int> m_hot_layer;
200 NTuple::Array<int> m_hot_wire;
201 NTuple::Array<double> m_hot_x;
202 NTuple::Array<double> m_hot_y;
203 NTuple::Array<double> m_hot_z;
204 NTuple::Array<double> m_hot_x0;
205 NTuple::Array<double> m_hot_y0;
206 NTuple::Array<double> m_hot_z0;
207 NTuple::Array<double> m_hot_s0;
208 NTuple::Array<double> m_hot_x1;
209 NTuple::Array<double> m_hot_y1;
210 NTuple::Array<double> m_hot_z1;
211 NTuple::Array<double> m_hot_s1;
212 NTuple::Array<double> m_hot_drift;
213 NTuple::Array<int> m_hot_flag;
214 NTuple::Array<double> m_hot_deltaD;
215 NTuple::Array<double> m_hot_truth_x;
216 NTuple::Array<double> m_hot_truth_y;
217 NTuple::Array<double> m_hot_truth_z;
218 NTuple::Array<double> m_hot_truth_drift;
219 NTuple::Array<int> m_hot_truth_ambig;
220
221 NTuple::Tuple* ntuple_trk;
222 NTuple::Item<int> m_trk_run;
223 NTuple::Item<int> m_trk_evt;
224 NTuple::Item<int> m_trk_ntrk;
225 NTuple::Item<int> m_trk_size;
226 NTuple::Array<int> m_trk_trackId;
227 NTuple::Array<int> m_trk_charge;
228 NTuple::Array<double> m_trk_dr;
229 NTuple::Array<double> m_trk_phi0;
230 NTuple::Array<double> m_trk_kappa;
231 NTuple::Array<double> m_trk_dz;
232 NTuple::Array<double> m_trk_tanl;
233 NTuple::Array<double> m_trk_pxy;
234 NTuple::Array<double> m_trk_px;
235 NTuple::Array<double> m_trk_py;
236 NTuple::Array<double> m_trk_pz;
237 NTuple::Array<double> m_trk_p;
238 NTuple::Array<double> m_trk_theta;
239 NTuple::Array<double> m_trk_phi;
240 NTuple::Array<double> m_trk_x;
241 NTuple::Array<double> m_trk_y;
242 NTuple::Array<double> m_trk_z;
243 NTuple::Array<double> m_trk_r;
244 NTuple::Array<double> m_trk_chi2;
245 NTuple::Array<double> m_trk_fiTerm;
246 NTuple::Array<double> m_trk_matchChi2;
247 NTuple::Array<int> m_trk_nhit;
248 NTuple::Array<int> m_trk_ncluster;
249 NTuple::Array<int> m_trk_stat;
250 NTuple::Array<int> m_trk_ndof;
251 NTuple::Array<int> m_trk_nster;
252 NTuple::Array<int> m_trk_nlayer;
253 NTuple::Array<int> m_trk_firstLayer;
254 NTuple::Array<int> m_trk_lastLayer;
255 NTuple::Array<int> m_trk_nCgemXClusters;
256 NTuple::Array<int> m_trk_nCgemVClusters;
257 NTuple::Array<int> m_trk_nhop;
258 NTuple::Array<int> m_trk_nhot;
259 NTuple::Array<double> m_trk_Xc;
260 NTuple::Array<double> m_trk_Yc;
261 NTuple::Array<double> m_trk_R;
262
263 NTuple::Array<int> m_trk_truth_charge;
264 NTuple::Array<double> m_trk_truth_dr;
265 NTuple::Array<double> m_trk_truth_phi0;
266 NTuple::Array<double> m_trk_truth_kappa;
267 NTuple::Array<double> m_trk_truth_dz;
268 NTuple::Array<double> m_trk_truth_tanl;
269 NTuple::Array<double> m_trk_truth_pxy;
270 NTuple::Array<double> m_trk_truth_px;
271 NTuple::Array<double> m_trk_truth_py;
272 NTuple::Array<double> m_trk_truth_pz;
273 NTuple::Array<double> m_trk_truth_p;
274 NTuple::Array<double> m_trk_truth_theta;
275 NTuple::Array<double> m_trk_truth_phi;
276 NTuple::Array<double> m_trk_truth_x;
277 NTuple::Array<double> m_trk_truth_y;
278 NTuple::Array<double> m_trk_truth_z;
279 NTuple::Array<double> m_trk_truth_r;
280 NTuple::Array<double> m_trk_truth_cosTheta;
281 NTuple::Array<double> m_trk_truth_Xc;
282 NTuple::Array<double> m_trk_truth_Yc;
283 NTuple::Array<double> m_trk_truth_R;
284
285
286};
287bool more_pt(const HoughTrack* tracka,const HoughTrack* trackb);
288HepVector barbar2bes(HepVector a);
289HepVector bes2barbar(HepVector a);
290#endif
ObjectVector< RecMdcHit > RecMdcHitCol
ObjectVector< RecMdcTrack > RecMdcTrackCol
bool more_pt(const HoughTrack *tracka, const HoughTrack *trackb)
HepVector bes2barbar(HepVector a)
HepVector barbar2bes(HepVector a)
StatusCode execute()
StatusCode initialize()
StatusCode beginRun()
MdcHoughFinder(const std::string &name, ISvcLocator *pSvcLocator)
StatusCode finalize()
StatusCode bookTuple()