Skip to content

Commit

Permalink
Correct a critical bug for grammage mode and add some more example ca…
Browse files Browse the repository at this point in the history
…rds.
  • Loading branch information
niess committed Aug 19, 2017
1 parent ef4c2e7 commit 6430da7
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 4 deletions.
25 changes: 25 additions & 0 deletions cards/forward-tau-decays.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"events" : 10000,
"output-file" : null,

"mode" : "forward",
"longitudinal" : false,
"decay" : true,

"earth-model" : { "sea" : true },

"particle-sampler" : {
"altitude" : [ 0, 1E+4 ],
"elevation" : 1.0,
"energy" : [ 1E+06, 1E+12 ],
"weight" : { "tau" : 1.0 }
},

"primary-flux" : {
"nu_tau" : [ "power-law", {
"energy" : [ 1E+06, 1E+12 ],
"exponent" : -2.0,
"weight" : 1.0
} ]
}
}
14 changes: 14 additions & 0 deletions cards/grammage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"events" : 10,
"output-file" : null,

"mode" : "grammage",
"longitudinal" : true,

"earth-model" : { "sea" : true },

"particle-sampler" : {
"altitude" : 0,
"elevation" : [0.1, 90.0]
}
}
10 changes: 6 additions & 4 deletions src/danton.c
Original file line number Diff line number Diff line change
Expand Up @@ -1824,10 +1824,12 @@ int danton_run(struct danton_context * context, long events)
const double z0 = sample_log_or_linear(
context_, sampler->altitude, &weight);

context_->record->api.id = i;
context_->record->api.generation = 1;
context_->record->api.vertex = NULL;
context_->record->api.n_products = 0;
if (context->mode != DANTON_MODE_GRAMMAGE) {
context_->record->api.id = i;
context_->record->api.generation = 1;
context_->record->api.vertex = NULL;
context_->record->api.n_products = 0;
}
if ((context->mode != DANTON_MODE_GRAMMAGE) &&
!context_->flux_neutrino) {
/* This is a particle Monte-Carlo. */
Expand Down

0 comments on commit 6430da7

Please sign in to comment.