Skip to content

Commit

Permalink
Start implementation of a fragmentation scale
Browse files Browse the repository at this point in the history
  • Loading branch information
t7phy committed Jul 24, 2024
1 parent 03f2dc6 commit 5e281ae
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 9 deletions.
17 changes: 13 additions & 4 deletions pineappl/src/boc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ pub struct Order {
pub alpha: u32,
/// Exponent of the logarithm of the scale factor of the renomalization scale.
pub logxir: u32,
/// Exponent of the logarithm of the scale factor of the factorization scale.
/// Exponent of the logarithm of the scale factor of the initial state factorization scale.
pub logxif: u32,
/// Exponent of the logarithm of the scale factor of the final state factorization scale (fragmentation scale).
pub logxia: u32,
}

impl FromStr for Order {
Expand All @@ -37,6 +39,7 @@ impl FromStr for Order {
alpha: 0,
logxir: 0,
logxif: 0,
logxia: 0,
};

for tuple in s
Expand All @@ -61,6 +64,9 @@ impl FromStr for Order {
("lf", Ok(num)) => {
result.logxif = num;
}
("la", Ok(num)) => {
result.logxia = num;
}
(label, Err(err)) => {
return Err(ParseOrderError(format!(
"error while parsing exponent of '{label}': {err}"
Expand All @@ -82,10 +88,11 @@ impl Ord for Order {
// rest lexicographically
(self.alphas + self.alpha)
.cmp(&(other.alphas + other.alpha))
.then((self.alpha, self.logxir, self.logxif).cmp(&(
.then((self.alpha, self.logxir, self.logxif, self.logxia).cmp(&(
other.alpha,
other.logxir,
other.logxif,
other.logxia,
)))
}
}
Expand All @@ -100,12 +107,13 @@ impl Order {
/// Constructor. This function mainly exists to have a way of constructing `Order` that is less
/// verbose.
#[must_use]
pub const fn new(alphas: u32, alpha: u32, logxir: u32, logxif: u32) -> Self {
pub const fn new(alphas: u32, alpha: u32, logxir: u32, logxif: u32, logxia: u32) -> Self {
Self {
alphas,
alpha,
logxir,
logxif,
logxia,
}
}

Expand Down Expand Up @@ -238,8 +246,9 @@ impl Order {
alpha,
logxir,
logxif,
logxia,
}| {
if !logs && (logxir > 0 || logxif > 0) {
if !logs && (logxir > 0 || logxif > 0 || logxia > 0) {
return false;
}

Expand Down
1 change: 1 addition & 0 deletions pineappl/src/fk_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ impl TryFrom<Grid> for FkTable {
alpha: 0,
logxir: 0,
logxif: 0,
logxia: 0,
}]
{
return Err(TryFromGridError::NonTrivialOrder);
Expand Down
4 changes: 2 additions & 2 deletions pineappl/src/grid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1458,7 +1458,7 @@ impl Grid {
subgrids,
channels,
bin_limits: self.bin_limits.clone(),
orders: vec![Order::new(0, 0, 0, 0)],
orders: vec![Order::new(0, 0, 0, 0, 0)],
subgrid_params: SubgridParams::default(),
more_members: self.more_members.clone(),
};
Expand Down Expand Up @@ -1594,7 +1594,7 @@ impl Grid {
subgrids,
channels,
bin_limits: self.bin_limits.clone(),
orders: vec![Order::new(0, 0, 0, 0)],
orders: vec![Order::new(0, 0, 0, 0, 0)],
subgrid_params: SubgridParams::default(),
more_members: self.more_members.clone(),
};
Expand Down
1 change: 1 addition & 0 deletions pineappl_capi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,7 @@ pub unsafe extern "C" fn pineappl_grid_new(
alpha: s[1],
logxir: s[2],
logxif: s[3],
logxia: s[4],
})
.collect();

Expand Down
2 changes: 2 additions & 0 deletions pineappl_cli/src/export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ impl Subcommand for Opts {
alpha,
logxir,
logxif,
logxia,
} in grid
.orders()
.iter()
Expand All @@ -138,6 +139,7 @@ impl Subcommand for Opts {
alpha,
logxir,
logxif,
logxia,
},
keep,
)| {
Expand Down
12 changes: 10 additions & 2 deletions pineappl_cli/src/plot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,16 @@ fn map_format_channel(channel: &Channel, has_pdf1: bool, has_pdf2: bool) -> Stri
.map(|(pids, _)| {
format!(
"{}{}",
if has_pdf1 { map_format_parton(pids[0]) } else { "" },
if has_pdf2 { map_format_parton(pids[1]) } else { "" }
if has_pdf1 {
map_format_parton(pids[0])
} else {
""
},
if has_pdf2 {
map_format_parton(pids[1])
} else {
""
}
)
})
.join(" + ")
Expand Down
6 changes: 5 additions & 1 deletion pineappl_cli/src/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,10 @@ impl Subcommand for Opts {
row.add_cell(cell!(format!("{index}")));

for (pids, factor) in channel.entry() {
row.add_cell(cell!(format!("{factor} \u{d7} ({})", pids.iter().map(ToString::to_string).join(", "))));
row.add_cell(cell!(format!(
"{factor} \u{d7} ({})",
pids.iter().map(ToString::to_string).join(", ")
)));
}
}
} else if self.group.ew || self.group.qcd {
Expand Down Expand Up @@ -210,6 +213,7 @@ impl Subcommand for Opts {
alpha,
logxir,
logxif,
logxia,
} = order;

let order_string = [alphas, alpha, logxir, logxif]
Expand Down

0 comments on commit 5e281ae

Please sign in to comment.