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, 5, 8, 0.25,
false, 0}},
34 {{
"period", 13.5,
true, 0, 0, 0,
false, 0}},
35 {{
"IndA", 0.1,
false, -0.5, 2, 0.1,
true, 0}},
36 {{
"IndB", 0.2,
false, -0.5, 2, 0.1,
false, 0}},
37 {{
"bI", -0.02,
true, -0.5, 0.5, 0.025,
true, -0.02}},
40 {
"PbPb2025FreeInduct",
41 {{{
"period", 13,
false, 10, 30, 1,
true, 13}},
42 {{
"IndA", 0.25,
false, -1, 2, 0.1,
true, 0}},
43 {{
"IndB", 0.8,
false, -1, 2, 0.1,
false, 0}},
44 {{
"bI", -0.025,
false, -0.5, 0.5, 0,
false, 0}},
48 {{{
"period", 16,
true, 0, 0, 0,
false, 0}},
49 {{
"IndA", 0.25,
false, 0, 2, 0.1,
false, 0}},
50 {{
"IndB", 0.8,
false, 0, 2, 0.1,
false, 0}},
51 {{
"bI", 0.018,
true, 0, -0.5, 0.5,
false, 0}},
52 {{
"delta", 0.015,
true, 0, 0, 0,
false, 0}},
60 {{{
"A", 1000,
false, 2, 5000, 50,
false, 0}},
61 {{
"T0", 40,
false, 0, 100, 1,
false, 0}},
62 {{
"Aexp", 0,
false, 0.5, 3, 0.05,
false, 0}},
63 {{
"tauexp", 0,
false, 3.5, 8, 0.25,
false, 0}},
64 {{
"bsqrtexp", 0,
false, -50, 50, 1,
true, 0}},
65 {{
"C", 0,
false, -50, 50, 1,
true, 0}},
66 {{
"period", 13.5,
true, 0, 0, 0,
false, 0}},
67 {{
"IndA", 0.2,
false, -2, 2, 0.1,
false, 0}},
68 {{
"IndB", 0.2,
false, -2, 2, 0.1,
false, 0}},
69 {{
"bI", -0.02,
true, -0.5, 0.5, 0.025,
true, -0.02}}
73 {{{
"period", 13.5,
true, 0, 0, 0,
false, 0}},
74 {{
"IndA", 0.1,
false, -0.5, 2, 0.1,
true, 0}},
75 {{
"IndB", 0.2,
false, -0.5, 2, 0.1,
false, 0}},
76 {{
"bI", -0.02,
true, -0.5, 0.5, 0.025,
true, -0.02}},
79 {
"PbPb2025FreeInduct",
80 {{{
"period", 13,
false, 10, 30, 1,
true, 13}},
81 {{
"IndA", 0.25,
false, -1, 2, 0.1,
true, 0}},
82 {{
"IndB", 0.8,
false, -1, 2, 0.1,
false, 0}},
83 {{
"bI", -0.025,
false, -0.5, 0.5, 0,
false, 0}},
91 {{{
"A", 1000,
false, 2, 5000, 50,
false, 0}},
92 {{
"T0", 40,
false, 0, 100, 1,
false, 0}},
93 {{
"Apre", 0,
false, 0.5, 3, 0.05,
false, 0}},
94 {{
"T0pre", 0,
false, 3.5, 8, 0.25,
false, 0}},
95 {{
"C", 0,
false, -50, 50, 1,
true, 0}},
96 {{
"period", 13.5,
true, 0, 0, 0,
false, 0}},
97 {{
"IndA", 0.2,
false, -2, 2, 0.1,
false, 0}},
98 {{
"IndB", 0.2,
false, -2, 2, 0.1,
false, 0}},
99 {{
"bI", -0.02,
true, -0.5, 0.5, 0.025,
true, -0.02}}
103 {{{
"period", 13.5,
true, 0, 0, 0,
false, 0}},
104 {{
"IndA", 0.1,
false, -0.5, 2, 0.1,
true, 0}},
105 {{
"IndB", 0.2,
false, -0.5, 2, 0.1,
false, 0}},
106 {{
"bI", -0.02,
true, -0.5, 0.5, 0.025,
true, -0.02}},
109 {
"PbPb2025FreeInduct",
110 {{{
"period", 13,
false, 10, 30, 1,
true, 13}},
111 {{
"IndA", 0.25,
false, -1, 2, 0.1,
true, 0}},
112 {{
"IndB", 0.8,
false, -1, 2, 0.1,
false, 0}},
113 {{
"bI", -0.025,
false, -0.5, 0.5, 0,
false, 0}},
121 [name](
const FitParameter& parDesc){return parDesc.name() == name;});
122 if (iter ==
m_parameterSet.end())
throw std::logic_error(
"ZDCFitWrapper::GetParameterDescr: invalid parameter name: " + name );
130 if (
int(parameterSet.size()) !=
m_wrapperTF1->GetNpar())
throw std::logic_error(
"ZDCFitWrapper::LoadDefaultParameterSet:: Incorrect number of parameters in default parameter set");
139 unsigned parIndex = 0;
140 for (
const auto & parDescr : parameterSet) {
144 std::string name = parDescr.name();
145 theTF1->SetParName(parIndex, name.c_str());
147 bool fixed = parDescr.fixed();
150 float fixedValue = parDescr.defaultValue();
151 theTF1->FixParameter(parIndex, fixedValue);
154 float lowerLimit = parDescr.lowerLimit();
155 float upperLimit = parDescr.upperLimit();
156 theTF1->SetParLimits(parIndex, lowerLimit, upperLimit);
169 for (
const auto & parDescr : overParamSet) {
170 std::string inputName = parDescr.name();
175 [inputName](
const FitParameter& parDesc){return parDesc.name() == inputName;});
176 if (iter ==
m_parameterSet.end())
throw std::logic_error(
"ZDCFitWrapper::OverrideParameterSet: invalid parameter name: " +inputName );
184 unsigned int parIndex = std::distance(
m_parameterSet.begin(), iter);
185 bool fixed = parDescr.fixed();
188 float fixedValue = parDescr.defaultValue();
189 theTF1->FixParameter(parIndex, fixedValue);
192 float lowerLimit = parDescr.lowerLimit();
193 float upperLimit = parDescr.upperLimit();
194 theTF1->SetParLimits(parIndex, lowerLimit, upperLimit);
205 unsigned int npar = tf1_p->GetNpar();
206 std::vector<double> zeroVec(npar, 0.0);
224 for (
unsigned int ipar = 0; ipar <
m_parameterSet.size(); ipar++) {
230 if (!fitparDescr.fixed()) {
231 tf1_p->SetParameter(ipar, fitparDescr.defaultValue());
232 tf1_p->SetParError(ipar, fitparDescr.stepSize());
236 tf1_p->SetParameter(0, initialAmp);
237 tf1_p->SetParameter(1, initialT0);
249 std::vector<double> zeroVec(npar, 0.0);
250 tf1_p->SetParErrors(&zeroVec[0]);
255void ZDCFitWrapper::Initialize(
float initialAmp,
float initialT0,
float ampMin,
float ampMax,
float fitTmin,
float fitTmax,
float fitTRef)
260 Initialize(initialAmp, initialT0, ampMin, ampMax);
282 for (
unsigned int ipar = 2; ipar <
m_parameterSet.size(); ipar++) {
285 if (!fitparDescr.fixed() && fitparDescr.constrainFixed()) {
286 tf1_p->FixParameter(ipar, fitparDescr.constrainValue());
298 for (
unsigned int ipar = 2; ipar <
m_parameterSet.size(); ipar++) {
301 if (!fitparDescr.fixed() && fitparDescr.constrainFixed()) {
302 tf1_p->ReleaseParameter(ipar);
303 tf1_p->SetParameter(ipar, fitparDescr.defaultValue());
305 float lowerLimit = fitparDescr.lowerLimit();
306 float upperLimit = fitparDescr.upperLimit();
307 tf1_p->SetParLimits(ipar, lowerLimit, upperLimit);
309 tf1_p->SetParError(ipar, fitparDescr.stepSize());
322 theTF1->SetParName(0,
"Amp");
323 theTF1->SetParName(1,
"T0");
324 theTF1->SetParName(2,
"tau1");
325 theTF1->SetParName(3,
"tau2");
326 theTF1->SetParName(4,
"C");
329 theTF1->SetParLimits(1, tmin, tmax);
330 theTF1->SetParLimits(2, 3, 6);
331 theTF1->SetParLimits(3, 10, 40);
341 theTF1->SetParameter(0, initialAmp);
342 theTF1->SetParameter(1, initialT0);
343 theTF1->SetParameter(4, 0);
345 theTF1->SetParLimits(0, ampMin, ampMax);
356 theTF1->SetParLimits(1, t0Min, t0Max);
365 theTF1->FixParameter(4, 0);
370 theTF1->ReleaseParameter(4);
377 theTF1->SetParLimits(2, 0.5, 3);
378 theTF1->SetParLimits(3, 4, 10);
393 theTF1->SetParName(0,
"Amp");
394 theTF1->SetParName(1,
"T0");
395 theTF1->SetParName(2,
"tau1");
396 theTF1->SetParName(3,
"tau2");
397 theTF1->SetParName(4,
"C");
398 theTF1->SetParName(5,
"refdelay");
399 theTF1->SetParName(6,
"reflAmpFrac");
400 theTF1->SetParName(7,
"reflWidth");
401 theTF1->SetParName(8,
"delta");
403 theTF1->SetParLimits(1, tmin, tmax);
404 theTF1->SetParLimits(4, -100, 100);
405 theTF1->SetParLimits(6, -1e-4, 0.35);
407 theTF1->FixParameter(5, 6.5);
408 theTF1->FixParameter(7, 1.5);
409 theTF1->FixParameter(8, 0.01);
412 else theTF1->SetParLimits(2, 1, 2);
415 else theTF1->SetParLimits(3, 3.5, 6);
422 theTF1->SetParameter(0, initialAmp);
424 float t0 = initialT0;
427 theTF1->SetParameter(1,
t0);
429 theTF1->SetParameter(1, initialT0);
430 theTF1->SetParameter(4, 0);
431 theTF1->SetParameter(6, 0.1);
433 theTF1->SetParLimits(0, ampMin, ampMax);
440 double ampStep = std::min(0.05*initialAmp, std::abs(ampMax - initialAmp)/2.);
442 theTF1->SetParError(0, ampStep);
443 theTF1->SetParError(1, 1.0);
445 if (!
m_fixTau1) theTF1->SetParError(2, 0.05);
446 if (!
m_fixTau2) theTF1->SetParError(3, 0.25);
448 theTF1->SetParError(4, 2);
449 theTF1->SetParError(5, 0.25);
450 theTF1->SetParError(6, 0.05);
458 theTF1->SetParLimits(1, t0Min, t0Max);
467 theTF1->FixParameter(4, 0);
468 theTF1->FixParameter(6, 0);
473 theTF1->ReleaseParameter(4);
474 theTF1->SetParameter(4, 0);
476 theTF1->ReleaseParameter(6);
477 theTF1->SetParLimits(6, -1e-4, 0.35);
478 theTF1->SetParameter(6, 0.1);
487 theTF1->SetParName(0,
"Amp");
488 theTF1->SetParName(1,
"T0");
489 theTF1->SetParName(2,
"tau1");
490 theTF1->SetParName(3,
"tau2");
491 theTF1->SetParName(4,
"C");
492 theTF1->SetParName(5,
"period");
493 theTF1->SetParName(6,
"IndA");
494 theTF1->SetParName(7,
"IndB");
495 theTF1->SetParName(8,
"tauI");
496 theTF1->SetParName(9,
"delta");
498 theTF1->SetParLimits(1, tmin, tmax);
499 theTF1->SetParLimits(4, -50, 50);
500 theTF1->SetParLimits(5, 10, 50);
501 theTF1->SetParLimits(6, 0, 2);
502 theTF1->SetParLimits(7, 0, 2);
504 theTF1->FixParameter(8, 5.5);
505 theTF1->FixParameter(5, 16);
512 else theTF1->SetParLimits(2, 0.5, 3);
515 else theTF1->SetParLimits(3, 3.5, 8);
525 if (iter ==
s_ConfigParamMap.end())
throw std::runtime_error(
"ZDCFitExpFermiVariableTausInduct:: invalid parameter set identifier: " + paramSet);
527 std::vector<ZDCFitWrapper::FitParameter> overRideParams = iter->second;
531 auto tau1Iter = std::find_if(overRideParams.begin(), overRideParams.end(), [](
const FitParameter& parDesc){return parDesc.name() ==
"tau1";});
532 if (tau1Iter != overRideParams.end()) {
533 if (fixTau1) tau1Iter->setFixed(tau1);
534 else tau1Iter->setDefaultValue(tau1);
537 FitParameter tau1Descr = GetParameterDescr(
"tau1");
538 if (fixTau1) tau1Descr.setFixed(tau1);
539 else tau1Descr.setDefaultValue(tau1);
540 overRideParams.push_back(std::move(tau1Descr));
543 auto tau2Iter = std::find_if(overRideParams.begin(), overRideParams.end(), [](
const FitParameter& parDesc){return parDesc.name() ==
"tau2";});
544 if (tau2Iter != overRideParams.end()) {
545 if (fixTau2) tau2Iter->setFixed(tau2);
546 else tau2Iter->setDefaultValue(tau2);
549 FitParameter tau2Descr = GetParameterDescr(
"tau2");
550 if (fixTau2) tau2Descr.setFixed(tau2);
551 else tau2Descr.setDefaultValue(std::move(tau2));
552 overRideParams.push_back(tau2Descr);
564 theTF1->SetParameter(0, initialAmp);
565 theTF1->SetParLimits(0, ampMin, ampMax);
567 float t0 = initialT0;
570 theTF1->SetParameter(1,
t0);
572 theTF1->SetParameter(6, 0.25);
573 theTF1->SetParameter(7, 0.8);
581 double ampStep = std::min(0.05*initialAmp, std::abs(ampMax - initialAmp)/2.);
583 theTF1->SetParError(0, ampStep);
584 theTF1->SetParError(1, 1.0);
586 if (!
m_fixTau1) theTF1->SetParError(2, 0.05);
587 if (!
m_fixTau2) theTF1->SetParError(3, 0.25);
589 theTF1->SetParError(4, 1);
590 theTF1->SetParError(5, 5);
591 theTF1->SetParError(6, 0.1);
592 theTF1->SetParError(7, 0.1);
600 theTF1->SetParLimits(1, t0Min, t0Max);
606 theTF1->FixParameter(6, 0.25);
607 theTF1->FixParameter(4, 0);
614 theTF1->ReleaseParameter(6);
615 theTF1->ReleaseParameter(4);
616 theTF1->SetParLimits(6, 0, 2);
617 theTF1->SetParLimits(4, -50, 50);
622 ZDCFitWrapper(
std::make_shared<TF1>((
"ExpFermiFixedTaus" + tag).c_str(), this, tmin, tmax, 3)),
628 theTF1->SetParLimits(1, tmin, tmax);
630 theTF1->SetParName(0,
"Amp");
631 theTF1->SetParName(1,
"T0");
632 theTF1->SetParName(2,
"C");
636 std::string funcNameRefFunc =
"ExpFermiFixedTausRefFunc" + tag;
662 theTF1->FixParameter(2, 0);
667 theTF1->ReleaseParameter(2);
681 std::string funcNameRefFunc =
"ExpFermiPrePulseRefFunc" + tag;
699 theTF1->SetParLimits(1, tmin, tmax);
700 theTF1->SetParLimits(2, 1, 8196);
701 theTF1->SetParLimits(3, -20, 10);
703 theTF1->SetParName(0,
"Amp");
704 theTF1->SetParName(1,
"T0");
705 theTF1->SetParName(2,
"Amp_{pre}");
706 theTF1->SetParName(3,
"T0_{pre}");
707 theTF1->SetParName(4,
"C");
716 theTF1->FixParameter(2, 0);
717 theTF1->FixParameter(4, 0);
722 theTF1->ReleaseParameter(2);
723 theTF1->ReleaseParameter(4);
725 theTF1->SetParLimits(2, 1, 8196);
751 double ampStep = std::min(0.05*initialAmp, std::abs(ampMax - initialAmp)/2.);
762 theTF1->SetParLimits(1, t0Min, t0Max);
772 std::string funcNameRefFunc =
"ExpFermiPreExpRefFunc" + tag;
790 theTF1->SetParName(0,
"Amp");
791 theTF1->SetParName(1,
"T0");
792 theTF1->SetParName(2,
"Amp_{pre}");
793 theTF1->SetParName(3,
"tau_{pre}");
794 theTF1->SetParName(4,
"tausqrt_{pre}");
795 theTF1->SetParName(5,
"C");
797 theTF1->SetParLimits(1, tmin, tmax);
798 theTF1->SetParLimits(2, -1, 8196);
799 theTF1->SetParLimits(3, 6, 30);
800 theTF1->SetParLimits(4, -0.2, 0.2);
801 theTF1->SetParLimits(5, -50, 50);
810 theTF1->FixParameter(2, 0);
812 theTF1->FixParameter(5, 0);
818 theTF1->ReleaseParameter(2);
819 theTF1->SetParLimits(2, -1, 8196);
821 theTF1->ReleaseParameter(3);
822 theTF1->SetParLimits(3, 6, 30);
825 theTF1->ReleaseParameter(5);
826 theTF1->SetParLimits(5, -50, 50);
827 theTF1->SetParameter(5, 0);
843 double ampStep = std::min(0.05*initialAmp, std::abs(ampMax - initialAmp)/2.);
855 theTF1->SetParLimits(1, t0Min, t0Max);
865 std::string funcNameRefFunc =
"ExpFermiLHCfPreExpRefFunc" + tag;
884 theTF1->SetParName(0,
"Amp");
885 theTF1->SetParName(1,
"T0");
886 theTF1->SetParName(2,
"Tau1");
887 theTF1->SetParName(3,
"Tau2");
888 theTF1->SetParName(4,
"Amp_{pre}");
889 theTF1->SetParName(5,
"tau_{pre}");
890 theTF1->SetParName(6,
"bsqrt_{pre}");
891 theTF1->SetParName(7,
"ReflFrac");
893 theTF1->SetParLimits(1, tmin, tmax);
894 theTF1->SetParLimits(2, 1.0, 2);
895 theTF1->SetParLimits(3, 3.5, 5.5);
896 theTF1->SetParLimits(4, -1, 8196);
897 theTF1->SetParLimits(5, 4, 12);
898 theTF1->SetParLimits(6, -0.001, 0.001);
899 theTF1->SetParLimits(7, -1.0e-4, 0.3);
904 GetWrapperTF1()->SetParameter(0, std::max(initialAmp, ampMin));
906 float t0 = initialT0;
922 double ampStep = std::min(0.05*initialAmp, std::abs(ampMax - initialAmp)/2.);
940 theTF1->FixParameter(6, 0);
941 theTF1->FixParameter(7, 0.20);
947 theTF1->ReleaseParameter(5);
948 theTF1->SetParLimits(5, 6, 12);
950 theTF1->ReleaseParameter(6);
951 theTF1->SetParLimits(6, -0.001, 0.001);
954 theTF1->ReleaseParameter(7);
955 theTF1->SetParLimits(7, -1.0e-4, 0.3);
963 theTF1->SetParLimits(1, t0Min, t0Max);
972 std::string funcNameRefFunc =
"ExpFermiLHCfPrePulseRefFunc" + tag;
973 std::string funcNamePreFunc =
"ExpFermiLHCfPrePulsePreFunc" + tag;
1001 theTF1->SetParName(0,
"Amp");
1002 theTF1->SetParName(1,
"T0");
1003 theTF1->SetParName(2,
"tau1");
1004 theTF1->SetParName(3,
"tau2");
1005 theTF1->SetParName(4,
"Amp_{pre}");
1006 theTF1->SetParName(5,
"T0_{pre}");
1007 theTF1->SetParName(6,
"C");
1010 theTF1->SetParLimits(1, tmin, tmax);
1011 theTF1->SetParLimits(2, 1.0, 2);
1012 theTF1->SetParLimits(3, 3.5, 5.5);
1013 theTF1->SetParLimits(4, 1, 8196);
1014 theTF1->SetParLimits(5, -20, 10);
1015 theTF1->SetParLimits(6, -50, 50);
1025 theTF1->FixParameter(4, 0);
1026 theTF1->FixParameter(6, 0);
1031 theTF1->ReleaseParameter(4);
1032 theTF1->ReleaseParameter(6);
1034 theTF1->SetParLimits(4, 1, 8196);
1035 theTF1->SetParLimits(6, -50, 50);
1065 double ampStep = std::min(0.05*initialAmp, std::abs(ampMax - initialAmp)/2.);
1078 theTF1->SetParLimits(1, t0Min, t0Max);
1088 std::string funcNameRefFunc =
"ExpFermiInductPreExpRefFunc" + tag;
1108 theTF1->SetParName(0,
"Amp");
1109 theTF1->SetParName(1,
"T0");
1110 theTF1->SetParName(2,
"Aexp");
1111 theTF1->SetParName(3,
"tauexp");
1112 theTF1->SetParName(4,
"bsqrtexp");
1113 theTF1->SetParName(5,
"C");
1114 theTF1->SetParName(6,
"Period");
1115 theTF1->SetParName(7,
"IndA");
1116 theTF1->SetParName(8,
"IndB");
1117 theTF1->SetParName(9,
"bI");
1119 theTF1->SetParLimits(1, tmin, tmax);
1120 theTF1->SetParLimits(2, -1, 8196);
1121 theTF1->SetParLimits(3, 4, 12);
1122 theTF1->SetParLimits(4, -0.001, 0.001);
1123 theTF1->SetParLimits(5, -10, 10);
1124 theTF1->FixParameter(6, 13);
1125 theTF1->SetParLimits(7, -0.1, 2);
1126 theTF1->SetParLimits(8, -0.1, 2);
1127 theTF1->SetParLimits(9, -0.05, 0.5);
1136 if (iter ==
s_ConfigParamMap.end())
throw std::runtime_error(
"ZDCFitExpFermiVariableTausInduct:: invalid parameter set identifier: " + paramSet);
1138 std::vector<ZDCFitWrapper::FitParameter> overRideParams = iter->second;
1144 std::string funcNameRefFunc =
"ExpFermiInductPreExpRefFunc" + tag;
1164 GetWrapperTF1()->SetParameter(0, std::max(initialAmp, ampMin));
1166 float t0 = initialT0;
1182 double ampStep = std::min(0.05*initialAmp, std::abs(ampMax - initialAmp)/2.);
1205 theTF1->SetParLimits(1, t0Min, t0Max);
1214 std::string funcNameRefFunc =
"ExpFermiInductPrePulseRefFunc" + tag;
1215 std::string funcNamePreFunc =
"ExpFermiInductPrePulsePreFunc" + tag;
1244 theTF1->SetParName(0,
"Amp");
1245 theTF1->SetParName(1,
"T0");
1246 theTF1->SetParName(2,
"Apre");
1247 theTF1->SetParName(3,
"T0pre");
1248 theTF1->SetParName(4,
"C");
1249 theTF1->SetParName(5,
"Period");
1250 theTF1->SetParName(6,
"IndA");
1251 theTF1->SetParName(7,
"IndB");
1252 theTF1->SetParName(8,
"bI");
1255 theTF1->SetParLimits(1, tmin, tmax);
1256 theTF1->SetParLimits(2, 0, 5000);
1257 theTF1->SetParLimits(3, 0, 30);
1258 theTF1->SetParLimits(4, 0, 2);
1259 theTF1->SetParLimits(3, 4, 12);
1260 theTF1->SetParLimits(4, -50, 50);
1261 theTF1->SetParLimits(5, 10, 20);
1262 theTF1->SetParLimits(6, -0.1, 1);
1263 theTF1->SetParLimits(7, -0.1, 1);
1264 theTF1->SetParLimits(9, -0.2, 0.2);
1275 if (iter ==
s_ConfigParamMap.end())
throw std::runtime_error(
"ZDCFitExpFermiVariableTausInduct:: invalid parameter set identifier: " + paramSet);
1277 std::vector<ZDCFitWrapper::FitParameter> overRideParams = iter->second;
1283 std::string funcNameRefFunc =
"ExpFermiInductPrePulseRefFunc" + tag;
1284 std::string funcNamePreFunc =
"ExpFermiInductPrePulsePreFunc" + tag;
1313 theTF1->FixParameter(4, 0);
1314 theTF1->FixParameter(5, 0);
1315 theTF1->FixParameter(7, 0);
1320 theTF1->ReleaseParameter(5);
1321 theTF1->ReleaseParameter(7);
1322 theTF1->SetParLimits(4, -0.001, 0.001);
1323 theTF1->SetParLimits(5, -10, 10);
1324 theTF1->SetParLimits(7, -0.1, 2);
1355 double ampStep = std::min(0.05*initialAmp, std::abs(ampMax - initialAmp)/2.);
1369 theTF1->SetParLimits(1, t0Min, t0Max);
1376 ZDCFitWrapper(
std::make_shared<TF1>((
"ExpFermiFixedTaus" + tag).c_str(), this, tmin, tmax, 4)),
1382 theTF1->SetParLimits(1, tmin, tmax);
1384 theTF1->SetParName(0,
"Amp");
1385 theTF1->SetParName(1,
"T0");
1386 theTF1->SetParName(2,
"s_{b}");
1387 theTF1->SetParName(3,
"c_{b}");
1391 std::string funcNameRefFunc =
"ExpFermiFixedTausRefFunc" + tag;
1411 theTF1->FixParameter(2, 0);
1412 theTF1->FixParameter(3, 0);
1418 theTF1->ReleaseParameter(2);
1419 theTF1->ReleaseParameter(3);
1424 float slope = std::abs(0.1 * initialAmp / initialT0);
1425 float intercept = std::abs(0.1 * initialAmp);
1436 double ampStep = std::min(0.05*initialAmp, std::abs(ampMax - initialAmp)/2.);
1447 theTF1->SetParLimits(1, t0Min, t0Max);
1458 std::string funcNameRefFunc =
"ExpFermiPerPulseRefFunc" + tag;
1475 theTF1->SetParName(0,
"Amp");
1476 theTF1->SetParName(1,
"T0");
1477 theTF1->SetParName(2,
"Amp_{pre}");
1478 theTF1->SetParName(3,
"T0_{pre}");
1479 theTF1->SetParName(4,
"s_{b}");
1480 theTF1->SetParName(5,
"c_{b}");
1483 theTF1->SetParLimits(1, tmin, tmax);
1484 theTF1->SetParLimits(2, 1, 4096);
1485 theTF1->SetParLimits(3, -20, 10);
1494 theTF1->FixParameter(4, 0);
1495 theTF1->FixParameter(5, 0);
1501 theTF1->ReleaseParameter(4);
1502 theTF1->ReleaseParameter(5);
1512 float slope = std::abs(initialAmp / initialT0);
1513 float intercept = std::abs(0.5 * initialAmp);
1524 double ampStep = std::min(0.05*initialAmp, std::abs(ampMax - initialAmp)/2.);
1548 std::string funcNameRefFunc =
"ExpFermiPerPulseRefFunc" + tag;
1565 theTF1->SetParLimits(1, tmin, tmax);
1566 theTF1->SetParLimits(2, 0, 2048);
1567 theTF1->SetParLimits(3, 0, 40);
1568 theTF1->SetParLimits(6, 0, 4096);
1570 theTF1->SetParName(0,
"Amp");
1571 theTF1->SetParName(1,
"T0");
1572 theTF1->SetParName(2,
"Amp_{pre}");
1573 theTF1->SetParName(3,
"T0_{pre}");
1574 theTF1->SetParName(4,
"s_{b}");
1575 theTF1->SetParName(5,
"c_{b}");
1576 theTF1->SetParName(6,
"Amp_{exp}");
1585 theTF1->FixParameter(2, 0);
1586 theTF1->FixParameter(4, 0);
1587 theTF1->FixParameter(5, 0);
1592 theTF1->ReleaseParameter(2);
1593 theTF1->ReleaseParameter(4);
1594 theTF1->ReleaseParameter(5);
1610 float slope = std::abs(initialAmp / initialT0);
1611 float intercept = std::abs(0.1 * initialAmp);
1641 std::string funcNameRefFunc =
"ExpFermiPerPulseRefFunc" + tag;
1658 theTF1->SetParLimits(1, tmin, tmax);
1659 theTF1->SetParLimits(2, 0, 2048);
1660 theTF1->SetParLimits(3, 0, 40);
1661 theTF1->SetParLimits(6, 0, 4096);
1662 theTF1->SetParLimits(7, 0, 2048);
1663 theTF1->SetParLimits(8, 100, 163);
1665 theTF1->SetParName(0,
"Amp");
1666 theTF1->SetParName(1,
"T0");
1667 theTF1->SetParName(2,
"Amp_{pre}");
1668 theTF1->SetParName(3,
"T0_{pre}");
1669 theTF1->SetParName(4,
"s_{b}");
1670 theTF1->SetParName(5,
"c_{b}");
1671 theTF1->SetParName(6,
"Amp_{exp}");
1672 theTF1->SetParName(7,
"Amp_{post}");
1673 theTF1->SetParName(8,
"T0_{post}");
1682 theTF1->FixParameter(2, 0);
1683 theTF1->FixParameter(4, 0);
1684 theTF1->FixParameter(5, 0);
1689 theTF1->ReleaseParameter(2);
1690 theTF1->ReleaseParameter(4);
1691 theTF1->ReleaseParameter(5);
1697 if (tmin < 0) tmin = 0;
1708 float iniPostT0 = initialPostT0;
1714 float slope = std::abs(initialAmp / initialT0);
1715 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 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)