This are nudk codes - #42
Conversation
| @@ -0,0 +1,125 @@ | |||
| //#include "/exp/nova/app/users/acbarros/Nud_S240822/OscLib/OscLib/IOscCalcDecay.h" | |||
There was a problem hiding this comment.
remove this line please
| assert(false); | ||
| } | ||
| //--------------------------------------------------------------------------- | ||
| /* void IOscCalcDecay::SetAlpha3(double&) |
There was a problem hiding this comment.
if these aren't needed, let's remove
| 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 |
There was a problem hiding this comment.
calc_sterile --> calc_decay
| 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 |
There was a problem hiding this comment.
calc_sterile --> calc_decay
|
|
||
| namespace osc | ||
| { | ||
| /// \brief base class for sterile oscillation calculators |
There was a problem hiding this comment.
incorrect description. this refers to sterile osc calcs and not NuDecay
| /////////////////////////////////////////////////////////////////////////////// | ||
|
|
||
|
|
||
| //#include "/exp/nova/app/users/acbarros/Nud_S240822/OscLib/OscLib/IOscCalcDecay.h" |
There was a problem hiding this comment.
remove these three lines
| virtual void SetDm(int i, double dm) override; | ||
| virtual void SetAlpha3(double alpha3) override; | ||
| virtual void SetAlpha2(double alpha2) override; | ||
| //virtual double GetAlpha3(); |
| /// Set standard 3-flavor parameters | ||
| virtual void SetStdPars(); | ||
| virtual void SetIsNuBar(bool IsNuBar); | ||
| //virtual void SetIsNuBar(int anti); |
| bool fBuiltHms; ///< Tag to avoid rebuilding Hms | ||
| bool fIsNuBar; /// anti-neutrino flag | ||
| bool fGotES; | ||
| double kr2GNe; |
There was a problem hiding this comment.
what are these? fGotES , kr2GNe
|
my requests are cosmetic, but desired. |
|
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 |
| void IOscCalcDecay::SetDmsq21(const double&) | ||
| { | ||
| std::cerr << "Must use SetDm!" << std::endl; | ||
| assert(false); |
There was a problem hiding this comment.
Rather than assert(false) instead consider abort() which seems more in-tune with what you want to do here.
There was a problem hiding this comment.
In Andrea's defence, she was basing it on IOscCalcSterile.cxx, which still has the asserts; but I agree abort() preferred
| /// three-neutrino framework with decay. | ||
| /// | ||
| /// \author Andrea Barros - acbarros@mail.uniatlantico.edu.co | ||
| /// \author Mario Acero - |
There was a problem hiding this comment.
There is a missing email here for Mario.
| #include <Eigen/Dense> | ||
| #include <unsupported/Eigen/MatrixFunctions> | ||
| #include "TMath.h" | ||
| using std::complex; |
There was a problem hiding this comment.
Throughout the file, you're inconsistently using both std::cout and cout for example - suggest removing the using statements and use full std:: everywhere.
| /// | ||
| /// @param isNuBar - true if antineutrinos | ||
| /// | ||
| /*void OscCalcDecayEigen::SetIsNuBar(int anti) |
There was a problem hiding this comment.
Remove the commented out function.
|
|
||
| fTheta(i-1,j-1) = th; | ||
|
|
||
| //fBuiltHms = false; |
There was a problem hiding this comment.
Remove commented code.
| /// | ||
| /// @return alpha3 | ||
| /// | ||
| //double OscCalcDecayEigen::GetAlpha3() { return fAlpha(2); } |
There was a problem hiding this comment.
Remove the other commented out not-const methods here too.
|
|
||
| double fSinBuffer = sin(fTheta(i,j)); | ||
| double fCosBuffer = cos(fTheta(i,j)); | ||
| //_sincos(fTheta(i,j), fSinBuffer, fCosBuffer); |
There was a problem hiding this comment.
There's more commented code in this method that should be removed.
| // Check if anything changed | ||
| if(fBuiltHms) return; | ||
|
|
||
| //fHms.setZero(fNumNus, fNumNus); |
There was a problem hiding this comment.
More commented code to be removed in this method.
| } | ||
| else return; | ||
|
|
||
| double lv = (2 * kGeV2eV * E); // 2E in eV |
There was a problem hiding this comment.
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.
| SolveHam(E, Ne); | ||
| //SolveHam(E, Ne, anti); | ||
|
|
||
| double LengthIneV = kKm2eV * L; |
There was a problem hiding this comment.
Also use the OscLib constants header here to convert km to eV.
| /// | ||
| ///////////////////////////////////////////////////////////////////////////// | ||
|
|
||
| // void OscCalcDecayEigen::PropagatePath(double L, double E, double Ne, int anti) |
There was a problem hiding this comment.
Remove commented code in this function.
| double OscCalcDecayEigen::GetP(int flv) const | ||
| { | ||
| assert(flv >= 0 && flv < fNumNus); | ||
| //return norm(fNuState.coeff(flv)); |
There was a problem hiding this comment.
Commented code to remove.
cullenmsullivan
left a comment
There was a problem hiding this comment.
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!
Copy Cullen changes
…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
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.
Here are the codes for neutrino decay analysis.