#include #include #include #include #include #include #include #include #include #include using namespace RAT; using namespace RAT::PDFs; #include #include using namespace std; PDFFactory::PDFFactory() { fFactory.Register( SimpleTiming::Name(), new Alloc() ); fFactory.Register( ET1D::Name(), new Alloc() ); fFactory.Register( GV1D::Name(), new Alloc() ); fFactory.Register( PartialET1D::Name(), new Alloc() ); fFactory.Register( RadialPDF::Name(), new Alloc() ); fFactory.Register( DirectionPDF::Name(), new Alloc() ); fFactory.Register( PositionDirectionPDF::Name(), new Alloc() ); fFactory.Register( CherenkovSourcePDF::Name(), new Alloc() ); } void PDFFactory::Register( std::string name, AllocBase* allocator ) { fFactory.Register( name, allocator ); } RAT::PDFs::PDF* PDFFactory::GetPDF( const std::string& name ) { string pdfName, initialisation(""); const size_t hyphenPos = name.find( "-" ); if( hyphenPos != string::npos ) { pdfName = name.substr( 0, hyphenPos ); initialisation = name.substr( hyphenPos + 1 ); } else pdfName = name; PDF* pdf = fFactory.New( pdfName ); pdf->Initialise( initialisation ); return pdf; }