#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace RAT::Classifiers; #include using namespace std; ClassifierFactory::ClassifierFactory() { fFactory.Register( EarlyTime::Name(), new Alloc() ); fFactory.Register( IsotropyRegions::Name(), new Alloc() ); fFactory.Register( MeanTime::Name(), new Alloc() ); fFactory.Register( PreTriggerHits::Name(), new Alloc() ); fFactory.Register( TimingPeaks::Name(), new Alloc() ); fFactory.Register( AlphaClassifierUnseeded::Name(), new Alloc() ); fFactory.Register( AlphaClassifierSeeded::Name(), new Alloc() ); fFactory.Register( NearAVAngularClassifier::Name(), new Alloc() ); fFactory.Register( Beta14::Name(), new Alloc() ); fFactory.Register( Isotropy::Name(), new Alloc() ); fFactory.Register( ITR::Name(), new Alloc() ); fFactory.Register( QPDT::Name(), new Alloc() ); fFactory.Register( BiPoCumulTimeResid::Name(), new Alloc() ); fFactory.Register( BiPoLikelihoodDiff::Name(), new Alloc() ); fFactory.Register( AlphaBetaClassifier::Name(), new Alloc() ); fFactory.Register( MuonClassifier::Name(), new Alloc() ); fFactory.Register( BerkeleyAlphaBeta::Name(), new Alloc() ); fFactory.Register( IBDClassifierUnseeded::Name(), new Alloc() ); fFactory.Register( Ext0NuTimeRes::Name(), new Alloc() ); fFactory.Register( Ext0NuCosTheta::Name(), new Alloc() ); fFactory.Register( SkyShine::Name(), new Alloc() ); } void ClassifierFactory::Register( std::string name, AllocBase* allocator ) { fFactory.Register( name, allocator ); } Classifier* ClassifierFactory::GetClassifier( const std::string name ) { string classifierName, initialisation(""); const size_t hyphenPos = name.find( "-" ); if( hyphenPos != string::npos ) { classifierName = name.substr( 0, hyphenPos ); initialisation = name.substr( hyphenPos + 1 ); } else classifierName = name; Classifier* classifier = fFactory.New( classifierName ); classifier->Initialise( initialisation ); return classifier; }