/// Evaluates the FOM over the parameter space /// (slices of FOM surface can be plotted by FitPlot tools) /// /// J Amey /// /// 08/12 - New File //////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include #include using namespace RAT::Optimisers; #include #include using namespace CLHEP; using namespace std; void Surface::Initialise( const std::string& param ) { // Convert input string to fDiv, else make fDiv take default val if ( param.empty() ){ fDiv=40; } else { stringstream strStream(param); strStream >> fDiv; if ( fDiv % 2 ) warn << "Surface::Initialise: No. of divisions must be even" << newline; } } double Surface::Minimise() { Evaluate(); return 1.0; } double Surface::Maximise() { Evaluate(); return 1.0; } void Surface::Evaluate() { // Get initial seed parameters vector params = fComponent->GetParams(); // Use the positive position errors since only 1 set of them is used below vector errors = fComponent->GetPositiveErrors(); std::string methodName = "TEMP, fix in #436"; //fComponent->GetName(); fTotalDim=params.size(); // Initialise starting point of mixed space grid and increments fStartp = params; fIncs = params; // Range to be evaluated is from (seed-error) to (seed+error) for (int ii=0; iiBranch("data", &fData); TTree* i = new TTree("Tincs","Increments"); i->Branch("incs", &fIncs); TTree* s = new TTree("Tseeds","Seeds"); s->Branch("seeds", ¶ms); i->Fill(); s->Fill(); // Call recursive Scan member function Scan( params, 0 ); f->Write(); f->Close(); } void Surface::Scan( std::vector coords, int dimension ) { for( int spacePosition=0 ; spacePositionFill(); } } }