BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
FTFinder Class Reference

#include <FTFinder.h>

Public Member Functions

void setAlgorithmPointer (Algorithm *)
 returns FTFinder pointer
 FTFinder ()
 Constructors and destructor.
void init ()
 initializer(creates geometry)
void term ()
 terminator
void begin_run ()
 begin run function(reads constants)
void event ()
 track finder core
FTSuperLayersuperLayer (int id) const
 returns superlayer
FTList< FTTrack * > & tracks ()
 returns track list
CLHEP::Hep3Vector vertex () const
 returns event primary vertex
int getWireId (FTWire *) const
 returns wire ID for given FTWire object
float t2x (const FTLayer *l, const float t) const
 convert t to x
float x2t (const FTLayer *l, const float x) const
 convert x to t
void setBunchtime (double bunchtime)
 set bunchtime for MC events
void setT0cal (double t0cal)
 set crude mdc time calibconst (~200 ns) for t0 calculation

Public Attributes

int eventNo
int runNo
int expflag
float t0Estime
float tOffSet
float evtTiming
const HepPoint3D pivot
float Testime
int i_rPhiFit
int tEstFlag
FTList< FTList< float > > tEstime

Detailed Description

Definition at line 25 of file FTFinder.h.

Constructor & Destructor Documentation

◆ FTFinder()

FTFinder::FTFinder ( )

Constructors and destructor.

Definition at line 111 of file FTFinder.cxx.

112 : tOffSet( 0 )
113 , t0Estime( -999 )
114 , tEstFlag( 0 )
115 , tEstime( 10 )
116 , _tracks( 0 )
117 , _linkedSegments( 0 )
118 , _axialSegCollect( 0 )
119 , _vx( 0 )
120 , _vy( 0 )
121 , _vz( 0 )
122 , _ExpNo( 0 )
123 , _RunNo( 0 )
124 , m_total_trk( 0 )
125 , pivot( 0, 0, 0 ) {
126 StatusCode scmgn = Gaudi::svcLocator()->service( "MagneticFieldSvc", m_pmgnIMF );
127 if ( scmgn != StatusCode::SUCCESS )
128 { std::cout << "Unable to open Magnetic field service" << std::endl; }
129}
float t0Estime
Definition FTFinder.h:131
int tEstFlag
Definition FTFinder.h:137
float tOffSet
Definition FTFinder.h:132
const HepPoint3D pivot
Definition FTFinder.h:134
FTList< FTList< float > > tEstime
Definition FTFinder.h:138

Member Function Documentation

◆ begin_run()

void FTFinder::begin_run ( )

begin run function(reads constants)

Definition at line 154 of file FTFinder.cxx.

154 {
155 eventNo = 0;
156 runNo = 0;
157 expflag = 0;
158 if ( !param->_doIt ) return;
159 _ExpNo = 0;
160 _RunNo = 0;
161
162 IMdcGeomSvc* mdcGeomSvc;
163 StatusCode sc = Gaudi::svcLocator()->service( "MdcGeomSvc", mdcGeomSvc );
164
165 if ( !sc.isSuccess() ) return;
166
167 m_geom = FTGeom::instance();
168}
int eventNo
Definition FTFinder.h:128
int runNo
Definition FTFinder.h:129
int expflag
Definition FTFinder.h:130
static FTGeom * instance()
Definition FTGeom.cxx:162

◆ event()

void FTFinder::event ( )

track finder core

– vertex(r-phi) fit and event timing correction

– 2D track re-fitting

Definition at line 170 of file FTFinder.cxx.

170 {
171 if ( !param->_doIt ) return;
172
173 IMessageSvc* msgSvc;
174 Gaudi::svcLocator()->service( "MessageSvc", msgSvc ).ignore();
175
176 MsgStream log( msgSvc, "FTFinder" );
177
178 IDataProviderSvc* eventSvc;
179 Gaudi::svcLocator()->service( "EventDataSvc", eventSvc ).ignore();
180
181 //--
182 // clear old information
183 //--
184 clear();
185
186 // check whether Recon already registered
187 DataObject* aReconEvent;
188 eventSvc->findObject( "/Event/Recon", aReconEvent ).ignore();
189 if ( !aReconEvent )
190 {
191 // register ReconEvent Data Object to TDS;
192 ReconEvent* recevt = new ReconEvent;
193 StatusCode sc = eventSvc->registerObject( "/Event/Recon", recevt );
194 if ( sc != StatusCode::SUCCESS )
195 {
196 log << MSG::FATAL << "Could not register ReconEvent" << endmsg;
197 return;
198 }
199 }
200
201 // register Event start time
202 IDataManagerSvc* dataManSvc;
203 Gaudi::svcLocator()->service( "EventDataSvc", dataManSvc ).ignore();
204
205 DataObject* aEsTimeEvent;
206 eventSvc->findObject( "/Event/Recon/RecEsTimeCol", aEsTimeEvent ).ignore();
207 if ( aEsTimeEvent )
208 {
209 dataManSvc->clearSubTree( "/Event/Recon/RecEsTimeCol" ).ignore();
210 eventSvc->unregisterObject( "/Event/Recon/RecEsTimeCol" ).ignore();
211 }
212
213 RecEsTimeCol* aRecEsTimeCol = new RecEsTimeCol;
214 StatusCode est;
215 est = eventSvc->registerObject( "/Event/Recon/RecEsTimeCol", aRecEsTimeCol );
216 if ( est.isFailure() )
217 {
218 log << MSG::FATAL << "Could not register RecEsTimeCol" << endmsg;
219 return;
220 }
221 log << MSG::DEBUG << "RecEsTimeCol registered successfully!" << endmsg;
222
223 //--
224 // update wirehit information
225 //--
226 updateMdc();
227
228 //--
229 // segment finding
230 //--
231 for ( int i = 0; i < 11; i++ ) { m_geom->getSuperLayer( i )->mkSegmentList(); }
232
233 //--
234 // reduce noise and get start time from segment fit
235 //--
236 for ( int i = 0; i < 10; i++ ) { m_geom->getSuperLayer( i )->reduce_noise( tEstime ); }
237
238 getTestime();
239
240 //--
241 // axial segment linking
242 //--
243 mkTrackList();
244
245 //--
246 // 2D track fitting
247 //--
248 //(*_superLayer).reAppendSalvage();
249 log << MSG::DEBUG << "number of 2D tracks: " << _tracks.size() << endmsg;
250
251#ifndef OnlineMode
252 num_2Dtrk += _tracks.size();
253#endif
254
255 for ( auto it = _tracks.begin(); it != _tracks.end(); )
256 {
257 if ( !( *it )->r_phiFit() )
258 {
259 delete *it;
260 it = _tracks.erase( it );
261 int tmp_index = std::distance( _tracks.begin(), it );
262 log << MSG::DEBUG << "===========> deleted 2D track : " << tmp_index << endmsg;
263 }
264 else it++;
265 }
266
267 if ( t0Estime != -999 )
268 {
269 // begin to make Event start time
270 RecEsTime* arecestime = new RecEsTime;
271 arecestime->setTest( t0Estime );
272 arecestime->setStat( tEstFlag );
273 aRecEsTimeCol->push_back( arecestime );
274 }
275
276 if ( !_tracks.size() )
277 {
278 makeTds().ignore();
279 return;
280 }
281
282 ///--
283 /// vertex(r-phi) fit and event timing correction
284 //--
285 int vtx_flag = VertexFit( 0 );
286 evtTiming = ( param->_evtTimeCorr ) ? CorrectEvtTiming() : 0;
287
288 ///--
289 /// 2D track re-fitting
290 //--
291 if ( param->_hitscut == 1 )
292 {
293 for ( auto trk_i : _tracks ) { trk_i->r_phiReFit( _vx, _vy, vtx_flag ); }
294 }
295
296 //--
297 // cut bad hits from 2D track re-fitting
298 if ( param->_hitscut == 2 )
299 {
300 for ( auto trk_i : _tracks )
301 {
302 for ( int j = 0; j < 2; j++ )
303 {
304 i_rPhiFit = trk_i->r_phi2Fit( _vx, _vy, vtx_flag );
305 if ( i_rPhiFit != -99 ) trk_i->r_phi3Fit( i_rPhiFit, _vx, _vy, vtx_flag );
306 }
307 trk_i->r_phi4Fit( _vx, _vy, vtx_flag );
308 }
309 }
310
311 //--
312 // stereo segment linking
313 //--
314 mkTrack3D();
315
316 //--
317 // final track fittng
318 //--
319 log << MSG::DEBUG << "number of 3D tracks: " << _tracks.size() << endmsg;
320
321#ifndef OnlineMode
322 num_3Dtrk += _tracks.size();
323#endif
324
325 for ( auto it = _tracks.begin(); it != _tracks.end(); )
326 {
327
328 int trk_index = std::distance( _tracks.begin(), it ) + 1;
329
330#ifndef OnlineMode
331 log << MSG::DEBUG << "=======> 3D track: " << trk_index << endmsg;
332 ( *it )->printout();
333#endif
334
335 if ( ( *it )->get_nhits() < 18 )
336 {
337 delete ( *it );
338 log << MSG::DEBUG << "================> deleted 3D track : " << trk_index << endmsg;
339 it = _tracks.erase( it );
340 }
341 else it++;
342 }
343
344 if ( !_tracks.size() )
345 {
346 makeTds().ignore();
347 return;
348 }
349
350 for ( auto trk_i : _tracks ) trk_i->s_zFit();
351
352 //--
353 // find primary event vertex
354 //--
355 if ( param->_findEventVertex ) { VertexFit( 1 ); }
356
357 log << MSG::DEBUG << "final number of tracks: " << _tracks.size() << endmsg;
358
359#ifndef OnlineMode
360 num_finaltrk += _tracks.size();
361 if ( param->_mkMdst ) makeMdst();
362#endif
363
364 //--
365 // output tracking result into TDS
366 // by wangdy
367 //--
368 if ( param->_mkTds ) makeTds().ignore();
369}
ObjectVector< RecEsTime > RecEsTimeCol
int num_3Dtrk
Definition FTFinder.cxx:81
int num_2Dtrk
int num_finaltrk
Definition FTFinder.cxx:81
IMessageSvc * msgSvc()
int i_rPhiFit
Definition FTFinder.h:136
float evtTiming
Definition FTFinder.h:133

◆ getWireId()

int FTFinder::getWireId ( FTWire * w) const

returns wire ID for given FTWire object

Definition at line 89 of file FTFinder.cxx.

89{ return w->getWireId(); }
double w

◆ init()

void FTFinder::init ( )

initializer(creates geometry)

Definition at line 131 of file FTFinder.cxx.

131 {
132 if ( !param->_doIt ) return;
133
134 // Get the Particle Properties Service
135 IPartPropSvc* p_PartPropSvc;
136 StatusCode PartPropStatus = Gaudi::svcLocator()->service( "PartPropSvc", p_PartPropSvc );
137
138 if ( !PartPropStatus.isSuccess() )
139 {
140 std::cerr << "Could not initialize Particle Properties Service" << std::endl;
141 return;
142 }
143 m_particleTable = p_PartPropSvc->PDT();
144
145 StatusCode RawData =
146 Gaudi::svcLocator()->service( "RawDataProviderSvc", m_rawDataProviderSvc );
147 if ( !RawData.isSuccess() )
148 {
149 std::cerr << "Could not load RawDataProviderSvc!" << m_rawDataProviderSvc << endmsg;
150 return;
151 }
152}

◆ setAlgorithmPointer()

void FTFinder::setAlgorithmPointer ( Algorithm * alg)

returns FTFinder pointer

Definition at line 87 of file FTFinder.cxx.

87{ m_algorithm = alg; }

◆ setBunchtime()

void FTFinder::setBunchtime ( double bunchtime)
inline

set bunchtime for MC events

Definition at line 68 of file FTFinder.h.

68{ _bunchtime = bunchtime; };

◆ setT0cal()

void FTFinder::setT0cal ( double t0cal)
inline

set crude mdc time calibconst (~200 ns) for t0 calculation

Definition at line 70 of file FTFinder.h.

70{ _t0cal = t0cal; };

◆ superLayer()

FTSuperLayer * FTFinder::superLayer ( int id) const

returns superlayer

Definition at line 85 of file FTFinder.cxx.

85{ return m_geom->getSuperLayer( id ); }

◆ t2x()

float FTFinder::t2x ( const FTLayer * l,
const float t ) const

convert t to x

Definition at line 95 of file FTFinder.cxx.

95 {
96 float x = ( t > 0.0f ) ? (( param->_xtCoEff ))*sqrt( t * l->csize() ) : 0.0f;
97 if ( x > 0.47f * l->csize() )
98 {
99 x = 0.0004f * t +
100 0.47f * l->csize() *
101 ( 1.0f - 0.0004f * 0.47f / ( ( param->_xtCoEff ) * ( param->_xtCoEff ) ) );
102 }
103
104 return x;
105}
Double_t x[10]
double csize() const
returns cell size
Definition FTLayer.h:53
int t()
Definition t.c:1

◆ term()

void FTFinder::term ( )

terminator

Definition at line 1783 of file FTFinder.cxx.

1783 {
1784 for ( auto t : _tracks ) delete t;
1785 for ( auto s : _linkedSegments ) delete s;
1786
1787 if ( param->_doIt ) clear();
1788}
XmlRpcServer s

◆ tracks()

FTList< FTTrack * > & FTFinder::tracks ( )

returns track list

Definition at line 86 of file FTFinder.cxx.

86{ return _tracks; }

◆ vertex()

Hep3Vector FTFinder::vertex ( ) const

returns event primary vertex

Definition at line 107 of file FTFinder.cxx.

107{ return Hep3Vector( _vx, _vy, _vz ); }

◆ x2t()

float FTFinder::x2t ( const FTLayer * l,
const float x ) const

convert x to t

Definition at line 91 of file FTFinder.cxx.

91 {
92 return ( x * x ) / ( param->_xtCoEff * param->_xtCoEff * l->csize() );
93}

Member Data Documentation

◆ eventNo

int FTFinder::eventNo

Definition at line 128 of file FTFinder.h.

Referenced by begin_run().

◆ evtTiming

float FTFinder::evtTiming

Definition at line 133 of file FTFinder.h.

Referenced by event().

◆ expflag

int FTFinder::expflag

Definition at line 130 of file FTFinder.h.

Referenced by begin_run().

◆ i_rPhiFit

int FTFinder::i_rPhiFit

Definition at line 136 of file FTFinder.h.

Referenced by event().

◆ pivot

const HepPoint3D FTFinder::pivot

Definition at line 134 of file FTFinder.h.

Referenced by FTFinder().

◆ runNo

int FTFinder::runNo

Definition at line 129 of file FTFinder.h.

Referenced by begin_run().

◆ t0Estime

float FTFinder::t0Estime

Definition at line 131 of file FTFinder.h.

Referenced by event(), and FTFinder().

◆ tEstFlag

int FTFinder::tEstFlag

Definition at line 137 of file FTFinder.h.

Referenced by event(), and FTFinder().

◆ Testime

float FTFinder::Testime

Definition at line 135 of file FTFinder.h.

◆ tEstime

FTList<FTList<float> > FTFinder::tEstime

Definition at line 138 of file FTFinder.h.

Referenced by event(), and FTFinder().

◆ tOffSet

float FTFinder::tOffSet

Definition at line 132 of file FTFinder.h.

Referenced by FTFinder().


The documentation for this class was generated from the following files: