BOSS 7.0.8
BESIII Offline Software System
Loading...
Searching...
No Matches
TBuilderCurl Class Reference

A class to build a Curl track. More...

#include <TBuilderCurl.h>

+ Inheritance diagram for TBuilderCurl:

Public Member Functions

 TBuilderCurl (const std::string &name)
 Constructor.
 
virtual ~TBuilderCurl ()
 Destructor.
 
TTrackbuildStereo (TTrack &track, const AList< TMLink > &) const
 appends stereo hits to a track.
 
TTrackbuildStereoMC (TTrack &track, const AList< TMLink > &) const
 
void setParam (const TCurlFinderParameter &)
 
TTrackbuildStereo (TTrack &track, const AList< TMLink > &, const AList< TMLink > &) const
 
bool buildStereo (TTrack &track, double &dZ, double &tanL) const
 
- Public Member Functions inherited from TBuilder0
 TBuilder0 (const std::string &name)
 Constructor.
 
 TBuilder0 (const std::string &name, float salvageLevel)
 Constructor with salvage level.
 
 TBuilder0 (const std::string &name, float stereoZ3, float stereoZ4, float stereoChisq3, float stereoChisq4, float stereoMaxSigma, unsigned fittingCorrections, float salvageLevel)
 Constructor with parameters.
 
virtual ~TBuilder0 ()
 Destructor.
 
const std::string & name (void) const
 returns name.
 
void dump (const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
 dumps debug information.
 
const TMSelectortrackSelector (void) const
 returns a track selector.
 
TTrackbuildRphi (const AList< TMLink > &) const
 builds a r/phi track from TMLinks or from Segments.
 
TTrackbuildStereo0 (TTrack &track, const AList< TMLink > &) const
 appends stereo hits to a track. (old version)
 
virtual TTrackbuildStereo (TTrack &track, const AList< TMLink > &) const
 appends stereo hits to a track.
 
void appendClusters (TTrack &track, const AList< TMLink > &) const
 appends TMLinks in a list.
 
void salvage (TTrack &track, AList< TMLink > &list) const
 salvages links in a list. Used links will be removed from a list.
 
virtual int fit (TTrackBase &) const
 fits a track using a private fitter.
 
virtual const TMSelectortrackSelector (const TMSelector &)
 sets a track selector.
 

Additional Inherited Members

- Protected Attributes inherited from TBuilder0
TMSelector _circleSelector
 
TMSelector _trackSelector
 
TMSelector _lineSelector
 
float _stereoZ3
 
float _stereoZ4
 
float _stereoChisq3
 
float _stereoChisq4
 
float _stereoMaxSigma
 

Detailed Description

A class to build a Curl track.

Definition at line 54 of file TBuilderCurl.h.

Constructor & Destructor Documentation

◆ TBuilderCurl()

TBuilderCurl::TBuilderCurl ( const std::string &  name)

Constructor.

Definition at line 59 of file TBuilderCurl.cxx.

61 _fitter("TBuilderCurl Fitter"){
62
63 //jialk
64 StatusCode scmgn = Gaudi::svcLocator()->service("MagneticFieldSvc",m_pmgnIMF);
65 if(scmgn!=StatusCode::SUCCESS) {
66 std::cout<< __FILE__<<"Unable to open Magnetic field service"<<std::endl;
67 }
68
69#if 0
70// if(m_param.ON_CORRECTION){
71// _fitter.sag(true);
72// _fitter.propagation(true);
73// _fitter.tof(true);
74// }
75 if (m_param.ON_CORRECTION & 1) _fitter.sag(true);
76 if (m_param.ON_CORRECTION & 2) _fitter.propagation(true);
77 if (m_param.ON_CORRECTION & 4) _fitter.tof(true);
78#endif
79}
A class to build a track.
Definition: TBuilder0.h:35
const std::string & name(void) const
returns name.
Definition: TBuilder0.h:137
bool tof(void) const
sets/returns propagation-delay correction flag.
Definition: THelixFitter.h:207
bool sag(void) const
sets/returns sag correction flag.
Definition: THelixFitter.h:181
bool propagation(void) const
sets/returns propagation-delay correction flag.
Definition: THelixFitter.h:193

◆ ~TBuilderCurl()

TBuilderCurl::~TBuilderCurl ( )
virtual

Destructor.

Definition at line 81 of file TBuilderCurl.cxx.

81 {
82 // if(m_param.SVD_RECONSTRUCTION){
83 // delete m_svdFinder;
84 // delete m_svdAssociator;
85 // }
86}

Member Function Documentation

◆ buildStereo() [1/3]

TTrack * TBuilderCurl::buildStereo ( TTrack track,
const AList< TMLink > &  stereoList 
) const
virtual

appends stereo hits to a track.

Reimplemented from TBuilder0.

Definition at line 182 of file TBuilderCurl.cxx.

183 {
184 return NULL;
185}
#define NULL

◆ buildStereo() [2/3]

TTrack * TBuilderCurl::buildStereo ( TTrack track,
const AList< TMLink > &  stereoList,
const AList< TMLink > &  allStereoList 
) const

Definition at line 188 of file TBuilderCurl.cxx.

190 {
191#if (DEBUG_CURL_DUMP+DEBUG_CURL_GNUPLOT+DEBUG_CURL_MC)
192 Belle_event_Manager &evtMgr = Belle_event_Manager::get_manager();
193 debugMcFlag = 1;
194 if(evtMgr.count() != 0 &&
195 evtMgr[0].ExpMC() != 2)debugMcFlag = 0;// not MC
196#endif
197
198 AList<TMLink> list = stereoList;
199 unsigned nList = list.length();
200
201 //...gets stereo wires from track.links
202 for(unsigned i = 0, size = track.links().length(); i < size; ++i){
203 unsigned superID = (track.links())[i]->wire()->superLayerId();
204 if(superID == 0 || superID == 1 || superID == 5 ||
205 superID == 6 || superID == 7 || superID == 8 ){
206 int ok = 1;
207 for (unsigned j = 0; j < nList; ++j) {
208 TMLink * l = list[j];
209 if(l->hit()->wire()->id() == (track.links())[i]->hit()->wire()->id()){
210 ok = 0; break;
211 }
212 }
213 if(ok == 1)list.append(((track.links())[i]));
214 }
215 // set LR 2
216 (track.links())[i]->leftRight(2); // returns left-right. 0:left, 1:right, 2:wire
217 }
218 for(unsigned i = 0, size = list.length(); i < size; ++i){
219 track._links.remove(list[i]);
220 // set LR 2
221 list[i]->leftRight(2);
222 }
223
224 if(list.length() < 2 ||
225 list.length()+track.nLinks() < 5)return NULL;
226#if DEBUG_CURL_DUMP
227 unsigned debug_stereo_counter1 = 0;
228 for(unsigned i=0;i<track.links().length();++i){
229 unsigned superID = (track.links())[i]->hit()->wire()->superLayerId();
230 if(superID == 0 || superID == 1 ||
231 superID == 5 || superID == 6 ||
232 superID == 7 || superID == 8 )++debug_stereo_counter1;
233 }
234 std::cout << "(TBuilderCurl)Fitted Track:";
235 std::cout << ", A# = " << track.links().length()-debug_stereo_counter1;
236 std::cout << ", S# = " << debug_stereo_counter1 << "(==0)";
237 std::cout << ", A+S# = " << track.links().length();
238 std::cout << ", Cand Stereo Wires # = " << list.length() << std::endl;
239 double debugChg = -1.;
240 if(track.charge() > 0.)debugChg = 1.;
241 if(debugChg > 0.)std::cout << "(TBuilderCurl) Positive Track" << std::endl;
242 else std::cout << "(TBuilderCurl) Negative Track" << std::endl;
243#endif
244
245 //...calculates a circle.
246 double xc2D;
247 double yc2D;
248 double r2D;
249 AList<TMLink> tmpAxialList = track.links();
250 bool err2D = fitWDD(xc2D,yc2D,r2D,tmpAxialList);
251
252 //...using SVD //....Liuqg
253 //double dZSVD, tanLSVD;
254 //bool initWithSVD = buildStereo(track, dZSVD, tanLSVD);
255
256 //...sets arc and z pairs of each stereo hit wire.
257 setArcZ(track,list);
258 AList<TMLink> removeList;
259 for(unsigned i = 0, size = list.length(); i < size; ++i){
260 if(list[i]->arcZ(0).x() == -999. && list[i]->arcZ(1).x() == -999.)removeList.append(list[i]);
261 }
262 list.remove(removeList);
263 if(list.length() < 2 ||
264 list.length()+track.nLinks() < 5){ // stereo >=2 && axial >= 3
265#if DEBUG_CURL_DUMP
266 std::cout << "(TBuilderCurl) Fail...few wires which can be set Arc-Z # = "
267 << list.length() << std::endl;
268#endif
269 return NULL;
270 }
271#if DEBUG_CURL_DUMP
272 std::cout << "(TBuilderCurl) Cand Stereo Wires which can be set Arc-Z # = "
273 << list.length() << std::endl;
274 plotArcZ(list,0.,0.,0);
275#endif
276
277#if 0
278 //...separates
279 AList<TMLink> layer[18];
280 for(unsigned i = 0, size = list.length(); i < size; ++i){
281 layer[list[i]->wire()->layer()->axialStereoLayerId()].append(*list[i]);
282 }
283
284#if DEBUG_CURL_DUMP
285 for(int i=0;i<18;++i){
286 if(layer[i].length())
287 std::cout << "(TBuilderCurl) Cand Stereo Wires which can be set Arc-Z # = "
288 << layer[i].length()
289 << " on " << i << " Layer." << std::endl;
290 }
291#endif
292#endif
293
294 // makes a line.
295 AList<TMLink> goodL;
296 AList<HepPoint3D> goodP;
297 double minChi2 = 9999.;
298 double goodA = 9999.;
299 double goodB = 9999.;
300 makeLine(track, list, allStereoList, goodL,
301 minChi2, goodA, goodB, goodP);
302 HepAListDeleteAll(goodP);
303
304#if DEBUG_CURL_DUMP
305 std::cout << "(TBuilderCurl) a = " << goodA << ", b = " << goodB
306 << " (after makeLine-function)" << std::endl;
307#endif
308
309 // refits
310 static TRobustLineFitter rfitter("Can you work well?");
311 TMLine newLine0(goodL);
312 if(rfitter.fit(newLine0) != 0){
313#if DEBUG_CURL_DUMP
314 std::cout << "(TBuilderCurl) Fail...linefitting...fail." << std::endl;
315#endif
316 return NULL;
317 }
318
319#if DEBUG_CURL_DUMP
320 std::cout << "(TBuilderCurl) a = " << newLine0.a() << ", b = " << newLine0.b()
321 << " (after robustline-fit)" << std::endl;
322#endif
323
324 //...appends at last chance
325 unsigned nGoodL = goodL.length();
326 list.remove(goodL);
327 AList<TMLink> goodL2;
328 if(m_param.CURL_VERSION == 0){ // default
329 if(fabs(newLine0.b()) < 10.){
330 appendPoints(list, goodL2,
331 newLine0.a(), newLine0.b(), track, m_param.Z_DIFF_FOR_LAST_ATTEND);
332 }else{ // in case of bad result of robustLineFitter. (2001/04/04)
333 appendPoints(list, goodL2,
334 goodA, goodB, track, m_param.Z_DIFF_FOR_LAST_ATTEND);
335 }
336 }else{
337 // same with b20010409_2122 at least
338 appendPoints(list, goodL2,
339 newLine0.a(), newLine0.b(), track, m_param.Z_DIFF_FOR_LAST_ATTEND);
340 }
341 goodL.append(goodL2);
342 TMLine newLine(goodL);
343
344 //...refits
345 if(rfitter.fit(newLine) != 0){
346#if DEBUG_CURL_DUMP
347 std::cout << "(TBuilderCurl) Fail...appending and re-fitting...fail." << std::endl;
348#endif
349 return NULL;
350 }
351
352#if DEBUG_CURL_DUMP
353 std::cout << "(TBuilderCurl) a = " << newLine.a() << ", b = " << newLine.b()
354 << " (after last-append + re-robustline-fit)" << std::endl;
355#endif
356 //...makes 3D tracks
357 const AList<TMLink> &good = newLine.links();
358 track.TTrackBase::append(good);
359 if(!check(track)){
360#if DEBUG_CURL_DUMP
361 std::cout << "(TBuilderCurl) Fail...checking wire numbers...fail." << std::endl;
362#endif
363 return NULL;
364 }
365
366 //...sets initial values
367 Vector a = track.helix().a();
368 if(err2D){
369 double tmpA[3];
370 double tmpQ = track.charge() > 0. ? 1. : -1.;
371 tmpA[1] = fmod(atan2(tmpQ * yc2D,
372 tmpQ * xc2D)
373 + 4. * M_PI,
374 2. * M_PI);
375 // tmpA[2] = tmpQ*Helix::ConstantAlpha/r2D;
376 // tmpA[2] = tmpQ*333.564095/r2D;
377 tmpA[2] = tmpQ*(333.564095/(-1000*(m_pmgnIMF->getReferField())))/r2D;
378//cout<<"TBuilderCurl::tmpA[2]: "<<(333.564095/(-1000*(m_pmgnIMF->getReferField())))<<endl;
379 tmpA[0] = xc2D/cos(tmpA[1]) - tmpQ*r2D;
380 //std::cout << yc2D/sin(tmpA[1])-tmpQ*r2D << std::endl;
381 //std::cout << a[0] << " -0- " << tmpA[0] << std::endl;
382 //std::cout << a[1] << " -1- " << tmpA[1] << std::endl;
383 //std::cout << a[2] << " -2- " << tmpA[2] << std::endl;
384 a[0] = tmpA[0];
385 a[1] = tmpA[1];
386 a[2] = tmpA[2];
387 }
388 a[3] = newLine.b();
389 a[4] = newLine.a();
390//Liuqg
391/* if(initWithSVD){ // use SVD initial values if possible.
392 a[3] = dZSVD;
393 a[4] = tanLSVD;
394 }
395*/
396 if(m_param.CURL_VERSION == 0){
397 if(fabs(a[3]) > 10. && fabs(goodB) < 10.){ // 50cm --> 10cm @ 2001/04/04
398 // use initial values when results of RobustFit is bad.
399 a[3] = goodB;
400 a[4] = goodA;
401 }
402 }else{
403 if(fabs(a[3]) > 50. && fabs(goodB) < 50.){
404 a[3] = goodB;
405 a[4] = goodA;
406 track.TTrackBase::remove(goodL2);
407 }
408 }
409
410 track._helix->a(a);
411
412#if DEBUG_CURL_DUMP
413 std::cout << "(TBuilderCurl) Created Line: y = " << newLine.a()
414 << " * x + " << newLine.b()
415 << ", size = " << good.length() << std::endl;
416 plotArcZ(const_cast< AList<TMLink>& >(good), newLine.a(), newLine.b(), 0);
417#endif
418
419 /* std::cout << "1st : "
420 << track.helix().a()[0] << " " << track.helix().a()[1] << " "
421 << track.helix().a()[2] << " " << track.helix().a()[3] << " "
422 << track.helix().a()[4] << std::endl; */
423
424#if 1
425// if(m_param.ON_CORRECTION){
426// _fitter.sag();
427// _fitter.propagation();
428// _fitter.tof();
429// }
430 if (m_param.ON_CORRECTION & 1) _fitter.sag(true);
431 if (m_param.ON_CORRECTION & 2) _fitter.propagation(true);
432 if (m_param.ON_CORRECTION & 4) _fitter.tof(true);
433#endif
434
435 //...fits
436 AList<TMLink> bad;
437 int err = _fitter.fit(track);
438 if (err < 0){
439#if DEBUG_CURL_DUMP
440 std::cout << "(TBuilderCurl) Fail fitting(0)...error code = " << err << std::endl;
441#endif
442 return NULL;
443 } else if ( fabs(track.helix().a()[3]) > fabs(a[3]) &&
444 (fabs(track.helix().a()[3]) > 50. || // 50cm
445 fabs(track.helix().a()[2]) > 100. || // 0.01GeV
446 fabs(track.helix().a()[2]) < 0.1) ){ // 10GeV
447 // in strange case, set "correction" of wires OFF
448 // and then fit with the initial values.
449 if(m_param.ON_CORRECTION){
450 if (m_param.ON_CORRECTION & 1) _fitter.sag(true);
451 if (m_param.ON_CORRECTION & 2) _fitter.propagation(true);
452 if (m_param.ON_CORRECTION & 4) _fitter.tof(true);
453 //_fitter.sag();
454 //_fitter.propagation();
455 //_fitter.tof();
456 track._helix->a(a);
457 //std::cout << "ON --> OFF" << std::endl;
458 }else{
459 return NULL;
460 }
461 }
462
463 /* std::cout << "2nd : "
464 << track.helix().a()[0] << " " << track.helix().a()[1] << " "
465 << track.helix().a()[2] << " " << track.helix().a()[3] << " "
466 << track.helix().a()[4] << std::endl; */
467
468 track.refine(bad, m_param.SELECTOR_MAX_SIGMA * 100.);
469 if (!check(track)){
470#if DEBUG_CURL_DUMP
471 std::cout << "(TBuilderCurl) Fail checking(1)..." << std::endl;
472#endif
473 return NULL;
474 }
475 err = _fitter.fit(track);
476 if (err < 0){
477#if DEBUG_CURL_DUMP
478 std::cout << "(TBuilderCurl) Fail fitting(1)...error code = " << err << std::endl;
479#endif
480 return NULL;
481 }
482 track.refine(bad, m_param.SELECTOR_MAX_SIGMA * 10.);
483 if (!check(track)){
484#if DEBUG_CURL_DUMP
485 std::cout << "(TBuilderCurl) Fail checking(2)..." << std::endl;
486#endif
487 return NULL;
488 }
489 err = _fitter.fit(track);
490 if (err < 0){
491#if DEBUG_CURL_DUMP
492 std::cout << "(TBuilderCurl) Fail fitting(2)...error code = " << err << std::endl;
493#endif
494 return NULL;
495 }
496 track.refine(bad, m_param.SELECTOR_MAX_SIGMA);
497 if (!check(track)){
498#if DEBUG_CURL_DUMP
499 std::cout << "(TBuilderCurl) Fail checking(3)..." << std::endl;
500#endif
501 return NULL;
502 }
503 err = _fitter.fit(track);
504 if (err < 0){
505#if DEBUG_CURL_DUMP
506 std::cout << "(TBuilderCurl) Fail fitting(3)...error code = " << err << std::endl;
507#endif
508 return NULL;
509 }
510
511#if 0
512 for(int i=0;i<track.links().length();++i){
513 if(track.links()[i]->pull() > 36.){
514 std::cout << track.links()[i]->wire()->id()
515 << " :+: " << track.links()[i]->pull() << std::endl;
516 }
517 if(track.links()[i]->hit()->state() & WireHitInvalidForFit)
518 std::cout << "Not Valid For Fit!" << std::endl;
519 //if(!(track.links()[i]->hit()->state() & WireHitFittingValid))
520 //std::cout << "No-Valid For Fit!" << std::endl;
521 }
522#endif
523 track.refine(bad, m_param.SELECTOR_MAX_SIGMA);
524 if (!check(track)){
525#if DEBUG_CURL_DUMP
526 std::cout << "(TBuilderCurl) Fail checking(4)..." << std::endl;
527#endif
528 return NULL;
529 }
530 err = _fitter.fit(track);
531 if (err < 0){
532#if DEBUG_CURL_DUMP
533 std::cout << "(TBuilderCurl) Fail fitting(4)...error code = " << err << std::endl;
534#endif
535 return NULL;
536 }
537
538#if 0
539 for(int i=0;i<track.links().length();++i){
540 if(track.links()[i]->pull() > 36.){
541 std::cout << track.links()[i]->wire()->id()
542 << " :*: " << track.links()[i]->pull() << std::endl;
543 }
544 if(track.links()[i]->hit()->state() & WireHitInvalidForFit)
545 std::cout << "Not Valid For Fit!" << std::endl;
546 //if(!(track.links()[i]->hit()->state() & WireHitFittingValid))
547 //std::cout << "No-Valid For Fit!" << std::endl;
548 }
549#endif
550
551 /* std::cout << "3rd : "
552 << track.helix().a()[0] << " " << track.helix().a()[1] << " "
553 << track.helix().a()[2] << " " << track.helix().a()[3] << " "
554 << track.helix().a()[4] << std::endl; */
555
556 //...tests
557 if (track.nLinks() < 5){ // axial + stereo >= 5
558#if DEBUG_CURL_DUMP
559 std::cout << "(TBuilderCurl) Success fitting, but pre-selection...fail." << std::endl;
560#endif
561 return NULL;
562 }
563 if(fabs(track.impact()) > m_param.SELECTOR_MAX_IMPACT ||
564 track.pt() < 0.005 || // Pt >= 5MeV
565 fabs(track.pz()) > m_param.SELECTOR_STRANGE_PZ){
566#if DEBUG_CURL_DUMP
567 std::cout << "(TBuilderCurl) Success fitting, but selection...fail." << std::endl;
568 std::cout << "(TBuilderCurl) impact = " << track.impact() << std::endl;
569 std::cout << "(TBuilderCurl) pt = " << track.pt() << std::endl;
570 std::cout << "(TBuilderCurl) pz = " << track.pz() << std::endl;
571 std::cout << "(TBuilderCurl) dz = " << track.helix().a()[3] << std::endl;
572#endif
573 return NULL;
574 }
575
576 //...replaces init helix if dz is bad.
577 if(fabs(track.helix().a()[3]) > m_param.SELECTOR_REPLACE_DZ &&
578 fabs(a[3]) < fabs(track.helix().a()[3])){
579 track._helix->a(a);
580 }
581#if DEBUG_CURL_DUMP
582 std::cout << "(TBuilderCurl) Success Build Stereo!!!" << std::endl;
583#endif
584 return & track;
585}
double cos(const BesAngle a)
Definition: BesAngle.h:213
Double_t x[10]
#define M_PI
Definition: TConstant.h:4
#define WireHitInvalidForFit
Definition: TMDCWireHit.h:55
const HepVector & a(void) const
returns helix parameters.
virtual double getReferField()=0
int fit(TTrackBase &) const
Definition: THelixFitter.h:231
const TMDCWire *const wire(void) const
returns a pointer to a TMDCWire.
Definition: TMDCWireHit.h:218
unsigned id(void) const
returns id.
Definition: TMDCWire.h:207
A class to represent a track in tracking.
Definition: TMLine.h:40
A class to fit a TTrackBase object to a line.
AList< TMLink > _links
Definition: TTrackBase.h:161
virtual void refine(AList< TMLink > &list, double maxSigma)
removes bad points by pull. The bad points are removed from the track, and are returned in 'list'.
Definition: TTrackBase.cxx:170
const AList< TMLink > & links(unsigned mask=0) const
returns a list of masked TMLinks assigned to this track. 'mask' will be applied if mask is not 0.
Definition: TTrackBase.cxx:297
unsigned nLinks(unsigned mask=0) const
returns # of masked TMLinks assigned to this track object.
Definition: TTrackBase.cxx:305
const Helix & helix(void) const
returns helix parameter.
Definition: TTrack.h:477
double impact(void) const
returns signed impact parameter to the origin.
Definition: TTrack.h:571
double pt(void) const
returns Pt.
Definition: TTrack.h:528
double pz(void) const
returns Pz.
Definition: TTrack.h:534
double charge(void) const
returns charge.
Definition: TTrack.h:504

◆ buildStereo() [3/3]

bool TBuilderCurl::buildStereo ( TTrack track,
double &  dZ,
double &  tanL 
) const

Definition at line 134 of file TBuilderCurl.cxx.

136 {
137/*
138 if(!(m_param.SVD_RECONSTRUCTION))return false;
139
140#if 0
141 double q = 1.;
142 if(track.helix().kappa()<0.)q = -1.;
143 double h[5], chisq;
144 if(m_svdFinder->recTrk(track.helix().center().x(),
145 track.helix().center().y(),
146 fabs(track.helix().radius()),
147 q,
148 0.2,
149 h[0], h[1], h[2], h[3], h[4], chisq)){
150#if 0
151 std::cout << "SVD = "
152 << h[0] << " "
153 << h[1] << " "
154 << h[2] << " "
155 << h[3] << " "
156 << h[4];
157 std::cout << ", chi2 = " << chisq << " pt=" << 1./h[2] << std::endl;
158#endif
159 dZ = h[3];
160 tanL = h[4];
161 return true;
162 }else{
163 //std::cout << "SVD Fail....." << std::endl;
164 return false;
165 }
166#else
167 Helix th(track.helix());
168 th.pivot(HepPoint3D(0.,0.,0.));
169 AList<TSvdHit> cand;
170 if(m_svdAssociator->recTrk(th,dZ,tanL,0.5,-1.0,cand,0.5)){
171 //std::cout << "SVD " << dZ << " " << tanL << std::endl;
172 return true;
173 }else{
174 //std::cout << "SVD..." << std::endl;
175 return false;
176 }
177#endif
178 */
179}

◆ buildStereoMC()

TTrack * TBuilderCurl::buildStereoMC ( TTrack track,
const AList< TMLink > &  stereoList 
) const

Definition at line 1050 of file TBuilderCurl.cxx.

1050 {
1051#if DEBUG_CURL_MC
1052 AList<TMLink> list = stereoList;
1053
1054 HepPoint3D center = track.helix().center();
1055 double r = fabs(track.helix().curv());
1056 for(unsigned i = 0, size = list.length();
1057 i < size; ++i){
1058 HepPoint3D point((list[i]->hit()->mc()->datcdc()->m_xin+
1059 list[i]->hit()->mc()->datcdc()->m_xout)*0.5,
1060 (list[i]->hit()->mc()->datcdc()->m_yin+
1061 list[i]->hit()->mc()->datcdc()->m_yout)*0.5,
1062 0.);
1063 double cosdPhi = - center.dot((point - center).unit()) / center.mag();
1064 double dPhi;
1065 if(fabs(cosdPhi) < 1.0){
1066 dPhi = acos(cosdPhi);
1067 }else if(cosdPhi >= 1.0){
1068 dPhi = 0.;
1069 }else{
1070 dPhi = M_PI;
1071 }
1072 list[i]->position(HepPoint3D(r*dPhi,
1073 (list[i]->hit()->mc()->datcdc()->m_zin+
1074 list[i]->hit()->mc()->datcdc()->m_zout)*0.5,
1075 0.));
1076 /* std::cout << list[i]->wire()->id() << ": "
1077 << point.x() << " "
1078 << point.y() << " "
1079 << (list[i]->hit()->mc()->datcdc()->m_zin+
1080 list[i]->hit()->mc()->datcdc()->m_zout)*0.5 << std::endl; */
1081 }
1082 //std::cout << "A# = " << track.links().length() << ", S# = " << list.length() << std::endl;
1083 double xc2D;
1084 double yc2D;
1085 double r2D;
1086 bool err2D = fitWDD(xc2D,yc2D,r2D,track.links()); // axial only
1087
1088 TLine0 newLine(list);
1089 if(newLine.fit() != 0) return NULL;
1090 const AList<TMLink> &good = newLine.links();
1091 track.append(good);
1092 Vector a = track.helix().a();
1093 a[3] = newLine.b();
1094 a[4] = newLine.a();
1095 if(err2D){
1096 double tmpA[3];
1097 double tmpQ = track.charge() > 0. ? 1. : -1.;
1098 tmpA[1] = fmod(atan2(tmpQ * yc2D,
1099 tmpQ * xc2D)
1100 + 4. * M_PI,
1101 2. * M_PI);
1102 // tmpA[2] = tmpQ*Helix::ConstantAlpha/r2D;
1103 // tmpA[2] = tmpQ*333.564095/r2D;
1104 tmpA[2] =tmpQ*(333.564095/(-1000*(m_pmgnIMF->getReferField())))/r2D;
1105 tmpA[0] = xc2D/cos(tmpA[1]) - tmpQ*r2D;
1106 a[0] = tmpA[0];
1107 a[1] = tmpA[1];
1108 a[2] = tmpA[2];
1109 }
1110 track._helix->a(a);
1111#if 0
1112 std::cout << track.helix().a()[0] << " " << track.helix().a()[1] << " "
1113 << track.helix().a()[2] << " " << track.helix().a()[3] << " "
1114 << track.helix().a()[4] << std::endl;
1115#endif
1116 //...fits
1117 AList<TMLink> bad;
1118 int err = _fitter.fit(track);
1119 if (err < m_param.ERROR_FOR_HELIX_FIT)return NULL;
1120 track.refine(bad, m_param.SELECTOR_MAX_SIGMA * 100.);
1121 err = _fitter.fit(track);
1122 if (err < m_param.ERROR_FOR_HELIX_FIT)return NULL;
1123 track.refine(bad, m_param.SELECTOR_MAX_SIGMA * 10.);
1124 err = _fitter.fit(track);
1125 if (err < m_param.ERROR_FOR_HELIX_FIT)return NULL;
1126 track.refine(bad, m_param.SELECTOR_MAX_SIGMA);
1127 err = _fitter.fit(track);
1128 if (err < m_param.ERROR_FOR_HELIX_FIT)return NULL;
1129#if 0
1130 std::cout << track.helix().a()[0] << " " << track.helix().a()[1] << " "
1131 << track.helix().a()[2] << " " << track.helix().a()[3] << " "
1132 << track.helix().a()[4] << std::endl;
1133#endif
1134 //track._helix->a(a); // re-write
1135
1136 //...checks
1137 if (track.nLinks() < m_param.SELECTOR_NLINKS)return NULL;
1138 if (fabs(track.impact()) > m_param.SELECTOR_MAX_IMPACT ||
1139 track.pt() < m_param.SELECTOR_MIN_PT)return NULL;
1140 return & track;
1141#else
1142 return NULL;
1143#endif
1144}
*******INTEGER m_nBinMax INTEGER m_NdiMax !No of bins in histogram for cell exploration division $ !Last vertex $ !Last active cell $ !Last cell in buffer $ !No of sampling when dividing cell $ !No of function total $ !Flag for random ceel for $ !Flag for type of for WtMax $ !Flag which decides whether vertices are included in the sampling $ entire domain is hyp !Maximum effective eevents per saves r n generator level $ !Flag for chat level in !Latex Output unit
Definition: FoamA.h:90
HepGeom::Point3D< double > HepPoint3D
Definition: TBuilderCurl.h:36
const HepPoint3D & center(void) const
returns position of helix center(z = 0.);
A class to represent a track in tracking.
Definition: TLine0.h:30
void append(TMLink &)
appends a TMLink.
Definition: TTrackBase.cxx:362

◆ setParam()

void TBuilderCurl::setParam ( const TCurlFinderParameter p)

Definition at line 89 of file TBuilderCurl.cxx.

89 {
90 m_param.Z_CUT = p.Z_CUT;
98 m_param.ON_CORRECTION = p.ON_CORRECTION;
99 m_param.CURL_VERSION = p.CURL_VERSION;
100#if 1
101// if(m_param.ON_CORRECTION){
102// _fitter.sag(true);
103// _fitter.propagation(true);
104// _fitter.tof(true);
105// }
106 if (m_param.ON_CORRECTION & 1) _fitter.sag(true);
107 if (m_param.ON_CORRECTION & 2) _fitter.propagation(true);
108 if (m_param.ON_CORRECTION & 4) _fitter.tof(true);
109#endif
110 // if(m_param.SVD_RECONSTRUCTION){
111 ////m_svdFinder = new TSvdFinder(-1.*(m_param.MIN_SVD_ELECTRONS),
112 //// m_param.MIN_SVD_ELECTRONS);
113 //m_svdAssociator = new TSvdAssociator(-1.*(m_param.MIN_SVD_ELECTRONS),
114 // m_param.MIN_SVD_ELECTRONS);
115 //}
116}

Referenced by TCurlFinder::TCurlFinder().


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