ATLAS Offline Software
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
ZDCFitWrapper Class Referenceabstract

#include <ZDCFitWrapper.h>

Inheritance diagram for ZDCFitWrapper:
Collaboration diagram for ZDCFitWrapper:

Public Member Functions

 ZDCFitWrapper (const std::shared_ptr< TF1 > &wrapperTF1)
 
virtual ~ZDCFitWrapper ()
 
void Initialize (float initialAmp, float initialT0, float ampMin, float ampMax)
 
void Initialize (float initialAmp, float initialT0, float ampMin, float ampMax, float fitTmin, float fitTmax, float fitTRef)
 
virtual void DoInitialize (float initialAmp, float initialT0, float ampMin, float ampMax)=0
 
void SetAmpMinMax (float minAmp, float maxAmp)
 
void SetT0Range (float t0Min, float t0Max)
 
virtual void ConstrainFit ()=0
 
virtual void UnconstrainFit ()=0
 
virtual float GetAmplitude () const =0
 
virtual float GetAmpError () const =0
 
virtual float GetTime () const =0
 
virtual float GetTau1 () const =0
 
virtual float GetTau2 () const =0
 
float GetMinAmp () const
 
float GetMaxAmp () const
 
float GetTMin () const
 
float GetTMax () const
 
float GetT0Min () const
 
float GetT0Max () const
 
float GetTMinAdjust () const
 
virtual float GetBkgdMaxFraction () const =0
 
virtual float GetShapeParameter (size_t index) const =0
 
virtual double operator() (const double *x, const double *p)=0
 
virtual std::shared_ptr< TF1 > GetWrapperTF1 ()
 
virtual const TF1 * GetWrapperTF1 () const
 
virtual TF1 * GetWrapperTF1RawPtr () const
 

Protected Member Functions

virtual void SetT0FitLimits (float tMin, float tMax)=0
 

Private Attributes

std::shared_ptr< TF1 > m_wrapperTF1 {}
 
float m_tmin {0}
 
float m_tmax {0}
 
float m_ampMin {0}
 
float m_ampMax {0}
 
float m_t0Min {0}
 
float m_t0Max {0}
 
bool m_adjTLimitsEvent {false}
 
float m_tminAdjust {0}
 
float m_tempTmin {0}
 
float m_tempTmax {0}
 

Detailed Description

Definition at line 18 of file ZDCFitWrapper.h.

Constructor & Destructor Documentation

◆ ZDCFitWrapper()

ZDCFitWrapper::ZDCFitWrapper ( const std::shared_ptr< TF1 > &  wrapperTF1)
inline

Definition at line 43 of file ZDCFitWrapper.h.

43  : 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 
50  m_t0Min = m_tmin;
51  m_t0Max = m_tmax;
52  }

◆ ~ZDCFitWrapper()

virtual ZDCFitWrapper::~ZDCFitWrapper ( )
inlinevirtual

Definition at line 54 of file ZDCFitWrapper.h.

54 {}

Member Function Documentation

◆ ConstrainFit()

virtual void ZDCFitWrapper::ConstrainFit ( )
pure virtual

◆ DoInitialize()

virtual void ZDCFitWrapper::DoInitialize ( float  initialAmp,
float  initialT0,
float  ampMin,
float  ampMax 
)
pure virtual

◆ GetAmpError()

virtual float ZDCFitWrapper::GetAmpError ( ) const
pure virtual

◆ GetAmplitude()

virtual float ZDCFitWrapper::GetAmplitude ( ) const
pure virtual

◆ GetBkgdMaxFraction()

virtual float ZDCFitWrapper::GetBkgdMaxFraction ( ) const
pure virtual

◆ GetMaxAmp()

float ZDCFitWrapper::GetMaxAmp ( ) const
inline

Definition at line 87 of file ZDCFitWrapper.h.

87 {return m_ampMax;}

◆ GetMinAmp()

float ZDCFitWrapper::GetMinAmp ( ) const
inline

Definition at line 86 of file ZDCFitWrapper.h.

86 {return m_ampMin;}

◆ GetShapeParameter()

virtual float ZDCFitWrapper::GetShapeParameter ( size_t  index) const
pure virtual

◆ GetT0Max()

float ZDCFitWrapper::GetT0Max ( ) const
inline

Definition at line 97 of file ZDCFitWrapper.h.

97  {
98  if (m_adjTLimitsEvent) return m_tempTmax;
99  else return m_t0Max;
100  }

◆ GetT0Min()

float ZDCFitWrapper::GetT0Min ( ) const
inline

Definition at line 92 of file ZDCFitWrapper.h.

92  {
93  if (m_adjTLimitsEvent) return m_tempTmin;
94  else return m_t0Min;
95  }

◆ GetTau1()

virtual float ZDCFitWrapper::GetTau1 ( ) const
pure virtual

◆ GetTau2()

virtual float ZDCFitWrapper::GetTau2 ( ) const
pure virtual

◆ GetTime()

virtual float ZDCFitWrapper::GetTime ( ) const
pure virtual

◆ GetTMax()

float ZDCFitWrapper::GetTMax ( ) const
inline

Definition at line 90 of file ZDCFitWrapper.h.

90 {return m_tmax;}

◆ GetTMin()

float ZDCFitWrapper::GetTMin ( ) const
inline

Definition at line 89 of file ZDCFitWrapper.h.

89 {return m_tmin;}

◆ GetTMinAdjust()

float ZDCFitWrapper::GetTMinAdjust ( ) const
inline

Definition at line 102 of file ZDCFitWrapper.h.

102 {return m_tminAdjust;}

◆ GetWrapperTF1() [1/2]

virtual std::shared_ptr<TF1> ZDCFitWrapper::GetWrapperTF1 ( )
inlinevirtual

Definition at line 110 of file ZDCFitWrapper.h.

110 {return m_wrapperTF1;}

◆ GetWrapperTF1() [2/2]

virtual const TF1* ZDCFitWrapper::GetWrapperTF1 ( ) const
inlinevirtual

Definition at line 111 of file ZDCFitWrapper.h.

111 {return m_wrapperTF1.get();}

◆ GetWrapperTF1RawPtr()

virtual TF1* ZDCFitWrapper::GetWrapperTF1RawPtr ( ) const
inlinevirtual

Definition at line 112 of file ZDCFitWrapper.h.

112 {return m_wrapperTF1.get();}

◆ Initialize() [1/2]

void ZDCFitWrapper::Initialize ( float  initialAmp,
float  initialT0,
float  ampMin,
float  ampMax 
)

Definition at line 9 of file ZDCFitWrapper.cxx.

10 {
11  // Clear the errors on the TF1 because retaining the errors seems to affect
12  // the convergence of fits
13  //
14  unsigned int npar = GetWrapperTF1()->GetNpar();
15  std::vector<double> zeroVec(npar, 0.0);
16  GetWrapperTF1()->SetParErrors(&zeroVec[0]);
17 
18  // If we adjusted the time range on the previous event, restore to default
19  //
20  if (m_adjTLimitsEvent) {
22 
23  m_adjTLimitsEvent = false;
24  m_tminAdjust = 0;
25  }
26 
27  SetAmpMinMax(ampMin, ampMax);
28 
29  DoInitialize(initialAmp, initialT0, ampMin, ampMax);
30 }

◆ Initialize() [2/2]

void ZDCFitWrapper::Initialize ( float  initialAmp,
float  initialT0,
float  ampMin,
float  ampMax,
float  fitTmin,
float  fitTmax,
float  fitTRef 
)

Definition at line 32 of file ZDCFitWrapper.cxx.

33 {
34  // Clear the errors on the TF1 because retaining the errors seems to affect
35  // the convergence of fits
36  //
37  unsigned int npar = GetWrapperTF1()->GetNpar();
38  std::vector<double> zeroVec(npar, 0.0);
39  GetWrapperTF1()->SetParErrors(&zeroVec[0]);
40 
41  m_adjTLimitsEvent = true;
42 
43  m_tminAdjust = fitTRef; // Note: this is the time corresponding to the sample used for presample subtraction
44 
45  m_tempTmin = std::max(m_t0Min, fitTmin);
46  m_tempTmax = std::min(m_t0Max, fitTmax);
47 
48  SetAmpMinMax(ampMin, ampMax);
50 
51  DoInitialize(initialAmp, initialT0, ampMin, ampMax);
52 }

◆ operator()()

virtual double ZDCFitWrapper::operator() ( const double *  x,
const double *  p 
)
pure virtual

◆ SetAmpMinMax()

void ZDCFitWrapper::SetAmpMinMax ( float  minAmp,
float  maxAmp 
)
inline

Definition at line 63 of file ZDCFitWrapper.h.

64  {
65  m_ampMin = minAmp;
66  m_ampMax = maxAmp;
67  }

◆ SetT0FitLimits()

virtual void ZDCFitWrapper::SetT0FitLimits ( float  tMin,
float  tMax 
)
protectedpure virtual

◆ SetT0Range()

void ZDCFitWrapper::SetT0Range ( float  t0Min,
float  t0Max 
)
inline

Definition at line 69 of file ZDCFitWrapper.h.

70  {
71  m_t0Min = t0Min;
72  m_t0Max = t0Max;
73 
74  SetT0FitLimits(t0Min, t0Max);
75  }

◆ UnconstrainFit()

virtual void ZDCFitWrapper::UnconstrainFit ( )
pure virtual

Member Data Documentation

◆ m_adjTLimitsEvent

bool ZDCFitWrapper::m_adjTLimitsEvent {false}
private

Definition at line 32 of file ZDCFitWrapper.h.

◆ m_ampMax

float ZDCFitWrapper::m_ampMax {0}
private

Definition at line 27 of file ZDCFitWrapper.h.

◆ m_ampMin

float ZDCFitWrapper::m_ampMin {0}
private

Definition at line 26 of file ZDCFitWrapper.h.

◆ m_t0Max

float ZDCFitWrapper::m_t0Max {0}
private

Definition at line 30 of file ZDCFitWrapper.h.

◆ m_t0Min

float ZDCFitWrapper::m_t0Min {0}
private

Definition at line 29 of file ZDCFitWrapper.h.

◆ m_tempTmax

float ZDCFitWrapper::m_tempTmax {0}
private

Definition at line 35 of file ZDCFitWrapper.h.

◆ m_tempTmin

float ZDCFitWrapper::m_tempTmin {0}
private

Definition at line 34 of file ZDCFitWrapper.h.

◆ m_tmax

float ZDCFitWrapper::m_tmax {0}
private

Definition at line 24 of file ZDCFitWrapper.h.

◆ m_tmin

float ZDCFitWrapper::m_tmin {0}
private

Definition at line 23 of file ZDCFitWrapper.h.

◆ m_tminAdjust

float ZDCFitWrapper::m_tminAdjust {0}
private

Definition at line 33 of file ZDCFitWrapper.h.

◆ m_wrapperTF1

std::shared_ptr<TF1> ZDCFitWrapper::m_wrapperTF1 {}
private

Definition at line 21 of file ZDCFitWrapper.h.


The documentation for this class was generated from the following files:
ZDCFitWrapper::m_wrapperTF1
std::shared_ptr< TF1 > m_wrapperTF1
Definition: ZDCFitWrapper.h:21
ZDCFitWrapper::m_tmin
float m_tmin
Definition: ZDCFitWrapper.h:23
ZDCFitWrapper::SetT0FitLimits
virtual void SetT0FitLimits(float tMin, float tMax)=0
max
#define max(a, b)
Definition: cfImp.cxx:41
ZDCFitWrapper::DoInitialize
virtual void DoInitialize(float initialAmp, float initialT0, float ampMin, float ampMax)=0
ZDCFitWrapper::m_ampMin
float m_ampMin
Definition: ZDCFitWrapper.h:26
ZDCFitWrapper::m_t0Max
float m_t0Max
Definition: ZDCFitWrapper.h:30
ZDCFitWrapper::GetWrapperTF1
virtual std::shared_ptr< TF1 > GetWrapperTF1()
Definition: ZDCFitWrapper.h:110
ZDCFitWrapper::m_adjTLimitsEvent
bool m_adjTLimitsEvent
Definition: ZDCFitWrapper.h:32
ZDCFitWrapper::m_tempTmax
float m_tempTmax
Definition: ZDCFitWrapper.h:35
ZDCFitWrapper::m_ampMax
float m_ampMax
Definition: ZDCFitWrapper.h:27
min
#define min(a, b)
Definition: cfImp.cxx:40
ZDCFitWrapper::m_t0Min
float m_t0Min
Definition: ZDCFitWrapper.h:29
ZDCFitWrapper::m_tminAdjust
float m_tminAdjust
Definition: ZDCFitWrapper.h:33
ZDCFitWrapper::m_tmax
float m_tmax
Definition: ZDCFitWrapper.h:24
ZDCFitWrapper::SetAmpMinMax
void SetAmpMinMax(float minAmp, float maxAmp)
Definition: ZDCFitWrapper.h:63
ZDCFitWrapper::m_tempTmin
float m_tempTmin
Definition: ZDCFitWrapper.h:34