4#include "GaudiKernel/Algorithm.h"
5#include "GaudiKernel/INTupleSvc.h"
6#include "GaudiKernel/NTuple.h"
23 HoughFinder(
const std::string& name, ISvcLocator* pSvcLocator);
47 int checkHot(vector<HoughTrack>& trackVector);
48 int checkTrack(vector<HoughTrack>& trackVector);
49 void clearTrack(vector<HoughTrack>& trackVector);
59 vector<HoughTrack>::iterator
getHoughTrkIt(vector<HoughTrack>& houghTrkList,
int trkId);
80 std::string m_pdtFile;
88 int m_totEvtProcessed;
100 double m_driftTimeUpLimit;
103 double m_shareHitRate;
110 double m_chi2CutHits;
113 int m_findPeakMethod;
115 int m_removeNOuterHits;
147 RecCgemClusterCol::iterator m_recCgemClusterColBegin;
150 vector<MdcHit*> m_mdcHitCol;
151 vector<HoughHit> m_mcHitCol;
152 vector<HoughHit> m_houghHitList;
153 vector<HoughTrack> m_mcTrackCol;
154 vector<HoughTrack> m_houghTrackList;
156 vector<HoughHit*> m_XHoughHitList;
157 vector<HoughHit*> m_VHoughHitList;
158 vector<HoughHit*> m_VHoughHitListOnSZmap;
161 std::string m_evtFile;
167 double m_XGapFractionCutHough;
168 double m_XGapFractionCutFit;
170 TH2D m_roughRhoThetaMap;
171 TH2D m_fineRhoThetaMap;
173 void getWeightedPeak(TH2D& h,
double& x_peak,
double& y_peak,
double& x_weight,
double& y_weight,
int x_ext=2,
int y_ext=1);
176 int nFineBinTheta(
double rho);
177 int nFineBinRho(
double rho);
178 TGraph* m_cut1_cgem, *m_cut2_cgem;
179 TGraph* m_cut1_ODC1, *m_cut2_ODC1;
180 TGraph* m_cut1_ODC2, *m_cut2_ODC2;
181 void XhitCutWindow(
double rho,
int ilayer,
double charge,
double& cut1,
double &cut2);
191 TH2D m_roughTanlDzMap;
192 TH2D m_fineTanlDzMap;
193 int associateVHits();
196 int nFineBinTanl(
double tanl);
197 int nFineBinDz(
double tanl);
198 void XVhitCutWindow(
double tanl,
int ilayer,
double charge,
double& cut1,
double &cut2);
206 int dumpHoughTrack();
207 int dumpHoughEvent();
212 NTuple::Tuple* ntuple_hit;
213 NTuple::Item<int> m_hit_run;
214 NTuple::Item<int> m_hit_event;
215 NTuple::Item<int> m_hit_nhit;
217 NTuple::Array<int> m_hit_hitID;
218 NTuple::Array<int> m_hit_hitType;
219 NTuple::Array<int> m_hit_layer;
220 NTuple::Array<int> m_hit_wire;
221 NTuple::Array<int> m_hit_flag;
222 NTuple::Array<int> m_hit_halfCircle;
223 NTuple::Array<double> m_hit_x;
224 NTuple::Array<double> m_hit_y;
225 NTuple::Array<double> m_hit_z;
226 NTuple::Array<double> m_hit_drift;
228 NTuple::Array<int> m_mcHit_hitID;
229 NTuple::Array<int> m_mcHit_hitType;
230 NTuple::Array<int> m_mcHit_layer;
231 NTuple::Array<int> m_mcHit_wire;
232 NTuple::Array<int> m_mcHit_flag;
233 NTuple::Array<int> m_mcHit_halfCircle;
234 NTuple::Array<double> m_mcHit_x;
235 NTuple::Array<double> m_mcHit_y;
236 NTuple::Array<double> m_mcHit_z;
237 NTuple::Array<double> m_mcHit_drift;
241 NTuple::Tuple* ntuple_track;
242 NTuple::Item<int> m_trk_run;
243 NTuple::Item<int> m_trk_event;
244 NTuple::Item<int> m_trk_nTrack;
245 NTuple::Item<int> m_trk_trackID;
246 NTuple::Item<int> m_trk_charge;
247 NTuple::Item<int> m_trk_flag;
248 NTuple::Item<double> m_trk_angle;
249 NTuple::Item<double> m_trk_rho;
250 NTuple::Item<double> m_trk_dAngle;
251 NTuple::Item<double> m_trk_dRho;
252 NTuple::Item<double> m_trk_dTanl;
253 NTuple::Item<double> m_trk_dDz;
254 NTuple::Item<double> m_trk_Xc;
255 NTuple::Item<double> m_trk_Yc;
256 NTuple::Item<double> m_trk_R;
257 NTuple::Item<double> m_trk_dr;
258 NTuple::Item<double> m_trk_phi0;
259 NTuple::Item<double> m_trk_kappa;
260 NTuple::Item<double> m_trk_dz;
261 NTuple::Item<double> m_trk_tanl;
262 NTuple::Item<double> m_trk_pxy;
263 NTuple::Item<double> m_trk_px;
264 NTuple::Item<double> m_trk_py;
265 NTuple::Item<double> m_trk_pz;
266 NTuple::Item<double> m_trk_p;
267 NTuple::Item<double> m_trk_phi;
268 NTuple::Item<double> m_trk_theta;
269 NTuple::Item<double> m_trk_cosTheta;
270 NTuple::Item<double> m_trk_vx;
271 NTuple::Item<double> m_trk_vy;
272 NTuple::Item<double> m_trk_vz;
273 NTuple::Item<double> m_trk_vr;
274 NTuple::Item<double> m_trk_chi2;
275 NTuple::Item<double> m_trk_fiTerm;
276 NTuple::Item<int> m_trk_nhit;
277 NTuple::Item<int> m_trk_ncluster;
278 NTuple::Item<int> m_trk_stat;
279 NTuple::Item<int> m_trk_ndof;
280 NTuple::Item<int> m_trk_nster;
281 NTuple::Item<int> m_trk_nlayer;
282 NTuple::Item<int> m_trk_firstLayer;
283 NTuple::Item<int> m_trk_lastLayer;
284 NTuple::Item<int> m_trk_nCgemXClusters;
285 NTuple::Item<int> m_trk_nCgemVClusters;
286 NTuple::Item<int> m_trk_nHot;
288 NTuple::Array<int> m_hot_hitID;
289 NTuple::Array<int> m_hot_hitType;
290 NTuple::Array<int> m_hot_layer;
291 NTuple::Array<int> m_hot_wire;
292 NTuple::Array<int> m_hot_flag;
293 NTuple::Array<int> m_hot_halfCircle;
294 NTuple::Array<double> m_hot_x;
295 NTuple::Array<double> m_hot_y;
296 NTuple::Array<double> m_hot_z;
297 NTuple::Array<double> m_hot_drift;
298 NTuple::Array<double> m_hot_residual;
300 NTuple::Array<int> m_mcHot_hitID;
301 NTuple::Array<int> m_mcHot_hitType;
302 NTuple::Array<int> m_mcHot_layer;
303 NTuple::Array<int> m_mcHot_wire;
304 NTuple::Array<int> m_mcHot_flag;
305 NTuple::Array<int> m_mcHot_halfCircle;
306 NTuple::Array<double> m_mcHot_x;
307 NTuple::Array<double> m_mcHot_y;
308 NTuple::Array<double> m_mcHot_z;
309 NTuple::Array<double> m_mcHot_drift;
311 NTuple::Item<int> m_mcTrk_trackID;
312 NTuple::Item<int> m_mcTrk_charge;
313 NTuple::Item<int> m_mcTrk_flag;
314 NTuple::Item<double> m_mcTrk_angle;
315 NTuple::Item<double> m_mcTrk_rho;
316 NTuple::Item<double> m_mcTrk_dAngle;
317 NTuple::Item<double> m_mcTrk_dRho;
318 NTuple::Item<double> m_mcTrk_dTanl;
319 NTuple::Item<double> m_mcTrk_dDz;
320 NTuple::Item<double> m_mcTrk_Xc;
321 NTuple::Item<double> m_mcTrk_Yc;
322 NTuple::Item<double> m_mcTrk_R;
323 NTuple::Item<double> m_mcTrk_dr;
324 NTuple::Item<double> m_mcTrk_phi0;
325 NTuple::Item<double> m_mcTrk_kappa;
326 NTuple::Item<double> m_mcTrk_dz;
327 NTuple::Item<double> m_mcTrk_tanl;
328 NTuple::Item<double> m_mcTrk_pxy;
329 NTuple::Item<double> m_mcTrk_px;
330 NTuple::Item<double> m_mcTrk_py;
331 NTuple::Item<double> m_mcTrk_pz;
332 NTuple::Item<double> m_mcTrk_p;
333 NTuple::Item<double> m_mcTrk_phi;
334 NTuple::Item<double> m_mcTrk_theta;
335 NTuple::Item<double> m_mcTrk_cosTheta;
336 NTuple::Item<double> m_mcTrk_vx;
337 NTuple::Item<double> m_mcTrk_vy;
338 NTuple::Item<double> m_mcTrk_vz;
339 NTuple::Item<double> m_mcTrk_vr;
340 NTuple::Item<double> m_mcTrk_chi2;
341 NTuple::Item<double> m_mcTrk_fiTerm;
342 NTuple::Item<int> m_mcTrk_nhit;
343 NTuple::Item<int> m_mcTrk_ncluster;
344 NTuple::Item<int> m_mcTrk_stat;
345 NTuple::Item<int> m_mcTrk_ndof;
346 NTuple::Item<int> m_mcTrk_nster;
347 NTuple::Item<int> m_mcTrk_nlayer;
348 NTuple::Item<int> m_mcTrk_firstLayer;
349 NTuple::Item<int> m_mcTrk_lastLayer;
350 NTuple::Item<int> m_mcTrk_nCgemXClusters;
351 NTuple::Item<int> m_mcTrk_nCgemVClusters;
352 NTuple::Item<int> m_mcTrk_nHot;
354 NTuple::Array<int> m_mcTrkHot_hitID;
355 NTuple::Array<int> m_mcTrkHot_hitType;
356 NTuple::Array<int> m_mcTrkHot_layer;
357 NTuple::Array<int> m_mcTrkHot_wire;
358 NTuple::Array<int> m_mcTrkHot_flag;
359 NTuple::Array<int> m_mcTrkHot_halfCircle;
360 NTuple::Array<double> m_mcTrkHot_x;
361 NTuple::Array<double> m_mcTrkHot_y;
362 NTuple::Array<double> m_mcTrkHot_z;
363 NTuple::Array<double> m_mcTrkHot_drift;
367 NTuple::Tuple* ntuple_event;
368 NTuple::Item<int> m_evt_run;
369 NTuple::Item<int> m_evt_event;
370 NTuple::Item<int> m_evt_nXCluster;
371 NTuple::Item<int> m_evt_nVCluster;
372 NTuple::Item<int> m_evt_nXVCluster;
373 NTuple::Item<int> m_evt_nCGEMCluster;
374 NTuple::Item<int> m_evt_nAxialHit;
375 NTuple::Item<int> m_evt_nStereoHit;
376 NTuple::Item<int> m_evt_nODCHit;
377 NTuple::Item<int> m_evt_nHit;
378 NTuple::Item<int> m_evt_nTrack;
380 NTuple::Array<int> m_evtTrk_trackID;
381 NTuple::Array<int> m_evtTrk_charge;
382 NTuple::Array<int> m_evtTrk_flag;
383 NTuple::Array<double> m_evtTrk_angle;
384 NTuple::Array<double> m_evtTrk_rho;
385 NTuple::Array<double> m_evtTrk_dAngle;
386 NTuple::Array<double> m_evtTrk_dRho;
387 NTuple::Array<double> m_evtTrk_dTanl;
388 NTuple::Array<double> m_evtTrk_dDz;
389 NTuple::Array<double> m_evtTrk_Xc;
390 NTuple::Array<double> m_evtTrk_Yc;
391 NTuple::Array<double> m_evtTrk_R;
392 NTuple::Array<double> m_evtTrk_dr;
393 NTuple::Array<double> m_evtTrk_phi0;
394 NTuple::Array<double> m_evtTrk_kappa;
395 NTuple::Array<double> m_evtTrk_dz;
396 NTuple::Array<double> m_evtTrk_tanl;
397 NTuple::Array<double> m_evtTrk_pxy;
398 NTuple::Array<double> m_evtTrk_px;
399 NTuple::Array<double> m_evtTrk_py;
400 NTuple::Array<double> m_evtTrk_pz;
401 NTuple::Array<double> m_evtTrk_p;
402 NTuple::Array<double> m_evtTrk_phi;
403 NTuple::Array<double> m_evtTrk_theta;
404 NTuple::Array<double> m_evtTrk_cosTheta;
405 NTuple::Array<double> m_evtTrk_vx;
406 NTuple::Array<double> m_evtTrk_vy;
407 NTuple::Array<double> m_evtTrk_vz;
408 NTuple::Array<double> m_evtTrk_vr;
409 NTuple::Array<double> m_evtTrk_chi2;
410 NTuple::Array<double> m_evtTrk_fiTerm;
411 NTuple::Array<int> m_evtTrk_nhit;
412 NTuple::Array<int> m_evtTrk_ncluster;
413 NTuple::Array<int> m_evtTrk_stat;
414 NTuple::Array<int> m_evtTrk_ndof;
415 NTuple::Array<int> m_evtTrk_nster;
416 NTuple::Array<int> m_evtTrk_nlayer;
417 NTuple::Array<int> m_evtTrk_firstLayer;
418 NTuple::Array<int> m_evtTrk_lastLayer;
419 NTuple::Array<int> m_evtTrk_nCgemXClusters;
420 NTuple::Array<int> m_evtTrk_nCgemVClusters;
422 NTuple::Array<int> m_mcEvtTrk_trackID;
423 NTuple::Array<int> m_mcEvtTrk_charge;
424 NTuple::Array<int> m_mcEvtTrk_flag;
425 NTuple::Array<double> m_mcEvtTrk_angle;
426 NTuple::Array<double> m_mcEvtTrk_rho;
427 NTuple::Array<double> m_mcEvtTrk_dAngle;
428 NTuple::Array<double> m_mcEvtTrk_dRho;
429 NTuple::Array<double> m_mcEvtTrk_dTanl;
430 NTuple::Array<double> m_mcEvtTrk_dDz;
431 NTuple::Array<double> m_mcEvtTrk_Xc;
432 NTuple::Array<double> m_mcEvtTrk_Yc;
433 NTuple::Array<double> m_mcEvtTrk_R;
434 NTuple::Array<double> m_mcEvtTrk_dr;
435 NTuple::Array<double> m_mcEvtTrk_phi0;
436 NTuple::Array<double> m_mcEvtTrk_kappa;
437 NTuple::Array<double> m_mcEvtTrk_dz;
438 NTuple::Array<double> m_mcEvtTrk_tanl;
439 NTuple::Array<double> m_mcEvtTrk_pxy;
440 NTuple::Array<double> m_mcEvtTrk_px;
441 NTuple::Array<double> m_mcEvtTrk_py;
442 NTuple::Array<double> m_mcEvtTrk_pz;
443 NTuple::Array<double> m_mcEvtTrk_p;
444 NTuple::Array<double> m_mcEvtTrk_phi;
445 NTuple::Array<double> m_mcEvtTrk_theta;
446 NTuple::Array<double> m_mcEvtTrk_cosTheta;
447 NTuple::Array<double> m_mcEvtTrk_vx;
448 NTuple::Array<double> m_mcEvtTrk_vy;
449 NTuple::Array<double> m_mcEvtTrk_vz;
450 NTuple::Array<double> m_mcEvtTrk_vr;
451 NTuple::Array<double> m_mcEvtTrk_chi2;
452 NTuple::Array<double> m_mcEvtTrk_fiTerm;
453 NTuple::Array<int> m_mcEvtTrk_nhit;
454 NTuple::Array<int> m_mcEvtTrk_ncluster;
455 NTuple::Array<int> m_mcEvtTrk_stat;
456 NTuple::Array<int> m_mcEvtTrk_ndof;
457 NTuple::Array<int> m_mcEvtTrk_nster;
458 NTuple::Array<int> m_mcEvtTrk_nlayer;
459 NTuple::Array<int> m_mcEvtTrk_firstLayer;
460 NTuple::Array<int> m_mcEvtTrk_lastLayer;
461 NTuple::Array<int> m_mcEvtTrk_nCgemXClusters;
462 NTuple::Array<int> m_mcEvtTrk_nCgemVClusters;
ObjectVector< RecMdcHit > RecMdcHitCol
ObjectVector< RecMdcTrack > RecMdcTrackCol
int separateHoughHitByPhi()
int activeUnusedCgemHitsOnly(vector< HoughHit * > &hitPntList)
int checkTrack(vector< HoughTrack > &trackVector)
int storeRecTracks(RecMdcTrackCol *trackList, RecMdcHitCol *hitList, vector< HoughTrack > &trackVector)
void solveSharedHits(vector< HoughHit * > &hitList)
int storeTrack(vector< HoughTrack > &trackVector, RecMdcTrackCol *&recMdcTrackCol, RecMdcHitCol *&recMdcHitCol)
int storeTracks(RecMdcTrackCol *trackList, RecMdcHitCol *hitList, vector< HoughTrack > &trackVector)
vector< HoughTrack >::iterator getHoughTrkIt(vector< HoughTrack > &houghTrkList, int trkId)
void clearTrack(vector< HoughTrack > &trackVector)
int checkHot(vector< HoughTrack > &trackVector)
int fillHistogram(HoughHit *hit, TH2D *hitMap, int charge, int vote)
StatusCode registerTrack(RecMdcTrackCol *&trackList_tds, RecMdcHitCol *&hitList_tds)