ATLAS Offline Software
Loading...
Searching...
No Matches
ZDCWaveformFermiExpTail Class Reference

#include <ZDCWaveformFermiExp.h>

Inheritance diagram for ZDCWaveformFermiExpTail:
Collaboration diagram for ZDCWaveformFermiExpTail:

Public Member Functions

 ZDCWaveformFermiExpTail ()=delete
 ZDCWaveformFermiExpTail (const std::string &tag, double initialTauRise, double initialTauFall, double tailShiftFrac)
void setTailParameter (double tailShiftFrac)
ZDCWaveformBaseDuplicate ()
double evaluate (double time) const
double evaluateRoot (double *x, double *p)
double evaluateRootNoTF1Par (double *x, double *p)
double operator() (double *x, double *p)
const std::string & getTag () const
std::string getNameTag () const
const std::string getName () const
double getTauRise () const
double getTauFall () const
unsigned int getNumAddtlShapeValues () const
double getAddtlShapeValue (const std::string &name) const
double getAddtlShapeValue (unsigned int index) const
void setAddtlShapeValue (std::string name, double value)
void setAddtlShapeValue (unsigned int index, double value)
void setTaus (double tauRise, double tauFall)
void restoreInitial ()
TF1 * makeWaveformTF1 (ZDCWaveformBase *ptr, double xmin, double xmax, bool useTF1Params=true)
TF1 * makeWaveformTF1 (ZDCWaveformBase &instance, double xmin, double xmax, bool useTF1Params=true)

Protected Member Functions

void setAddtlShapeParameters (const std::vector< std::string > &addtlShapeNames, const std::vector< double > &addtlShapeValues)
void setAddtlShapeValues (const double *values)
void setAddtlShapeValues (const std::vector< double > &values)

Protected Attributes

double m_tauRise
double m_tauFall
std::vector< double > m_addtlShapeValues

Private Member Functions

double doEvaluate (double time) const override
virtual std::string name () const override

Private Attributes

std::string m_tag
std::map< std::string, unsigned int > m_addtlShapeNames
double m_initialTauRise
double m_initialTauFall
unsigned int m_numAddtlShapePars
std::vector< double > m_addtlShapeInitialValues

Detailed Description

Definition at line 37 of file ZDCWaveformFermiExp.h.

Constructor & Destructor Documentation

◆ ZDCWaveformFermiExpTail() [1/2]

ZDCWaveformFermiExpTail::ZDCWaveformFermiExpTail ( )
delete

◆ ZDCWaveformFermiExpTail() [2/2]

ZDCWaveformFermiExpTail::ZDCWaveformFermiExpTail ( const std::string & tag,
double initialTauRise,
double initialTauFall,
double tailShiftFrac )
inline

Definition at line 51 of file ZDCWaveformFermiExp.h.

51 :
52 ZDCWaveformFermiExp(tag, initialTauRise, initialTauFall)
53 {
54 double tailShiftScaled = tailShiftFrac*ZDCWaveformFermiExp::doEvaluate(0);
55 setAddtlShapeParameters(std::vector<std::string>({"tailFrac"}), std::vector<double>({tailShiftScaled}));
56 }
void setAddtlShapeParameters(const std::vector< std::string > &addtlShapeNames, const std::vector< double > &addtlShapeValues)
ZDCWaveformFermiExp()=delete
double doEvaluate(double time) const override

Member Function Documentation

◆ doEvaluate()

double ZDCWaveformFermiExpTail::doEvaluate ( double time) const
inlineoverrideprivatevirtual

Reimplemented from ZDCWaveformFermiExp.

Definition at line 39 of file ZDCWaveformFermiExp.h.

40 {
41 double tailShift = getAddtlShapeValue(0);
42 if (time <= 0) return ZDCWaveformFermiExp::doEvaluate(time);
43 else return ZDCWaveformFermiExp::doEvaluate(time) + tailShift;
44 }
double getAddtlShapeValue(const std::string &name) const

◆ Duplicate()

ZDCWaveformBase * ZDCWaveformBase::Duplicate ( )
inherited

◆ evaluate()

double ZDCWaveformBase::evaluate ( double time) const
inlineinherited

Definition at line 81 of file ZDCWaveform.h.

82 {
83 return doEvaluate(time)/doEvaluate(0);
84 }
virtual double doEvaluate(double time) const =0

◆ evaluateRoot()

double ZDCWaveformBase::evaluateRoot ( double * x,
double * p )
inlineinherited

Definition at line 86 of file ZDCWaveform.h.

86 {
87 return this->operator()(x,p);
88 }
#define x
double operator()(double *x, double *p)
Definition ZDCWaveform.h:95

◆ evaluateRootNoTF1Par()

double ZDCWaveformBase::evaluateRootNoTF1Par ( double * x,
double * p )
inlineinherited

Definition at line 90 of file ZDCWaveform.h.

90 {
91 (void)p;
92 return evaluate(x[0]);
93 }
double evaluate(double time) const
Definition ZDCWaveform.h:81

◆ getAddtlShapeValue() [1/2]

double ZDCWaveformBase::getAddtlShapeValue ( const std::string & name) const
inlineinherited

Definition at line 108 of file ZDCWaveform.h.

108{return m_addtlShapeValues.at(m_addtlShapeNames.find(name)->second);}
virtual std::string name() const =0
std::vector< double > m_addtlShapeValues
Definition ZDCWaveform.h:45
std::map< std::string, unsigned int > m_addtlShapeNames
Definition ZDCWaveform.h:33

◆ getAddtlShapeValue() [2/2]

double ZDCWaveformBase::getAddtlShapeValue ( unsigned int index) const
inlineinherited

Definition at line 109 of file ZDCWaveform.h.

109{return m_addtlShapeValues.at(index);}

◆ getName()

const std::string ZDCWaveformBase::getName ( ) const
inlineinherited

Definition at line 103 of file ZDCWaveform.h.

103{return name();}

◆ getNameTag()

std::string ZDCWaveformBase::getNameTag ( ) const
inlineinherited

Definition at line 102 of file ZDCWaveform.h.

102{return name() + "_" + m_tag;}
std::string m_tag
Definition ZDCWaveform.h:32

◆ getNumAddtlShapeValues()

unsigned int ZDCWaveformBase::getNumAddtlShapeValues ( ) const
inlineinherited

Definition at line 107 of file ZDCWaveform.h.

107{return m_numAddtlShapePars;}
unsigned int m_numAddtlShapePars
Definition ZDCWaveform.h:37

◆ getTag()

const std::string & ZDCWaveformBase::getTag ( ) const
inlineinherited

Definition at line 101 of file ZDCWaveform.h.

101{return m_tag;}

◆ getTauFall()

double ZDCWaveformBase::getTauFall ( ) const
inlineinherited

Definition at line 105 of file ZDCWaveform.h.

105{return m_tauFall;}

◆ getTauRise()

double ZDCWaveformBase::getTauRise ( ) const
inlineinherited

Definition at line 104 of file ZDCWaveform.h.

104{return m_tauRise;}

◆ makeWaveformTF1() [1/2]

TF1 * ZDCWaveformBase::makeWaveformTF1 ( ZDCWaveformBase & instance,
double xmin,
double xmax,
bool useTF1Params = true )
inlineinherited

Definition at line 163 of file ZDCWaveform.h.

164{
165 return makeWaveformTF1(&instance, xmin, xmax, useTF1Params);
166}
std::map< std::string, double > instance
TF1 * makeWaveformTF1(ZDCWaveformBase *ptr, double xmin, double xmax, bool useTF1Params=true)
double xmax
Definition listroot.cxx:61
double xmin
Definition listroot.cxx:60

◆ makeWaveformTF1() [2/2]

TF1 * ZDCWaveformBase::makeWaveformTF1 ( ZDCWaveformBase * ptr,
double xmin,
double xmax,
bool useTF1Params = true )
inlineinherited

Definition at line 133 of file ZDCWaveform.h.

134{
135 std::string name = ptr->getNameTag() + "_TF1";
136
137 TF1* newTF1 = 0;
138
139 if (useTF1Params) {
140 unsigned int numPar = 2 + ptr->getNumAddtlShapeValues();
141
142 newTF1= new TF1(name.c_str(), ptr, &ZDCWaveformBase::evaluateRoot, xmin, xmax, numPar,
143 "ZDCWaveformBase", "evaluateRoot");
144
145 newTF1->SetParameter(0, ptr->getTauRise());
146 newTF1->SetParameter(1, ptr->getTauFall());
147
148 if (numPar > 2) {
149 for (unsigned int idxpar = 2; idxpar < numPar; idxpar++) {
150 newTF1->SetParameter(idxpar, ptr->getAddtlShapeValue(idxpar - 2));
151 }
152 }
153 }
154 else {
155 newTF1= new TF1(name.c_str(), ptr, &ZDCWaveformBase::evaluateRootNoTF1Par, xmin, xmax, 0,
156 "ZDCWaveformBase", "evaluateRoot");
157 }
158
159 newTF1->SetNpx(1000);
160 return newTF1;
161}
double evaluateRoot(double *x, double *p)
Definition ZDCWaveform.h:86
double evaluateRootNoTF1Par(double *x, double *p)
Definition ZDCWaveform.h:90
void * ptr(T *p)
Definition SGImplSvc.cxx:74

◆ name()

virtual std::string ZDCWaveformFermiExpTail::name ( ) const
inlineoverrideprivatevirtual

Reimplemented from ZDCWaveformFermiExp.

Definition at line 46 of file ZDCWaveformFermiExp.h.

46{return "FermiExpTail";}

◆ operator()()

double ZDCWaveformBase::operator() ( double * x,
double * p )
inlineinherited

Definition at line 95 of file ZDCWaveform.h.

95 {
96 setTaus(p[0], p[1]);
98 return evaluate(x[0]);
99 }
void setAddtlShapeValues(const double *values)
void setTaus(double tauRise, double tauFall)
unsigned int getNumAddtlShapeValues() const

◆ restoreInitial()

void ZDCWaveformBase::restoreInitial ( )
inherited

Definition at line 60 of file ZDCWaveform.cxx.

◆ setAddtlShapeParameters()

void ZDCWaveformBase::setAddtlShapeParameters ( const std::vector< std::string > & addtlShapeNames,
const std::vector< double > & addtlShapeValues )
protectedinherited

Definition at line 32 of file ZDCWaveform.cxx.

34{
35 // Enforce consistency in vector lengths
36 //
37 m_numAddtlShapePars = addtlShapeNames.size();
38 if (m_numAddtlShapePars != addtlShapeValues.size()) throw std::runtime_error("ZDCWaveformBase::setAddtlShapeParameters; Shape name and value size mismatch");
39
40 m_addtlShapeNames.clear();
41
42 // Insert names into map with index
43 //
44 for (unsigned int param = 0; param < addtlShapeNames.size(); param++) {
45 m_addtlShapeNames.insert({addtlShapeNames[param], param});
46 }
47
48 // Save shape values, first to "initial", then to the actual
49 //
50 m_addtlShapeInitialValues = addtlShapeValues;
52}

◆ setAddtlShapeValue() [1/2]

void ZDCWaveformBase::setAddtlShapeValue ( std::string name,
double value )
inherited

◆ setAddtlShapeValue() [2/2]

void ZDCWaveformBase::setAddtlShapeValue ( unsigned int index,
double value )
inlineinherited

Definition at line 113 of file ZDCWaveform.h.

113 {
114 m_addtlShapeValues.at(index) = value;
115 }

◆ setAddtlShapeValues() [1/2]

void ZDCWaveformBase::setAddtlShapeValues ( const double * values)
protectedinherited

Definition at line 54 of file ZDCWaveform.cxx.

55{
56 unsigned int nvalues = m_addtlShapeValues.size();
57 std::copy_n(values, nvalues, m_addtlShapeValues.begin());
58}

◆ setAddtlShapeValues() [2/2]

void ZDCWaveformBase::setAddtlShapeValues ( const std::vector< double > & values)
inlineprotectedinherited

Definition at line 53 of file ZDCWaveform.h.

53 {
54 setAddtlShapeValues(&values[0]);
55 }

◆ setTailParameter()

void ZDCWaveformFermiExpTail::setTailParameter ( double tailShiftFrac)
inline

Definition at line 58 of file ZDCWaveformFermiExp.h.

58 {
59 double tailShiftScaled = tailShiftFrac*ZDCWaveformFermiExp::doEvaluate(0);
60 setAddtlShapeValue(0, tailShiftScaled);
61 }
void setAddtlShapeValue(std::string name, double value)

◆ setTaus()

void ZDCWaveformBase::setTaus ( double tauRise,
double tauFall )
inlineinherited

Definition at line 117 of file ZDCWaveform.h.

118 {
119 m_tauRise = tauRise;
120 m_tauFall = tauFall;
121 }

Member Data Documentation

◆ m_addtlShapeInitialValues

std::vector<double> ZDCWaveformBase::m_addtlShapeInitialValues
privateinherited

Definition at line 38 of file ZDCWaveform.h.

◆ m_addtlShapeNames

std::map<std::string, unsigned int> ZDCWaveformBase::m_addtlShapeNames
privateinherited

Definition at line 33 of file ZDCWaveform.h.

◆ m_addtlShapeValues

std::vector<double> ZDCWaveformBase::m_addtlShapeValues
protectedinherited

Definition at line 45 of file ZDCWaveform.h.

◆ m_initialTauFall

double ZDCWaveformBase::m_initialTauFall
privateinherited

Definition at line 36 of file ZDCWaveform.h.

◆ m_initialTauRise

double ZDCWaveformBase::m_initialTauRise
privateinherited

Definition at line 35 of file ZDCWaveform.h.

◆ m_numAddtlShapePars

unsigned int ZDCWaveformBase::m_numAddtlShapePars
privateinherited

Definition at line 37 of file ZDCWaveform.h.

◆ m_tag

std::string ZDCWaveformBase::m_tag
privateinherited

Definition at line 32 of file ZDCWaveform.h.

◆ m_tauFall

double ZDCWaveformBase::m_tauFall
protectedinherited

Definition at line 43 of file ZDCWaveform.h.

◆ m_tauRise

double ZDCWaveformBase::m_tauRise
protectedinherited

Definition at line 42 of file ZDCWaveform.h.


The documentation for this class was generated from the following file: