message: Improved Run2Tune param extended to Emin 100 MeV
diff: @@ -824,21 +824,40 @@ Double_t AliPHOSTenderSupply::CorrectNonlinearity(Double_t en){
  if(fNonlinearityVersion=="Run2MC"){ //Default for Run2 + some correction
  return (1.-0.08/(1.+en*en/0.055))*(0.03+6.65e-02*TMath::Sqrt(en)+en)*fNonlinearityParams[0]*(1+fNonlinearityParams[1]/(1.+en*en/fNonlinearityParams[2]/fNonlinearityParams[2])) ;
  }
  - if(fNonlinearityVersion=="Run2Tune"){ //Improved Run2 tune
  +
  + if(fNonlinearityVersion=="Run2Tune"){ //Improved Run2 tune for Emin extended down to 100 MeV
  if(en<=0.) return 0.;
  - const Double_t x0=5.17 ;
  + const Double_t xMin=0.36; //low part of the param (optimized from pi0 peak)
  + const Double_t xMax=5.17; //Upper part of the param (optimized from pi0 peak)
  +
  + //middle part param
  const Double_t a= 1.02165 ;
  const Double_t b=-2.548e-01 ;
  const Double_t c= 6.483e-01 ;
  - const Double_t d=-4.775e-01 ;
  - const Double_t e= 1.205e-01 ;
  - const Double_t beta= b+2.*c/TMath::Sqrt(x0)+3.*d/x0+4.*e/x0/TMath::Sqrt(x0) ;
  - const Double_t alpha = a+b/TMath::Sqrt(x0)+c/x0+d/x0/TMath::Sqrt(x0)+e/(x0*x0)-beta/TMath::Sqrt(x0) ;
  - if(en<x0){
  - return 1.02384*(a*en+b*TMath::Sqrt(en)+c+d/TMath::Sqrt(en)+e/en) ;
  + const Double_t d=-0.4805 ;
  + const Double_t e= 0.1275 ;
  +
  + Double_t ecorr=0.;
  + if(en<xMin){
  + const Double_t beta = 2.*a*sqrt(xMin)+b-d/(xMin)-2.*e/(xMin*sqrt(xMin));
  + const Double_t alpha = a*xMin+b*sqrt(xMin)+c+d/sqrt(xMin)+e/xMin-beta*sqrt(xMin) ;
  + ecorr= 1.0312526*(alpha+beta*sqrt(en)) ;
  + }
  + else{
  + if(en<xMax){
  + ecorr= 1.0312526*(a*en+b*sqrt(en)+c+d/sqrt(en)+e/en) ;
  + }
  + else{
  + const Double_t beta= b+2.*c/sqrt(xMax)+3.*d/xMax+4.*e/xMax/sqrt(xMax) ;
  + const Double_t alpha = a+b/sqrt(xMax)+c/xMax+d/xMax/sqrt(xMax)+e/(xMax*xMax)-beta/sqrt(xMax) ;
  + ecorr= 1.0312526*(alpha*en+beta*sqrt(en)) ;
  + }
  + }
  + if(ecorr>0){
  + return ecorr;
  }
  else{
  - return 1.02384*(alpha*en+beta*TMath::Sqrt(en)) ;
  + return 0.;
  }
  }
  if(fNonlinearityVersion=="Run2TuneMC"){ //Improved Run2 tune for MC
  