BOSS 7.0.1
BESIII Offline Software System
Loading...
Searching...
No Matches
Reconstruction/MdcFastTrkAlg/MdcFastTrkAlg-00-04-09/MdcFastTrkAlg/FTFinder.h
Go to the documentation of this file.
1// -*- C++ -*-
2//
3// Package: MdcFastTrkAlg
4// Module: FTFinder
5//
6// Description: fast track finder class for MdcFastTrkAlg
7//
8//
9
10#ifndef FTFinder_FLAG_
11#define FTFinder_FLAG_
12
13
14#include <iostream>
15
16#include "MdcFastTrkAlg/FTList.h"
17#include "MdcFastTrkAlg/FTTrack.h"
18#include "MdcFastTrkAlg/FTWire.h"
19#include "MdcFastTrkAlg/FTLayer.h"
20#include "MdcFastTrkAlg/FTSuperLayer.h"
21#include "MdcFastTrkAlg/MdcParameter.h"
22#include "MdcFastTrkAlg/MdcFastTrkAlg.h"
23#include "HepPDT/ParticleDataTable.hh"
24#include "CLHEP/Vector/ThreeVector.h"
25#include "RawDataProviderSvc/IRawDataProviderSvc.h"
26#include "MagneticField/IMagneticFieldSvc.h"
27#include "MagneticField/MagneticFieldSvc.h"
28
29#ifndef ENABLE_BACKWARDS_COMPATIBILITY
31#endif
32
33using namespace CLHEP;
34
35class CLHEP::Hep3Vector;
36//class MdcParameter;
37class FTSegment;
38class BesEvent;
39class StatusCode;
40
41class FTFinder{
42
43public:
44 /// returns FTFinder pointer
45 //static FTFinder * GetPointer(void);
46
47 void setAlgorithmPointer(Algorithm*);
48public:
49 /// Constructors and destructor
51
52 /// initializer(creates geometry)
53 void init();
54
55 /// terminator
56 void term();
57
58 /// begin run function(reads constants)
59 void begin_run();
60
61 /// track finder core
62 void event();
63
64public: // Selectors
65
66 /// returns superlayer
67 FTSuperLayer * superLayer(int id) const;
68
69 /// returns track list
71
72 /// returns event primary vertex
73 CLHEP::Hep3Vector vertex(void) const;
74
75 /// returns wire ID for given FTWire object
76 int getWireId(FTWire *) const;
77
78 /// convert t to x
79 float t2x(const FTLayer& l, const float t) const;
80
81 /// convert x to t
82 float x2t(const FTLayer& l, const float x) const;
83
84 /// set bunchtime for MC events
85 void setBunchtime(double bunchtime){_bunchtime=bunchtime;};
86 /// set crude mdc time calibconst (~200 ns) for t0 calculation
87 void setT0cal(double t0cal) {_t0cal=t0cal;};
88
89private: // private member functions
90Algorithm * m_algorithm;
91
92 /// clear object
93 void clear(void);
94
95 /// unpack RAWCDC and create wire-hit
96 int updateMdc(void);
97
98 ///get event start time from segment linear fit
99 int getTestime(void);
100
101 /// create track list
102 void mkTrackList(void);
103
104 /// create 3D track list
105 void mkTrack3D(void);
106
107 /// finds event primary vertex
108 int VertexFit(int z_flag);
109
110 /// finds event primary vertex from 2D tracks
111 int VertexFit2D();
112
113 /// find vertex closest to IP
114 int findBestVertex(void);
115
116 /// corrects event timing after 2nd r-phi fit and returns event timing
117 int CorrectEvtTiming(void);
118
119 /// link axial segments to make track
120 FTTrack * linkAxialSegments(FTSegment ** inner, FTSegment ** outer);
121
122 // link 2,3,4 axial segments
123 void linkAxialSuperLayer234(FTList<FTSegment *> & inner_segments);
124
125 // link 9,10 axial segments
126 void linkAxialSuperLayer910(FTList<FTSegment *> & outer_segments);
127
128 void linkAxialSegments_step(FTList<FTSegment *>& InnerSegments,
129 FTList<FTSegment *>& OuterSegments,
130 FTList<FTSegment *>& Connected,
131 float maxDphi, float maxChi2);
132
133#ifndef OnlineMode
134 /// make Mdst_charged/trk/trk_fit table from reconstruted tracks
135 void makeMdst(void);
136#endif
137
138 /// output tracking results into TDS
139 // by wangdy
140 StatusCode makeTds(void);
141
142 //register T0 into TDS by max
143 StatusCode registT0(void);
144
145 public: // public data menbers
146 /* int findEventVertex;
147 int evtTimeCorr;
148 double minPt;
149 double minDr;
150 float tOffSet;
151 float xtCoEff;
152 int doIt;
153#ifndef OnlineMode
154 bool mkMdst;
155#endif
156 bool mkTds;
157 */
158 int eventNo;
159 int runNo;
160 int expflag;
161 float t0Estime;
162 float tOffSet;
163 float evtTiming;
164 const HepPoint3D pivot;
165 float Testime;
166 int i_rPhiFit;
167 int tEstFlag;
169
170private: // private data members
171 //static FTFinder * _tFinder;
172 FTWire * _wire;
173 FTLayer * _layer;
174 FTSuperLayer * _superLayer;
175 FTList<FTTrack *> & _tracks;
176 FTList<FTSegment *> * _linkedSegments;
177 FTList<FTSegment *> _axialSegCollect;
178 double _vx;
179 double _vy;
180 double _vz;
181 int _ExpNo;
182 int _RunNo;
183 double _bunchtime;
184 double _t0cal;
185 int m_total_trk;
186 HepPDT::ParticleDataTable* m_particleTable;
187 IRawDataProviderSvc* m_rawDataProviderSvc;
188 IMagneticFieldSvc* m_pmgnIMF;
189
190 static MdcParameter* param;
191 int _widbase[43];
192};
193
194inline
196FTFinder::superLayer(int id) const{
197 return _superLayer + id;
198}
199
200inline
202FTFinder::tracks(void) const{
203 return _tracks;
204}
205
206inline
207int
208FTFinder::getWireId(FTWire * w) const {
209 return ((long)w - (long)_wire)/sizeof(FTWire);
210}
211
212inline
213float
214FTFinder::x2t(const FTLayer & l, const float x) const
215{
216 return (x*x) / (param->_xtCoEff * param->_xtCoEff *l.csize());
217}
218
219inline
220float
221FTFinder::t2x(const FTLayer & l, const float t) const
222{
223 float x = (t>0.0f) ?((param->_xtCoEff))*sqrt(t*l.csize()) : 0.0f;
224 if ( x > 0.47f*l.csize() ){
225 x = 0.0004f*t + 0.47f*l.csize()*(1.0f-0.0004f*0.47f/((param->_xtCoEff)*(param->_xtCoEff)));
226 }
227
228 return x;
229}
230
231inline
232void
233FTFinder::setAlgorithmPointer(Algorithm* alg){
234 m_algorithm = alg;
235}
236#endif /* FTFinder_FLAG_ */
Double_t x[10]
FTSuperLayer * superLayer(int id) const
returns superlayer
void event()
track finder core
void init()
initializer(creates geometry)
CLHEP::Hep3Vector vertex(void) const
returns event primary vertex
void begin_run()
begin run function(reads constants)
FTList< FTTrack * > & tracks(void) const
returns track list
float t2x(const FTLayer &l, const float t) const
convert t to x
void setT0cal(double t0cal)
set crude mdc time calibconst (~200 ns) for t0 calculation
void term()
terminator
void setAlgorithmPointer(Algorithm *)
returns FTFinder pointer
int getWireId(FTWire *) const
returns wire ID for given FTWire object
FTFinder()
Constructors and destructor.
void setBunchtime(double bunchtime)
set bunchtime for MC events
float x2t(const FTLayer &l, const float x) const
convert x to t
double csize(void) const
returns cell size
int t()
Definition: t.c:1