Skip to content

Systematics 5sa#221

Open
AlanSalcedo wants to merge 13 commits intomasterfrom
systematics_5sa
Open

Systematics 5sa#221
AlanSalcedo wants to merge 13 commits intomasterfrom
systematics_5sa

Conversation

@AlanSalcedo
Copy link
Copy Markdown
Member

This PR adds the ability to modify the askaryan signal amplitude, attenuation lengths (given a file), and n(z) parameters, so we can evaluate systematics on simulations.

All veff tests passed:

  • [ x] veff_ara3
  • [ x] veff_birefringence
  • [ x] veff_pulser
  • [ x] veff_pa

Copy link
Copy Markdown
Contributor

@marcomuzio marcomuzio left a comment

Choose a reason for hiding this comment

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

Thanks @AlanSalcedo ! Just a few small things.

IceModel.cc Outdated

setUpIceModel(model);

const char* araSimDir = getenv("ARA_SIM_DIR");
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.

I think this is already defined in the header as ara_sim_dir

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed

IceModel.cc Outdated
}
else {
std::string attenFile =
std::string(araSimDir) + "/data/iceattenuation_systematics.txt";
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.

Does this file exist? Or is this just a placeholder for something that needs to be added?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Added.

std::string(araSimDir) + "/data/iceattenuation_systematics.txt";

if (!LoadIceAttenPercentTable(attenFile)) {
std::cerr << "Warning: failed to load ice attenuation systematics file: "
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.

Should this throw an error? Or is the idea we always try to load it but maybe we don't always use it?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Throwing error

IceModel.cc Outdated
}

double IceModel::GetIceAttenSystematicsFactor(double depth, Settings *settings1) const {
if (!settings1) {
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.

Is this to make it like an optional argument?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is unnecessary, let me drop it

return 1.0;
}

if (!iceAttenPctTableLoaded || iceAttenPctDepth.empty()) {
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.

Okay maybe now this should be a real crash? I think if you've gotten this far into the function the user is intending to calculate the systematics?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fair


// read depth in positive value and return attenuation length (m) at the depth
double IceModel::GetARAIceAttenuLength(double depth) {
double IceModel::GetARAIceAttenuLength(double depth, Settings *settings1) {
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.

Do we also want to add the systematics support to EffectiveAttenuationLength?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fair enough. Only to the version that already uses has settings in the parameters, which is the only one used in report.cc.

}


ApplyNofzSystematics(ns, nd, nc, settings1);
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.

Doesn't this mean the ice model parameters are incremented in every call to this function? Are they always reset in the function too?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

No, ns, nd, nc are reset in every call, so the increments don't accumulate. That's how it was done already

RaySolver.cc Outdated


void RaySolver::ApplyNofzSystematics(double& ns, double& nd, double& nc, Settings* settings1) {
if (!settings1) return;
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's the use case here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Dropped

Settings.h Outdated

int SYSTEMATICS_IceAttenuation; // 0=central, 1=up, 2=low

int SYSTEMATICS_Askaryan; // 0=central (default), 1=increase pecentage, 2=decrease pecentage
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.

typos on "percentage"

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 do we need this parameter and the one for the size of the change? they seem a little redundant.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It just feels more natural to say 12% and then: add or subtract via this other flag.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Instead of +12% and -12%?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Okay, I settled for allowing + or - instead. So we avoid redundancy.

signal.cc Outdated
}

double Signal::GetAskaryanSystematicsFactor(Settings *settings1) {
if (!settings1) return 1.0;
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.

same question

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Dropped

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.

2 participants