Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,12 @@ add_subdirectory(examples/random)
add_subdirectory(examples/histograming)
add_subdirectory(examples/async)
add_subdirectory(examples/misc)
add_subdirectory(examples/phys)


if(Minuit2_FOUND)

add_subdirectory(examples/fit)
add_subdirectory(examples/phys)

endif(Minuit2_FOUND)

Expand Down
12 changes: 6 additions & 6 deletions examples/phys/FlatteLineShape.inl
Original file line number Diff line number Diff line change
Expand Up @@ -350,11 +350,11 @@ int main(int argv, char** argc)

double f0_MASS = 0.965;
double f0_MAG = 12.341;
double f0_Phase = -62.852*(M_PI / 180) +M_PI;
double f0_RC = f0_MAG * cos(f0_Phase);
double f0_IMC = f0_MAG * sin(f0_Phase);
double f0_Phase = -62.852*(M_PI / 180.0 ) + M_PI; // 2.044618312126317
double f0_RC = f0_MAG * cos(f0_Phase); //-5.631081433470062
double f0_IMC = f0_MAG * sin(f0_Phase); //10.981402592093087
double f0_rho1 = 0.165;
double f0_rho2 = 4.21*f0_rho1;
double f0_rho2 = 4.21*f0_rho1; // 0.69465

double D_MASS = 1.86962;
double Kplus_MASS = 0.493677; // K+ mass
Expand All @@ -381,8 +381,8 @@ int main(int argv, char** argc)
//======================================================

//f0
auto coef_ref0 = hydra::Parameter::Create().Name("f0_RC").Value(f0_RC).Error(0.0001).Limits(-100,100);
auto coef_imf0 = hydra::Parameter::Create().Name("f0_IM").Value(f0_IMC).Error(0.0001).Limits(-100,100);
auto coef_ref0 = hydra::Parameter::Create().Name("f0_RC").Value(f0_RC).Error(0.0001).Limits(-f0_RC*20.0,+f0_RC*20.0);
auto coef_imf0 = hydra::Parameter::Create().Name("f0_IM").Value(f0_IMC).Error(0.0001).Limits(-f0_IMC*20.0,+f0_IMC*20.0);
auto f0Mass = hydra::Parameter::Create().Name("MASS_f0").Value(f0_MASS).Fixed();
auto f0g1 = hydra::Parameter::Create().Name("f0_g1").Value(f0_rho1).Fixed();
auto rg1og2 = hydra::Parameter::Create().Name("f0_g1xg2").Value(f0_rho2).Fixed();
Expand Down
14 changes: 7 additions & 7 deletions hydra/functions/FlatteLineShape.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/*
* FlatteLineShape.h
*
* Created on: 03/09/2018 Based on Goofit Flatte code
* Created on: 03/09/2018 Based on Goofit Flatte Code
* Author: Juan B de S Leite
*
*
Expand Down Expand Up @@ -223,19 +223,19 @@ namespace hydra {
rhopipi_imag = (2. / 3) * ::sqrt(-1 + twopimasssq / s);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idem...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, try to eliminate the if/else instructions using boolean arithmetic. Avoid value., enforce value.0.


if(s >= twopi0masssq)
rhopipi_real = (1. / 3) * TMath::Sqrt(1 - twopi0masssq / s ); // Above pi0pi0 threshold
rhopipi_real = (1. / 3) * ::sqrt(1 - twopi0masssq / s ); // Above pi0pi0 threshold
else
rhopipi_imag = (1. / 3) * TMath::Sqrt(-1 + twopi0masssq / s );
rhopipi_imag = (1. / 3) * ::sqrt(-1 + twopi0masssq / s );

if(s >= twokmasssq)
rhokk_real = 0.5 * TMath::Sqrt(1 - twokmasssq / s ); // Above K+K- threshold
rhokk_real = 0.5 * ::sqrt(1 - twokmasssq / s ); // Above K+K- threshold
else
rhokk_imag = 0.5 * TMath::Sqrt(-1 + twokmasssq / s );
rhokk_imag = 0.5 * ::sqrt(-1 + twokmasssq / s );

if(s >= twok0masssq)
rhokk_real = 0.5 * TMath::Sqrt(1 - twok0masssq / s ); // Above K0K0 threshold
rhokk_real = 0.5 * ::sqrt(1 - twok0masssq / s ); // Above K0K0 threshold
else
rhokk_imag = 0.5 * TMath::Sqrt(-1 + twok0masssq / s );
rhokk_imag = 0.5 * ::sqrt(-1 + twok0masssq / s );

double A = (resonance_mass*resonance_mass - s) + resonance_mass*(rhopipi_imag*g1 + rhokk_imag*g2);
double B = resonance_mass*(rhopipi_real*g1 + rhokk_real*g2);
Expand Down