368 #include "Sti/Base/Filter.h"
369 #include "Sti/Base/Factory.h"
370 #include "Sti/Base/EditableParameter.h"
371 #include "Sti/Base/StiFactory.h"
372 #include "Sti/StiHit.h"
373 #include "Sti/StiHitContainer.h"
374 #include "Sti/StiMasterDetectorBuilder.h"
375 #include "Sti/StiMasterHitLoader.h"
376 #include "Sti/StiDetector.h"
377 #include "Sti/StiDetectorContainer.h"
378 #include "Sti/StiTrackContainer.h"
379 #include "Sti/StiLocalTrackSeedFinder.h"
380 #include "Sti/StiTrackFinder.h"
381 #include "Sti/StiTrackFitter.h"
382 #include "Sti/StiDefaultTrackFilter.h"
383 #include "Sti/StiTrack.h"
385 #include "Sti/StiKalmanTrackNode.h"
386 #include "Sti/StiKalmanTrackFitter.h"
387 #include "Sti/StiKalmanTrackFinder.h"
388 #include "Sti/StiTrackMerger.h"
389 #include "Sti/StiStarVertexFinder.h"
390 #include "Sti/StiDefaultTrackFilter.h"
391 #include "Sti/StiDetectorGroup.h"
392 #include "Sti/StiDetectorGroups.h"
393 #include "Sti/StiCATpcSeedFinder.h"
394 #include "StDetectorDbMaker/StiHitErrorCalculator.h"
395 #include "StiTpc/StiTpcHitLoader.h"
396 #include "StiSvt/StiSvtHitLoader.h"
397 #include "StDetectorDbMaker/StiHitErrorCalculator.h"
399 #include "StEvent/StHit.h"
400 #include "StarClassLibrary/StMCTruth.h"
404 StiDefaultToolkit::StiDefaultToolkit()
406 _evaluatorEnabled(false),
407 _trackFilterFactory(0),
408 _parameterFactory(0),
412 _detectorNodeFactory(0),
413 _trackNodeFactory(0),
414 _trackNodeExtFactory(0),
415 _trackNodeInfFactory(0),
417 _detectorContainer(0),
427 _loaderTrackFilter(0),
428 _finderTrackFilter(0)
430 cout<<
"StiDefaultToolkit::StiDefaultToolkit() -I- Started"<<endl;
431 _detectorGroups =
new StiDetectorGroups(
"StarDetectorGroups",
"StarDetectorGroups");
432 cout<<
"StiDefaultToolkit::StiDefaultToolkit() -I- Done"<<endl;
436 StiDefaultToolkit::~StiDefaultToolkit()
438 delete _trackFilterFactory;
440 delete _hitContainer;
441 delete _detectorFactory;
442 delete _detectorContainer;
443 delete _trackNodeFactory;
444 delete _trackNodeExtFactory;
445 delete _trackNodeInfFactory;
446 delete _trackContainer;
447 delete _trackFactory;
448 delete _parameterFactory;
449 delete _trackSeedFinder;
457 if (_trackFilterFactory)
458 return _trackFilterFactory;
459 cout <<
"StiDefaultToolkit::getTrackFilterFactory() -I- Instantiating StiTrackFilterFactory" << endl;
462 return _trackFilterFactory;
468 if (_parameterFactory)
469 return _parameterFactory;
471 return _parameterFactory;
477 if (_hitFactory)
return _hitFactory;
479 _hitFactory->setFastDelete();
480 _hitFactory->setMaxIncrementCount(2000000);
487 if (_trackFactory)
return _trackFactory;
488 cout <<
"StiDefaultToolkit::getTrackFactory() -I- ";
490 _trackFactory->setFastDelete();
491 return _trackFactory;
498 if (_detectorFactory)
499 return _detectorFactory;
500 cout <<
"StiDefaultToolkit::getDetectorFactory() -I- Instantiating Detector Factory"<<endl;
502 return _detectorFactory;
508 if (_detectorNodeFactory)
509 return _detectorNodeFactory;
512 return _detectorNodeFactory;
519 if (_trackNodeFactory)
520 return _trackNodeFactory;
522 _trackNodeFactory->setMaxIncrementCount(4000000);
523 _trackNodeFactory->setFastDelete();
525 return _trackNodeFactory;
531 if (_trackNodeExtFactory)
532 return _trackNodeExtFactory;
534 _trackNodeExtFactory->setMaxIncrementCount(4000000);
535 _trackNodeExtFactory->setFastDelete();
536 return _trackNodeExtFactory;
541 if (_trackNodeInfFactory)
542 return _trackNodeInfFactory;
544 _trackNodeInfFactory->setMaxIncrementCount(4000000);
545 _trackNodeInfFactory->setFastDelete();
546 return _trackNodeInfFactory;
552 return _detectorGroups;
565 cout <<
"StiDefaultToolkit::add() -I- Adding hit loader for detector group:"
566 << detectorGroup->
getName()<<endl;
567 masterLoader->addLoader(loader);
570 cout <<
"StiDefaultToolkit::add() -I- Not adding hit loader for detector group:"<< detectorGroup->
getName()<<endl;
576 cout <<
"StiDefaultToolkit::add() -I- Adding builder for detector group:"<< detectorGroup->
getName()<<endl;
577 masterBuilder->add(builder);
580 cout <<
"StiDefaultToolkit::add() -I- Not adding builder for detector group:"<< detectorGroup->
getName()<<endl;
586 if (_detectorBuilder)
587 return _detectorBuilder;
589 return _detectorBuilder;
595 if (_detectorContainer)
596 return _detectorContainer;
597 _detectorContainer =
new StiDetectorContainer(
"DetectorContainer",
"Detector Container", getDetectorBuilder());
600 return _detectorContainer;
607 return _hitContainer;
608 _hitContainer =
new StiHitContainer(
"HitContainer",
"Reconstructed Hits", getHitFactory() );
609 return _hitContainer;
618 return _trackContainer;
619 _trackContainer =
new StiTrackContainer(
"TrackContainer",
"Reconstructed Tracks");
620 return _trackContainer;
626 "Local Track Seed Finder",
629 getDetectorContainer());
636 auto *mySeed = (
StiTrackFinder*)gROOT->ProcessLineFast(
"new StiKNNSeedFinder");
652 StiTrack::setTrackFinder(_trackFinder);
663 StiTrack::setTrackFitter(_trackFitter);
671 cout <<
"StiDefaultToolkit::getVertexFinder() -I- Started"<<endl;
673 return _vertexFinder;
675 return _vertexFinder;
692 void StiDefaultToolkit::setEvaluatorEnabled(
bool evaluatorEnabled)
694 _evaluatorEnabled = evaluatorEnabled;
698 bool StiDefaultToolkit::isEvaluatorEnabled()
const
700 return _evaluatorEnabled;
707 return _loaderHitFilter;
713 return _loaderTrackFilter;
719 return _finderTrackFilter;
725 _loaderHitFilter = loaderHitFilter;
731 _loaderTrackFilter = loaderTrackFilter;
737 _finderTrackFilter = finderTrackFilter;
741 int StiDefaultToolkit::getTruth(
const StiHit *stiHit)
745 if (!stHit)
return 0;
746 return StMCTruth(stHit->idTruth(),stHit->qaTruth());
const StiDetector * detector() const
Definition of Kalman Track.
virtual StiDetectorBuilder * getDetectorBuilder()
Get a detector builder appropriate for this detector group.
const StMeasuredPoint * stHit() const
An abstract class defining the interface to the track finder.
static void setKalmanTrackNodeFactory(Factory< StiKalmanTrackNode > *)
Set the factory used for the creation of kalman track nodes.
virtual StiHitLoader< Event, StiDetectorBuilder > * getHitLoader()
Get a hit loader appropriate for this detector group.
const string & getName() const
Get the name of the object.