BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
MdcxTrackFinder.h
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2// File and Version Information:
3// $Id: MdcxTrackFinder.h,v 1.28 2017/08/18 06:51:52 zhangy Exp $
4//
5// Description:
6// Class MdcxTrackFinder. This is a simple example of a user module. It
7// just prints out each entrypoint (operation) as it is accessed.
8//
9// Environment:
10// Software developed for the BaBar Detector at the SLAC B-Factory.
11//
12// Author List:
13// David R. Quarrie Original Author
14// Zhang Yao(zhangyao@ihep.ac.cn)
15//
16// Copyright Information:
17// Copyright (C) 1994 Lawrence Berkeley Laboratory
18//
19// History:
20// Migration for BESIII MDC
21//
22//------------------------------------------------------------------------
23
24#ifndef MDCXTRACKFINDER_H
25#define MDCXTRACKFINDER_H
26
27//----------------------
28// Base Class Headers --
29//----------------------
30#include "CLHEP/Alist/AList.h"
31#include "GaudiKernel/Algorithm.h"
32#include "GaudiKernel/NTuple.h"
33#include "GaudiKernel/SmartDataPtr.h"
34#include "MagneticFieldSvc/IBesMagFieldSvc.h"
35#include "MdcCalibFunSvc/IMdcCalibFunSvc.h"
36#include "MdcData/MdcHit.h"
37#include "MdcData/MdcRecoHitOnTrack.h"
38#include "MdcRecEvent/RecMdcHit.h"
39#include "MdcRecEvent/RecMdcTrack.h"
40#include "MdcTrkRecon/MdcFlagHold.h"
41#include "MdcxReco/MdcxHits.h"
42#include "RawDataProviderSvc/IRawDataProviderSvc.h"
43#include "TrkFitter/TrkContextEv.h"
44#ifdef MDCXTIMEDEBUG
45# include "BesTimerSvc/BesTimerSvc.h"
46# include "BesTimerSvc/IBesTimerSvc.h"
47#endif
48
49class MdcxHel;
50class TrkHitList;
51namespace MdcPatRec {
52 class BField;
53}
54class TrkRecoTrk;
55class MdcxSeg;
56class MdcxFittedHel;
57
58//---------------------
59//-- Class Interface --
60//---------------------
61
62class MdcxTrackFinder : public Algorithm {
63
64 //--------------------
65 // Instance Members --
66 //--------------------
67
68public:
69 // Constructors
70 MdcxTrackFinder( const std::string& name, ISvcLocator* pSvcLocator );
71
72 // Destructor
73 virtual ~MdcxTrackFinder();
74
75 // Operations
76 StatusCode initialize();
77 StatusCode execute();
78 StatusCode finalize();
79 StatusCode beginRun();
80
81private:
82 bool m_beginRun{ false };
83
84 // temp var
85 int haveDigi[43][288];
86 int nTk;
87 bool b_saveEvent;
88 int t_nTdsTk;
89 int t_nDigi;
90 int t_nSeg;
91 int t_nTkTot;
92 int t_nTkNum[20];
93
94 double m_bunchT0;
95 double m_timing;
96 int m_t0Stat;
97 double m_t0Truth;
98 int m_eventNo;
99
100 // debug and hist flag
101 int m_debug;
102 int m_hist;
103 bool m_mcHist;
104
105 // for raw data input
106 bool m_dropUnmatch;
107 bool m_keepBadTdc;
108 bool m_dropHot;
109 bool m_keepUnmatch;
110 uint32_t m_getDigiFlag;
111 int m_maxMdcDigi;
112 int m_minMdcDigi;
113 bool m_dropMultiHotInLayer;
114
115 // fit type control
116 bool m_salvageTrk;
117 bool m_lineFit;
118 // bool m_cosmicFit;
119
120 // fix of Hit
121 bool m_countPropTime;
122 bool m_doSag;
123
124 // fit cuts
125 double m_cresol;
126 std::vector<float> m_dropHitsSigma;
127 std::vector<float> m_helixFitCut;
128 double m_dropTrkPt;
129 double m_addHitCut;
130 double m_minTrkProb;
131 double m_csmax4;
132 double m_csmax3;
133 double m_helixFitSigma;
134 double m_maxRcsInAddSeg;
135 double m_nSigAddHitTrk;
136 double m_maxProca;
137 double m_d0Cut;
138 double m_z0Cut;
139
140 MdcPatRec::BField* m_bfield{ nullptr };
141 IBesMagFieldSvc* m_pIMF;
142 const IMdcCalibFunSvc* m_mdcCalibFunSvc;
143 IRawDataProviderSvc* m_rawDataProviderSvc;
144 std::string m_pdtFile;
145 HepAList<MdcHit>* m_junkHitList;
146 MdcxHits m_mdcxHits;
147
148 TrkContextEv* m_context;
149 const MdcDetector* m_gm;
150 MdcDigiVec mdcDigiVec;
151
152 StatusCode FitMdcxTrack( HepAList<MdcxFittedHel>& trkList,
153 const HepAList<MdcxHit>& dchitlist, MdcHitCol* hitCol,
154 RecMdcTrackCol* trackList, RecMdcHitCol* hitList );
155 void MdcxHitsToHots( MdcxHel& mdcxHelix, const HepAList<MdcxHit>& mdcxHits,
156 TrkHitList* m_trkHitList, MdcHitCol* hitCol );
157 void MdcxHitsToHots( TrkHitList* m_trkHitList, HitRefVec& recMdcHits,
158 HitRefVec& skipedHits );
159
160 void store( TrkRecoTrk* aTrack, RecMdcTrackCol*, RecMdcHitCol* );
161 void printTrack( RecMdcTrack* tk );
162 void dumpTrackList( const HepAList<MdcxFittedHel>& trackList ) const;
163 void dumpTrack( RecMdcTrackCol* trackList );
164 void dumpMdcxSegs( const HepAList<MdcxSeg>& segList ) const;
165 void bookNTuple();
166 void fillMdcxSegs( const HepAList<MdcxSeg>& segList ) const;
167 void fillTrkl( const HepAList<MdcxFittedHel>& firsttrkl ) const;
168 void fillMcTruth();
169 void fillTrack( TrkRecoTrk* aTrack );
170 void fillEvent();
171 void dropMultiHotInLayer( TrkHitList* list );
172 void dumpTdsTrack( RecMdcTrackCol* trackList );
173 void dumpTdsHits( RecMdcHitCol* hitList );
174 const MdcDigi* m_digiMap[43][288];
175
176#ifdef MDCXTIMEDEBUG
177 IBesTimerSvc* m_timersvc;
178 static const int NTIMERS = 5;
179 BesTimer* m_timer[NTIMERS];
180#endif
181};
182
183#endif
#define NTIMERS
MdcxTrackFinder(const std::string &name, ISvcLocator *pSvcLocator)
StatusCode finalize()
StatusCode beginRun()
StatusCode initialize()