feat(fit): add --fix-e0 flag

This commit is contained in:
2025-11-20 15:35:13 +03:00
parent dcc443dc18
commit ae5714e3b6
2 changed files with 10 additions and 1 deletions

View File

@@ -34,6 +34,7 @@ data class FitCustomParams(
val fixTrap: Boolean = false,
val trapFunc: String = "TrapInterpolator",
val fixRWall: Boolean = false,
val fixE0: Boolean = false,
val wallFunc: String = "wallStep",
val noAdiabacity: Boolean = false,
val adiabacityFunc: String = "2024_11"
@@ -94,6 +95,7 @@ fun main (args: Array<String>) {
fixTrap = config.fixTrap,
trapFunc = trapFunc,
fixRwall = config.fixRWall,
fixE0 = config.fixE0,
wallFunc = wallFunc,
noAdiabacity = config.noAdiabacity,
adiabacityFunc = adiabacityFunc

View File

@@ -101,6 +101,8 @@ class CustomArgs : CliktCommand() {
val noAdiabacity: Boolean by option().flag().help("Use const 1 instead of adiabacity function")
val fixE0: Boolean by option().flag().help("Don't fit e0 variable")
// TODO: convert to enum
val adiabacityFunc: String by option().default("2024_11").help(
"adiabacity type (one of 2024_11, shifted, vasya)"
@@ -130,6 +132,7 @@ class CustomArgs : CliktCommand() {
fixBkg,
fixU2,
fixTrap,
fixE0,
getTrapByName(trapFunc),
fixRwall,
noAdiabacity,
@@ -172,6 +175,7 @@ suspend fun processCustom(
fixBkg: Boolean,
fixU2: Boolean,
fixTrap: Boolean,
fixE0: Boolean,
trapFunc: ITrap,
fixRwall: Boolean,
noAdiabacity: Boolean,
@@ -211,7 +215,6 @@ suspend fun processCustom(
}
val fitVars = mutableListOf(
NumassBeta.e0,
NBkgSpectrum.norm,
// NBkgSpectrum.bkg,
// rearWall,
@@ -221,6 +224,10 @@ suspend fun processCustom(
// NumassTransmission.trap,
)
if (!fixE0) {
fitVars += NumassBeta.e0
}
if (!fixBkg) {
fitVars += NBkgSpectrum.bkg
}