Optimization and clean up

This commit is contained in:
Zaher Salman
2018-08-15 20:17:13 +02:00
parent 36e3d28130
commit 3cdf3d356e

View File

@ -10,8 +10,8 @@
***************************************************************************/ ***************************************************************************/
/*************************************************************************** /***************************************************************************
* Copyright (C) 2010 by Zaher Salman * * Copyright (C) 2010 by Zaher Salman *
* zaher.salman@psi.ch * * zaher.salman@psi.ch *
* * * *
* This program is free software; you can redistribute it and/or modify * * This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by * * it under the terms of the GNU General Public License as published by *
@ -20,7 +20,7 @@
* * * *
* This program is distributed in the hope that it will be useful, * * This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of * * but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. * * GNU General Public License for more details. *
* * * *
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
@ -109,12 +109,8 @@ double MLRes::operator()(double x, const vector<double> &par) const {
// par[0] time of beam off // par[0] time of beam off
// par[1] is the relaxation rate // par[1] is the relaxation rate
// par[2] is the exponent // par[2] is the exponent
double tau_p;
double y; double y;
tau_p = (tau_Li/(1.+par[1]*tau_Li));
if ( x >= 0 && x <= par[0] ) { if ( x >= 0 && x <= par[0] ) {
TF1 sexp("sexp", "exp(-([0]-x)/[3])*exp(-pow(([1]*([0]-x)),[2]))", 0.0, 10000.0); TF1 sexp("sexp", "exp(-([0]-x)/[3])*exp(-pow(([1]*([0]-x)),[2]))", 0.0, 10000.0);
sexp.SetParameters(x, par[1], par[2],tau_Li); sexp.SetParameters(x, par[1], par[2],tau_Li);