Skip to content

This are nudk codes - #42

Closed
abarroscs wants to merge 11 commits into
cafana:mainfrom
abarroscs:feature/acbarros_nudk_osc
Closed

This are nudk codes#42
abarroscs wants to merge 11 commits into
cafana:mainfrom
abarroscs:feature/acbarros_nudk_osc

Conversation

@abarroscs

Copy link
Copy Markdown

Here are the codes for neutrino decay analysis.

@abarroscs
abarroscs requested a review from a team as a code owner March 12, 2026 13:07
Comment thread OscLib/IOscCalcDecay.cxx Outdated
@@ -0,0 +1,125 @@
//#include "/exp/nova/app/users/acbarros/Nud_S240822/OscLib/OscLib/IOscCalcDecay.h"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

remove this line please

Comment thread OscLib/IOscCalcDecay.cxx Outdated
assert(false);
}
//---------------------------------------------------------------------------
/* void IOscCalcDecay::SetAlpha3(double&)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

if these aren't needed, let's remove

Comment thread OscLib/IOscCalcDecay.cxx Outdated
if(calc_Decay) return calc_Decay;
if (!quiet)
std::cout << "Input calculator was not of type IOscCalcDecay." << std::endl;
return nullptr; // If the cast failed, calc_sterile should be nullptr anyway

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

calc_sterile --> calc_decay

Comment thread OscLib/IOscCalcDecay.cxx Outdated
if (calc_Decay) return calc_Decay;
if (!quiet)
std::cout << "Input calculator was not of type OscCalcDecay." << std::endl;
return nullptr; // If the cast failed, calc_sterile should be nullptr anyway

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

calc_sterile --> calc_decay

Comment thread OscLib/IOscCalcDecay.h Outdated
Comment thread OscLib/IOscCalcDecay.h Outdated

namespace osc
{
/// \brief base class for sterile oscillation calculators

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

incorrect description. this refers to sterile osc calcs and not NuDecay

Comment thread OscLib/OscCalcDecayEigen.h Outdated
///////////////////////////////////////////////////////////////////////////////


//#include "/exp/nova/app/users/acbarros/Nud_S240822/OscLib/OscLib/IOscCalcDecay.h"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

remove these three lines

Comment thread OscLib/OscCalcDecayEigen.h Outdated
virtual void SetDm(int i, double dm) override;
virtual void SetAlpha3(double alpha3) override;
virtual void SetAlpha2(double alpha2) override;
//virtual double GetAlpha3();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

remove

Comment thread OscLib/OscCalcDecayEigen.h Outdated
/// Set standard 3-flavor parameters
virtual void SetStdPars();
virtual void SetIsNuBar(bool IsNuBar);
//virtual void SetIsNuBar(int anti);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

remove

Comment thread OscLib/OscCalcDecayEigen.h Outdated
bool fBuiltHms; ///< Tag to avoid rebuilding Hms
bool fIsNuBar; /// anti-neutrino flag
bool fGotES;
double kr2GNe;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what are these? fGotES , kr2GNe

@gavinsdavies

Copy link
Copy Markdown
Contributor

my requests are cosmetic, but desired.

@chenel
chenel requested a review from cullenmsullivan March 12, 2026 19:14
@chenel

chenel commented Mar 12, 2026

Copy link
Copy Markdown
Contributor

I also suggest we get a review from @cullenmsullivan , since he's done a lot of work on the oscillation calculator infrastructure in the recent past and can hopefully give it a useful once-over

Comment thread OscLib/IOscCalcDecay.cxx Outdated
void IOscCalcDecay::SetDmsq21(const double&)
{
std::cerr << "Must use SetDm!" << std::endl;
assert(false);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Rather than assert(false) instead consider abort() which seems more in-tune with what you want to do here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In Andrea's defence, she was basing it on IOscCalcSterile.cxx, which still has the asserts; but I agree abort() preferred

Comment thread OscLib/OscCalcDecayEigen.cxx Outdated
/// three-neutrino framework with decay.
///
/// \author Andrea Barros - acbarros@mail.uniatlantico.edu.co
/// \author Mario Acero -

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There is a missing email here for Mario.

#include <Eigen/Dense>
#include <unsupported/Eigen/MatrixFunctions>
#include "TMath.h"
using std::complex;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Throughout the file, you're inconsistently using both std::cout and cout for example - suggest removing the using statements and use full std:: everywhere.

Comment thread OscLib/OscCalcDecayEigen.cxx Outdated
///
/// @param isNuBar - true if antineutrinos
///
/*void OscCalcDecayEigen::SetIsNuBar(int anti)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove the commented out function.

Comment thread OscLib/OscCalcDecayEigen.cxx
Comment thread OscLib/OscCalcDecayEigen.cxx
Comment thread OscLib/OscCalcDecayEigen.cxx Outdated

fTheta(i-1,j-1) = th;

//fBuiltHms = false;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove commented code.

Comment thread OscLib/OscCalcDecayEigen.cxx Outdated
///
/// @return alpha3
///
//double OscCalcDecayEigen::GetAlpha3() { return fAlpha(2); }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove the other commented out not-const methods here too.

Comment thread OscLib/OscCalcDecayEigen.cxx Outdated

double fSinBuffer = sin(fTheta(i,j));
double fCosBuffer = cos(fTheta(i,j));
//_sincos(fTheta(i,j), fSinBuffer, fCosBuffer);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There's more commented code in this method that should be removed.

Comment thread OscLib/OscCalcDecayEigen.cxx Outdated
// Check if anything changed
if(fBuiltHms) return;

//fHms.setZero(fNumNus, fNumNus);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

More commented code to be removed in this method.

Comment thread OscLib/OscCalcDecayEigen.cxx Outdated
Comment thread OscLib/OscCalcDecayEigen.h Outdated
Comment thread OscLib/OscCalcDecayEigen.cxx Outdated
}
else return;

double lv = (2 * kGeV2eV * E); // 2E in eV

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Rather than hardcoding your own constants into the calculator, please instead use the constants defined here for consistency with other calculators and for ease of updating.

Comment thread OscLib/OscCalcDecayEigen.cxx Outdated
SolveHam(E, Ne);
//SolveHam(E, Ne, anti);

double LengthIneV = kKm2eV * L;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also use the OscLib constants header here to convert km to eV.

Comment thread OscLib/OscCalcDecayEigen.cxx Outdated
///
/////////////////////////////////////////////////////////////////////////////

// void OscCalcDecayEigen::PropagatePath(double L, double E, double Ne, int anti)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove commented code in this function.

Comment thread OscLib/OscCalcDecayEigen.cxx Outdated
double OscCalcDecayEigen::GetP(int flv) const
{
assert(flv >= 0 && flv < fNumNus);
//return norm(fNuState.coeff(flv));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Commented code to remove.

Comment thread OscLib/OscCalcDecayEigen.cxx

@cullenmsullivan cullenmsullivan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Most of my comments are pedantic - either just cleaning out commented code or for style. The only important thing from me is making use of the OscLib fundamental constants header. Please let me know if you need more direction on what this means!

Andrea Connelly and others added 6 commits April 20, 2026 08:53
…after all comments

Merge branch 'main' into feature/acbarros_nudk_osc
Merge branch 'feature/acbarros_nudk_osc' of https://github.com/abarroscs/OscLib into feature/acbarros_nudk_osc
Merge branch 'feature/acbarros_nudk_osc' of https://github.com/abarroscs/OscLib into feature/acbarros_nudk_osc
@gavinsdavies

Copy link
Copy Markdown
Contributor

Consolidating this with #47 into #48, which carries this branch's history forward with #47's style/fIsNuBar fixes applied on top. Closing this in favor of #48 — the review comments here still apply, will address them there.

gavinsdavies added a commit that referenced this pull request Jul 29, 2026
Strips the commented-out three-argument SolveHam overload (.cxx/.h)
and its matching //int anti; member, per cullenmsullivan's review on
#42. Also drops the now-stale @param anti doxygen line that documented
the removed overload.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants