#include #include #include #include #include #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::Methods; #include using namespace std; MethodFactory::MethodFactory() { fFactory.Register( FixedSeed::Name(), new Alloc() ); fFactory.Register( Centroid::Name(), new Alloc() ); fFactory.Register( SimpleEnergy::Name(), new Alloc() ); fFactory.Register( SimpleTime::Name(), new Alloc() ); fFactory.Register( SimpleDirection::Name(), new Alloc() ); fFactory.Register( Quad::Name(), new Alloc() ); fFactory.Register( DirectionLikelihood::Name(), new Alloc() ); fFactory.Register( PositionTimeLikelihood::Name(), new Alloc() ); fFactory.Register( PositionTimeDirectionLikelihood::Name(), new Alloc() ); fFactory.Register( HoughDirection::Name(), new Alloc() ); fFactory.Register( TimeLikelihood::Name(), new Alloc() ); fFactory.Register( EnergyLookup::Name(), new Alloc() ); fFactory.Register( EnergyPromptHits::Name(), new Alloc() ); fFactory.Register( EnergyPromptLookup::Name(), new Alloc() ); fFactory.Register( EnergyRSP::Name(), new Alloc() ); fFactory.Register( PEnergy::Name(), new Alloc() ); fFactory.Register( SOCPositionTimeChiSquared::Name(), new Alloc() ); fFactory.Register( NearAVAngular::Name(), new Alloc() ); fFactory.Register( EnergyFunctional::Name(), new Alloc() ); fFactory.Register( EnergyRThetaFunctional::Name(), new Alloc() ); fFactory.Register( PartialEnergy::Name(), new Alloc() ); fFactory.Register( MuonWater::Name(), new Alloc() ); fFactory.Register( MuonScintillator::Name(), new Alloc() ); fFactory.Register( PositionANN::Name(), new Alloc() ); fFactory.Register( SmearResult::Name(), new Alloc() ); } void MethodFactory::Register( std::string name, AllocBase* allocator ) { fFactory.Register( name, allocator ); } Method* MethodFactory::GetMethod( const std::string name ) { string methodName, initialisation(""); const size_t hyphenPos = name.find( "-" ); if( hyphenPos != string::npos ) { methodName = name.substr( 0, hyphenPos ); initialisation = name.substr( hyphenPos + 1 ); } else methodName = name; Method* method = fFactory.New( methodName ); method->Initialise( initialisation ); return method; }