ATLAS Offline Software
Loading...
Searching...
No Matches
ZDCFitWrapper.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
6#include <numeric>
7#include <memory>
8
9void ZDCFitWrapper::Initialize(float initialAmp, float initialT0, float ampMin, float ampMax)
10{
11 // Clear the errors on the TF1 because retaining the errors seems to affect
12 // the convergence of fits
13 //
14 unsigned int npar = GetWrapperTF1()->GetNpar();
15 std::vector<double> zeroVec(npar, 0.0);
16 GetWrapperTF1()->SetParErrors(&zeroVec[0]);
17
18 // If we adjusted the time range on the previous event, restore to default
19 //
22
23 m_adjTLimitsEvent = false;
24 m_tminAdjust = 0;
25 }
26
27 SetAmpMinMax(ampMin, ampMax);
28
29 DoInitialize(initialAmp, initialT0, ampMin, ampMax);
30}
31
32void ZDCFitWrapper::Initialize(float initialAmp, float initialT0, float ampMin, float ampMax, float fitTmin, float fitTmax, float fitTRef)
33{
34 // Clear the errors on the TF1 because retaining the errors seems to affect
35 // the convergence of fits
36 //
37 unsigned int npar = GetWrapperTF1()->GetNpar();
38 std::vector<double> zeroVec(npar, 0.0);
39 GetWrapperTF1()->SetParErrors(&zeroVec[0]);
40
41 m_adjTLimitsEvent = true;
42
43 m_tminAdjust = fitTRef; // Note: this is the time corresponding to the sample used for presample subtraction
44
45 m_tempTmin = std::max(m_t0Min, fitTmin);
46 m_tempTmax = std::min(m_t0Max, fitTmax);
47
48 SetAmpMinMax(ampMin, ampMax);
50
51 DoInitialize(initialAmp, initialT0, ampMin, ampMax);
52}
53
54ZDCFitExpFermiVariableTaus::ZDCFitExpFermiVariableTaus(const std::string& tag, float tmin, float tmax, bool fixTau1, bool fixTau2, float tau1, float tau2) :
55 ZDCFitWrapper(std::make_shared<TF1>(("ExpFermiVariableTaus" + tag).c_str(), ZDCFermiExpFit, tmin, tmax, 5)),
56 m_fixTau1(fixTau1), m_fixTau2(fixTau2), m_tau1(tau1), m_tau2(tau2)
57{
58 std::shared_ptr<TF1> theTF1 = ZDCFitWrapper::GetWrapperTF1();
59
60 theTF1->SetParName(0, "Amp");
61 theTF1->SetParName(1, "T0");
62 theTF1->SetParName(2, "#tau_{1}");
63 theTF1->SetParName(3, "#tau_{2}");
64 theTF1->SetParName(4, "C");
65
66 // BAC, parameter 0 limits now is set in DoInitialize
67 theTF1->SetParLimits(1, tmin, tmax);
68 theTF1->SetParLimits(2, 3, 6);
69 theTF1->SetParLimits(3, 10, 40);
70
71 if (m_fixTau1) theTF1->FixParameter(2, m_tau1);
72 if (m_fixTau2) theTF1->FixParameter(3, m_tau2);
73}
74
75void ZDCFitExpFermiVariableTaus::DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax)
76{
77 std::shared_ptr<TF1> theTF1 = ZDCFitWrapper::GetWrapperTF1();
78
79 theTF1->SetParameter(0, initialAmp);
80 theTF1->SetParameter(1, initialT0);
81 theTF1->SetParameter(4, 0);
82
83 theTF1->SetParLimits(0, ampMin, ampMax);
84
85 if (!m_fixTau1) theTF1->SetParameter(2, m_tau1);
86 if (!m_fixTau2) theTF1->SetParameter(3, m_tau2);
87}
88
89void ZDCFitExpFermiVariableTaus::SetT0FitLimits(float t0Min, float t0Max)
90{
91 // Set the parameter limits accordingly on the TF1
92 //
93 std::shared_ptr<TF1> theTF1 = ZDCFitWrapper::GetWrapperTF1();
94 theTF1->SetParLimits(1, t0Min, t0Max);
95}
96
98{
99 // We force the constant terms to zero
100 //
101 std::shared_ptr<TF1> theTF1 = GetWrapperTF1();
102
103 theTF1->FixParameter(4, 0);
104}
106{
107 std::shared_ptr<TF1> theTF1 = GetWrapperTF1();
108 theTF1->ReleaseParameter(4);
109}
110
111ZDCFitExpFermiVariableTausRun3::ZDCFitExpFermiVariableTausRun3(const std::string& tag, float tmin, float tmax, bool fixTau1, bool fixTau2, float tau1, float tau2) :
112 ZDCFitExpFermiVariableTaus(tag, tmin, tmax, fixTau1, fixTau2, tau1, tau2)
113{
114 std::shared_ptr<TF1> theTF1 = ZDCFitWrapper::GetWrapperTF1();
115 theTF1->SetParLimits(2, 0.5, 3);
116 theTF1->SetParLimits(3, 4, 10);
117
118 // Since we st parameter ranges, we have to redo the fixing (or not) again here
119 //
120 if (m_fixTau1) theTF1->FixParameter(2, m_tau1);
121 if (m_fixTau2) theTF1->FixParameter(3, m_tau2);
122}
123
124
125ZDCFitExpFermiVariableTausLHCf::ZDCFitExpFermiVariableTausLHCf(const std::string& tag, float tmin, float tmax, bool fixTau1, bool fixTau2, float tau1, float tau2) :
126 ZDCFitWrapper(std::make_shared<TF1>(("ExpFermiVariableTausLHCf" + tag).c_str(), ZDCFermiExpFitRefl, tmin, tmax, 9)),
127 m_fixTau1(fixTau1), m_fixTau2(fixTau2), m_tau1(tau1), m_tau2(tau2)
128{
129 std::shared_ptr<TF1> theTF1 = ZDCFitWrapper::GetWrapperTF1();
130
131 theTF1->SetParName(0, "Amp");
132 theTF1->SetParName(1, "T0");
133 theTF1->SetParName(2, "#tau_{1}");
134 theTF1->SetParName(3, "#tau_{2}");
135 theTF1->SetParName(4, "C");
136 theTF1->SetParName(5, "refdelay");
137 theTF1->SetParName(6, "reflAmpFrac");
138 theTF1->SetParName(7, "reflWidth");
139 theTF1->SetParName(8, "delta");
140
141 theTF1->SetParLimits(1, tmin, tmax);
142 theTF1->SetParLimits(4, -100, 100);
143 theTF1->SetParLimits(6, -1e-4, 0.35);
144
145 theTF1->FixParameter(5, 6.5);
146 theTF1->FixParameter(7, 1.5);
147 theTF1->FixParameter(8, 0.01);
148
149 if (m_fixTau1) theTF1->FixParameter(2, m_tau1);
150 else theTF1->SetParLimits(2, 1, 2);
151
152 if (m_fixTau2) theTF1->FixParameter(3, m_tau2);
153 else theTF1->SetParLimits(3, 3.5, 6);
154}
155
156void ZDCFitExpFermiVariableTausLHCf::DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax)
157{
158 std::shared_ptr<TF1> theTF1 = ZDCFitWrapper::GetWrapperTF1();
159
160 theTF1->SetParameter(0, initialAmp);
161
162 float t0 = initialT0;
163 if (t0 < GetT0Min()) t0 = GetT0Min()*1.1;
164 if (t0 > GetT0Max()) t0 = GetT0Max()/1.1;
165 theTF1->SetParameter(1, t0);
166
167 theTF1->SetParameter(1, initialT0);
168 theTF1->SetParameter(4, 0);
169 theTF1->SetParameter(6, 0.1);
170
171 theTF1->SetParLimits(0, ampMin, ampMax);
172
173 if (!m_fixTau1) theTF1->SetParameter(2, m_tau1);
174 if (!m_fixTau2) theTF1->SetParameter(3, m_tau2);
175
176 // Set the parameter errors which ROOT now uses <<<to set the initial step sizes>>>
177 //
178 double ampStep = std::min(0.05*initialAmp, std::abs(ampMax - initialAmp)/2.);
179
180 theTF1->SetParError(0, ampStep);
181 theTF1->SetParError(1, 1.0);
182
183 if (!m_fixTau1) theTF1->SetParError(2, 0.05);
184 if (!m_fixTau2) theTF1->SetParError(3, 0.25);
185
186 theTF1->SetParError(4, 2);
187 theTF1->SetParError(5, 0.25);
188 theTF1->SetParError(6, 0.05);
189}
190
192{
193 // Set the parameter limits accordingly on the TF1
194 //
195 std::shared_ptr<TF1> theTF1 = ZDCFitWrapper::GetWrapperTF1();
196 theTF1->SetParLimits(1, t0Min, t0Max);
197}
198
200{
201 // We force the constant and reflection terms to zero
202 //
203 std::shared_ptr<TF1> theTF1 = GetWrapperTF1();
204
205 theTF1->FixParameter(4, 0);
206 theTF1->FixParameter(6, 0);
207}
209{
210 std::shared_ptr<TF1> theTF1 = GetWrapperTF1();
211 theTF1->ReleaseParameter(4);
212 theTF1->SetParameter(4, 0);
213
214 theTF1->ReleaseParameter(6);
215 theTF1->SetParLimits(6, -1e-4, 0.35);
216 theTF1->SetParameter(6, 0.1);
217}
218
219ZDCFitExpFermiFixedTaus::ZDCFitExpFermiFixedTaus(const std::string& tag, float tmin, float tmax, float tau1, float tau2) :
220 ZDCFitWrapper(std::make_shared<TF1>(("ExpFermiFixedTaus" + tag).c_str(), this, tmin, tmax, 3)),
221 m_tau1(tau1), m_tau2(tau2)
222{
223 std::shared_ptr<TF1> theTF1 = ZDCFitWrapper::GetWrapperTF1();
224
225 // BAC, parameter 0 limits now is set in DoInitialize
226 theTF1->SetParLimits(1, tmin, tmax);
227
228 theTF1->SetParName(0, "Amp");
229 theTF1->SetParName(1, "T0");
230 theTF1->SetParName(2, "C");
231
232 // Now create the reference function that we use to evaluate ExpFermiFit more efficiently
233 //
234 std::string funcNameRefFunc = "ExpFermiFixedTausRefFunc" + tag;
235 m_expFermiFunc = std::make_shared<TF1>(funcNameRefFunc.c_str(), ZDCFermiExpFit, -50, 100, 5);
236
237 m_expFermiFunc->SetParameter(0, 1);
238 m_expFermiFunc->SetParameter(1, 0);
239 m_expFermiFunc->SetParameter(2, m_tau1);
240 m_expFermiFunc->SetParameter(3, m_tau2);
241 m_expFermiFunc->SetParameter(4, 0);
242
243 m_norm = 1. / m_expFermiFunc->GetMaximum();
244 m_timeCorr = m_tau1 * std::log(m_tau2 / m_tau1 - 1.0);
245}
246
247void ZDCFitExpFermiFixedTaus::DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax)
248{
249 GetWrapperTF1()->SetParameter(0, initialAmp);
250 GetWrapperTF1()->SetParameter(1, initialT0);
251
252 GetWrapperTF1()->SetParLimits(0, ampMin, ampMax);
253}
255{
256 // We force the constant tersm to zero
257 //
258 std::shared_ptr<TF1> theTF1 = GetWrapperTF1();
259
260 theTF1->FixParameter(2, 0);
261}
263{
264 std::shared_ptr<TF1> theTF1 = GetWrapperTF1();
265 theTF1->ReleaseParameter(2);
266}
267
268void ZDCFitExpFermiFixedTaus::SetT0FitLimits(float t0Min, float t0Max)
269{
270 GetWrapperTF1()->SetParLimits(1, t0Min, t0Max);
271}
272
273ZDCFitExpFermiPrePulse::ZDCFitExpFermiPrePulse(const std::string& tag, float tmin, float tmax, float tau1, float tau2) :
274 ZDCPrePulseFitWrapper(std::make_shared<TF1>(("ExpFermiPrePulse" + tag).c_str(), this, tmin, tmax, 5)),
275 m_tau1(tau1), m_tau2(tau2)
276{
277 // Create the reference function that we use to evaluate ExpFermiFit more efficiently
278 //
279 std::string funcNameRefFunc = "ExpFermiPrePulseRefFunc" + tag;
280
281 m_expFermiFunc = std::make_shared<TF1>(funcNameRefFunc.c_str(), ZDCFermiExpFit, -50, 100, 5);
282
283 m_expFermiFunc->SetParameter(0, 1);
284 m_expFermiFunc->SetParameter(1, 0);
285 m_expFermiFunc->SetParameter(2, m_tau1);
286 m_expFermiFunc->SetParameter(3, m_tau2);
287 m_expFermiFunc->SetParameter(4, 0);
288
289 m_norm = 1. / m_expFermiFunc->GetMaximum();
290 m_timeCorr = m_tau1 * std::log(m_tau2 / m_tau1 - 1.0);
291
292 // Now set up the actual TF1
293 //
294 std::shared_ptr<TF1> theTF1 = ZDCFitWrapper::GetWrapperTF1();
295
296 // BAC, parameter 0 limits now is set in DoInitialize
297 theTF1->SetParLimits(1, tmin, tmax);
298 theTF1->SetParLimits(2, 1, 8196); // Increase the upper range to 2 times of ADC range to deal with large exponential tail case of pre-pulse.
299 theTF1->SetParLimits(3, -20, 10);
300
301 theTF1->SetParName(0, "Amp");
302 theTF1->SetParName(1, "T0");
303 theTF1->SetParName(2, "Amp_{pre}");
304 theTF1->SetParName(3, "T0_{pre}");
305 theTF1->SetParName(4, "C");
306}
307
309{
310 // We force the constant term and per-pulse amplitude to zero
311 //
312 std::shared_ptr<TF1> theTF1 = GetWrapperTF1();
313
314 theTF1->FixParameter(2, 0);
315 theTF1->FixParameter(4, 0);
316}
318{
319 std::shared_ptr<TF1> theTF1 = GetWrapperTF1();
320 theTF1->ReleaseParameter(2);
321 theTF1->ReleaseParameter(4);
322
323 theTF1->SetParLimits(2, 1, 8196); // Increase the upper range to 2 times of ADC range to deal with large exponential tail case of pre-pulse.
324}
325
327{
328 if (tmin > GetTMin()) {
329 m_preT0Min = tmin;
330 GetWrapperTF1()->ReleaseParameter(3);
331 GetWrapperTF1()->SetParLimits(3, tmin, tmax);
332 }
333 else {
334 m_preT0Min = -25;
335 GetWrapperTF1()->SetParLimits(3, -25, tmax);
336 }
337 m_preT0Max = tmax;
338}
339
340void ZDCFitExpFermiPrePulse::DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax)
341{
342 GetWrapperTF1()->SetParameter(0, initialAmp);
343 GetWrapperTF1()->SetParameter(1, initialT0);
344 GetWrapperTF1()->SetParameter(2, 5);
345 GetWrapperTF1()->SetParLimits(0, ampMin, ampMax);
346
347 // Set parameter errors for fit step size
348 //
349 double ampStep = std::min(0.05*initialAmp, std::abs(ampMax - initialAmp)/2.);
350 GetWrapperTF1()->SetParError(0, ampStep);
351 GetWrapperTF1()->SetParError(1, 1.0);
352 GetWrapperTF1()->SetParError(2, 2);
353 GetWrapperTF1()->SetParError(3, 1.0);
354 GetWrapperTF1()->SetParError(4, 1.0);
355}
356
357void ZDCFitExpFermiPrePulse::SetT0FitLimits(float t0Min, float t0Max)
358{
359 std::shared_ptr<TF1> theTF1 = GetWrapperTF1();
360 theTF1->SetParLimits(1, t0Min, t0Max);
361}
362
363ZDCFitExpFermiPreExp::ZDCFitExpFermiPreExp(const std::string& tag, float tmin, float tmax, float tau1, float tau2,
364 float defExpTau, float fixExpTau) :
365 ZDCPreExpFitWrapper(std::make_shared<TF1>(("ExpFermiPreExp" + tag).c_str(), this, tmin, tmax, 6), defExpTau, fixExpTau),
366 m_tau1(tau1), m_tau2(tau2)
367{
368 // Create the reference function that we use to evaluate ExpFermiFit more efficiently
369 //
370 std::string funcNameRefFunc = "ExpFermiPreExpRefFunc" + tag;
371
372 m_expFermiFunc = std::make_shared<TF1>(funcNameRefFunc.c_str(), ZDCFermiExpFit, tmin, tmax, 8);
373
374 // The parameters for the FermiExp
375 //
376 m_expFermiFunc->SetParameter(0, 1);
377 m_expFermiFunc->SetParameter(1, 0);
378 m_expFermiFunc->SetParameter(2, m_tau1);
379 m_expFermiFunc->SetParameter(3, m_tau2);
380 m_expFermiFunc->SetParameter(4, 0);
381
382 m_norm = 1. / m_expFermiFunc->GetMaximum();
383 m_timeCorr = m_tau1 * std::log(m_tau2 / m_tau1 - 1.0);
384
385 // Now set up the actual TF1
386 //
387 std::shared_ptr<TF1> theTF1 = ZDCFitWrapper::GetWrapperTF1();
388 theTF1->SetParName(0, "Amp");
389 theTF1->SetParName(1, "T0");
390 theTF1->SetParName(2, "Amp_{pre}");
391 theTF1->SetParName(3, "tau_{pre}");
392 theTF1->SetParName(4, "tausqrt_{pre}");
393 theTF1->SetParName(5, "C");
394
395 theTF1->SetParLimits(1, tmin, tmax);
396 theTF1->SetParLimits(2, -1, 8196); // Increase the upper range to 2 times of ADC range to deal with large exponential tail case of pre-pulse.
397 theTF1->SetParLimits(3, 6, 30);
398 theTF1->SetParLimits(4, -0.2, 0.2);
399 theTF1->SetParLimits(5, -50, 50);
400}
401
403{
404 // We force the constant term and per-pulse amplitude to zero
405 //
406 std::shared_ptr<TF1> theTF1 = GetWrapperTF1();
407
408 theTF1->FixParameter(2, 0);
409 theTF1->FixParameter(3, getDefaultExpTau());
410 theTF1->FixParameter(5, 0);
411}
413{
414 std::shared_ptr<TF1> theTF1 = GetWrapperTF1();
415
416 theTF1->ReleaseParameter(2);
417 theTF1->SetParLimits(2, -1, 8196); // Increase the upper range to 2 times of ADC range to deal with large exponential tail case of pre-pulse.
418
419 theTF1->ReleaseParameter(3);
420 theTF1->SetParLimits(3, 6, 30);
421 theTF1->SetParameter(3, getDefaultExpTau());
422
423 theTF1->ReleaseParameter(5);
424 theTF1->SetParLimits(5, -50, 50);
425 theTF1->SetParameter(5, 0);
426}
427
428void ZDCFitExpFermiPreExp::DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax)
429{
430 GetWrapperTF1()->SetParameter(0, initialAmp);
431 GetWrapperTF1()->SetParameter(1, initialT0);
432 GetWrapperTF1()->SetParameter(2, 0);
433 GetWrapperTF1()->SetParameter(3, getDefaultExpTau());
434 GetWrapperTF1()->SetParameter(4, 0.);
435 GetWrapperTF1()->SetParameter(5, 0);
436
437 GetWrapperTF1()->SetParLimits(0, ampMin, ampMax);
438
439 // Set parameter errors for fit step size
440 //
441 double ampStep = std::min(0.05*initialAmp, std::abs(ampMax - initialAmp)/2.);
442 GetWrapperTF1()->SetParError(0, ampStep);
443 GetWrapperTF1()->SetParError(1, 1.0);
444 GetWrapperTF1()->SetParError(2, ampStep/2);
445 GetWrapperTF1()->SetParError(3, 1.0);
446 GetWrapperTF1()->SetParError(4, 0.025);
447 GetWrapperTF1()->SetParError(5, 1.0);
448}
449
450void ZDCFitExpFermiPreExp::SetT0FitLimits(float t0Min, float t0Max)
451{
452 std::shared_ptr<TF1> theTF1 = GetWrapperTF1();
453 theTF1->SetParLimits(1, t0Min, t0Max);
454}
455
456ZDCFitExpFermiLHCfPreExp::ZDCFitExpFermiLHCfPreExp(const std::string& tag, float tmin, float tmax, float tau1, float tau2,
457 float defExpTau, float fixExpTau) :
458 ZDCPreExpFitWrapper(std::make_shared<TF1>(("ExpFermiLHCfPreExp" + tag).c_str(), this, tmin, tmax, 8), defExpTau, fixExpTau),
459 m_tau1(tau1), m_tau2(tau2)
460{
461 // Create the reference function that we use to evaluate ExpFermiFit more efficiently
462 //
463 std::string funcNameRefFunc = "ExpFermiLHCfPreExpRefFunc" + tag;
464
465 m_expFermiLHCfFunc = std::make_shared<TF1>(funcNameRefFunc.c_str(), ZDCFermiExpFitRefl, tmin, tmax, 9);
466
467 // The parameters for the FermiExpRefl
468 //
469 m_expFermiLHCfFunc->SetParameter(0, 1);
470 m_expFermiLHCfFunc->SetParameter(1, 0);
471 m_expFermiLHCfFunc->SetParameter(2, m_tau1);
472 m_expFermiLHCfFunc->SetParameter(3, m_tau2);
473 m_expFermiLHCfFunc->SetParameter(4, 0);
474 m_expFermiLHCfFunc->SetParameter(5, 6.5);
475 m_expFermiLHCfFunc->SetParameter(6, 0.1);
476 m_expFermiLHCfFunc->SetParameter(7, 1.5);
477 m_expFermiLHCfFunc->SetParameter(8, 0.01);
478
479 // Now set up the actual TF1
480 //
481 std::shared_ptr<TF1> theTF1 = ZDCFitWrapper::GetWrapperTF1();
482 theTF1->SetParName(0, "Amp");
483 theTF1->SetParName(1, "T0");
484 theTF1->SetParName(2, "Tau1");
485 theTF1->SetParName(3, "Tau2");
486 theTF1->SetParName(4, "Amp_{pre}");
487 theTF1->SetParName(5, "tau_{pre}");
488 theTF1->SetParName(6, "bsqrt_{pre}");
489 theTF1->SetParName(7, "ReflFrac");
490
491 theTF1->SetParLimits(1, tmin, tmax);
492 theTF1->SetParLimits(2, 1.0, 2);
493 theTF1->SetParLimits(3, 3.5, 5.5);
494 theTF1->SetParLimits(4, -1, 8196); // Increase the upper range to 2 times of ADC range to deal with large exponential tail case of pre-pulse.
495 theTF1->SetParLimits(5, 4, 12);
496 theTF1->SetParLimits(6, -0.001, 0.001);
497 theTF1->SetParLimits(7, -1.0e-4, 0.3);
498}
499
500void ZDCFitExpFermiLHCfPreExp::DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax)
501{
502 GetWrapperTF1()->SetParameter(0, std::max(initialAmp, ampMin));
503
504 float t0 = initialT0;
505 if (t0 < GetT0Min()) t0 = GetT0Min()*1.1;
506 if (t0 > GetT0Max()) t0 = GetT0Max()/1.1;
507 GetWrapperTF1()->SetParameter(1, t0);
508
509 GetWrapperTF1()->SetParameter(2, std::max(m_tau1, (float) 1.01));
510 GetWrapperTF1()->SetParameter(3, m_tau2);
511 GetWrapperTF1()->SetParameter(4, 0.);
512 GetWrapperTF1()->SetParameter(5, std::max(getDefaultExpTau(), (float) 6.01));
513 GetWrapperTF1()->SetParameter(6, 0);
514 GetWrapperTF1()->SetParameter(7, 0.2);
515
516 GetWrapperTF1()->SetParLimits(0, ampMin, ampMax);
517
518 // Set parameter errors for fit step size
519 //
520 double ampStep = std::min(0.05*initialAmp, std::abs(ampMax - initialAmp)/2.);
521 GetWrapperTF1()->SetParError(0, ampStep);
522 GetWrapperTF1()->SetParError(1, 1.0);
523 GetWrapperTF1()->SetParError(2, 0.1);
524 GetWrapperTF1()->SetParError(3, 0.1);
525 GetWrapperTF1()->SetParError(4, 1.0);
526 GetWrapperTF1()->SetParError(5, 0.5);
527 GetWrapperTF1()->SetParError(6, 0.001);
528 GetWrapperTF1()->SetParError(7, 0.01);
529}
530
532{
533 // We force the constant term and per-pulse amplitude to zero
534 //
535 std::shared_ptr<TF1> theTF1 = GetWrapperTF1();
536
537 theTF1->FixParameter(5, std::max(getDefaultExpTau(), (float) 6.01));
538 theTF1->FixParameter(6, 0);
539 theTF1->FixParameter(7, 0.20);
540}
542{
543 std::shared_ptr<TF1> theTF1 = GetWrapperTF1();
544
545 theTF1->ReleaseParameter(5);
546 theTF1->SetParLimits(5, 6, 12);
547
548 theTF1->ReleaseParameter(6);
549 theTF1->SetParLimits(6, -0.001, 0.001);
550 GetWrapperTF1()->SetParameter(6, 0);
551
552 theTF1->ReleaseParameter(7);
553 theTF1->SetParLimits(7, -1.0e-4, 0.3);
554 GetWrapperTF1()->SetParameter(7, 0.2);
555
556}
557
558void ZDCFitExpFermiLHCfPreExp::SetT0FitLimits(float t0Min, float t0Max)
559{
560 std::shared_ptr<TF1> theTF1 = GetWrapperTF1();
561 theTF1->SetParLimits(1, t0Min, t0Max);
562}
563
564ZDCFitExpFermiLHCfPrePulse::ZDCFitExpFermiLHCfPrePulse(const std::string& tag, float tmin, float tmax, float tau1, float tau2) :
565 ZDCPrePulseFitWrapper(std::make_shared<TF1>(("ExpFermiLHCfPrePulse" + tag).c_str(), this, tmin, tmax, 7)),
566 m_tau1(tau1), m_tau2(tau2)
567{
568 // Create the reference function that we use to evaluate ExpFermiFit more efficiently
569 //
570 std::string funcNameRefFunc = "ExpFermiLHCfPrePulseRefFunc" + tag;
571 std::string funcNamePreFunc = "ExpFermiLHCfPrePulsePreFunc" + tag;
572
573 m_expFermiLHCfFunc = std::make_shared<TF1>(funcNameRefFunc.c_str(), ZDCFermiExpFitRefl, tmin, tmax, 9);
574 m_expFermiLHCfFunc->SetParameter(0, 1);
575 m_expFermiLHCfFunc->SetParameter(1, 0);
576 m_expFermiLHCfFunc->SetParameter(2, m_tau1);
577 m_expFermiLHCfFunc->SetParameter(3, m_tau2);
578 m_expFermiLHCfFunc->SetParameter(4, 0);
579 m_expFermiLHCfFunc->SetParameter(5, 6.5);
580 m_expFermiLHCfFunc->SetParameter(6, 0.2);
581 m_expFermiLHCfFunc->SetParameter(7, 1.5);
582 m_expFermiLHCfFunc->SetParameter(8, 0.01);
583
584 m_expFermiPreFunc = std::make_shared<TF1>(funcNamePreFunc.c_str(), ZDCFermiExpFit, tmin, tmax, 9);
585
586 m_expFermiPreFunc->SetParameter(0, 1);
587 m_expFermiPreFunc->SetParameter(1, 0);
588 m_expFermiPreFunc->SetParameter(2, m_tau1);
589 m_expFermiPreFunc->SetParameter(3, m_tau2);
590 m_expFermiPreFunc->SetParameter(4, 0);
591 m_preNorm = 1. / m_expFermiPreFunc->GetMaximum();
592
593 // Now set up the actual TF1
594 //
595 std::shared_ptr<TF1> theTF1 = ZDCFitWrapper::GetWrapperTF1();
596
597 // The actual paerameters we fit
598 //
599 theTF1->SetParName(0, "Amp");
600 theTF1->SetParName(1, "T0");
601 theTF1->SetParName(2, "tau1");
602 theTF1->SetParName(3, "tau2");
603 theTF1->SetParName(4, "Amp_{pre}");
604 theTF1->SetParName(5, "T0_{pre}");
605 theTF1->SetParName(6, "C");
606
607 // BAC, parameter 0 limits now is set in DoInitialize
608 theTF1->SetParLimits(1, tmin, tmax);
609 theTF1->SetParLimits(2, 1.0, 2);
610 theTF1->SetParLimits(3, 3.5, 5.5);
611 theTF1->SetParLimits(4, 1, 8196); // Increase the upper range to 2 times of ADC range to deal with large exponential tail case of pre-pulse.
612 theTF1->SetParLimits(5, -20, 10);
613 theTF1->SetParLimits(6, -50, 50);
614
615}
616
618{
619 // We force the constant term and per-pulse amplitude to zero
620 //
621 std::shared_ptr<TF1> theTF1 = GetWrapperTF1();
622
623 theTF1->FixParameter(4, 0);
624 theTF1->FixParameter(6, 0);
625}
627{
628 std::shared_ptr<TF1> theTF1 = GetWrapperTF1();
629 theTF1->ReleaseParameter(4);
630 theTF1->ReleaseParameter(6);
631
632 theTF1->SetParLimits(4, 1, 8196); // Increase the upper range to 2 times of ADC range to deal with large exponential tail case of pre-pulse.
633 theTF1->SetParLimits(6, -50, 50);
634}
635
637{
638 if (tmin > GetTMin()) {
639 m_preT0Min = tmin;
640 GetWrapperTF1()->ReleaseParameter(5);
641 GetWrapperTF1()->SetParLimits(5, tmin, tmax);
642 }
643 else {
644 m_preT0Min = -25;
645 GetWrapperTF1()->SetParLimits(5, -25, tmax);
646 }
647 m_preT0Max = tmax;
648}
649
650void ZDCFitExpFermiLHCfPrePulse::DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax)
651{
652 GetWrapperTF1()->SetParameter(0, initialAmp);
653 GetWrapperTF1()->SetParameter(1, initialT0);
654 GetWrapperTF1()->SetParameter(2, m_tau1);
655 GetWrapperTF1()->SetParameter(3, m_tau2);
656 GetWrapperTF1()->SetParameter(4, 5);
657 GetWrapperTF1()->SetParameter(5, -10);
658 GetWrapperTF1()->SetParameter(6, 0);
659
660 GetWrapperTF1()->SetParLimits(0, ampMin, ampMax);
661 // Set parameter errors for fit step size
662 //
663 double ampStep = std::min(0.05*initialAmp, std::abs(ampMax - initialAmp)/2.);
664 GetWrapperTF1()->SetParError(0, ampStep);
665 GetWrapperTF1()->SetParError(1, 1.0);
666 GetWrapperTF1()->SetParError(2, 0.05);
667 GetWrapperTF1()->SetParError(3, 1);
668 GetWrapperTF1()->SetParError(4, 5.0);
669 GetWrapperTF1()->SetParError(5, 1.0);
670 GetWrapperTF1()->SetParError(6, 2.0);
671}
672
673void ZDCFitExpFermiLHCfPrePulse::SetT0FitLimits(float t0Min, float t0Max)
674{
675 std::shared_ptr<TF1> theTF1 = GetWrapperTF1();
676 theTF1->SetParLimits(1, t0Min, t0Max);
677}
678
679
680
681// --------------------------------------------------------------------------------------------------------------------------------------------
682//
683ZDCFitExpFermiLinearFixedTaus::ZDCFitExpFermiLinearFixedTaus(const std::string& tag, float tmin, float tmax, float tau1, float tau2) :
684 ZDCFitWrapper(std::make_shared<TF1>(("ExpFermiFixedTaus" + tag).c_str(), this, tmin, tmax, 4)),
685 m_tau1(tau1), m_tau2(tau2)
686{
687 std::shared_ptr<TF1> theTF1 = GetWrapperTF1();
688
689 // BAC, parameter 0 limits now is set in DoInitialize
690 theTF1->SetParLimits(1, tmin, tmax);
691
692 theTF1->SetParName(0, "Amp");
693 theTF1->SetParName(1, "T0");
694 theTF1->SetParName(2, "s_{b}");
695 theTF1->SetParName(3, "c_{b}");
696
697 // Now create the reference function that we use to evaluate ExpFermiFit more efficiently
698 //
699 std::string funcNameRefFunc = "ExpFermiFixedTausRefFunc" + tag;
700
701 m_expFermiFunc = std::make_shared<TF1>(funcNameRefFunc.c_str(), ZDCFermiExpFit, -50, 100, 5);
702
703 m_expFermiFunc->SetParameter(0, 1);
704 m_expFermiFunc->SetParameter(1, 0);
705 m_expFermiFunc->SetParameter(2, m_tau1);
706 m_expFermiFunc->SetParameter(3, m_tau2);
707 m_expFermiFunc->FixParameter(4, 0);
708
709 m_norm = 1. / m_expFermiFunc->GetMaximum();
710 m_timeCorr = m_tau1 * std::log(m_tau2 / m_tau1 - 1.0);
711}
712
714{
715 // We force the linear terms to zero
716 //
717 std::shared_ptr<TF1> theTF1 = GetWrapperTF1();
718
719 theTF1->FixParameter(2, 0);
720 theTF1->FixParameter(3, 0);
721}
722
724{
725 std::shared_ptr<TF1> theTF1 = GetWrapperTF1();
726 theTF1->ReleaseParameter(2);
727 theTF1->ReleaseParameter(3);
728}
729
730void ZDCFitExpFermiLinearFixedTaus::DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax)
731{
732 float slope = std::abs(0.1 * initialAmp / initialT0);
733 float intercept = std::abs(0.1 * initialAmp);
734 GetWrapperTF1()->SetParLimits(2, -slope , slope );
735 GetWrapperTF1()->SetParLimits(3, -intercept, intercept);
736
737 GetWrapperTF1()->SetParameter(0, initialAmp);
738 GetWrapperTF1()->SetParameter(1, initialT0);
739 GetWrapperTF1()->SetParameter(2, 0);
740 GetWrapperTF1()->SetParameter(3, 0);
741
742 GetWrapperTF1()->SetParLimits(0, ampMin, ampMax);
743
744 double ampStep = std::min(0.05*initialAmp, std::abs(ampMax - initialAmp)/2.);
745
746 GetWrapperTF1()->SetParError(0, ampStep);
747 GetWrapperTF1()->SetParError(1, 1);
748 GetWrapperTF1()->SetParError(2, 1);
749 GetWrapperTF1()->SetParError(3, 0.5);
750}
751
753{
754 std::shared_ptr<TF1> theTF1 = GetWrapperTF1();
755 theTF1->SetParLimits(1, t0Min, t0Max);
756}
757
758// --------------------------------------------------------------------------------------------------------------------------------------------
759//
760ZDCFitExpFermiLinearPrePulse::ZDCFitExpFermiLinearPrePulse(const std::string& tag, float tmin, float tmax, float tau1, float tau2) :
761 ZDCPrePulseFitWrapper(std::make_shared<TF1>(("ExpFermiLinearPrePulse" + tag).c_str(), this, tmin, tmax, 6)),
762 m_tau1(tau1), m_tau2(tau2)
763{
764 // Create the reference function that we use to evaluate ExpFermiFit more efficiently
765 //
766 std::string funcNameRefFunc = "ExpFermiPerPulseRefFunc" + tag;
767
768 m_expFermiFunc = std::make_shared<TF1>(funcNameRefFunc.c_str(), ZDCFermiExpFit, -50, 100, 5);
769
770 m_expFermiFunc->SetParameter(0, 1);
771 m_expFermiFunc->SetParameter(1, 0);
772 m_expFermiFunc->SetParameter(2, m_tau1);
773 m_expFermiFunc->SetParameter(3, m_tau2);
774 m_expFermiFunc->FixParameter(4, 0);
775
776 m_norm = 1. / m_expFermiFunc->GetMaximum();
777 m_timeCorr = m_tau1 * std::log(m_tau2 / m_tau1 - 1.0);
778
779 // Now set up the actual TF1
780 //
781 std::shared_ptr<TF1> theTF1 = ZDCFitWrapper::GetWrapperTF1();
782
783 theTF1->SetParName(0, "Amp");
784 theTF1->SetParName(1, "T0");
785 theTF1->SetParName(2, "Amp_{pre}");
786 theTF1->SetParName(3, "T0_{pre}");
787 theTF1->SetParName(4, "s_{b}");
788 theTF1->SetParName(5, "c_{b}");
789
790 // BAC, parameter 0 limits now is set in DoInitialize
791 theTF1->SetParLimits(1, tmin, tmax);
792 theTF1->SetParLimits(2, 1, 4096); // Increase the upper range to 4 times of ADC range to deal with large exponential tail case of pre-pulse.
793 theTF1->SetParLimits(3, -20, 10);
794}
795
797{
798 // We force the linear terms and prepulse terms to zero
799 //
800 std::shared_ptr<TF1> theTF1 = GetWrapperTF1();
801
802 theTF1->FixParameter(4, 0);
803 theTF1->FixParameter(5, 0);
804}
806{
807 std::shared_ptr<TF1> theTF1 = GetWrapperTF1();
808
809 theTF1->ReleaseParameter(4);
810 theTF1->ReleaseParameter(5);
811}
812
814{
815 GetWrapperTF1()->SetParLimits(3, tmin, tmax);
816}
817
818void ZDCFitExpFermiLinearPrePulse::DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax)
819{
820 float slope = std::abs(initialAmp / initialT0); // to be studied more ??? limit 0.1 0.05
821 float intercept = std::abs(0.5 * initialAmp);
822 GetWrapperTF1()->SetParLimits(4, -slope , slope );
823 GetWrapperTF1()->SetParLimits(5, -intercept, intercept);
824
825 GetWrapperTF1()->SetParLimits(0, ampMin, ampMax);
826
827 GetWrapperTF1()->SetParameter(0, initialAmp);
828 GetWrapperTF1()->SetParameter(1, initialT0);
829 GetWrapperTF1()->SetParameter(2, 5);
830 GetWrapperTF1()->SetParameter(5, 0);
831
832 double ampStep = std::min(0.05*initialAmp, std::abs(ampMax - initialAmp)/2.);
833
834 GetWrapperTF1()->SetParError(0, ampStep);
835 GetWrapperTF1()->SetParError(1, 1.0);
836 GetWrapperTF1()->SetParError(2, 1);
837 GetWrapperTF1()->SetParError(3, 1);
838 GetWrapperTF1()->SetParError(4, 0.1);
839 GetWrapperTF1()->SetParError(5, 1);
840}
841
843{
844 GetWrapperTF1()->SetParLimits(1, t0Min, t0Max);
845}
846
847
848// --------------------------------------------------------------------------------------------------------------------------------------------
849//
850ZDCFitComplexPrePulse::ZDCFitComplexPrePulse(const std::string& tag, float tmin, float tmax, float tau1, float tau2) :
851 ZDCPrePulseFitWrapper(std::make_shared<TF1>(("ExpFermiPrePulse" + tag).c_str(), this, tmin, tmax, 7)),
852 m_tau1(tau1), m_tau2(tau2)
853{
854 // Create the reference function that we use to evaluate ExpFermiFit more efficiently
855 //
856 std::string funcNameRefFunc = "ExpFermiPerPulseRefFunc" + tag;
857
858 m_expFermiFunc = std::make_shared<TF1>(funcNameRefFunc.c_str(), ZDCFermiExpFit, -50, 100, 4);
859
860 m_expFermiFunc->SetParameter(0, 1);
861 m_expFermiFunc->SetParameter(1, 0);
862 m_expFermiFunc->SetParameter(2, m_tau1);
863 m_expFermiFunc->SetParameter(3, m_tau2);
864
865 m_norm = 1. / m_expFermiFunc->GetMaximum();
866 m_timeCorr = m_tau1 * std::log(m_tau2 / m_tau1 - 1.0);
867
868 // Now set up the actual TF1
869 //
870 std::shared_ptr<TF1> theTF1 = GetWrapperTF1();
871
872 // BAC, parameter 0 limits now is set in DoInitialize
873 theTF1->SetParLimits(1, tmin, tmax);
874 theTF1->SetParLimits(2, 0, 2048); // Pre-pulse upper bound should not be greater 2 times of ADC range with overflow constrains.
875 theTF1->SetParLimits(3, 0, 40);
876 theTF1->SetParLimits(6, 0, 4096); // Increase the upper range to 4 times of ADC range to deal with large exponential tail case of pre-pulse.
877
878 theTF1->SetParName(0, "Amp");
879 theTF1->SetParName(1, "T0");
880 theTF1->SetParName(2, "Amp_{pre}");
881 theTF1->SetParName(3, "T0_{pre}");
882 theTF1->SetParName(4, "s_{b}");
883 theTF1->SetParName(5, "c_{b}");
884 theTF1->SetParName(6, "Amp_{exp}");
885}
886
888{
889 // We force the linear terms and prepulse terms to zero
890 //
891 std::shared_ptr<TF1> theTF1 = GetWrapperTF1();
892
893 theTF1->FixParameter(2, 0);
894 theTF1->FixParameter(4, 0);
895 theTF1->FixParameter(5, 0);
896}
898{
899 std::shared_ptr<TF1> theTF1 = GetWrapperTF1();
900 theTF1->ReleaseParameter(2);
901 theTF1->ReleaseParameter(4);
902 theTF1->ReleaseParameter(5);
903}
904
906{
907 if (tmin > GetTMin()) {
908 GetWrapperTF1()->ReleaseParameter(3);
909 GetWrapperTF1()->SetParLimits(3, tmin, tmax);
910 }
911 else {
912 GetWrapperTF1()->SetParLimits(3, 0, tmax);
913 }
914}
915
916void ZDCFitComplexPrePulse::DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax)
917{
918 float slope = std::abs(initialAmp / initialT0); // to be studied more ??? limit 0.1 0.05
919 float intercept = std::abs(0.1 * initialAmp); // reduce from 0.25 to 0.1 fix some fail issue
920 GetWrapperTF1()->SetParLimits(4, -slope , slope ); // if the lower limit is set to 0, there will be some fit fail issue...
921 GetWrapperTF1()->SetParLimits(5, -intercept, intercept);
922
923 GetWrapperTF1()->SetParLimits(0, ampMin, ampMax);
924
925 GetWrapperTF1()->SetParameter(0, initialAmp);
926 GetWrapperTF1()->SetParameter(1, initialT0);
927 GetWrapperTF1()->SetParameter(2, 5);
928 GetWrapperTF1()->SetParameter(3, 10);
929 GetWrapperTF1()->SetParameter(4, 0);
930 GetWrapperTF1()->SetParameter(5, 0);
931 GetWrapperTF1()->SetParameter(6, 1);
932}
933
934void ZDCFitComplexPrePulse::SetT0FitLimits(float t0Min, float t0Max)
935{
936 GetWrapperTF1()->SetParLimits(1, t0Min, t0Max);
937}
938
939
940
941// --------------------------------------------------------------------------------------------------------------------------------------------
942//
943ZDCFitGeneralPulse::ZDCFitGeneralPulse(const std::string& tag, float tmin, float tmax, float tau1, float tau2) :
944 ZDCPrePulseFitWrapper(std::make_shared<TF1>(("ExpFermiPrePulse" + tag).c_str(), this, tmin, tmax, 9)),
945 m_tau1(tau1), m_tau2(tau2)
946{
947 // Create the reference function that we use to evaluate ExpFermiFit more efficiently
948 //
949 std::string funcNameRefFunc = "ExpFermiPerPulseRefFunc" + tag;
950
951 m_expFermiFunc = std::make_shared<TF1>(funcNameRefFunc.c_str(), ZDCFermiExpFit, -50, 100, 4);
952
953 m_expFermiFunc->SetParameter(0, 1);
954 m_expFermiFunc->SetParameter(1, 0);
955 m_expFermiFunc->SetParameter(2, m_tau1);
956 m_expFermiFunc->SetParameter(3, m_tau2);
957
958 m_norm = 1. / m_expFermiFunc->GetMaximum();
959 m_timeCorr = m_tau1 * std::log(m_tau2 / m_tau1 - 1.0);
960
961 // Now set up the actual TF1
962 //
963 std::shared_ptr<TF1> theTF1 = GetWrapperTF1();
964
965 // BAC, parameter 0 limits now is set in DoInitialize
966 theTF1->SetParLimits(1, tmin, tmax);
967 theTF1->SetParLimits(2, 0, 2048); // Pre-pulse upper bound should not be greater 2 times of ADC range with overflow constrains.
968 theTF1->SetParLimits(3, 0, 40);
969 theTF1->SetParLimits(6, 0, 4096); // Increase the upper range to 4 times of ADC range to deal with large exponential tail case of pre-pulse.
970 theTF1->SetParLimits(7, 0, 2048); // Post-pulse upper bound should not be greater 2 times of ADC range with overflow constrains.
971 theTF1->SetParLimits(8, 100, 163);
972
973 theTF1->SetParName(0, "Amp");
974 theTF1->SetParName(1, "T0");
975 theTF1->SetParName(2, "Amp_{pre}");
976 theTF1->SetParName(3, "T0_{pre}");
977 theTF1->SetParName(4, "s_{b}");
978 theTF1->SetParName(5, "c_{b}");
979 theTF1->SetParName(6, "Amp_{exp}");
980 theTF1->SetParName(7, "Amp_{post}");
981 theTF1->SetParName(8, "T0_{post}");
982}
983
985{
986 // We force the linear terms and prepulse terms to zero
987 //
988 std::shared_ptr<TF1> theTF1 = GetWrapperTF1();
989
990 theTF1->FixParameter(2, 0);
991 theTF1->FixParameter(4, 0);
992 theTF1->FixParameter(5, 0);
993}
995{
996 std::shared_ptr<TF1> theTF1 = GetWrapperTF1();
997 theTF1->ReleaseParameter(2);
998 theTF1->ReleaseParameter(4);
999 theTF1->ReleaseParameter(5);
1000}
1001
1002void ZDCFitGeneralPulse::SetPrePulseT0Range(float tmin, float tmax)
1003{
1004 if (tmin > GetTMin()) {
1005 if (tmin < 0) tmin = 0;
1006 GetWrapperTF1()->SetParLimits(3, tmin, tmax);
1007 }
1008 else {
1009 GetWrapperTF1()->SetParLimits(3, 0, tmax);
1010 }
1011}
1012
1013void ZDCFitGeneralPulse::SetPostPulseT0Range(float tmin, float tmax, float initialPostT0)
1014{
1015 GetWrapperTF1()->SetParLimits(8, tmin, tmax);
1016 float iniPostT0 = initialPostT0;
1017 GetWrapperTF1()->SetParameter(8, iniPostT0);
1018}
1019
1020void ZDCFitGeneralPulse::DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax)
1021{
1022 float slope = std::abs(initialAmp / initialT0); // to be studied more ??? limit 0.1 0.05
1023 float intercept = std::abs(0.1 * initialAmp); // reduce from 0.25 to 0.1 fix some fail issue
1024 GetWrapperTF1()->SetParLimits(4, -slope , slope ); // if the lower limit is set to 0, there will be some fit fail issue...
1025 GetWrapperTF1()->SetParLimits(5, -intercept, intercept);
1026
1027 GetWrapperTF1()->SetParLimits(0, ampMin, ampMax);
1028
1029 GetWrapperTF1()->SetParameter(0, initialAmp);
1030 GetWrapperTF1()->SetParameter(1, initialT0);
1031 GetWrapperTF1()->SetParameter(4, 0);
1032 GetWrapperTF1()->SetParameter(5, 0);
1033 GetWrapperTF1()->SetParameter(7, 5);
1034}
1035
1036void ZDCFitGeneralPulse::SetT0FitLimits(float t0Min, float t0Max)
1037{
1038 GetWrapperTF1()->SetParLimits(1, t0Min, t0Max);
1039}
static Double_t t0
double ZDCFermiExpFit(const double *xvec, const double *pvec)
double ZDCFermiExpFitRefl(const double *xvec, const double *pvec)
virtual void UnconstrainFit() override
virtual void DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax) override
virtual void ConstrainFit() override
virtual void SetPrePulseT0Range(float tmin, float tmax) override
virtual void SetT0FitLimits(float tMin, float tMax) override
ZDCFitComplexPrePulse(const std::string &tag, float tmin, float tmax, float tau1, float tau2)
std::shared_ptr< TF1 > m_expFermiFunc
ZDCFitExpFermiFixedTaus(const std::string &tag, float tmin, float tmax, float tau1, float tau2)
virtual void ConstrainFit() override
virtual void DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax) override
std::shared_ptr< TF1 > m_expFermiFunc
virtual void UnconstrainFit() override
virtual void SetT0FitLimits(float tMin, float tMax) override
virtual void DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax) override
virtual void ConstrainFit() override
virtual void SetT0FitLimits(float tMin, float tMax) override
std::shared_ptr< TF1 > m_expFermiLHCfFunc
ZDCFitExpFermiLHCfPreExp(const std::string &tag, float tmin, float tmax, float tau1, float tau2, float defExpTau, float fixExpTau)
virtual void UnconstrainFit() override
std::shared_ptr< TF1 > m_expFermiPreFunc
std::shared_ptr< TF1 > m_expFermiLHCfFunc
virtual void ConstrainFit() override
virtual void SetPrePulseT0Range(float tmin, float tmax) 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)
virtual void UnconstrainFit() override
std::shared_ptr< TF1 > m_expFermiFunc
virtual void SetT0FitLimits(float tMin, float tMax) override
ZDCFitExpFermiLinearFixedTaus(const std::string &tag, float tmin, float tmax, float tau1, float tau2)
virtual void ConstrainFit() override
virtual void DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax) override
virtual void UnconstrainFit() override
virtual void ConstrainFit() override
virtual void SetPrePulseT0Range(float tmin, float tmax) override
virtual void UnconstrainFit() 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 SetT0FitLimits(float tMin, float tMax) override
std::shared_ptr< TF1 > m_expFermiFunc
virtual void UnconstrainFit() override
virtual void ConstrainFit() override
virtual void SetT0FitLimits(float tMin, float tMax) 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 ConstrainFit() override
virtual void SetT0FitLimits(float tMin, float tMax) 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
virtual void UnconstrainFit() override
ZDCFitExpFermiPrePulse(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 UnconstrainFit() override
ZDCFitExpFermiVariableTausLHCf(const std::string &tag, float tmin, float tmax, bool fixTau1, bool fixTau2, float tau1, float tau2)
virtual void SetT0FitLimits(float tMin, float tMax) override
virtual void ConstrainFit() 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
virtual void ConstrainFit() override
ZDCFitExpFermiVariableTaus(const std::string &tag, float tmin, float tmax, bool fixTau1, bool fixTau2, float tau1, float tau2)
virtual void UnconstrainFit() override
virtual void SetT0FitLimits(float tMin, float tMax) override
virtual void DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax) override
virtual void UnconstrainFit() override
virtual void ConstrainFit() override
std::shared_ptr< TF1 > m_expFermiFunc
virtual void SetT0FitLimits(float tMin, float tMax) 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 SetPrePulseT0Range(float tmin, float tmax) override
void Initialize(float initialAmp, float initialT0, float ampMin, float ampMax)
float GetTMin() const
virtual std::shared_ptr< TF1 > GetWrapperTF1()
float GetT0Max() const
float GetT0Min() const
virtual void SetT0FitLimits(float tMin, float tMax)=0
ZDCFitWrapper(const std::shared_ptr< TF1 > &wrapperTF1)
void SetAmpMinMax(float minAmp, float maxAmp)
virtual void DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax)=0
float getDefaultExpTau() const
ZDCPreExpFitWrapper(std::shared_ptr< TF1 > wrapperTF1, float defaultExpTau, bool fixTau)
bool fixExpTau() const
ZDCPrePulseFitWrapper(std::shared_ptr< TF1 > wrapperTF1)
STL namespace.