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 double C = theTF1->GetParameter(2);
342
343 return C / amp;
344 }
345
346 virtual double operator() (const double *x, const double *p) override
347 {
348 double amp = p[0];
349 double t0 = p[1];
350 double C = p[2];
351
352 double deltaT = x[0] - t0;
353
354 double expFermi = amp * m_norm * m_expFermiFunc->operator()(deltaT);
355
356 return expFermi + C; // + bckgd;
357 }
358};
359
361{
362private:
363 float m_tau1{0};
364 float m_tau2{0};
365 float m_norm{0};
366 float m_timeCorr{0};
367
368 std::shared_ptr<TF1> m_expFermiFunc = 0;
369 std::shared_ptr<TF1> m_expFermiPreFunc = 0;
370
371public:
372 ZDCFitExpFermiPrePulse(const std::string& tag, float tmin, float tmax, float tau1, float tau2);
374
375 virtual void DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax) override;
376 virtual void SetT0FitLimits(float tMin, float tMax) override;
377
378
379 virtual void SetInitialPrePulse(float amp, float t0, float /*expamp = 0*/, bool /*fixPrePulseToZero = false*/) override {
380 GetWrapperTF1()->SetParameter(2, std::max(amp, (float) 1.5)); //1.5 here ensures that we're above lower limit
381 GetWrapperTF1()->SetParameter(3, t0);
382 }
383
384 virtual void SetPrePulseT0Range(float tmin, float tmax) override;
385 virtual void SetPostPulseT0Range(float /*tmin*/, float /*tmax*/, float /*initialPostT0*/) override {return;}
386
387 virtual void ConstrainFit() override;
388 virtual void UnconstrainFit() override;
389
390 virtual unsigned int GetPreT0ParIndex() const override {return 3;}
391
392 virtual float GetAmplitude() const override {return GetWrapperTF1()->GetParameter(0); }
393 virtual float GetAmpError() const override {return GetWrapperTF1()->GetParError(0); }
394
395 virtual float GetTau1() const override {return m_tau1;}
396 virtual float GetTau2() const override {return m_tau2;}
397
398 virtual float GetPreT0() const override {return 0;}
399 virtual float GetPreAmp() const override {return 0;}
400
401 virtual float GetPostT0() const override {return 0;}
402 virtual float GetPostAmp() const override {return 0;}
403
404 virtual float GetExpAmp() const override {return 0;}
405
406 virtual float GetTime() const override {
407 return GetWrapperTF1()->GetParameter(1) + m_timeCorr; // Correct the time to the maximum
408 }
409
410 virtual float GetShapeParameter(size_t index) const override
411 {
412 if (index == 0) return m_tau1;
413 else if (index == 1) return m_tau2;
414 else if (index < 5) return GetWrapperTF1()->GetParameter(index);
415 else throw std::runtime_error("Fit parameter does not exist.");
416 }
417
418 virtual float GetBkgdMaxFraction() const override
419 {
420 const TF1* theTF1 = ZDCFitWrapper::GetWrapperTF1();
421
422 double maxTime = GetTime();
423
424 double amp = theTF1->GetParameter(0);
425 if (amp <= 0) return -1;
426
427 double preAmp = theTF1->GetParameter(2);
428 double preT0 = theTF1->GetParameter(3);
429
430 double deltaTPre = maxTime - preT0;
431 double background = preAmp * m_norm * m_expFermiFunc->operator()(deltaTPre);
432
433 return background / (amp + background);
434 }
435
436 virtual double operator() (const double *x, const double *p) override
437 {
438 double t = x[0];
439
440 double amp = p[0];
441 double t0 = p[1];
442 double preAmp = p[2];
443 double preT0 = p[3];
444 double C = p[4];
445
446 double deltaT = t - t0;
447 double deltaTPre = t - preT0;
448
449 // We subtract off the value of the pre-pulse at the minimum time (nominally 0,
450 // but can change if we exclude early samples) to account for the subtraction of the pre-sample
451 //
452 double deltaPresamp = GetTMinAdjust() - preT0;
453
454 // double bckgd = linSlope*t;
455
456 double pulse1 = amp*m_norm*m_expFermiFunc->operator()(deltaT);
457 double pulse2 = preAmp * m_norm * (m_expFermiPreFunc->operator()(deltaTPre) -
458 m_expFermiPreFunc->operator()(deltaPresamp));
459
460 return C + pulse1 + pulse2;// + bckgd;
461 }
462};
463
465{
466private:
467 float m_tau1{0};
468 float m_tau2{0};
469 float m_timeCorr{0};
470
471 double m_preNorm{1.};
472
473 std::shared_ptr<TF1> m_expFermiLHCfFunc = 0;
474 std::shared_ptr<TF1> m_expFermiPreFunc = 0;
475
476public:
477 ZDCFitExpFermiLHCfPrePulse(const std::string& tag, float tmin, float tmax, float tau1, float tau2);
479
480 virtual void DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax) override;
481 virtual void SetT0FitLimits(float tMin, float tMax) override;
482
483
484 virtual void SetInitialPrePulse(float amp, float t0, float /*expamp = 0*/, bool /*fixPrePulseToZero = false*/) override
485 {
486 double ampMin, ampMax;
487
488 GetWrapperTF1()->GetParLimits(2, ampMin, ampMax);
489 double initialAmp = std::min<double>(std::max<double>(amp, ampMin), ampMax);
490
491 GetWrapperTF1()->SetParameter(4, initialAmp);
492 GetWrapperTF1()->SetParameter(5, t0);
493 }
494
495 virtual void SetPrePulseT0Range(float tmin, float tmax) override;
496 virtual void SetPostPulseT0Range(float /*tmin*/, float /*tmax*/, float /*initialPostT0*/) override {return;}
497
498 virtual void ConstrainFit() override;
499 virtual void UnconstrainFit() override;
500
501 virtual unsigned int GetPreT0ParIndex() const override {return 3;}
502
503 virtual float GetAmplitude() const override {return GetWrapperTF1()->GetParameter(0); }
504 virtual float GetAmpError() const override {return GetWrapperTF1()->GetParError(0); }
505
506 virtual float GetTau1() const override {return m_tau1;}
507 virtual float GetTau2() const override {return m_tau2;}
508
509 virtual float GetPreT0() const override {return GetWrapperTF1()->GetParameter(3);}
510 virtual float GetPreAmp() const override {return GetWrapperTF1()->GetParameter(3);}
511
512 virtual float GetPostT0() const override {return 0;}
513 virtual float GetPostAmp() const override {return 0;}
514
515 virtual float GetExpAmp() const override {return 0;}
516
517 virtual float GetTime() const override {
518 return GetWrapperTF1()->GetParameter(1) + m_timeCorr; // Correct the time to the maximum
519 }
520
521 virtual float GetShapeParameter(size_t index) const override
522 {
523 if (index == 0) return m_tau1;
524 else if (index == 1) return m_tau2;
525 else if (index < 5) return GetWrapperTF1()->GetParameter(index);
526 else throw std::runtime_error("Fit parameter does not exist.");
527 }
528
529 virtual float GetBkgdMaxFraction() const override
530 {
531 const TF1* theTF1 = ZDCFitWrapper::GetWrapperTF1();
532
533 double maxTime = GetTime();
534
535 double amp = theTF1->GetParameter(0);
536 if (amp <= 0) return 1;
537
538 double preAmp = theTF1->GetParameter(2);
539 double preT0 = theTF1->GetParameter(3);
540
541 double deltaTPre = maxTime - preT0;
542 double background = preAmp * m_preNorm * m_expFermiLHCfFunc->operator()(deltaTPre);
543
544 return background / (amp + background);
545 }
546
547 virtual double operator() (const double *x, const double *p) override
548 {
549 double t = x[0];
550
551 double amp = p[0];
552 double t0 = p[1];
553 double tau1 = p[2];
554 double tau2 = p[3];
555 double preAmp = p[4];
556 double preT0 = p[5];
557 double C = p[6];
558
559 m_expFermiLHCfFunc->SetParameter(0, amp);
560 m_expFermiLHCfFunc->SetParameter(2, tau1);
561 m_expFermiLHCfFunc->SetParameter(3, tau2);
562 m_expFermiLHCfFunc->SetParameter(4, tau2);
563
564 double deltaT = t - t0;
565 double deltaTPre = t - preT0;
566
567 // We subtract off the value of the pre-pulse at the minimum time (nominally 0,
568 // but can change if we exclude early samples) to account for the subtraction of the pre-sample
569 //
570 double deltaPresamp = GetTMinAdjust() - preT0;
571
572 double pulse1 = m_expFermiLHCfFunc->operator()(deltaT);
573 double pulse2 = preAmp * m_preNorm * (m_expFermiPreFunc->operator()(deltaTPre) -
574 m_expFermiPreFunc->operator()(deltaPresamp));
575
576 return C + pulse1 + pulse2;
577 }
578};
579
581{
582private:
583 float m_tau1{0};
584 float m_tau2{0};
585 float m_timeCorr{0};
586 double m_norm;
587
588 std::shared_ptr<TF1> m_expFermiFunc{0};
589 std::shared_ptr<TF1> m_expFermiPreFunc{0};
590
591public:
592 ZDCFitExpFermiPreExp(const std::string& tag, float tmin, float tmax, float tau1, float tau2,
593 float defExpTau, float fixExpTau);
595
596 virtual void DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax) override;
597 virtual void SetT0FitLimits(float tMin, float tMax) override;
598
599 virtual void SetInitialExpPulse(float amp) override
600 {
601 GetWrapperTF1()->SetParameter(2, std::max(amp, (float) 0.5)); //0.5 here ensures that we're above lower limit (0)
602 }
603
604 virtual void ConstrainFit() override;
605 virtual void UnconstrainFit() override;
606
607 virtual float GetAmplitude() const override {return GetWrapperTF1()->GetParameter(0); }
608 virtual float GetAmpError() const override {return GetWrapperTF1()->GetParError(0); }
609
610 virtual float GetTau1() const override {return m_tau1;}
611 virtual float GetTau2() const override {return m_tau2;}
612
613 virtual float GetTime() const override {
614 return GetWrapperTF1()->GetParameter(1) + m_timeCorr; // Correct the time to the maximum
615 }
616
617 virtual float GetExpAmp() const override {return GetWrapperTF1()->GetParameter(2);}
618 virtual float GetExpTau() const override {return GetWrapperTF1()->GetParameter(3);}
619
620 virtual float GetShapeParameter(size_t index) const override
621 {
622 if (index == 0) return m_tau1;
623 else if (index == 1) return m_tau2;
624 else if (index < 5) return GetWrapperTF1()->GetParameter(index);
625 else throw std::runtime_error("Fit parameter does not exist.");
626 }
627
628 virtual float GetBkgdMaxFraction() const override
629 {
630 const TF1* theTF1 = ZDCFitWrapper::GetWrapperTF1();
631 double maxTime = GetTime();
632
633 double amp = theTF1->GetParameter(0);
634 if (amp <= 0) return -1;
635
636 double preAmp = theTF1->GetParameter(2);
637 double preT0 = theTF1->GetParameter(3);
638
639 double deltaTPre = maxTime - preT0;
640 double background = preAmp * m_norm * m_expFermiFunc->operator()(deltaTPre);
641
642 return background / (amp + background);
643 }
644
645 virtual double operator() (const double *x, const double *p) override
646 {
647 double t = x[0];
648
649 double amp = p[0];
650 double t0 = p[1];
651 double expAmp = p[2];
652 double expTau = p[3];
653 double expSqrtTau = p[4];
654 double C = p[5];
655
656 double deltaT = t - t0;
657 double pulse = amp * m_norm * m_expFermiFunc->operator()(deltaT);
658
659 // We subtract off the value of the exponential pulse at the minimum time (nominally 0),
660 // because it would have been included in the baseline subtraction
661 //
662 double tRef = GetTMinAdjust();
663 double expPre = 0;
664 if (t > 0 && std::abs(expSqrtTau)>1e-6) expPre = expAmp * (std::exp(-t/expTau-expSqrtTau*std::sqrt(t)) - std::exp(-tRef/expTau));
665 else expPre = expAmp * (std::exp(-t/expTau) - std::exp(-tRef/expTau));
666
667 return C + pulse + expPre;
668 }
669};
670
672{
673private:
674 float m_tau1{0};
675 float m_tau2{0};
676 float m_timeCorr{0};
677
678 std::shared_ptr<TF1> m_expFermiLHCfFunc{};
679 std::shared_ptr<TF1> m_expFermiLHCfPreFunc{};
680
681public:
682 ZDCFitExpFermiLHCfPreExp(const std::string& tag, float tmin, float tmax, float tau1, float tau2,
683 float defExpTau, float fixExpTau);
685
686 virtual void DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax) override;
687 virtual void SetT0FitLimits(float tMin, float tMax) override;
688
689 virtual void SetInitialExpPulse(float amp) override
690 {
691 GetWrapperTF1()->SetParameter(4, std::max(amp, (float) 0.5)); //0.5 here ensures that we're above lower limit (0)
692 }
693
694 virtual void ConstrainFit() override;
695 virtual void UnconstrainFit() override;
696
697 virtual float GetAmplitude() const override {return GetWrapperTF1()->GetParameter(0); }
698 virtual float GetAmpError() const override {return GetWrapperTF1()->GetParError(0); }
699
700 virtual float GetTau1() const override {return m_tau1;}
701 virtual float GetTau2() const override {return m_tau2;}
702
703 virtual float GetTime() const override {
704 const TF1* theTF1 = GetWrapperTF1();
705
706 float fitT0 = theTF1->GetParameter(1);
707
708 float tau1 = theTF1->GetParameter(2);
709 float tau2 = theTF1->GetParameter(3);
710
711 // Correct the time to the maximum
712 //
713 if (tau2 > tau1) fitT0 += tau1 * std::log(tau2 / tau1 - 1.0);
714 return fitT0;
715 }
716
717 virtual float GetExpAmp() const override {return GetWrapperTF1()->GetParameter(4);}
718 virtual float GetExpTau() const override {return GetWrapperTF1()->GetParameter(5);}
719
720 virtual float GetShapeParameter(size_t index) const override
721 {
722 if (index == 0) return m_tau1;
723 else if (index == 1) return m_tau2;
724 else if (index < 5) return GetWrapperTF1()->GetParameter(index);
725 else throw std::runtime_error("Fit parameter does not exist.");
726 }
727
728 virtual float GetBkgdMaxFraction() const override
729 {
730 const TF1* theTF1 = ZDCFitWrapper::GetWrapperTF1();
731 double amp = theTF1->GetParameter(0);
732 if (amp <= 0) return 1;
733
734 double maxTime = GetTime();
735
736 double expAmp = theTF1->GetParameter(4);
737 double expTau = theTF1->GetParameter(5);
738 double bexpSqrt = theTF1->GetParameter(6);
739
740 double tRef = GetTMinAdjust();
741 double expPre = expAmp * (std::exp(-maxTime/expTau - bexpSqrt*maxTime*maxTime) - std::exp(-tRef/expTau - bexpSqrt*tRef*tRef));
742
743 return expPre / (amp + expPre);
744 }
745
746 virtual double operator() (const double *x, const double *p) override
747 {
748 double t = x[0];
749
750 double amp = p[0];
751 double t0 = p[1];
752
753 double tau1 = p[2];
754 double tau2 = p[3];
755
756 double expAmp = p[4];
757 double expTau = p[5];
758 double bexpSqrt = p[6];
759 double reflFrac = p[7];
760
761 m_expFermiLHCfFunc->SetParameter(0, amp);
762 m_expFermiLHCfFunc->SetParameter(2, tau1);
763 m_expFermiLHCfFunc->SetParameter(3, tau2);
764 m_expFermiLHCfFunc->SetParameter(6, reflFrac);
765
766 m_timeCorr = m_tau1 * std::log(m_tau2 / m_tau1 - 1.0);
767
768 double deltaT = t - t0;
769 double pulse = m_expFermiLHCfFunc->operator()(deltaT);
770
771 // We subtract off the value of the exponential pulse at the minimum time (nominally 0),
772 // because it would have been included in the baseline subtraction
773 //
774 double tRef = GetTMinAdjust();
775 double expPre = 0;
776
777 expPre = expAmp * (std::exp(-t/expTau - bexpSqrt*t*t) - std::exp(-tRef/expTau - bexpSqrt*tRef*tRef));
778
779 return pulse + expPre;
780 }
781};
782
783// ----------------------------------------------------------------------
785{
786private:
787 float m_tau1;
788 float m_tau2;
789
790 float m_norm;
792
793 std::shared_ptr<TF1> m_expFermiFunc;
794
795public:
796
797 ZDCFitExpFermiLinearFixedTaus(const std::string& tag, float tmin, float tmax, float tau1, float tau2);
798
800
801 virtual void DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax) override;
802 virtual void SetT0FitLimits(float tMin, float tMax) override;
803
804 virtual void ConstrainFit() override;
805 virtual void UnconstrainFit() override;
806
807 virtual float GetAmplitude() const override {return GetWrapperTF1()->GetParameter(0); }
808 virtual float GetAmpError() const override {return GetWrapperTF1()->GetParError(0); }
809
810 virtual float GetTau1() const override {return m_tau1;}
811 virtual float GetTau2() const override {return m_tau2;}
812
813 virtual float GetTime() const override {
814 return GetWrapperTF1()->GetParameter(1) + m_timeCorr; // Correct the time to the maximum
815 }
816
817 virtual float GetShapeParameter(size_t index) const override
818 {
819 if (index == 0) return m_tau1;
820 else if (index == 1) return m_tau2;
821 else throw std::runtime_error("Fit parameter does not exist.");
822 }
823
824 virtual float GetBkgdMaxFraction() const override
825 {
826 const TF1* theTF1 = ZDCFitWrapper::GetWrapperTF1();
827 double amp = theTF1->GetParameter(0);
828 double slope = theTF1->GetParameter(2);
829
830 double background = slope * GetTime();
831 return background / amp;
832 }
833
834 virtual double operator() (const double *x, const double *p) override
835 {
836 double amp = p[0];
837 double t0 = p[1];
838 double deltaT = x[0] - t0;
839
840 double bckgd = p[2] * x[0] + p[3];
841
842 double expFermi = amp * m_norm * m_expFermiFunc->operator()(deltaT);
843
844 return expFermi + bckgd;
845 }
846};
847
848// ----------------------------------------------------------------------
850{
851private:
852 float m_tau1;
853 float m_tau2;
854 float m_norm;
856 std::shared_ptr<TF1> m_expFermiFunc;
857
858public:
859 ZDCFitExpFermiLinearPrePulse(const std::string& tag, float tmin, float tmax, float tau1, float tau2);
861
862 virtual void DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax) override;
863 virtual void SetT0FitLimits(float tMin, float tMax) override;
864
865 virtual void ConstrainFit() override;
866 virtual void UnconstrainFit() override;
867
868 virtual void SetInitialPrePulse(float amp, float t0, float /*expamp = 0*/, bool /*fixPrePulseToZero = false*/) override {
869 GetWrapperTF1()->SetParameter(2, std::max(amp, (float) 1.5)); //1.5 here ensures that we're above lower limit
870 GetWrapperTF1()->SetParameter(3, t0);
871 }
872
873 virtual void SetPrePulseT0Range(float tmin, float tmax) override;
874 virtual void SetPostPulseT0Range(float /*tmin*/, float /*tmax*/, float /*initialPostT0*/) override {return;}
875
876 unsigned int GetPreT0ParIndex() const override {return 3;}
877
878 virtual float GetAmplitude() const override {return GetWrapperTF1()->GetParameter(0); }
879 virtual float GetAmpError() const override {return GetWrapperTF1()->GetParError(0); }
880
881 virtual float GetTau1() const override {return m_tau1;}
882 virtual float GetTau2() const override {return m_tau2;}
883
884 virtual float GetPreT0() const override {
885 float fitPreT0 = GetWrapperTF1()->GetParameter(3);
886
887 // Correct the time to the maximum
888 //
889 fitPreT0 += m_timeCorr;
890
891 return fitPreT0;
892 }
893 virtual float GetPreAmp() const override {return GetWrapperTF1()->GetParameter(2);}
894
895 virtual float GetPostT0() const override {return 0;}
896 virtual float GetPostAmp() const override {return 0;}
897
898 virtual float GetExpAmp() const override {return 0;}
899
900 virtual float GetTime() const override {
901 return GetWrapperTF1()->GetParameter(1) + m_timeCorr; // Correct the time to the maximum
902 }
903
904 virtual float GetShapeParameter(size_t index) const override
905 {
906 if (index == 0) return m_tau1;
907 else if (index == 1) return m_tau2;
908 else if (index < 5) return GetWrapperTF1()->GetParameter(index);
909 else throw std::runtime_error("Fit parameter does not exist.");
910 }
911
912 virtual float GetBkgdMaxFraction() const override
913 {
914 const TF1* theTF1 = ZDCFitWrapper::GetWrapperTF1();
915
916 double maxTime = GetTime();
917
918 double amp = theTF1->GetParameter(0);
919 double preAmp = theTF1->GetParameter(2);
920 double preT0 = theTF1->GetParameter(3);
921 double slope = theTF1->GetParameter(4);
922
923 double deltaTPre = maxTime - preT0;
924
925 double background = slope * maxTime + preAmp * m_norm * (m_expFermiFunc->operator()(deltaTPre) -
926 m_expFermiFunc->operator()(-preT0));
927
928 return background / amp;
929 }
930
931 virtual double operator() (const double *x, const double *p) override
932 {
933 double t = x[0];
934
935 double amp = p[0];
936 double t0 = p[1];
937 double preAmp = p[2];
938 double preT0 = p[3];
939 double linSlope = p[4];
940
941 double deltaT = t - t0;
942 double deltaTPre = t - preT0;
943
944 // We subtract off the value of the pre-pulse at the minimum time (nominally 0,
945 // but can change if we exclude early samples) to account for the subtraction of the pre-sample
946 //
947 double deltaPresamp = GetTMinAdjust() - preT0;
948
949 double pulse1 = amp * m_norm * m_expFermiFunc->operator()(deltaT);
950 double pulse2 = preAmp * m_norm * (m_expFermiFunc->operator()(deltaTPre) -
951 m_expFermiFunc->operator()(deltaPresamp));
952
953 double bckgd = linSlope * (t - deltaPresamp) + p[5];
954
955 return pulse1 + pulse2 + bckgd;
956 }
957};
958
959
960
961// ----------------------------------------------------------------------
963{
964private:
965 float m_tau1;
966 float m_tau2;
967 float m_norm;
969 std::shared_ptr<TF1> m_expFermiFunc;
970
971public:
972 ZDCFitComplexPrePulse(const std::string& tag, float tmin, float tmax, float tau1, float tau2);
974
975 virtual void DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax) override;
976 virtual void SetT0FitLimits(float tMin, float tMax) override;
977
978 virtual void SetInitialPrePulse(float amp, float t0, float expamp, bool /*fixPrePulseToZero = false*/) override {
979 GetWrapperTF1()->SetParameter(2, std::max(amp, (float) 1.5)); //1.5 here ensures that we're above lower limit
980 GetWrapperTF1()->SetParameter(3, t0);
981 GetWrapperTF1()->SetParameter(6, std::max(std::abs(expamp), (float) 1.5));
982 }
983
984 virtual void ConstrainFit() override;
985 virtual void UnconstrainFit() override;
986
987 virtual void SetPrePulseT0Range(float tmin, float tmax) override;
988 virtual void SetPostPulseT0Range(float /*tmin*/, float /*tmax*/, float /*initialPostT0*/) override {return;}
989
990 unsigned int GetPreT0ParIndex() const override {return 3;}
991
992 virtual float GetAmplitude() const override {return GetWrapperTF1()->GetParameter(0); }
993 virtual float GetAmpError() const override {return GetWrapperTF1()->GetParError(0); }
994
995 virtual float GetTau1() const override {return m_tau1;}
996 virtual float GetTau2() const override {return m_tau2;}
997
998 virtual float GetPreT0() const override {
999 float fitPreT0 = GetWrapperTF1()->GetParameter(3);
1000
1001 // Correct the time to the maximum
1002 //
1003 fitPreT0 += m_timeCorr;
1004
1005 return fitPreT0;
1006 }
1007 virtual float GetPreAmp() const override {return GetWrapperTF1()->GetParameter(2);}
1008
1009 virtual float GetPostT0() const override {return 0;}
1010 virtual float GetPostAmp() const override {return 0;}
1011
1012 virtual float GetExpAmp() const override {return GetWrapperTF1()->GetParameter(6);}
1013
1014 virtual float GetTime() const override {
1015 return GetWrapperTF1()->GetParameter(1) + m_timeCorr; // Correct the time to the maximum
1016 }
1017
1018 virtual float GetShapeParameter(size_t index) const override
1019 {
1020 if (index == 0) return m_tau1;
1021 else if (index == 1) return m_tau2;
1022 else if (index < 5) return GetWrapperTF1()->GetParameter(index);
1023 else throw std::runtime_error("Fit parameter does not exist.");
1024 }
1025
1026 virtual float GetBkgdMaxFraction() const override
1027 {
1028 const TF1* theTF1 = ZDCFitWrapper::GetWrapperTF1();
1029
1030 double maxTime = GetTime();
1031
1032 double amp = theTF1->GetParameter(0);
1033 double preAmp = theTF1->GetParameter(2);
1034 double preT0 = theTF1->GetParameter(3);
1035 double slope = theTF1->GetParameter(4);
1036
1037 double deltaTPre = maxTime - preT0;
1038
1039 double background = slope * maxTime + preAmp * m_norm * (m_expFermiFunc->operator()(deltaTPre) -
1040 m_expFermiFunc->operator()(-preT0));
1041
1042 return background / amp;
1043 }
1044
1045 virtual double operator() (const double *x, const double *p) override
1046 {
1047 double t = x[0];
1048
1049 double amp = p[0];
1050 double t0 = p[1];
1051 double preAmp = p[2];
1052 double preT0 = p[3];
1053 double linSlope = p[4];
1054 double linConst = p[5];
1055 double expamp = p[6];
1056
1057 double deltaT = t - t0;
1058 double deltaTPre = t - preT0;
1059
1060 // We subtract off the value of the pre-pulse at the minimum time (nominally 0,
1061 // but can change if we exclude early samples) to account for the subtraction of the pre-sample
1062 //
1063 double deltaPresamp = GetTMinAdjust() - preT0;
1064
1065 double pulse1 = amp * m_norm * m_expFermiFunc->operator()(deltaT);
1066 double pulse2 = preAmp * m_norm * (m_expFermiFunc->operator()(deltaTPre) - m_expFermiFunc->operator()(deltaPresamp));
1067
1068 double linBG = linSlope * (t - deltaPresamp) + linConst;
1069 double expBG = expamp * std::exp(-(t) / m_tau2) - expamp; // deltaPresamp
1070
1071 return pulse1 + pulse2 + linBG + expBG;
1072 }
1073};
1074
1075
1076// ----------------------------------------------------------------------
1078{
1079private:
1080 float m_tau1;
1081 float m_tau2;
1082 float m_norm;
1084 std::shared_ptr<TF1> m_expFermiFunc;
1085
1086public:
1087 ZDCFitGeneralPulse(const std::string& tag, float tmin, float tmax, float tau1, float tau2);
1089
1090 virtual void DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax) override;
1091 virtual void SetT0FitLimits(float tMin, float tMax) override;
1092
1093 virtual void SetInitialPrePulse(float amp, float t0, float expamp, bool fixPrePulseToZero) override {
1094 GetWrapperTF1()->ReleaseParameter(2);
1095 GetWrapperTF1()->ReleaseParameter(3);
1096 GetWrapperTF1()->SetParameter(2, std::max(amp, (float) 1.5)); //1.5 here ensures that we're above lower limit
1097 GetWrapperTF1()->SetParameter(3, std::max(t0, (float) 20.0));
1098 GetWrapperTF1()->SetParameter(6, std::max(std::abs(expamp), (float) 1.5));
1099
1100 if (fixPrePulseToZero) {
1101 GetWrapperTF1()->FixParameter(2, 0. );
1102 GetWrapperTF1()->FixParameter(3, 20.);
1103 }
1104 }
1105
1106 virtual void ConstrainFit() override;
1107 virtual void UnconstrainFit() override;
1108
1109 virtual void SetPrePulseT0Range(float tmin, float tmax) override;
1110 virtual void SetPostPulseT0Range(float tmin, float tmax, float initialPostT0) override;
1111
1112 unsigned int GetPreT0ParIndex() const override {return 3;}
1113
1114 virtual float GetAmplitude() const override {return GetWrapperTF1()->GetParameter(0); }
1115 virtual float GetAmpError() const override {return GetWrapperTF1()->GetParError(0); }
1116
1117 virtual float GetTau1() const override {return m_tau1;}
1118 virtual float GetTau2() const override {return m_tau2;}
1119
1120 virtual float GetPreT0() const override {
1121 float fitPreT0 = GetWrapperTF1()->GetParameter(3);
1122
1123 // Correct the time to the maximum
1124 //
1125 fitPreT0 += m_timeCorr;
1126
1127 return fitPreT0;
1128 }
1129 virtual float GetPreAmp() const override {return GetWrapperTF1()->GetParameter(2);}
1130
1131 virtual float GetPostT0() const override {
1132 float fitPostT0 = GetWrapperTF1()->GetParameter(8);
1133
1134 // Correct the time to the maximum
1135 //
1136 fitPostT0 += m_timeCorr;
1137
1138 return fitPostT0;
1139 }
1140 virtual float GetPostAmp() const override {return GetWrapperTF1()->GetParameter(7);}
1141
1142 virtual float GetExpAmp() const override {return GetWrapperTF1()->GetParameter(6);}
1143
1144 virtual float GetTime() const override {
1145 return GetWrapperTF1()->GetParameter(1) + m_timeCorr; // Correct the time to the maximum
1146 }
1147
1148 virtual float GetShapeParameter(size_t index) const override
1149 {
1150 if (index == 0) return m_tau1;
1151 else if (index == 1) return m_tau2;
1152 else if (index < 5) return GetWrapperTF1()->GetParameter(index);
1153 else throw std::runtime_error("Fit parameter does not exist.");
1154 }
1155
1156 virtual float GetBkgdMaxFraction() const override
1157 {
1158 const TF1* theTF1 = ZDCFitWrapper::GetWrapperTF1();
1159
1160 double maxTime = GetTime();
1161
1162 double amp = theTF1->GetParameter(0);
1163 double preAmp = theTF1->GetParameter(2);
1164 double preT0 = theTF1->GetParameter(3);
1165 double slope = theTF1->GetParameter(4);
1166
1167 double deltaTPre = maxTime - preT0;
1168
1169 double background = slope * maxTime + preAmp * m_norm * (m_expFermiFunc->operator()(deltaTPre) -
1170 m_expFermiFunc->operator()(-preT0));
1171
1172 return background / amp;
1173 }
1174
1175 virtual double operator() (const double *x, const double *p) override
1176 {
1177 double t = x[0];
1178
1179 double amp = p[0];
1180 double t0 = p[1];
1181 double preAmp = p[2];
1182 double preT0 = p[3];
1183 double linSlope = p[4];
1184 double linConst = p[5];
1185 double expamp = p[6];
1186 double postAmp = p[7];
1187 double postT0 = p[8];
1188
1189 double deltaT = t - t0;
1190 double deltaTPre = t - preT0;
1191 double deltaTPost = t - postT0;
1192
1193 // We subtract off the value of the pre-pulse at the minimum time (nominally 0,
1194 // but can change if we exclude early samples) to account for the subtraction of the pre-sample
1195 //
1196 double deltaPresamp = GetTMinAdjust() - preT0;
1197
1198 double pulse1 = amp * m_norm * m_expFermiFunc->operator()(deltaT);
1199 double pulse2 = preAmp * m_norm * (m_expFermiFunc->operator()(deltaTPre) - m_expFermiFunc->operator()(deltaPresamp));
1200 double pulse3 = postAmp * m_norm * m_expFermiFunc->operator()(deltaTPost);
1201
1202 double linBG = linSlope * t + linConst;
1203 double expBG = expamp * std::exp(-(t) / m_tau2) - expamp * std::exp(-(GetTMinAdjust()) / m_tau2); // deltaPresamp
1204
1205 return pulse1 + pulse2 + pulse3 + linBG + expBG;
1206 }
1207};
1208
1209double ZDCFermiExpFit(const double* xvec, const double* pvec)
1210{
1211 double t = xvec[0];
1212
1213 double amp = pvec[0];
1214 double t0 = pvec[1];
1215 double tau1 = pvec[2];
1216 double tau2 = pvec[3];
1217 double C = pvec[4];
1218
1219 double tauRatio = tau2 / tau1;
1220 double tauRatioMinunsOne = tauRatio - 1;
1221
1222 double norm = (std::pow(1. / tauRatioMinunsOne, 1. / (1 + tauRatio)) /
1223 ( 1 + std::pow(1. / tauRatioMinunsOne, 1. / (1 + 1 / tauRatio))));
1224
1225 double deltaT = t - t0;
1226 if (deltaT < 0) deltaT = 0;
1227
1228 double expTerm = std::exp(-deltaT / tau2);
1229 double fermiTerm = 1. / (1. + std::exp(-(t - t0) / tau1));
1230
1231 return amp * expTerm * fermiTerm / norm + C;
1232}
1233
1234double ZDCFermiExpFitRefl(const double* xvec, const double* pvec)
1235{
1236 double t = xvec[0];
1237
1238 double amp = pvec[0];
1239 double t0 = pvec[1];
1240 double tau1 = pvec[2];
1241 double tau2 = pvec[3];
1242 double C = pvec[4];
1243
1244 double refldelay = pvec[5];
1245 double reflFrac = pvec[6];
1246 double reflwidth = pvec[7];
1247 double delta = pvec[8];
1248
1249 double tauRatio = tau2 / tau1;
1250 double tauRatioMinunsOne = tauRatio - 1;
1251
1252 double norm = std::pow(1. / tauRatioMinunsOne, 1. / (1 + tauRatio)) /
1253 ( 1 + std::pow(1. / tauRatioMinunsOne, 1. / (1 + 1 / tauRatio))) ;
1254
1255 double deltaT = t - t0;
1256 if (deltaT < 0) deltaT = 0;
1257
1258 // Note: the small constant added here accounts for the very long tail on the pulse
1259 // which doesn't go to zero over the time range that we sample
1260 //
1261 double expTerm = delta + std::exp(-deltaT / tau2);
1262 double fermiTerm = 1. / (1. + std::exp(-(t - t0) / tau1));
1263
1264 double deltaTRefl = deltaT - refldelay;
1265 double reflTerm = -reflFrac*amp*std::exp(-0.5*deltaTRefl*deltaTRefl/reflwidth/reflwidth);
1266
1267 return amp * expTerm * fermiTerm / norm + C + reflTerm;
1268}
1269
1270#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