12 {{{
"A", 1000,
false, 2, 5000, 50,
false, 0}},
13 {{
"T0", 40,
false, 0, 100, 2,
false, 0}},
14 {{
"tau1", 0,
false, 0.5, 3, 0.05,
false, 0}},
15 {{
"tau2", 0,
false, 3.5, 8, 0.25,
false, 0}},
16 {{
"C", 0,
false, -50, 50, 1,
true, 0}},
17 {{
"period", 13.5,
true, 10, 30, 0,
false, 0}},
18 {{
"IndA", 0.2,
false, -2, 2, 0.1,
false, 0}},
19 {{
"IndB", 0.2,
false, -2, 2, 0.1,
false, 0}},
20 {{
"bI", 0.18,
false, -1, 1, 0.025,
false, 0}},
21 {{
"delta", 0.015,
true, 0, 0, 0,
false, 0}}}
24 {{{
"period", 16,
true, 0, 0, 0,
false, 0}},
25 {{
"IndA", 0.25,
false, 0, 2, 0.1,
false, 0}},
26 {{
"IndB", 0.8,
false, 0, 2, 0.1,
false, 0}},
27 {{
"bI", 0.18,
false, -1, 1, 0.025,
false, 0}},
28 {{
"delta", 0.015,
true, 0, 0, 0,
false, 0}},
29 {{
"C", 0,
false, -50, 50, 1,
true, 0}},
33 {{{
"tau2", 0,
false, 4, 7.5, 0.25,
false, 0}},
34 {{
"period", 13,
true, 0, 0, 0,
false, 0}},
35 {{
"IndA", -0.07,
false, -0.1, 0.4, 0.025,
true, 0.}},
36 {{
"IndB", 0.1,
false, -0.1, 0.4, 0.025,
false, 0}},
37 {{
"bI", -0.025,
false, -0.15, 0.05, 0.025,
true, -0.03}},
38 {{
"C", 0,
false, -50, 50, 1,
false, 0}}, }
41 {{{
"tau2", 6,
false, 5, 8, 0.25,
false, 0}},
42 {{
"period", 14,
true, 10, 16, 1,
false, 0}},
43 {{
"IndA", 0.1,
false, -0.1, 0.75, 0.1,
true, 0}},
44 {{
"IndB", 0.1,
false, -0.25, 0.75, 0.1,
false, 0}},
45 {{
"bI", -0.02,
false, -0.2, 0.2, 0.025,
false, 0}},
48 {
"PbPb2025FreeInduct",
49 {{{
"period", 13,
false, 11, 20, 1,
true, 13}},
50 {{
"IndA", 0.25,
false, -0.05, 0.5, 0.1,
true, 0}},
51 {{
"IndB", 0.2,
false, -0.2, 0.5, 0.1,
false, 0}},
52 {{
"bI", -0.025,
false, -0.3, 0.3, 0,
false, 0}},
56 {{{
"period", 16,
true, 0, 0, 0,
false, 0}},
57 {{
"IndA", 0.25,
false, 0, 2, 0.1,
false, 0}},
58 {{
"IndB", 0.8,
false, 0, 2, 0.1,
false, 0}},
59 {{
"bI", 0.018,
true, 0, -0.5, 0.5,
false, 0}},
60 {{
"delta", 0.015,
true, 0, 0, 0,
false, 0}},
68 {{{
"A", 1000,
false, 2, 5000, 50,
false, 0}},
69 {{
"T0", 40,
false, 0, 100, 1,
false, 0}},
70 {{
"Aexp", 0,
false, 0, 4000, 0.05,
false, 0}},
71 {{
"tauexp", 0,
false, 3.5, 8, 0.25,
false, 0}},
72 {{
"bsqrtexp", 0,
false, -0.001, 0.001, 0.0001,
true, 0}},
73 {{
"C", 0,
false, -50, 50, 1,
true, 0}},
74 {{
"period", 13.5,
true, 0, 0, 0,
false, 0}},
75 {{
"IndA", 0.2,
false, -2, 2, 0.1,
false, 0}},
76 {{
"IndB", 0.2,
false, -2, 2, 0.1,
false, 0}},
77 {{
"bI", -0.02,
true, -0.5, 0.5, 0.025,
true, -0.02}}
81 {{{
"period", 13,
true, 0, 0, 0,
false, 0}},
82 {{
"IndA", 0.1,
false, -0.1, 0.4, 0.05,
true, 0}},
83 {{
"IndB", 0.2,
false, -0.1, 0.4, 0.05,
false, 0}},
84 {{
"bI", -0.05,
true, -0.15, 0.15, 0.025,
false, 0}},
85 {{
"C", 0,
false, -200, 200, 1,
false, 0}},
89 {{{
"period", 13,
true, 0, 0, 0,
false, 0}},
90 {{
"IndA", 0.1,
false, -0.1, 2, 0.1,
true, 0}},
91 {{
"IndB", 0.2,
false, -0.1, 2, 0.1,
false, 0}},
92 {{
"bI", -0.04,
true, -0.1, 0., 0.025,
true, -0.02}},
93 {{
"C", 0,
false, -200, 200, 1,
false, 0}},
96 {
"PbPb2025FreeInduct",
97 {{{
"period", 13,
false, 10, 30, 1,
true, 13}},
98 {{
"IndA", 0.,
false, -0.1, 0.25, 0.1,
true, 0}},
99 {{
"IndB", 0.1,
false, -0.1, 0.5, 0.1,
false, 0}},
100 {{
"bI", -0.025,
false, -0.5, 0.5, 0,
false, 0}},
101 {{
"C", 0,
false, -200, 200, 1,
false, 0}},
109 {{{
"A", 1000,
false, 2, 5000, 50,
false, 0}},
110 {{
"T0", 40,
false, 0, 100, 1,
false, 0}},
111 {{
"Apre", 0,
false, 0, 4000, 0.05,
false, 0}},
112 {{
"T0pre", 0,
false, 3.5, 8, 0.25,
false, 0}},
113 {{
"C", 0,
false, -50, 50, 1,
true, 0}},
114 {{
"period", 13.5,
true, 0, 0, 0,
false, 0}},
115 {{
"IndA", 0.2,
false, -2, 2, 0.1,
false, 0}},
116 {{
"IndB", 0.2,
false, -2, 2, 0.1,
false, 0}},
117 {{
"bI", -0.02,
true, -0.5, 0.5, 0.025,
true, -0.02}}
121 {{{
"period", 13,
true, 0, 0, 0,
false, 0}},
122 {{
"IndA", 0.1,
false, -0.25, 0.25, 0.1,
true, 0}},
123 {{
"IndB", 0.2,
false, -0.25, 0.25, 0.1,
false, 0}},
124 {{
"bI", -0.05,
true, -0.5, 0.5, 0.025,
true, -0.02}},
128 {{{
"period", 13,
true, 0, 0, 0,
false, 0}},
129 {{
"IndA", 0.1,
false, -0.25, 0.5, 0.1,
true, 0}},
130 {{
"IndB", 0.2,
false, -0.25, 0.5, 0.1,
false, 0}},
131 {{
"bI", -0.04,
false, -0.5, 0.5, 0.025,
true, -0.02}},
134 {
"PbPb2025FreeInduct",
135 {{{
"period", 13,
false, 10, 30, 1,
true, 13}},
136 {{
"IndA", 0.1,
false, -0.25, 0.5, 0.1,
true, 0}},
137 {{
"IndB", 0.2,
false, -0.25, 0.1, 0.1,
false, 0}},
138 {{
"bI", -0.025,
false, -0.5, 0.5, 0,
false, 0}},
146 [name](
const FitParameter& parDesc){return parDesc.name() == name;});
147 if (iter ==
m_parameterSet.end())
throw std::logic_error(
"ZDCFitWrapper::GetParameterDescr: invalid parameter name: " + name );
155 if (
int(parameterSet.size()) !=
m_wrapperTF1->GetNpar())
throw std::logic_error(
"ZDCFitWrapper::LoadDefaultParameterSet:: Incorrect number of parameters in default parameter set");
164 unsigned parIndex = 0;
165 for (
const auto & parDescr : parameterSet) {
169 std::string name = parDescr.name();
170 theTF1->SetParName(parIndex, name.c_str());
172 bool fixed = parDescr.fixed();
175 float fixedValue = parDescr.defaultValue();
176 theTF1->FixParameter(parIndex, fixedValue);
179 float lowerLimit = parDescr.lowerLimit();
180 float upperLimit = parDescr.upperLimit();
181 theTF1->SetParLimits(parIndex, lowerLimit, upperLimit);
194 for (
const auto & parDescr : overParamSet) {
195 std::string inputName = parDescr.name();
200 [inputName](
const FitParameter& parDesc){return parDesc.name() == inputName;});
201 if (iter ==
m_parameterSet.end())
throw std::logic_error(
"ZDCFitWrapper::OverrideParameterSet: invalid parameter name: " +inputName );
209 unsigned int parIndex = std::distance(
m_parameterSet.begin(), iter);
210 bool fixed = parDescr.fixed();
213 float fixedValue = parDescr.defaultValue();
214 theTF1->FixParameter(parIndex, fixedValue);
217 float lowerLimit = parDescr.lowerLimit();
218 float upperLimit = parDescr.upperLimit();
219 theTF1->SetParLimits(parIndex, lowerLimit, upperLimit);
230 unsigned int npar = tf1_p->GetNpar();
231 std::vector<double> zeroVec(npar, 0.0);
249 for (
unsigned int ipar = 0; ipar <
m_parameterSet.size(); ipar++) {
255 if (!fitparDescr.fixed()) {
256 tf1_p->SetParameter(ipar, fitparDescr.defaultValue());
257 tf1_p->SetParError(ipar, fitparDescr.stepSize());
261 tf1_p->SetParameter(0, initialAmp);
262 tf1_p->SetParameter(1, initialT0);
274 std::vector<double> zeroVec(npar, 0.0);
275 tf1_p->SetParErrors(&zeroVec[0]);
280void ZDCFitWrapper::Initialize(
float initialAmp,
float initialT0,
float ampMin,
float ampMax,
float fitTmin,
float fitTmax,
float fitTRef)
285 Initialize(initialAmp, initialT0, ampMin, ampMax);
307 for (
unsigned int ipar = 2; ipar <
m_parameterSet.size(); ipar++) {
310 if (!fitparDescr.fixed() && fitparDescr.constrainFixed()) {
311 tf1_p->FixParameter(ipar, fitparDescr.constrainValue());
323 for (
unsigned int ipar = 2; ipar <
m_parameterSet.size(); ipar++) {
326 if (!fitparDescr.fixed() && fitparDescr.constrainFixed()) {
327 tf1_p->ReleaseParameter(ipar);
328 tf1_p->SetParameter(ipar, fitparDescr.defaultValue());
330 float lowerLimit = fitparDescr.lowerLimit();
331 float upperLimit = fitparDescr.upperLimit();
332 tf1_p->SetParLimits(ipar, lowerLimit, upperLimit);
334 tf1_p->SetParError(ipar, fitparDescr.stepSize());
347 theTF1->SetParName(0,
"Amp");
348 theTF1->SetParName(1,
"T0");
349 theTF1->SetParName(2,
"tau1");
350 theTF1->SetParName(3,
"tau2");
351 theTF1->SetParName(4,
"C");
354 theTF1->SetParLimits(1, tmin, tmax);
355 theTF1->SetParLimits(2, 3, 6);
356 theTF1->SetParLimits(3, 10, 40);
366 theTF1->SetParameter(0, initialAmp);
367 theTF1->SetParameter(1, initialT0);
368 theTF1->SetParameter(4, 0);
370 theTF1->SetParLimits(0, ampMin, ampMax);
381 theTF1->SetParLimits(1, t0Min, t0Max);
390 theTF1->FixParameter(4, 0);
395 theTF1->ReleaseParameter(4);
402 theTF1->SetParLimits(2, 0.5, 3);
403 theTF1->SetParLimits(3, 4, 10);
418 theTF1->SetParName(0,
"Amp");
419 theTF1->SetParName(1,
"T0");
420 theTF1->SetParName(2,
"tau1");
421 theTF1->SetParName(3,
"tau2");
422 theTF1->SetParName(4,
"C");
423 theTF1->SetParName(5,
"refdelay");
424 theTF1->SetParName(6,
"reflAmpFrac");
425 theTF1->SetParName(7,
"reflWidth");
426 theTF1->SetParName(8,
"delta");
428 theTF1->SetParLimits(1, tmin, tmax);
429 theTF1->SetParLimits(4, -100, 100);
430 theTF1->SetParLimits(6, -1e-4, 0.35);
432 theTF1->FixParameter(5, 6.5);
433 theTF1->FixParameter(7, 1.5);
434 theTF1->FixParameter(8, 0.01);
437 else theTF1->SetParLimits(2, 1, 2);
440 else theTF1->SetParLimits(3, 3.5, 6);
447 theTF1->SetParameter(0, initialAmp);
449 float t0 = initialT0;
452 theTF1->SetParameter(1,
t0);
454 theTF1->SetParameter(1, initialT0);
455 theTF1->SetParameter(4, 0);
456 theTF1->SetParameter(6, 0.1);
458 theTF1->SetParLimits(0, ampMin, ampMax);
465 double ampStep = std::min(0.05*initialAmp, std::abs(ampMax - initialAmp)/2.);
467 theTF1->SetParError(0, ampStep);
468 theTF1->SetParError(1, 1.0);
470 if (!
m_fixTau1) theTF1->SetParError(2, 0.05);
471 if (!
m_fixTau2) theTF1->SetParError(3, 0.25);
473 theTF1->SetParError(4, 2);
474 theTF1->SetParError(5, 0.25);
475 theTF1->SetParError(6, 0.05);
483 theTF1->SetParLimits(1, t0Min, t0Max);
492 theTF1->FixParameter(4, 0);
493 theTF1->FixParameter(6, 0);
498 theTF1->ReleaseParameter(4);
499 theTF1->SetParameter(4, 0);
501 theTF1->ReleaseParameter(6);
502 theTF1->SetParLimits(6, -1e-4, 0.35);
503 theTF1->SetParameter(6, 0.1);
512 theTF1->SetParName(0,
"Amp");
513 theTF1->SetParName(1,
"T0");
514 theTF1->SetParName(2,
"tau1");
515 theTF1->SetParName(3,
"tau2");
516 theTF1->SetParName(4,
"C");
517 theTF1->SetParName(5,
"period");
518 theTF1->SetParName(6,
"IndA");
519 theTF1->SetParName(7,
"IndB");
520 theTF1->SetParName(8,
"tauI");
521 theTF1->SetParName(9,
"delta");
523 theTF1->SetParLimits(1, tmin, tmax);
524 theTF1->SetParLimits(4, -50, 50);
525 theTF1->SetParLimits(5, 10, 50);
526 theTF1->SetParLimits(6, 0, 2);
527 theTF1->SetParLimits(7, 0, 2);
529 theTF1->FixParameter(8, 5.5);
530 theTF1->FixParameter(5, 16);
533 theTF1->SetNpx(1000);
537 else theTF1->SetParLimits(2, 0.5, 3);
540 else theTF1->SetParLimits(3, 3.5, 8);
550 if (iter ==
s_ConfigParamMap.end())
throw std::runtime_error(
"ZDCFitExpFermiVariableTausInduct:: invalid parameter set identifier: " + paramSet);
552 std::vector<ZDCFitWrapper::FitParameter> overRideParams = iter->second;
556 auto tau1Iter = std::find_if(overRideParams.begin(), overRideParams.end(), [](
const FitParameter& parDesc){return parDesc.name() ==
"tau1";});
557 if (tau1Iter != overRideParams.end()) {
558 if (fixTau1) tau1Iter->setFixed(tau1);
559 else tau1Iter->setDefaultValue(tau1);
562 FitParameter tau1Descr = GetParameterDescr(
"tau1");
563 if (fixTau1) tau1Descr.setFixed(tau1);
564 else tau1Descr.setDefaultValue(tau1);
565 overRideParams.push_back(std::move(tau1Descr));
568 auto tau2Iter = std::find_if(overRideParams.begin(), overRideParams.end(), [](
const FitParameter& parDesc){return parDesc.name() ==
"tau2";});
569 if (tau2Iter != overRideParams.end()) {
570 if (fixTau2) tau2Iter->setFixed(tau2);
571 else tau2Iter->setDefaultValue(tau2);
574 FitParameter tau2Descr = GetParameterDescr(
"tau2");
575 if (fixTau2) tau2Descr.setFixed(tau2);
576 else tau2Descr.setDefaultValue(std::move(tau2));
577 overRideParams.push_back(std::move(tau2Descr));
581 auto periodIter = std::find_if(overRideParams.begin(), overRideParams.end(), [](
const FitParameter& parDesc){return parDesc.name() ==
"period";});
582 if (periodIter != overRideParams.end()) {
583 periodIter->setFixed(period);
588 overRideParams.push_back(std::move(periodDescr));
593 auto bIIter = std::find_if(overRideParams.begin(), overRideParams.end(), [](
const FitParameter& parDesc){return parDesc.name() ==
"bI";});
594 if (bIIter != overRideParams.end()) {
595 bIIter->setFixed(bI);
600 overRideParams.push_back(std::move(bIDescr));
613 theTF1->SetParameter(0, initialAmp);
614 theTF1->SetParLimits(0, ampMin, ampMax);
616 float t0 = initialT0;
619 theTF1->SetParameter(1,
t0);
621 theTF1->SetParameter(6, 0.25);
622 theTF1->SetParameter(7, 0.8);
630 double ampStep = std::min(0.05*initialAmp, std::abs(ampMax - initialAmp)/2.);
632 theTF1->SetParError(0, ampStep);
633 theTF1->SetParError(1, 1.0);
635 if (!
m_fixTau1) theTF1->SetParError(2, 0.05);
636 if (!
m_fixTau2) theTF1->SetParError(3, 0.25);
638 theTF1->SetParError(4, 1);
639 theTF1->SetParError(5, 5);
640 theTF1->SetParError(6, 0.1);
641 theTF1->SetParError(7, 0.1);
649 theTF1->SetParLimits(1, t0Min, t0Max);
655 theTF1->FixParameter(6, 0.25);
656 theTF1->FixParameter(4, 0);
663 theTF1->ReleaseParameter(6);
664 theTF1->ReleaseParameter(4);
665 theTF1->SetParLimits(6, 0, 2);
666 theTF1->SetParLimits(4, -50, 50);
671 ZDCFitWrapper(
std::make_shared<TF1>((
"ExpFermiFixedTaus" + tag).c_str(), this, tmin, tmax, 3)),
677 theTF1->SetParLimits(1, tmin, tmax);
679 theTF1->SetParName(0,
"Amp");
680 theTF1->SetParName(1,
"T0");
681 theTF1->SetParName(2,
"C");
685 std::string funcNameRefFunc =
"ExpFermiFixedTausRefFunc" + tag;
711 theTF1->FixParameter(2, 0);
716 theTF1->ReleaseParameter(2);
730 std::string funcNameRefFunc =
"ExpFermiPrePulseRefFunc" + tag;
748 theTF1->SetParLimits(1, tmin, tmax);
749 theTF1->SetParLimits(2, 1, 8196);
750 theTF1->SetParLimits(3, -20, 10);
752 theTF1->SetParName(0,
"Amp");
753 theTF1->SetParName(1,
"T0");
754 theTF1->SetParName(2,
"Amp_{pre}");
755 theTF1->SetParName(3,
"T0_{pre}");
756 theTF1->SetParName(4,
"C");
765 theTF1->FixParameter(2, 0);
766 theTF1->FixParameter(4, 0);
771 theTF1->ReleaseParameter(2);
772 theTF1->ReleaseParameter(4);
774 theTF1->SetParLimits(2, 1, 8196);
800 double ampStep = std::min(0.05*initialAmp, std::abs(ampMax - initialAmp)/2.);
811 theTF1->SetParLimits(1, t0Min, t0Max);
821 std::string funcNameRefFunc =
"ExpFermiPreExpRefFunc" + tag;
839 theTF1->SetParName(0,
"Amp");
840 theTF1->SetParName(1,
"T0");
841 theTF1->SetParName(2,
"Amp_{pre}");
842 theTF1->SetParName(3,
"tau_{pre}");
843 theTF1->SetParName(4,
"tausqrt_{pre}");
844 theTF1->SetParName(5,
"C");
846 theTF1->SetParLimits(1, tmin, tmax);
847 theTF1->SetParLimits(2, -1, 8196);
848 theTF1->SetParLimits(3, 6, 30);
849 theTF1->SetParLimits(4, -0.2, 0.2);
850 theTF1->SetParLimits(5, -50, 50);
859 theTF1->FixParameter(2, 0);
861 theTF1->FixParameter(5, 0);
867 theTF1->ReleaseParameter(2);
868 theTF1->SetParLimits(2, -1, 8196);
870 theTF1->ReleaseParameter(3);
871 theTF1->SetParLimits(3, 6, 30);
874 theTF1->ReleaseParameter(5);
875 theTF1->SetParLimits(5, -50, 50);
876 theTF1->SetParameter(5, 0);
892 double ampStep = std::min(0.05*initialAmp, std::abs(ampMax - initialAmp)/2.);
904 theTF1->SetParLimits(1, t0Min, t0Max);
914 std::string funcNameRefFunc =
"ExpFermiLHCfPreExpRefFunc" + tag;
933 theTF1->SetParName(0,
"Amp");
934 theTF1->SetParName(1,
"T0");
935 theTF1->SetParName(2,
"Tau1");
936 theTF1->SetParName(3,
"Tau2");
937 theTF1->SetParName(4,
"Amp_{pre}");
938 theTF1->SetParName(5,
"tau_{pre}");
939 theTF1->SetParName(6,
"bsqrt_{pre}");
940 theTF1->SetParName(7,
"ReflFrac");
942 theTF1->SetParLimits(1, tmin, tmax);
943 theTF1->SetParLimits(2, 1.0, 2);
944 theTF1->SetParLimits(3, 3.5, 5.5);
945 theTF1->SetParLimits(4, -1, 8196);
946 theTF1->SetParLimits(5, 4, 12);
947 theTF1->SetParLimits(6, -0.001, 0.001);
948 theTF1->SetParLimits(7, -1.0e-4, 0.3);
953 GetWrapperTF1()->SetParameter(0, std::max(initialAmp, ampMin));
955 float t0 = initialT0;
971 double ampStep = std::min(0.05*initialAmp, std::abs(ampMax - initialAmp)/2.);
989 theTF1->FixParameter(6, 0);
990 theTF1->FixParameter(7, 0.20);
996 theTF1->ReleaseParameter(5);
997 theTF1->SetParLimits(5, 6, 12);
999 theTF1->ReleaseParameter(6);
1000 theTF1->SetParLimits(6, -0.001, 0.001);
1003 theTF1->ReleaseParameter(7);
1004 theTF1->SetParLimits(7, -1.0e-4, 0.3);
1012 theTF1->SetParLimits(1, t0Min, t0Max);
1021 std::string funcNameRefFunc =
"ExpFermiLHCfPrePulseRefFunc" + tag;
1022 std::string funcNamePreFunc =
"ExpFermiLHCfPrePulsePreFunc" + tag;
1050 theTF1->SetParName(0,
"Amp");
1051 theTF1->SetParName(1,
"T0");
1052 theTF1->SetParName(2,
"tau1");
1053 theTF1->SetParName(3,
"tau2");
1054 theTF1->SetParName(4,
"Amp_{pre}");
1055 theTF1->SetParName(5,
"T0_{pre}");
1056 theTF1->SetParName(6,
"C");
1059 theTF1->SetParLimits(1, tmin, tmax);
1060 theTF1->SetParLimits(2, 1.0, 2);
1061 theTF1->SetParLimits(3, 3.5, 5.5);
1062 theTF1->SetParLimits(4, 1, 8196);
1063 theTF1->SetParLimits(5, -20, 10);
1064 theTF1->SetParLimits(6, -50, 50);
1074 theTF1->FixParameter(4, 0);
1075 theTF1->FixParameter(6, 0);
1080 theTF1->ReleaseParameter(4);
1081 theTF1->ReleaseParameter(6);
1083 theTF1->SetParLimits(4, 1, 8196);
1084 theTF1->SetParLimits(6, -50, 50);
1114 double ampStep = std::min(0.05*initialAmp, std::abs(ampMax - initialAmp)/2.);
1127 theTF1->SetParLimits(1, t0Min, t0Max);
1137 std::string funcNameRefFunc =
"ExpFermiInductPreExpRefFunc" + tag;
1157 theTF1->SetParName(0,
"Amp");
1158 theTF1->SetParName(1,
"T0");
1159 theTF1->SetParName(2,
"Aexp");
1160 theTF1->SetParName(3,
"tauexp");
1161 theTF1->SetParName(4,
"bsqrtexp");
1162 theTF1->SetParName(5,
"C");
1163 theTF1->SetParName(6,
"Period");
1164 theTF1->SetParName(7,
"IndA");
1165 theTF1->SetParName(8,
"IndB");
1166 theTF1->SetParName(9,
"bI");
1168 theTF1->SetParLimits(1, tmin, tmax);
1169 theTF1->SetParLimits(2, -1, 8196);
1170 theTF1->SetParLimits(3, 4, 12);
1171 theTF1->SetParLimits(4, -0.001, 0.001);
1172 theTF1->SetParLimits(5, -10, 10);
1173 theTF1->FixParameter(6, 13);
1174 theTF1->SetParLimits(7, -0.1, 2);
1175 theTF1->SetParLimits(8, -0.1, 2);
1176 theTF1->SetParLimits(9, -0.05, 0.5);
1185 if (iter ==
s_ConfigParamMap.end())
throw std::runtime_error(
"ZDCFitExpFermiVariableTausInduct:: invalid parameter set identifier: " + paramSet);
1187 std::vector<ZDCFitWrapper::FitParameter> overRideParams = iter->second;
1193 auto periodIter = std::find_if(overRideParams.begin(), overRideParams.end(), [](
const FitParameter& parDesc){return parDesc.name() ==
"period";});
1194 if (periodIter != overRideParams.end()) {
1195 periodIter->setFixed(period);
1200 overRideParams.push_back(std::move(periodDescr));
1205 auto bIIter = std::find_if(overRideParams.begin(), overRideParams.end(), [](
const FitParameter& parDesc){return parDesc.name() ==
"bI";});
1206 if (bIIter != overRideParams.end()) {
1207 bIIter->setFixed(bI);
1212 overRideParams.push_back(std::move(bIDescr));
1220 std::string funcNameRefFunc =
"ExpFermiInductPreExpRefFunc" + tag;
1240 GetWrapperTF1()->SetParameter(0, std::max(initialAmp, ampMin));
1242 float t0 = initialT0;
1258 double ampStep = std::min(0.05*initialAmp, std::abs(ampMax - initialAmp)/2.);
1281 theTF1->SetParLimits(1, t0Min, t0Max);
1290 std::string funcNameRefFunc =
"ExpFermiInductPrePulseRefFunc" + tag;
1291 std::string funcNamePreFunc =
"ExpFermiInductPrePulsePreFunc" + tag;
1320 theTF1->SetParName(0,
"Amp");
1321 theTF1->SetParName(1,
"T0");
1322 theTF1->SetParName(2,
"Apre");
1323 theTF1->SetParName(3,
"T0pre");
1324 theTF1->SetParName(4,
"C");
1325 theTF1->SetParName(5,
"Period");
1326 theTF1->SetParName(6,
"IndA");
1327 theTF1->SetParName(7,
"IndB");
1328 theTF1->SetParName(8,
"bI");
1331 theTF1->SetParLimits(1, tmin, tmax);
1332 theTF1->SetParLimits(2, 0, 5000);
1333 theTF1->SetParLimits(3, 0, 30);
1334 theTF1->SetParLimits(4, 0, 2);
1335 theTF1->SetParLimits(3, 4, 12);
1336 theTF1->SetParLimits(4, -50, 50);
1337 theTF1->SetParLimits(5, 10, 20);
1338 theTF1->SetParLimits(6, -0.1, 1);
1339 theTF1->SetParLimits(7, -0.1, 1);
1340 theTF1->SetParLimits(9, -0.2, 0.2);
1351 if (iter ==
s_ConfigParamMap.end())
throw std::runtime_error(
"ZDCFitExpFermiVariableTausInduct:: invalid parameter set identifier: " + paramSet);
1353 std::vector<ZDCFitWrapper::FitParameter> overRideParams = iter->second;
1359 std::string funcNameRefFunc =
"ExpFermiInductPrePulseRefFunc" + tag;
1360 std::string funcNamePreFunc =
"ExpFermiInductPrePulsePreFunc" + tag;
1389 theTF1->FixParameter(4, 0);
1390 theTF1->FixParameter(5, 0);
1391 theTF1->FixParameter(7, 0);
1396 theTF1->ReleaseParameter(5);
1397 theTF1->ReleaseParameter(7);
1398 theTF1->SetParLimits(4, -0.001, 0.001);
1399 theTF1->SetParLimits(5, -10, 10);
1400 theTF1->SetParLimits(7, -0.1, 2);
1431 double ampStep = std::min(0.05*initialAmp, std::abs(ampMax - initialAmp)/2.);
1445 theTF1->SetParLimits(1, t0Min, t0Max);
1452 ZDCFitWrapper(
std::make_shared<TF1>((
"ExpFermiFixedTaus" + tag).c_str(), this, tmin, tmax, 4)),
1458 theTF1->SetParLimits(1, tmin, tmax);
1460 theTF1->SetParName(0,
"Amp");
1461 theTF1->SetParName(1,
"T0");
1462 theTF1->SetParName(2,
"s_{b}");
1463 theTF1->SetParName(3,
"c_{b}");
1467 std::string funcNameRefFunc =
"ExpFermiFixedTausRefFunc" + tag;
1487 theTF1->FixParameter(2, 0);
1488 theTF1->FixParameter(3, 0);
1494 theTF1->ReleaseParameter(2);
1495 theTF1->ReleaseParameter(3);
1500 float slope = std::abs(0.1 * initialAmp / initialT0);
1501 float intercept = std::abs(0.1 * initialAmp);
1512 double ampStep = std::min(0.05*initialAmp, std::abs(ampMax - initialAmp)/2.);
1523 theTF1->SetParLimits(1, t0Min, t0Max);
1534 std::string funcNameRefFunc =
"ExpFermiPerPulseRefFunc" + tag;
1551 theTF1->SetParName(0,
"Amp");
1552 theTF1->SetParName(1,
"T0");
1553 theTF1->SetParName(2,
"Amp_{pre}");
1554 theTF1->SetParName(3,
"T0_{pre}");
1555 theTF1->SetParName(4,
"s_{b}");
1556 theTF1->SetParName(5,
"c_{b}");
1559 theTF1->SetParLimits(1, tmin, tmax);
1560 theTF1->SetParLimits(2, 1, 4096);
1561 theTF1->SetParLimits(3, -20, 10);
1570 theTF1->FixParameter(4, 0);
1571 theTF1->FixParameter(5, 0);
1577 theTF1->ReleaseParameter(4);
1578 theTF1->ReleaseParameter(5);
1588 float slope = std::abs(initialAmp / initialT0);
1589 float intercept = std::abs(0.5 * initialAmp);
1600 double ampStep = std::min(0.05*initialAmp, std::abs(ampMax - initialAmp)/2.);
1624 std::string funcNameRefFunc =
"ExpFermiPerPulseRefFunc" + tag;
1641 theTF1->SetParLimits(1, tmin, tmax);
1642 theTF1->SetParLimits(2, 0, 2048);
1643 theTF1->SetParLimits(3, 0, 40);
1644 theTF1->SetParLimits(6, 0, 4096);
1646 theTF1->SetParName(0,
"Amp");
1647 theTF1->SetParName(1,
"T0");
1648 theTF1->SetParName(2,
"Amp_{pre}");
1649 theTF1->SetParName(3,
"T0_{pre}");
1650 theTF1->SetParName(4,
"s_{b}");
1651 theTF1->SetParName(5,
"c_{b}");
1652 theTF1->SetParName(6,
"Amp_{exp}");
1661 theTF1->FixParameter(2, 0);
1662 theTF1->FixParameter(4, 0);
1663 theTF1->FixParameter(5, 0);
1668 theTF1->ReleaseParameter(2);
1669 theTF1->ReleaseParameter(4);
1670 theTF1->ReleaseParameter(5);
1686 float slope = std::abs(initialAmp / initialT0);
1687 float intercept = std::abs(0.1 * initialAmp);
1717 std::string funcNameRefFunc =
"ExpFermiPerPulseRefFunc" + tag;
1734 theTF1->SetParLimits(1, tmin, tmax);
1735 theTF1->SetParLimits(2, 0, 2048);
1736 theTF1->SetParLimits(3, 0, 40);
1737 theTF1->SetParLimits(6, 0, 4096);
1738 theTF1->SetParLimits(7, 0, 2048);
1739 theTF1->SetParLimits(8, 100, 163);
1741 theTF1->SetParName(0,
"Amp");
1742 theTF1->SetParName(1,
"T0");
1743 theTF1->SetParName(2,
"Amp_{pre}");
1744 theTF1->SetParName(3,
"T0_{pre}");
1745 theTF1->SetParName(4,
"s_{b}");
1746 theTF1->SetParName(5,
"c_{b}");
1747 theTF1->SetParName(6,
"Amp_{exp}");
1748 theTF1->SetParName(7,
"Amp_{post}");
1749 theTF1->SetParName(8,
"T0_{post}");
1758 theTF1->FixParameter(2, 0);
1759 theTF1->FixParameter(4, 0);
1760 theTF1->FixParameter(5, 0);
1765 theTF1->ReleaseParameter(2);
1766 theTF1->ReleaseParameter(4);
1767 theTF1->ReleaseParameter(5);
1773 if (tmin < 0) tmin = 0;
1784 float iniPostT0 = initialPostT0;
1790 float slope = std::abs(initialAmp / initialT0);
1791 float intercept = std::abs(0.1 * initialAmp);
double ZDCFermiExpFit(const double *xvec, const double *pvec)
double ZDCFermiExpFitRefl(const double *xvec, const double *pvec)
double ZDCFermiExpFitInduct(const double *xvec, const double *pvec)
virtual void DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax) override
virtual void SetPrePulseT0Range(float tmin, float tmax) override
virtual void SetT0FitLimits(float tMin, float tMax) override
virtual void doConstrainFit() override
ZDCFitComplexPrePulse(const std::string &tag, float tmin, float tmax, float tau1, float tau2)
std::shared_ptr< TF1 > m_expFermiFunc
virtual void doUnconstrainFit() override
ZDCFitExpFermiFixedTaus(const std::string &tag, float tmin, float tmax, float tau1, float tau2)
virtual void doUnconstrainFit() override
virtual void doConstrainFit() override
virtual void DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax) override
std::shared_ptr< TF1 > m_expFermiFunc
virtual void SetT0FitLimits(float tMin, float tMax) override
virtual void doUnconstrainFit() override
std::shared_ptr< TF1 > m_expFermiInductFunc
virtual void doConstrainFit() override
virtual void DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax) override
static const std::map< std::string, std::vector< ZDCFitWrapper::FitParameter > > s_ConfigParamMap
ZDCFitExpFermiInductPreExp(const std::string &tag, float tmin, float tmax, float tau1, float tau2, float defExpTau, float fixExpTau)
virtual void SetT0FitLimits(float tMin, float tMax) override
virtual void doConstrainFit() override
static const std::map< std::string, std::vector< ZDCFitWrapper::FitParameter > > s_ConfigParamMap
virtual void SetT0FitLimits(float tMin, float tMax) override
virtual void doUnconstrainFit() override
ZDCFitExpFermiInductPrePulse(const std::string &tag, float tmin, float tmax, float tau1, float tau2)
std::shared_ptr< TF1 > m_expFermiPreFunc
std::shared_ptr< TF1 > m_expFermiInductFunc
virtual void DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax) override
virtual void SetPrePulseT0Range(float tmin, float tmax) override
virtual void DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax) override
virtual void SetT0FitLimits(float tMin, float tMax) override
std::shared_ptr< TF1 > m_expFermiLHCfFunc
virtual void doConstrainFit() override
virtual void doUnconstrainFit() override
ZDCFitExpFermiLHCfPreExp(const std::string &tag, float tmin, float tmax, float tau1, float tau2, float defExpTau, float fixExpTau)
std::shared_ptr< TF1 > m_expFermiPreFunc
std::shared_ptr< TF1 > m_expFermiLHCfFunc
virtual void SetPrePulseT0Range(float tmin, float tmax) override
virtual void doConstrainFit() override
virtual void doUnconstrainFit() override
virtual void SetT0FitLimits(float tMin, float tMax) override
virtual void DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax) override
ZDCFitExpFermiLHCfPrePulse(const std::string &tag, float tmin, float tmax, float tau1, float tau2)
std::shared_ptr< TF1 > m_expFermiFunc
virtual void doUnconstrainFit() override
virtual void doConstrainFit() override
virtual void SetT0FitLimits(float tMin, float tMax) override
ZDCFitExpFermiLinearFixedTaus(const std::string &tag, float tmin, float tmax, float tau1, float tau2)
virtual void DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax) override
virtual void doUnconstrainFit() override
virtual void SetPrePulseT0Range(float tmin, float tmax) override
virtual void DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax) override
ZDCFitExpFermiLinearPrePulse(const std::string &tag, float tmin, float tmax, float tau1, float tau2)
std::shared_ptr< TF1 > m_expFermiFunc
virtual void doConstrainFit() override
virtual void SetT0FitLimits(float tMin, float tMax) override
std::shared_ptr< TF1 > m_expFermiFunc
virtual void doUnconstrainFit() override
virtual void SetT0FitLimits(float tMin, float tMax) override
virtual void doConstrainFit() override
ZDCFitExpFermiPreExp(const std::string &tag, float tmin, float tmax, float tau1, float tau2, float defExpTau, float fixExpTau)
virtual void DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax) override
virtual void doUnconstrainFit() override
virtual void SetT0FitLimits(float tMin, float tMax) override
virtual void doConstrainFit() override
virtual void DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax) override
std::shared_ptr< TF1 > m_expFermiFunc
virtual void SetPrePulseT0Range(float tmin, float tmax) override
ZDCFitExpFermiPrePulse(const std::string &tag, float tmin, float tmax, float tau1, float tau2)
static const std::map< std::string, std::vector< ZDCFitWrapper::FitParameter > > s_ConfigParamMap
virtual void doConstrainFit() override
ZDCFitExpFermiVariableTausInduct(const std::string &tag, float tmin, float tmax, bool fixTau1, bool fixTau2, float tau1, float tau2)
virtual void doUnconstrainFit() override
virtual void DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax) override
void FixDelta(float value)
virtual void SetT0FitLimits(float tMin, float tMax) override
virtual void DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax) override
virtual void doUnconstrainFit() override
ZDCFitExpFermiVariableTausLHCf(const std::string &tag, float tmin, float tmax, bool fixTau1, bool fixTau2, float tau1, float tau2)
virtual void doConstrainFit() override
virtual void SetT0FitLimits(float tMin, float tMax) override
ZDCFitExpFermiVariableTausRun3(const std::string &tag, float tmin, float tmax, bool fixTau1, bool fixTau2, float tau1, float tau2)
virtual void DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax) override
ZDCFitExpFermiVariableTaus(const std::string &tag, float tmin, float tmax, bool fixTau1, bool fixTau2, float tau1, float tau2)
virtual void doConstrainFit() override
virtual void SetT0FitLimits(float tMin, float tMax) override
virtual void doUnconstrainFit() override
virtual void DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax) override
std::shared_ptr< TF1 > m_expFermiFunc
virtual void SetT0FitLimits(float tMin, float tMax) override
virtual void doUnconstrainFit() override
virtual void SetPostPulseT0Range(float tmin, float tmax, float initialPostT0) override
ZDCFitGeneralPulse(const std::string &tag, float tmin, float tmax, float tau1, float tau2)
virtual void doConstrainFit() override
virtual void SetPrePulseT0Range(float tmin, float tmax) override
void setFixed(float fixedValue)
void Initialize(float initialAmp, float initialT0, float ampMin, float ampMax)
void OverrideParameterSet(const std::vector< FitParameter > ¶meterSet)
virtual void doUnconstrainFit()=0
virtual std::shared_ptr< TF1 > GetWrapperTF1()
std::vector< FitParameter > m_parameterSet
void LoadDefaultParameterSet(const std::vector< FitParameter > ¶meterSet)
virtual void SetT0FitLimits(float tMin, float tMax)=0
void SetAmpMinMax(float minAmp, float maxAmp)
virtual void DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax)=0
virtual void doConstrainFit()=0
const FitParameter & GetParameterDescr(const std::string &name)
std::shared_ptr< TF1 > m_wrapperTF1
float getDefaultExpTau() const
ZDCPreExpFitWrapper(std::shared_ptr< TF1 > wrapperTF1, float defaultExpTau, bool fixTau)
ZDCPrePulseFitWrapper(std::shared_ptr< TF1 > wrapperTF1)