ATLAS Offline Software
Loading...
Searching...
No Matches
ZDCFitWrapper.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef ZDCANALYSIS_ZDCFITWRAPPER_H
6#define ZDCANALYSIS_ZDCFITWRAPPER_H
7
9
10// Base class that defines the interface
11//
12#include <TF1.h>
13#include <memory>
14
15inline double ZDCFermiExpFit(const double* xvec, const double* pvec);
16inline double ZDCFermiExpFitRefl(const double* xvec, const double* pvec);
17
19{
20private:
21 std::shared_ptr<TF1> m_wrapperTF1{};
22
23 float m_tmin{0};
24 float m_tmax{0};
25
26 float m_ampMin{0};
27 float m_ampMax{0};
28
29 float m_t0Min{0};
30 float m_t0Max{0};
31
32 bool m_adjTLimitsEvent{false};
33 float m_tminAdjust{0};
34 float m_tempTmin{0};
35 float m_tempTmax{0};
36
37protected:
38 // Actually sets the t0 parameter limits in the fit function
39 //
40 virtual void SetT0FitLimits(float tMin, float tMax) = 0;
41
42public:
43 ZDCFitWrapper(const std::shared_ptr<TF1>& wrapperTF1) : m_wrapperTF1(wrapperTF1),
44 m_ampMin(0),
45 m_adjTLimitsEvent(true) // true here forces a setting of T0 par limits on first event
46 {
47 m_tmin = m_wrapperTF1->GetXmin();
48 m_tmax = m_wrapperTF1->GetXmax();
49
52 }
53
54 virtual ~ZDCFitWrapper() {}
55
56 void Initialize(float initialAmp, float initialT0, float ampMin, float ampMax);
57 void Initialize(float initialAmp, float initialT0, float ampMin, float ampMax, float fitTmin, float fitTmax, float fitTRef);
58
59 // Performs the class-specific event initialization
60 //
61 virtual void DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax) = 0;
62
63 void SetAmpMinMax(float minAmp, float maxAmp)
64 {
65 m_ampMin = minAmp;
66 m_ampMax = maxAmp;
67 }
68
69 void SetT0Range(float t0Min, float t0Max)
70 {
71 m_t0Min = t0Min;
72 m_t0Max = t0Max;
73
74 SetT0FitLimits(t0Min, t0Max);
75 }
76
77 virtual void ConstrainFit() = 0;
78 virtual void UnconstrainFit() = 0;
79
80 virtual float GetAmplitude() const = 0;
81 virtual float GetAmpError() const = 0;
82 virtual float GetTime() const = 0;
83 virtual float GetTau1() const = 0;
84 virtual float GetTau2() const = 0;
85
86 float GetMinAmp() const {return m_ampMin;}
87 float GetMaxAmp() const {return m_ampMax;}
88
89 float GetTMin() const {return m_tmin;}
90 float GetTMax() const {return m_tmax;}
91
92 float GetT0Min() const {
93 if (m_adjTLimitsEvent) return m_tempTmin;
94 else return m_t0Min;
95 }
96
97 float GetT0Max() const {
98 if (m_adjTLimitsEvent) return m_tempTmax;
99 else return m_t0Max;
100 }
101
102 float GetTMinAdjust() const {return m_tminAdjust;}
103
104 virtual float GetBkgdMaxFraction() const = 0;
105
106 virtual float GetShapeParameter(size_t index) const = 0;
107
108 virtual double operator()(const double *x, const double *p) = 0;
109
110 virtual std::shared_ptr<TF1> GetWrapperTF1() {return m_wrapperTF1;}
111 virtual const TF1* GetWrapperTF1() const {return m_wrapperTF1.get();}
112 virtual TF1* GetWrapperTF1RawPtr() const {return m_wrapperTF1.get();}
113};
114
116{
117protected:
120public:
121 ZDCPrePulseFitWrapper(std::shared_ptr<TF1> wrapperTF1) : ZDCFitWrapper(wrapperTF1)
122 {
125 }
126
127 virtual void SetInitialPrePulse(float amp, float t0, float expamp, bool fixPrePulseToZero) = 0;
128
129 virtual void SetPrePulseT0Range(float tmin, float tmax) = 0;
130 virtual void SetPostPulseT0Range(float tmin, float tmax, float initialPostT0) = 0;
131
132 virtual unsigned int GetPreT0ParIndex() const = 0;
133
134 virtual float GetPreT0() const = 0;
135 virtual float GetPreAmp() const = 0;
136
137 virtual float GetPostT0() const = 0;
138 virtual float GetPostAmp() const = 0;
139
140 virtual float GetExpAmp() const = 0;
141};
142
144{
145protected:
148
149public:
150 ZDCPreExpFitWrapper(std::shared_ptr<TF1> wrapperTF1, float defaultExpTau, bool fixTau) :
151 ZDCFitWrapper(wrapperTF1), m_defaultTau(defaultExpTau), m_fixTau(fixTau)
152 {}
153
154 virtual void SetInitialExpPulse(float expamp) = 0;
155
156 bool fixExpTau() const {return m_fixTau;}
157 float getDefaultExpTau() const {return m_defaultTau;}
158
159 virtual float GetExpAmp() const = 0;
160 virtual float GetExpTau() const = 0;
161};
162
164{
165protected:
166 bool m_fixTau1{false};
167 bool m_fixTau2{false};
168
169 float m_tau1{0};
170 float m_tau2{0};
171
172public:
173
174 ZDCFitExpFermiVariableTaus(const std::string& tag, float tmin, float tmax, bool fixTau1, bool fixTau2, float tau1, float tau2);
175
176 virtual void DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax) override;
177 virtual void SetT0FitLimits(float tMin, float tMax) override;
178
179 virtual float GetAmplitude() const override {return GetWrapperTF1()->GetParameter(0); }
180 virtual float GetAmpError() const override {return GetWrapperTF1()->GetParError(0); }
181
182 virtual float GetTau1() const override {return GetWrapperTF1()->GetParameter(2);}
183 virtual float GetTau2() const override {return GetWrapperTF1()->GetParameter(3);}
184
185 virtual float GetTime() const override {
186 const TF1* theTF1 = GetWrapperTF1();
187
188 float fitT0 = theTF1->GetParameter(1);
189
190 float tau1 = theTF1->GetParameter(2);
191 float tau2 = theTF1->GetParameter(3);
192
193 // Correct the time to the maximum
194 //
195 if (tau2 > tau1) fitT0 += tau1 * std::log(tau2 / tau1 - 1.0);
196 return fitT0;
197 }
198
199 virtual float GetShapeParameter(size_t index) const override
200 {
201 if (index == 0) return GetWrapperTF1()->GetParameter(2);
202 else if (index == 1) return GetWrapperTF1()->GetParameter(3);
203 else throw std::runtime_error("Fit parameter does not exist.");
204 }
205
206 virtual float GetBkgdMaxFraction() const override
207 {
208 const TF1* theTF1 = ZDCFitWrapper::GetWrapperTF1();
209 double amp = theTF1->GetParameter(0);
210 double constant = theTF1->GetParameter(4);
211
212 if (amp > 0) return constant / amp;
213 else return -1;
214 }
215
216 virtual double operator()(const double *x, const double *p) override{
217 return ZDCFermiExpFit(x, p);
218 }
219
220 virtual void ConstrainFit() override;
221 virtual void UnconstrainFit() override;
222};
223
224//
225// A special version of the fermi*negative exponential function that includes a term to describe
226// the "reflection" effects we see in the ZDC+LHCf joint run due to the splitting of the ZDC
227// signals to send a copy to LHCf DAQ. It's not really a reflection but an artifact introduced
228// by the bandwidth limit of the linear fan-in/fan-out module that we used.
229//
231{
232protected:
233 bool m_fixTau1{false};
234 bool m_fixTau2{false};
235
236 float m_tau1{0};
237 float m_tau2{0};
238
239public:
240
241 ZDCFitExpFermiVariableTausLHCf(const std::string& tag, float tmin, float tmax, bool fixTau1, bool fixTau2, float tau1, float tau2);
242
243 virtual void DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax) override;
244 virtual void SetT0FitLimits(float tMin, float tMax) override;
245
246 virtual float GetAmplitude() const override {return GetWrapperTF1()->GetParameter(0); }
247 virtual float GetAmpError() const override {return GetWrapperTF1()->GetParError(0); }
248
249 virtual float GetTau1() const override {return GetWrapperTF1()->GetParameter(2);}
250 virtual float GetTau2() const override {return GetWrapperTF1()->GetParameter(3);}
251
252 virtual float GetTime() const override {
253 const TF1* theTF1 = GetWrapperTF1();
254
255 float fitT0 = theTF1->GetParameter(1);
256
257 float tau1 = theTF1->GetParameter(2);
258 float tau2 = theTF1->GetParameter(3);
259
260 // Correct the time to the maximum
261 //
262 if (tau2 > tau1) fitT0 += tau1 * std::log(tau2 / tau1 - 1.0);
263 return fitT0;
264 }
265
266 virtual float GetShapeParameter(size_t index) const override
267 {
268 if (index == 0) return GetWrapperTF1()->GetParameter(2);
269 else if (index == 1) return GetWrapperTF1()->GetParameter(3);
270 else throw std::runtime_error("Fit parameter does not exist.");
271 }
272
273 virtual float GetBkgdMaxFraction() const override
274 {
275 const TF1* theTF1 = ZDCFitWrapper::GetWrapperTF1();
276 double amp = theTF1->GetParameter(0);
277 double constant = theTF1->GetParameter(4);
278
279 if (amp > 0) return constant / amp;
280 else return 1;
281 }
282
283 virtual double operator()(const double *x, const double *p) override{
284 return ZDCFermiExpFitRefl(x, p);
285 }
286
287 virtual void ConstrainFit() override;
288 virtual void UnconstrainFit() override;
289};
290
292{
293public:
294 ZDCFitExpFermiVariableTausRun3(const std::string& tag, float tmin, float tmax, bool fixTau1, bool fixTau2, float tau1, float tau2);
295};
296
298{
299private:
300 float m_tau1{0};
301 float m_tau2{0};
302
303 float m_norm{0};
304 float m_timeCorr{0};
305
306 std::shared_ptr<TF1> m_expFermiFunc{};
307
308public:
309
310 ZDCFitExpFermiFixedTaus(const std::string& tag, float tmin, float tmax, float tau1, float tau2);
311
313
314 virtual void DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax) override;
315 virtual void SetT0FitLimits(float tMin, float tMax) override;
316
317 virtual void ConstrainFit() override;
318 virtual void UnconstrainFit() override;
319
320 virtual float GetAmplitude() const override {return GetWrapperTF1()->GetParameter(0); }
321 virtual float GetAmpError() const override {return GetWrapperTF1()->GetParError(0); }
322
323 virtual float GetTau1() const override {return m_tau1;}
324 virtual float GetTau2() const override {return m_tau2;}
325
326 virtual float GetTime() const override {
327 return GetWrapperTF1()->GetParameter(1) + m_timeCorr; // Correct the time to the maximum
328 }
329
330 virtual float GetShapeParameter(size_t index) const override
331 {
332 if (index == 0) return m_tau1;
333 else if (index == 1) return m_tau2;
334 else throw std::runtime_error("Fit parameter does not exist.");
335 }
336
337 virtual float GetBkgdMaxFraction() const override
338 {
339 const TF1* theTF1 = ZDCFitWrapper::GetWrapperTF1();
340 double amp = theTF1->GetParameter(0);
341 if (amp <= 0) return -1;
342
343 double C = theTF1->GetParameter(2);
344 return C / amp;
345 }
346
347 virtual double operator() (const double *x, const double *p) override
348 {
349 double amp = p[0];
350 double t0 = p[1];
351 double C = p[2];
352
353 double deltaT = x[0] - t0;
354
355 double expFermi = amp * m_norm * m_expFermiFunc->operator()(deltaT);
356
357 return expFermi + C; // + bckgd;
358 }
359};
360
362{
363private:
364 float m_tau1{0};
365 float m_tau2{0};
366 float m_norm{0};
367 float m_timeCorr{0};
368
369 std::shared_ptr<TF1> m_expFermiFunc = 0;
370 std::shared_ptr<TF1> m_expFermiPreFunc = 0;
371
372public:
373 ZDCFitExpFermiPrePulse(const std::string& tag, float tmin, float tmax, float tau1, float tau2);
375
376 virtual void DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax) override;
377 virtual void SetT0FitLimits(float tMin, float tMax) override;
378
379
380 virtual void SetInitialPrePulse(float amp, float t0, float /*expamp = 0*/, bool /*fixPrePulseToZero = false*/) override {
381 GetWrapperTF1()->SetParameter(2, std::max(amp, (float) 1.5)); //1.5 here ensures that we're above lower limit
382 GetWrapperTF1()->SetParameter(3, t0);
383 }
384
385 virtual void SetPrePulseT0Range(float tmin, float tmax) override;
386 virtual void SetPostPulseT0Range(float /*tmin*/, float /*tmax*/, float /*initialPostT0*/) override {return;}
387
388 virtual void ConstrainFit() override;
389 virtual void UnconstrainFit() override;
390
391 virtual unsigned int GetPreT0ParIndex() const override {return 3;}
392
393 virtual float GetAmplitude() const override {return GetWrapperTF1()->GetParameter(0); }
394 virtual float GetAmpError() const override {return GetWrapperTF1()->GetParError(0); }
395
396 virtual float GetTau1() const override {return m_tau1;}
397 virtual float GetTau2() const override {return m_tau2;}
398
399 virtual float GetPreT0() const override {return 0;}
400 virtual float GetPreAmp() const override {return 0;}
401
402 virtual float GetPostT0() const override {return 0;}
403 virtual float GetPostAmp() const override {return 0;}
404
405 virtual float GetExpAmp() const override {return 0;}
406
407 virtual float GetTime() const override {
408 return GetWrapperTF1()->GetParameter(1) + m_timeCorr; // Correct the time to the maximum
409 }
410
411 virtual float GetShapeParameter(size_t index) const override
412 {
413 if (index == 0) return m_tau1;
414 else if (index == 1) return m_tau2;
415 else if (index < 5) return GetWrapperTF1()->GetParameter(index);
416 else throw std::runtime_error("Fit parameter does not exist.");
417 }
418
419 virtual float GetBkgdMaxFraction() const override
420 {
421 const TF1* theTF1 = ZDCFitWrapper::GetWrapperTF1();
422
423 double maxTime = GetTime();
424
425 double amp = theTF1->GetParameter(0);
426 if (amp <= 0) return -1;
427
428 double preAmp = theTF1->GetParameter(2);
429 double preT0 = theTF1->GetParameter(3);
430
431 double deltaTPre = maxTime - preT0;
432 double background = preAmp * m_norm * m_expFermiFunc->operator()(deltaTPre);
433
434 return background / (amp + background);
435 }
436
437 virtual double operator() (const double *x, const double *p) override
438 {
439 double t = x[0];
440
441 double amp = p[0];
442 double t0 = p[1];
443 double preAmp = p[2];
444 double preT0 = p[3];
445 double C = p[4];
446
447 double deltaT = t - t0;
448 double deltaTPre = t - preT0;
449
450 // We subtract off the value of the pre-pulse at the minimum time (nominally 0,
451 // but can change if we exclude early samples) to account for the subtraction of the pre-sample
452 //
453 double deltaPresamp = GetTMinAdjust() - preT0;
454
455 // double bckgd = linSlope*t;
456
457 double pulse1 = amp*m_norm*m_expFermiFunc->operator()(deltaT);
458 double pulse2 = preAmp * m_norm * (m_expFermiFunc->operator()(deltaTPre) -
459 m_expFermiFunc->operator()(deltaPresamp));
460
461 return C + pulse1 + pulse2;// + bckgd;
462 }
463};
464
466{
467private:
468 float m_tau1{0};
469 float m_tau2{0};
470 float m_timeCorr{0};
471
472 double m_preNorm{1.};
473
474 std::shared_ptr<TF1> m_expFermiLHCfFunc = 0;
475 std::shared_ptr<TF1> m_expFermiPreFunc = 0;
476
477public:
478 ZDCFitExpFermiLHCfPrePulse(const std::string& tag, float tmin, float tmax, float tau1, float tau2);
480
481 virtual void DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax) override;
482 virtual void SetT0FitLimits(float tMin, float tMax) override;
483
484
485 virtual void SetInitialPrePulse(float amp, float t0, float /*expamp = 0*/, bool /*fixPrePulseToZero = false*/) override
486 {
487 double ampMin, ampMax;
488
489 GetWrapperTF1()->GetParLimits(2, ampMin, ampMax);
490 double initialAmp = std::min<double>(std::max<double>(amp, ampMin), ampMax);
491
492 GetWrapperTF1()->SetParameter(4, initialAmp);
493 GetWrapperTF1()->SetParameter(5, t0);
494 }
495
496 virtual void SetPrePulseT0Range(float tmin, float tmax) override;
497 virtual void SetPostPulseT0Range(float /*tmin*/, float /*tmax*/, float /*initialPostT0*/) override {return;}
498
499 virtual void ConstrainFit() override;
500 virtual void UnconstrainFit() override;
501
502 virtual unsigned int GetPreT0ParIndex() const override {return 3;}
503
504 virtual float GetAmplitude() const override {return GetWrapperTF1()->GetParameter(0); }
505 virtual float GetAmpError() const override {return GetWrapperTF1()->GetParError(0); }
506
507 virtual float GetTau1() const override {return m_tau1;}
508 virtual float GetTau2() const override {return m_tau2;}
509
510 virtual float GetPreT0() const override {return GetWrapperTF1()->GetParameter(3);}
511 virtual float GetPreAmp() const override {return GetWrapperTF1()->GetParameter(3);}
512
513 virtual float GetPostT0() const override {return 0;}
514 virtual float GetPostAmp() const override {return 0;}
515
516 virtual float GetExpAmp() const override {return 0;}
517
518 virtual float GetTime() const override {
519 return GetWrapperTF1()->GetParameter(1) + m_timeCorr; // Correct the time to the maximum
520 }
521
522 virtual float GetShapeParameter(size_t index) const override
523 {
524 if (index == 0) return m_tau1;
525 else if (index == 1) return m_tau2;
526 else if (index < 5) return GetWrapperTF1()->GetParameter(index);
527 else throw std::runtime_error("Fit parameter does not exist.");
528 }
529
530 virtual float GetBkgdMaxFraction() const override
531 {
532 const TF1* theTF1 = ZDCFitWrapper::GetWrapperTF1();
533
534 double maxTime = GetTime();
535
536 double amp = theTF1->GetParameter(0);
537 if (amp <= 0) return -1;
538
539 double preAmp = theTF1->GetParameter(2);
540 double preT0 = theTF1->GetParameter(3);
541
542 double deltaTPre = maxTime - preT0;
543 double background = preAmp * m_preNorm * m_expFermiLHCfFunc->operator()(deltaTPre);
544
545 return background / (amp + background);
546 }
547
548 virtual double operator() (const double *x, const double *p) override
549 {
550 double t = x[0];
551
552 double amp = p[0];
553 double t0 = p[1];
554 double tau1 = p[2];
555 double tau2 = p[3];
556 double preAmp = p[4];
557 double preT0 = p[5];
558 double C = p[6];
559
560 m_expFermiLHCfFunc->SetParameter(0, amp);
561 m_expFermiLHCfFunc->SetParameter(2, tau1);
562 m_expFermiLHCfFunc->SetParameter(3, tau2);
563 m_expFermiLHCfFunc->SetParameter(4, tau2);
564
565 double deltaT = t - t0;
566 double deltaTPre = t - preT0;
567
568 // We subtract off the value of the pre-pulse at the minimum time (nominally 0,
569 // but can change if we exclude early samples) to account for the subtraction of the pre-sample
570 //
571 double deltaPresamp = GetTMinAdjust() - preT0;
572
573 double pulse1 = m_expFermiLHCfFunc->operator()(deltaT);
574 double pulse2 = preAmp * m_preNorm * (m_expFermiPreFunc->operator()(deltaTPre) -
575 m_expFermiPreFunc->operator()(deltaPresamp));
576
577 return C + pulse1 + pulse2;
578 }
579};
580
582{
583private:
584 float m_tau1{0};
585 float m_tau2{0};
586 float m_timeCorr{0};
587 double m_norm;
588
589 std::shared_ptr<TF1> m_expFermiFunc{0};
590 std::shared_ptr<TF1> m_expFermiPreFunc{0};
591
592public:
593 ZDCFitExpFermiPreExp(const std::string& tag, float tmin, float tmax, float tau1, float tau2,
594 float defExpTau, float fixExpTau);
596
597 virtual void DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax) override;
598 virtual void SetT0FitLimits(float tMin, float tMax) override;
599
600 virtual void SetInitialExpPulse(float amp) override
601 {
602 GetWrapperTF1()->SetParameter(2, std::max(amp, (float) 0.5)); //0.5 here ensures that we're above lower limit (0)
603 }
604
605 virtual void ConstrainFit() override;
606 virtual void UnconstrainFit() override;
607
608 virtual float GetAmplitude() const override {return GetWrapperTF1()->GetParameter(0); }
609 virtual float GetAmpError() const override {return GetWrapperTF1()->GetParError(0); }
610
611 virtual float GetTau1() const override {return m_tau1;}
612 virtual float GetTau2() const override {return m_tau2;}
613
614 virtual float GetTime() const override {
615 return GetWrapperTF1()->GetParameter(1) + m_timeCorr; // Correct the time to the maximum
616 }
617
618 virtual float GetExpAmp() const override {return GetWrapperTF1()->GetParameter(2);}
619 virtual float GetExpTau() const override {return GetWrapperTF1()->GetParameter(3);}
620
621 virtual float GetShapeParameter(size_t index) const override
622 {
623 if (index == 0) return m_tau1;
624 else if (index == 1) return m_tau2;
625 else if (index < 5) return GetWrapperTF1()->GetParameter(index);
626 else throw std::runtime_error("Fit parameter does not exist.");
627 }
628
629 virtual float GetBkgdMaxFraction() const override
630 {
631 const TF1* theTF1 = ZDCFitWrapper::GetWrapperTF1();
632 double maxTime = GetTime();
633
634 double amp = theTF1->GetParameter(0);
635 if (amp <= 0) return -1;
636
637 double preAmp = theTF1->GetParameter(2);
638 double preT0 = theTF1->GetParameter(3);
639
640 double deltaTPre = maxTime - preT0;
641 double background = preAmp * m_norm * m_expFermiFunc->operator()(deltaTPre);
642
643 return background / (amp + background);
644 }
645
646 virtual double operator() (const double *x, const double *p) override
647 {
648 double t = x[0];
649
650 double amp = p[0];
651 double t0 = p[1];
652 double expAmp = p[2];
653 double expTau = p[3];
654 double expSqrtTau = p[4];
655 double C = p[5];
656
657 double deltaT = t - t0;
658 double pulse = amp * m_norm * m_expFermiFunc->operator()(deltaT);
659
660 // We subtract off the value of the exponential pulse at the minimum time (nominally 0),
661 // because it would have been included in the baseline subtraction
662 //
663 double tRef = GetTMinAdjust();
664 double expPre = 0;
665 if (t > 0 && std::abs(expSqrtTau)>1e-6) expPre = expAmp * (std::exp(-t/expTau-expSqrtTau*std::sqrt(t)) - std::exp(-tRef/expTau));
666 else expPre = expAmp * (std::exp(-t/expTau) - std::exp(-tRef/expTau));
667
668 return C + pulse + expPre;
669 }
670};
671
673{
674private:
675 float m_tau1{0};
676 float m_tau2{0};
677 float m_timeCorr{0};
678
679 std::shared_ptr<TF1> m_expFermiLHCfFunc{};
680 std::shared_ptr<TF1> m_expFermiLHCfPreFunc{};
681
682public:
683 ZDCFitExpFermiLHCfPreExp(const std::string& tag, float tmin, float tmax, float tau1, float tau2,
684 float defExpTau, float fixExpTau);
686
687 virtual void DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax) override;
688 virtual void SetT0FitLimits(float tMin, float tMax) override;
689
690 virtual void SetInitialExpPulse(float amp) override
691 {
692 GetWrapperTF1()->SetParameter(4, std::max(amp, (float) 0.5)); //0.5 here ensures that we're above lower limit (0)
693 }
694
695 virtual void ConstrainFit() override;
696 virtual void UnconstrainFit() override;
697
698 virtual float GetAmplitude() const override {return GetWrapperTF1()->GetParameter(0); }
699 virtual float GetAmpError() const override {return GetWrapperTF1()->GetParError(0); }
700
701 virtual float GetTau1() const override {return m_tau1;}
702 virtual float GetTau2() const override {return m_tau2;}
703
704 virtual float GetTime() const override {
705 const TF1* theTF1 = GetWrapperTF1();
706
707 float fitT0 = theTF1->GetParameter(1);
708
709 float tau1 = theTF1->GetParameter(2);
710 float tau2 = theTF1->GetParameter(3);
711
712 // Correct the time to the maximum
713 //
714 if (tau2 > tau1) fitT0 += tau1 * std::log(tau2 / tau1 - 1.0);
715 return fitT0;
716 }
717
718 virtual float GetExpAmp() const override {return GetWrapperTF1()->GetParameter(4);}
719 virtual float GetExpTau() const override {return GetWrapperTF1()->GetParameter(5);}
720
721 virtual float GetShapeParameter(size_t index) const override
722 {
723 if (index == 0) return m_tau1;
724 else if (index == 1) return m_tau2;
725 else if (index < 5) return GetWrapperTF1()->GetParameter(index);
726 else throw std::runtime_error("Fit parameter does not exist.");
727 }
728
729 virtual float GetBkgdMaxFraction() const override
730 {
731 const TF1* theTF1 = ZDCFitWrapper::GetWrapperTF1();
732 double amp = theTF1->GetParameter(0);
733 if (amp <= 0) return -1;
734
735 double maxTime = GetTime();
736
737 double expAmp = theTF1->GetParameter(4);
738 double expTau = theTF1->GetParameter(5);
739 double bexpSqrt = theTF1->GetParameter(6);
740
741 double tRef = GetTMinAdjust();
742 double expPre = expAmp * (std::exp(-maxTime/expTau - bexpSqrt*maxTime*maxTime) - std::exp(-tRef/expTau - bexpSqrt*tRef*tRef));
743
744 return expPre / (amp + expPre);
745 }
746
747 virtual double operator() (const double *x, const double *p) override
748 {
749 double t = x[0];
750
751 double amp = p[0];
752 double t0 = p[1];
753
754 double tau1 = p[2];
755 double tau2 = p[3];
756
757 double expAmp = p[4];
758 double expTau = p[5];
759 double bexpSqrt = p[6];
760 double reflFrac = p[7];
761
762 m_expFermiLHCfFunc->SetParameter(0, amp);
763 m_expFermiLHCfFunc->SetParameter(2, tau1);
764 m_expFermiLHCfFunc->SetParameter(3, tau2);
765 m_expFermiLHCfFunc->SetParameter(6, reflFrac);
766
767 m_timeCorr = m_tau1 * std::log(m_tau2 / m_tau1 - 1.0);
768
769 double deltaT = t - t0;
770 double pulse = m_expFermiLHCfFunc->operator()(deltaT);
771
772 // We subtract off the value of the exponential pulse at the minimum time (nominally 0),
773 // because it would have been included in the baseline subtraction
774 //
775 double tRef = GetTMinAdjust();
776 double expPre = 0;
777
778 expPre = expAmp * (std::exp(-t/expTau - bexpSqrt*t*t) - std::exp(-tRef/expTau - bexpSqrt*tRef*tRef));
779
780 return pulse + expPre;
781 }
782};
783
784// ----------------------------------------------------------------------
786{
787private:
788 float m_tau1;
789 float m_tau2;
790
791 float m_norm;
793
794 std::shared_ptr<TF1> m_expFermiFunc;
795
796public:
797
798 ZDCFitExpFermiLinearFixedTaus(const std::string& tag, float tmin, float tmax, float tau1, float tau2);
799
801
802 virtual void DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax) override;
803 virtual void SetT0FitLimits(float tMin, float tMax) override;
804
805 virtual void ConstrainFit() override;
806 virtual void UnconstrainFit() override;
807
808 virtual float GetAmplitude() const override {return GetWrapperTF1()->GetParameter(0); }
809 virtual float GetAmpError() const override {return GetWrapperTF1()->GetParError(0); }
810
811 virtual float GetTau1() const override {return m_tau1;}
812 virtual float GetTau2() const override {return m_tau2;}
813
814 virtual float GetTime() const override {
815 return GetWrapperTF1()->GetParameter(1) + m_timeCorr; // Correct the time to the maximum
816 }
817
818 virtual float GetShapeParameter(size_t index) const override
819 {
820 if (index == 0) return m_tau1;
821 else if (index == 1) return m_tau2;
822 else throw std::runtime_error("Fit parameter does not exist.");
823 }
824
825 virtual float GetBkgdMaxFraction() const override
826 {
827 const TF1* theTF1 = ZDCFitWrapper::GetWrapperTF1();
828 double amp = theTF1->GetParameter(0);
829 if (amp <= 0) return -1;
830
831 double slope = theTF1->GetParameter(2);
832
833 double background = slope * GetTime();
834 return background / amp;
835 }
836
837 virtual double operator() (const double *x, const double *p) override
838 {
839 double amp = p[0];
840 double t0 = p[1];
841 double deltaT = x[0] - t0;
842
843 double bckgd = p[2] * x[0] + p[3];
844
845 double expFermi = amp * m_norm * m_expFermiFunc->operator()(deltaT);
846
847 return expFermi + bckgd;
848 }
849};
850
851// ----------------------------------------------------------------------
853{
854private:
855 float m_tau1;
856 float m_tau2;
857 float m_norm;
859 std::shared_ptr<TF1> m_expFermiFunc;
860
861public:
862 ZDCFitExpFermiLinearPrePulse(const std::string& tag, float tmin, float tmax, float tau1, float tau2);
864
865 virtual void DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax) override;
866 virtual void SetT0FitLimits(float tMin, float tMax) override;
867
868 virtual void ConstrainFit() override;
869 virtual void UnconstrainFit() override;
870
871 virtual void SetInitialPrePulse(float amp, float t0, float /*expamp = 0*/, bool /*fixPrePulseToZero = false*/) override {
872 GetWrapperTF1()->SetParameter(2, std::max(amp, (float) 1.5)); //1.5 here ensures that we're above lower limit
873 GetWrapperTF1()->SetParameter(3, t0);
874 }
875
876 virtual void SetPrePulseT0Range(float tmin, float tmax) override;
877 virtual void SetPostPulseT0Range(float /*tmin*/, float /*tmax*/, float /*initialPostT0*/) override {return;}
878
879 unsigned int GetPreT0ParIndex() const override {return 3;}
880
881 virtual float GetAmplitude() const override {return GetWrapperTF1()->GetParameter(0); }
882 virtual float GetAmpError() const override {return GetWrapperTF1()->GetParError(0); }
883
884 virtual float GetTau1() const override {return m_tau1;}
885 virtual float GetTau2() const override {return m_tau2;}
886
887 virtual float GetPreT0() const override {
888 float fitPreT0 = GetWrapperTF1()->GetParameter(3);
889
890 // Correct the time to the maximum
891 //
892 fitPreT0 += m_timeCorr;
893
894 return fitPreT0;
895 }
896 virtual float GetPreAmp() const override {return GetWrapperTF1()->GetParameter(2);}
897
898 virtual float GetPostT0() const override {return 0;}
899 virtual float GetPostAmp() const override {return 0;}
900
901 virtual float GetExpAmp() const override {return 0;}
902
903 virtual float GetTime() const override {
904 return GetWrapperTF1()->GetParameter(1) + m_timeCorr; // Correct the time to the maximum
905 }
906
907 virtual float GetShapeParameter(size_t index) const override
908 {
909 if (index == 0) return m_tau1;
910 else if (index == 1) return m_tau2;
911 else if (index < 5) return GetWrapperTF1()->GetParameter(index);
912 else throw std::runtime_error("Fit parameter does not exist.");
913 }
914
915 virtual float GetBkgdMaxFraction() const override
916 {
917 const TF1* theTF1 = ZDCFitWrapper::GetWrapperTF1();
918
919 double maxTime = GetTime();
920
921 double amp = theTF1->GetParameter(0);
922 if (amp <= 0) return -1;
923
924 double preAmp = theTF1->GetParameter(2);
925 double preT0 = theTF1->GetParameter(3);
926 double slope = theTF1->GetParameter(4);
927
928 double deltaTPre = maxTime - preT0;
929
930 double background = slope * maxTime + preAmp * m_norm * (m_expFermiFunc->operator()(deltaTPre) -
931 m_expFermiFunc->operator()(-preT0));
932
933 return background / amp;
934 }
935
936 virtual double operator() (const double *x, const double *p) override
937 {
938 double t = x[0];
939
940 double amp = p[0];
941 double t0 = p[1];
942 double preAmp = p[2];
943 double preT0 = p[3];
944 double linSlope = p[4];
945
946 double deltaT = t - t0;
947 double deltaTPre = t - preT0;
948
949 // We subtract off the value of the pre-pulse at the minimum time (nominally 0,
950 // but can change if we exclude early samples) to account for the subtraction of the pre-sample
951 //
952 double deltaPresamp = GetTMinAdjust() - preT0;
953
954 double pulse1 = amp * m_norm * m_expFermiFunc->operator()(deltaT);
955 double pulse2 = preAmp * m_norm * (m_expFermiFunc->operator()(deltaTPre) -
956 m_expFermiFunc->operator()(deltaPresamp));
957
958 double bckgd = linSlope * (t - deltaPresamp) + p[5];
959
960 return pulse1 + pulse2 + bckgd;
961 }
962};
963
964
965
966// ----------------------------------------------------------------------
968{
969private:
970 float m_tau1;
971 float m_tau2;
972 float m_norm;
974 std::shared_ptr<TF1> m_expFermiFunc;
975
976public:
977 ZDCFitComplexPrePulse(const std::string& tag, float tmin, float tmax, float tau1, float tau2);
979
980 virtual void DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax) override;
981 virtual void SetT0FitLimits(float tMin, float tMax) override;
982
983 virtual void SetInitialPrePulse(float amp, float t0, float expamp, bool /*fixPrePulseToZero = false*/) override {
984 GetWrapperTF1()->SetParameter(2, std::max(amp, (float) 1.5)); //1.5 here ensures that we're above lower limit
985 GetWrapperTF1()->SetParameter(3, t0);
986 GetWrapperTF1()->SetParameter(6, std::max(std::abs(expamp), (float) 1.5));
987 }
988
989 virtual void ConstrainFit() override;
990 virtual void UnconstrainFit() override;
991
992 virtual void SetPrePulseT0Range(float tmin, float tmax) override;
993 virtual void SetPostPulseT0Range(float /*tmin*/, float /*tmax*/, float /*initialPostT0*/) override {return;}
994
995 unsigned int GetPreT0ParIndex() const override {return 3;}
996
997 virtual float GetAmplitude() const override {return GetWrapperTF1()->GetParameter(0); }
998 virtual float GetAmpError() const override {return GetWrapperTF1()->GetParError(0); }
999
1000 virtual float GetTau1() const override {return m_tau1;}
1001 virtual float GetTau2() const override {return m_tau2;}
1002
1003 virtual float GetPreT0() const override {
1004 float fitPreT0 = GetWrapperTF1()->GetParameter(3);
1005
1006 // Correct the time to the maximum
1007 //
1008 fitPreT0 += m_timeCorr;
1009
1010 return fitPreT0;
1011 }
1012 virtual float GetPreAmp() const override {return GetWrapperTF1()->GetParameter(2);}
1013
1014 virtual float GetPostT0() const override {return 0;}
1015 virtual float GetPostAmp() const override {return 0;}
1016
1017 virtual float GetExpAmp() const override {return GetWrapperTF1()->GetParameter(6);}
1018
1019 virtual float GetTime() const override {
1020 return GetWrapperTF1()->GetParameter(1) + m_timeCorr; // Correct the time to the maximum
1021 }
1022
1023 virtual float GetShapeParameter(size_t index) const override
1024 {
1025 if (index == 0) return m_tau1;
1026 else if (index == 1) return m_tau2;
1027 else if (index < 5) return GetWrapperTF1()->GetParameter(index);
1028 else throw std::runtime_error("Fit parameter does not exist.");
1029 }
1030
1031 virtual float GetBkgdMaxFraction() const override
1032 {
1033 const TF1* theTF1 = ZDCFitWrapper::GetWrapperTF1();
1034
1035 double maxTime = GetTime();
1036
1037 double amp = theTF1->GetParameter(0);
1038 if (amp <= 0) return -1;
1039
1040 double preAmp = theTF1->GetParameter(2);
1041 double preT0 = theTF1->GetParameter(3);
1042 double slope = theTF1->GetParameter(4);
1043
1044 double deltaTPre = maxTime - preT0;
1045
1046 double background = slope * maxTime + preAmp * m_norm * (m_expFermiFunc->operator()(deltaTPre) -
1047 m_expFermiFunc->operator()(-preT0));
1048
1049 return background / amp;
1050 }
1051
1052 virtual double operator() (const double *x, const double *p) override
1053 {
1054 double t = x[0];
1055
1056 double amp = p[0];
1057 double t0 = p[1];
1058 double preAmp = p[2];
1059 double preT0 = p[3];
1060 double linSlope = p[4];
1061 double linConst = p[5];
1062 double expamp = p[6];
1063
1064 double deltaT = t - t0;
1065 double deltaTPre = t - preT0;
1066
1067 // We subtract off the value of the pre-pulse at the minimum time (nominally 0,
1068 // but can change if we exclude early samples) to account for the subtraction of the pre-sample
1069 //
1070 double deltaPresamp = GetTMinAdjust() - preT0;
1071
1072 double pulse1 = amp * m_norm * m_expFermiFunc->operator()(deltaT);
1073 double pulse2 = preAmp * m_norm * (m_expFermiFunc->operator()(deltaTPre) - m_expFermiFunc->operator()(deltaPresamp));
1074
1075 double linBG = linSlope * (t - deltaPresamp) + linConst;
1076 double expBG = expamp * std::exp(-(t) / m_tau2) - expamp; // deltaPresamp
1077
1078 return pulse1 + pulse2 + linBG + expBG;
1079 }
1080};
1081
1082
1083// ----------------------------------------------------------------------
1085{
1086private:
1087 float m_tau1;
1088 float m_tau2;
1089 float m_norm;
1091 std::shared_ptr<TF1> m_expFermiFunc;
1092
1093public:
1094 ZDCFitGeneralPulse(const std::string& tag, float tmin, float tmax, float tau1, float tau2);
1096
1097 virtual void DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax) override;
1098 virtual void SetT0FitLimits(float tMin, float tMax) override;
1099
1100 virtual void SetInitialPrePulse(float amp, float t0, float expamp, bool fixPrePulseToZero) override {
1101 GetWrapperTF1()->ReleaseParameter(2);
1102 GetWrapperTF1()->ReleaseParameter(3);
1103 GetWrapperTF1()->SetParameter(2, std::max(amp, (float) 1.5)); //1.5 here ensures that we're above lower limit
1104 GetWrapperTF1()->SetParameter(3, std::max(t0, (float) 20.0));
1105 GetWrapperTF1()->SetParameter(6, std::max(std::abs(expamp), (float) 1.5));
1106
1107 if (fixPrePulseToZero) {
1108 GetWrapperTF1()->FixParameter(2, 0. );
1109 GetWrapperTF1()->FixParameter(3, 20.);
1110 }
1111 }
1112
1113 virtual void ConstrainFit() override;
1114 virtual void UnconstrainFit() override;
1115
1116 virtual void SetPrePulseT0Range(float tmin, float tmax) override;
1117 virtual void SetPostPulseT0Range(float tmin, float tmax, float initialPostT0) override;
1118
1119 unsigned int GetPreT0ParIndex() const override {return 3;}
1120
1121 virtual float GetAmplitude() const override {return GetWrapperTF1()->GetParameter(0); }
1122 virtual float GetAmpError() const override {return GetWrapperTF1()->GetParError(0); }
1123
1124 virtual float GetTau1() const override {return m_tau1;}
1125 virtual float GetTau2() const override {return m_tau2;}
1126
1127 virtual float GetPreT0() const override {
1128 float fitPreT0 = GetWrapperTF1()->GetParameter(3);
1129
1130 // Correct the time to the maximum
1131 //
1132 fitPreT0 += m_timeCorr;
1133
1134 return fitPreT0;
1135 }
1136 virtual float GetPreAmp() const override {return GetWrapperTF1()->GetParameter(2);}
1137
1138 virtual float GetPostT0() const override {
1139 float fitPostT0 = GetWrapperTF1()->GetParameter(8);
1140
1141 // Correct the time to the maximum
1142 //
1143 fitPostT0 += m_timeCorr;
1144
1145 return fitPostT0;
1146 }
1147 virtual float GetPostAmp() const override {return GetWrapperTF1()->GetParameter(7);}
1148
1149 virtual float GetExpAmp() const override {return GetWrapperTF1()->GetParameter(6);}
1150
1151 virtual float GetTime() const override {
1152 return GetWrapperTF1()->GetParameter(1) + m_timeCorr; // Correct the time to the maximum
1153 }
1154
1155 virtual float GetShapeParameter(size_t index) const override
1156 {
1157 if (index == 0) return m_tau1;
1158 else if (index == 1) return m_tau2;
1159 else if (index < 5) return GetWrapperTF1()->GetParameter(index);
1160 else throw std::runtime_error("Fit parameter does not exist.");
1161 }
1162
1163 virtual float GetBkgdMaxFraction() const override
1164 {
1165 const TF1* theTF1 = ZDCFitWrapper::GetWrapperTF1();
1166
1167 double maxTime = GetTime();
1168
1169 double amp = theTF1->GetParameter(0);
1170 if (amp <= 0) return -1;
1171 double preAmp = theTF1->GetParameter(2);
1172 double preT0 = theTF1->GetParameter(3);
1173 double slope = theTF1->GetParameter(4);
1174
1175 double deltaTPre = maxTime - preT0;
1176
1177 double background = slope * maxTime + preAmp * m_norm * (m_expFermiFunc->operator()(deltaTPre) -
1178 m_expFermiFunc->operator()(-preT0));
1179
1180 return background / amp;
1181 }
1182
1183 virtual double operator() (const double *x, const double *p) override
1184 {
1185 double t = x[0];
1186
1187 double amp = p[0];
1188 double t0 = p[1];
1189 double preAmp = p[2];
1190 double preT0 = p[3];
1191 double linSlope = p[4];
1192 double linConst = p[5];
1193 double expamp = p[6];
1194 double postAmp = p[7];
1195 double postT0 = p[8];
1196
1197 double deltaT = t - t0;
1198 double deltaTPre = t - preT0;
1199 double deltaTPost = t - postT0;
1200
1201 // We subtract off the value of the pre-pulse at the minimum time (nominally 0,
1202 // but can change if we exclude early samples) to account for the subtraction of the pre-sample
1203 //
1204 double deltaPresamp = GetTMinAdjust() - preT0;
1205
1206 double pulse1 = amp * m_norm * m_expFermiFunc->operator()(deltaT);
1207 double pulse2 = preAmp * m_norm * (m_expFermiFunc->operator()(deltaTPre) - m_expFermiFunc->operator()(deltaPresamp));
1208 double pulse3 = postAmp * m_norm * m_expFermiFunc->operator()(deltaTPost);
1209
1210 double linBG = linSlope * t + linConst;
1211 double expBG = expamp * std::exp(-(t) / m_tau2) - expamp * std::exp(-(GetTMinAdjust()) / m_tau2); // deltaPresamp
1212
1213 return pulse1 + pulse2 + pulse3 + linBG + expBG;
1214 }
1215};
1216
1217double ZDCFermiExpFit(const double* xvec, const double* pvec)
1218{
1219 double t = xvec[0];
1220
1221 double amp = pvec[0];
1222 double t0 = pvec[1];
1223 double tau1 = pvec[2];
1224 double tau2 = pvec[3];
1225 double C = pvec[4];
1226
1227 double tauRatio = tau2 / tau1;
1228 double tauRatioMinunsOne = tauRatio - 1;
1229
1230 double norm = (std::pow(1. / tauRatioMinunsOne, 1. / (1 + tauRatio)) /
1231 ( 1 + std::pow(1. / tauRatioMinunsOne, 1. / (1 + 1 / tauRatio))));
1232
1233 double deltaT = t - t0;
1234 if (deltaT < 0) deltaT = 0;
1235
1236 double expTerm = std::exp(-deltaT / tau2);
1237 double fermiTerm = 1. / (1. + std::exp(-(t - t0) / tau1));
1238
1239 return amp * expTerm * fermiTerm / norm + C;
1240}
1241
1242double ZDCFermiExpFitRefl(const double* xvec, const double* pvec)
1243{
1244 double t = xvec[0];
1245
1246 double amp = pvec[0];
1247 double t0 = pvec[1];
1248 double tau1 = pvec[2];
1249 double tau2 = pvec[3];
1250 double C = pvec[4];
1251
1252 double refldelay = pvec[5];
1253 double reflFrac = pvec[6];
1254 double reflwidth = pvec[7];
1255 double delta = pvec[8];
1256
1257 double tauRatio = tau2 / tau1;
1258 double tauRatioMinunsOne = tauRatio - 1;
1259
1260 double norm = std::pow(1. / tauRatioMinunsOne, 1. / (1 + tauRatio)) /
1261 ( 1 + std::pow(1. / tauRatioMinunsOne, 1. / (1 + 1 / tauRatio))) ;
1262
1263 double deltaT = t - t0;
1264 if (deltaT < 0) deltaT = 0;
1265
1266 // Note: the small constant added here accounts for the very long tail on the pulse
1267 // which doesn't go to zero over the time range that we sample
1268 //
1269 double expTerm = delta + std::exp(-deltaT / tau2);
1270 double fermiTerm = 1. / (1. + std::exp(-(t - t0) / tau1));
1271
1272 double deltaTRefl = deltaT - refldelay;
1273 double reflTerm = -reflFrac*amp*std::exp(-0.5*deltaTRefl*deltaTRefl/reflwidth/reflwidth);
1274
1275 return amp * expTerm * fermiTerm / norm + C + reflTerm;
1276}
1277
1278#endif
std::array< fp_t, 2 > pvec
static Double_t t0
#define x
double ZDCFermiExpFit(const double *xvec, const double *pvec)
double ZDCFermiExpFitRefl(const double *xvec, const double *pvec)
Define macros for attributes used to control the static checker.
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
virtual float GetPreAmp() const override
virtual float GetTau1() const override
virtual float GetShapeParameter(size_t index) const override
virtual float GetBkgdMaxFraction() const override
virtual float GetPostAmp() const override
virtual float GetExpAmp() const override
virtual float GetTime() const override
virtual void SetPostPulseT0Range(float, float, float) override
virtual float GetAmpError() const override
virtual float GetPreT0() const override
virtual float GetTau2() const override
virtual float GetPostT0() const override
ZDCFitComplexPrePulse(const std::string &tag, float tmin, float tmax, float tau1, float tau2)
virtual void SetInitialPrePulse(float amp, float t0, float expamp, bool) override
unsigned int GetPreT0ParIndex() const override
std::shared_ptr< TF1 > m_expFermiFunc
virtual float GetAmplitude() const override
ZDCFitExpFermiFixedTaus(const std::string &tag, float tmin, float tmax, float tau1, float tau2)
virtual float GetAmplitude() const override
virtual float GetBkgdMaxFraction() const override
virtual float GetTau1() const override
virtual float GetTime() const override
virtual float GetAmpError() const override
virtual float GetShapeParameter(size_t index) const override
std::shared_ptr< TF1 > m_expFermiFunc
virtual float GetTau2() const override
virtual float GetTau1() const override
virtual float GetExpTau() const override
virtual float GetTau2() const override
std::shared_ptr< TF1 > m_expFermiLHCfFunc
std::shared_ptr< TF1 > m_expFermiLHCfPreFunc
virtual float GetShapeParameter(size_t index) const override
virtual float GetTime() const override
virtual float GetBkgdMaxFraction() const override
virtual float GetExpAmp() const override
ZDCFitExpFermiLHCfPreExp(const std::string &tag, float tmin, float tmax, float tau1, float tau2, float defExpTau, float fixExpTau)
virtual float GetAmplitude() const override
virtual float GetAmpError() const override
virtual void SetInitialExpPulse(float amp) override
virtual unsigned int GetPreT0ParIndex() const override
std::shared_ptr< TF1 > m_expFermiPreFunc
virtual float GetBkgdMaxFraction() const override
virtual float GetAmpError() const override
virtual float GetExpAmp() const override
virtual float GetTau2() const override
std::shared_ptr< TF1 > m_expFermiLHCfFunc
virtual float GetPreT0() const override
virtual void SetPostPulseT0Range(float, float, float) override
virtual float GetPostT0() const override
virtual float GetShapeParameter(size_t index) const override
virtual float GetTime() const override
virtual float GetPreAmp() const override
ZDCFitExpFermiLHCfPrePulse(const std::string &tag, float tmin, float tmax, float tau1, float tau2)
virtual float GetTau1() const override
virtual float GetPostAmp() const override
virtual float GetAmplitude() const override
virtual void SetInitialPrePulse(float amp, float t0, float, bool) override
std::shared_ptr< TF1 > m_expFermiFunc
virtual float GetBkgdMaxFraction() const override
virtual float GetAmpError() const override
virtual float GetTime() const override
ZDCFitExpFermiLinearFixedTaus(const std::string &tag, float tmin, float tmax, float tau1, float tau2)
virtual float GetTau1() const override
virtual float GetShapeParameter(size_t index) const override
virtual float GetTau2() const override
virtual float GetAmplitude() const override
virtual float GetShapeParameter(size_t index) const override
virtual float GetPreT0() const override
virtual float GetPostAmp() const override
virtual float GetBkgdMaxFraction() const override
virtual float GetAmplitude() const override
virtual void SetInitialPrePulse(float amp, float t0, float, bool) override
virtual float GetPostT0() const override
virtual float GetPreAmp() const override
virtual float GetTau1() const override
unsigned int GetPreT0ParIndex() const override
virtual float GetExpAmp() const override
virtual float GetTime() const override
virtual void SetPostPulseT0Range(float, float, float) override
virtual float GetAmpError() const override
virtual float GetTau2() const override
ZDCFitExpFermiLinearPrePulse(const std::string &tag, float tmin, float tmax, float tau1, float tau2)
std::shared_ptr< TF1 > m_expFermiFunc
virtual float GetExpAmp() const override
virtual float GetTau1() const override
virtual float GetAmpError() const override
std::shared_ptr< TF1 > m_expFermiFunc
virtual float GetShapeParameter(size_t index) const override
std::shared_ptr< TF1 > m_expFermiPreFunc
virtual float GetBkgdMaxFraction() const override
virtual float GetAmplitude() const override
virtual void SetInitialExpPulse(float amp) override
virtual float GetExpTau() const override
ZDCFitExpFermiPreExp(const std::string &tag, float tmin, float tmax, float tau1, float tau2, float defExpTau, float fixExpTau)
virtual float GetTime() const override
virtual float GetTau2() const override
std::shared_ptr< TF1 > m_expFermiPreFunc
virtual float GetPostT0() const override
virtual float GetExpAmp() const override
virtual float GetTau1() const override
virtual float GetAmplitude() const override
virtual float GetAmpError() const override
virtual float GetBkgdMaxFraction() const override
std::shared_ptr< TF1 > m_expFermiFunc
virtual void SetInitialPrePulse(float amp, float t0, float, bool) override
virtual void SetPostPulseT0Range(float, float, float) override
virtual float GetPreT0() const override
virtual float GetPostAmp() const override
virtual unsigned int GetPreT0ParIndex() const override
ZDCFitExpFermiPrePulse(const std::string &tag, float tmin, float tmax, float tau1, float tau2)
virtual float GetTime() const override
virtual float GetPreAmp() const override
virtual float GetTau2() const override
virtual float GetShapeParameter(size_t index) const override
virtual float GetTime() const override
virtual double operator()(const double *x, const double *p) override
virtual float GetAmplitude() const override
ZDCFitExpFermiVariableTausLHCf(const std::string &tag, float tmin, float tmax, bool fixTau1, bool fixTau2, float tau1, float tau2)
virtual float GetShapeParameter(size_t index) const override
virtual float GetBkgdMaxFraction() const override
virtual float GetTau1() const override
virtual float GetAmpError() const override
virtual float GetTau2() const override
ZDCFitExpFermiVariableTausRun3(const std::string &tag, float tmin, float tmax, bool fixTau1, bool fixTau2, float tau1, float tau2)
virtual float GetTime() const override
virtual float GetShapeParameter(size_t index) const override
virtual float GetTau2() const override
virtual float GetAmplitude() const override
virtual double operator()(const double *x, const double *p) override
virtual float GetTau1() const override
ZDCFitExpFermiVariableTaus(const std::string &tag, float tmin, float tmax, bool fixTau1, bool fixTau2, float tau1, float tau2)
virtual float GetBkgdMaxFraction() const override
virtual float GetAmpError() const override
virtual float GetPreAmp() const override
virtual float GetAmpError() const override
virtual float GetPostT0() const override
virtual float GetPreT0() const override
virtual float GetAmplitude() const override
virtual float GetTau2() const override
unsigned int GetPreT0ParIndex() const override
virtual float GetPostAmp() const override
std::shared_ptr< TF1 > m_expFermiFunc
virtual float GetShapeParameter(size_t index) const override
virtual float GetExpAmp() const override
virtual float GetTime() const override
virtual void SetInitialPrePulse(float amp, float t0, float expamp, bool fixPrePulseToZero) override
virtual float GetBkgdMaxFraction() const override
virtual float GetTau1() const override
ZDCFitGeneralPulse(const std::string &tag, float tmin, float tmax, float tau1, float tau2)
virtual float GetTau1() const =0
void Initialize(float initialAmp, float initialT0, float ampMin, float ampMax)
float GetTMin() const
virtual float GetBkgdMaxFraction() const =0
virtual void ConstrainFit()=0
virtual TF1 * GetWrapperTF1RawPtr() const
virtual std::shared_ptr< TF1 > GetWrapperTF1()
virtual float GetAmpError() const =0
virtual void UnconstrainFit()=0
float GetT0Max() const
virtual float GetTime() const =0
virtual float GetShapeParameter(size_t index) const =0
virtual ~ZDCFitWrapper()
float GetMinAmp() const
virtual float GetTau2() const =0
float GetMaxAmp() const
virtual const TF1 * GetWrapperTF1() const
float GetT0Min() const
virtual void SetT0FitLimits(float tMin, float tMax)=0
ZDCFitWrapper(const std::shared_ptr< TF1 > &wrapperTF1)
virtual float GetAmplitude() const =0
void SetAmpMinMax(float minAmp, float maxAmp)
virtual void DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax)=0
virtual double operator()(const double *x, const double *p)=0
float GetTMinAdjust() const
void SetT0Range(float t0Min, float t0Max)
float GetTMax() const
std::shared_ptr< TF1 > m_wrapperTF1
virtual float GetExpAmp() const =0
virtual float GetExpTau() const =0
virtual void SetInitialExpPulse(float expamp)=0
float getDefaultExpTau() const
ZDCPreExpFitWrapper(std::shared_ptr< TF1 > wrapperTF1, float defaultExpTau, bool fixTau)
bool fixExpTau() const
virtual float GetPreAmp() const =0
virtual void SetPostPulseT0Range(float tmin, float tmax, float initialPostT0)=0
virtual unsigned int GetPreT0ParIndex() const =0
virtual float GetPreT0() const =0
virtual float GetPostT0() const =0
virtual float GetExpAmp() const =0
virtual void SetPrePulseT0Range(float tmin, float tmax)=0
virtual void SetInitialPrePulse(float amp, float t0, float expamp, bool fixPrePulseToZero)=0
ZDCPrePulseFitWrapper(std::shared_ptr< TF1 > wrapperTF1)
virtual float GetPostAmp() const =0
struct color C
Definition index.py:1