61enum BasisSign {
Both = 0, Plus = +1, Minus = -1 };
88 _mean(
"mean",
"Mean of Gaussian component",
this,
meanIn),
91 _meanSF(
"meanSF",
"Scale factor for mean",
this,
meanSF),
146 ssf(
"ssf",
"Sigma Scale Factor",
this,
_rsSF),
147 rsf(
"rsf",
"RLife Scale Factor",
this,
_rsSF),
148 _flip(
type==Flipped),
178 _flip(
type==Flipped),
197 _flatSFInt(
other._flatSFInt),
198 _asympInt(
other._asympInt)
206 std::string str =
name;
209 str.erase(remove(str.begin(),str.end(),
' '),str.end());
213 if (str ==
"exp(-abs(@0)/@1)")
return expBasisSum ;
214 if (str ==
"exp(-@0/@1)*sin(@0*@2)")
return sinBasisPlus ;
216 if (str ==
"exp(-abs(@0)/@1)*sin(@0*@2)")
return sinBasisSum ;
217 if (str ==
"exp(-@0/@1)*cos(@0*@2)")
return cosBasisPlus ;
219 if (str ==
"exp(-abs(@0)/@1)*cos(@0*@2)")
return cosBasisSum ;
220 if (str ==
"exp(-@0/@1)*sinh(@0*@2/2)")
return sinhBasisPlus;
222 if (str ==
"exp(-abs(@0)/@1)*sinh(@0*@2/2)")
return sinhBasisSum;
223 if (str ==
"exp(-@0/@1)*cosh(@0*@2/2)")
return coshBasisPlus;
225 if (str ==
"exp(-abs(@0)/@1)*cosh(@0*@2/2)")
return coshBasisSum;
244 (-z * z - 1.26551223 +
250 t * (-1.13520398 + t * (1.48851587 + t * (-0.82215223 + t * 0.17087277)))))))));
255 exp(-z * z - 1.26551223 +
260 t * (0.27886807 + t * (-1.13520398 +
261 t * (1.48851587 + t * (-0.82215223 + t * 0.17087277))))))))));
272std::complex<double> evalCerfApprox(
double swt,
double u,
double c)
274 static double rootpi= sqrt(atan2(0.,-1.));
275 std::complex<double> z(
swt*
c,
u+
c);
276 std::complex<double>
zc(
u+
c,-
swt*
c);
277 std::complex<double>
zsq= z*z;
278 std::complex<double>
v= -
zsq -
u*
u;
280 return std::exp(
v)*(-std::exp(
zsq)/(
zc*
rootpi) + 1.)*2.;
285std::complex<double> evalCerf(
double swt,
double u,
double c)
287 std::complex<double> z(
swt*
c,
u+
c);
311 static double root2(sqrt(2.)) ;
330 if (
verboseEval()>2) std::cout <<
"RooGExpModel::evaluate(" <<
GetName() <<
") 1st form" << std::endl ;
360 if (
verboseEval()>2) std::cout <<
"RooGExpModel::evaluate(" <<
GetName() <<
") 2nd form" << std::endl ;
368 if (
verboseEval()>2) std::cout <<
"RooGExpModel::evaluate(" <<
GetName() <<
") 3d form tau=" << tau << std::endl ;
379 if (
verboseEval()>2) std::cout <<
"RooGExpModel::evaluate(" <<
GetName() <<
") 4th form omega = "
380 <<
omega <<
", tau = " << tau << std::endl ;
392 <<
") 5th form omega = " <<
omega <<
", tau = " << tau << std::endl ;
406 <<
") 6th form = " <<
dgamma <<
", tau = " << tau << std::endl;
426 <<
") 7th form = " <<
dgamma <<
", tau = " << tau << std::endl;
449 static double root2(sqrt(2.)) ;
460 std::complex<double>
eins(1,0);
461 std::complex<double> k(1/tau,
sign*
omega);
475 static double root2(sqrt(2.)) ;
498 static double root2(sqrt(2.)) ;
499 static double root2pi(sqrt(2*atan2(0.,-1.))) ;
500 static double rootpi(sqrt(atan2(0.,-1.)));
503 double xp(
x - _mean*_meanSF) ;
512 if ((
sign<0)&&(std::abs(tau-
rtau)<tau/260)) {
521 *(sig*exp(-1/(2*sig*sig)*std::pow((sig*sig/
MeanTau+
xp),2))
525 double epsilon=0.5*(tau-
rtau);
579double RooGExpModel::calcCoshConv(double sign, double tau, double dgamma, double sig, double rtau, double fsign) const
583 static double root2(sqrt(2.)) ;
584 static double root2pi(sqrt(2*atan2(0.,-1.))) ;
585 static double rootpi(sqrt(atan2(0.,-1.)));
586 double tau1 = 1/(1/tau-dgamma/2);
587 double tau2 = 1/(1/tau+dgamma/2);
595 xp *= fsign ; // modified FMV,08/13/03
596 sign *= fsign ; // modified FMV,08/13/03
598 cFly=tau1*(exp(sig*sig/(2*tau1*tau1)-sign*xp/tau1)
599 *RooMath::erfc(sig/(root2*tau1)-sign*xp/(root2*sig))
600 +sign*exp(sig*sig/(2*rtau*rtau)+xp/rtau)
601 *RooMath::erfc(sig/(root2*rtau)+xp/(root2*sig)))/(2*(tau1+sign*rtau))
602 +tau2*(exp(sig*sig/(2*tau2*tau2)-sign*xp/tau2)
603 *RooMath::erfc(sig/(root2*tau2)-sign*xp/(root2*sig))
604 +sign*exp(sig*sig/(2*rtau*rtau)+xp/rtau)
605 *RooMath::erfc(sig/(root2*rtau)+xp/(root2*sig)))/(2*(tau2+sign*rtau));
614double RooGExpModel::calcSinhConv(double sign, double sign1, double sign2, double tau, double dgamma, double sig, double rtau, double fsign) const
616 static double root2(sqrt(2.)) ;
617 static double root2pi(sqrt(2*atan2(0.,-1.))) ;
618 static double rootpi(sqrt(atan2(0.,-1.)));
619 double tau1 = 1/(1/tau-dgamma/2);
620 double tau2 = 1/(1/tau+dgamma/2);
629 xp *= fsign ; // modified FMV,08/13/03
630 sign1 *= fsign ; // modified FMV,08/13/03
631 sign2 *= fsign ; // modified FMV,08/13/03
633 cFly=sign1*tau1*(exp(sig*sig/(2*tau1*tau1)-sign*xp/tau1)
634 *RooMath::erfc(sig/(root2*tau1)-sign*xp/(root2*sig))
635 +sign*exp(sig*sig/(2*rtau*rtau)+xp/rtau)
636 *RooMath::erfc(sig/(root2*rtau)+xp/(root2*sig)))/(2*(tau1+sign*rtau))
637 +sign2*tau2*(exp(sig*sig/(2*tau2*tau2)-sign*xp/tau2)
638 *RooMath::erfc(sig/(root2*tau2)-sign*xp/(root2*sig))
639 +sign*exp(sig*sig/(2*rtau*rtau)+xp/rtau)
640 *RooMath::erfc(sig/(root2*rtau)+xp/(root2*sig)))/(2*(tau2+sign*rtau));
691 static double root2 = sqrt(2.) ;
717 if (
verboseEval()>0) std::cout <<
"RooGExpModel::analyticalIntegral(" <<
GetName() <<
") 1st form" << std::endl ;
743 if (
verboseEval()>0) std::cout <<
"RooGExpModel::analyticalIntegral(" <<
GetName() <<
") 2nd form" << std::endl ;
762 if (
verboseEval()>0) std::cout <<
"RooGExpModel::analyticalIntegral(" <<
GetName() <<
") 4th form omega = "
763 <<
omega <<
", tau = " << tau << std::endl ;
779 <<
") 5th form omega = " <<
omega <<
", tau = " << tau << std::endl ;
796 <<
") 6th form dgamma = " <<
dgamma <<
", tau = " << tau << std::endl ;
815 <<
") 6th form dgamma = " <<
dgamma <<
", tau = " << tau << std::endl ;
844 double sig,
double rtau,
double fsign,
const char* rangeName)
const
846 static double root2(sqrt(2.)) ;
859 std::complex<double>
eins(1,0);
860 std::complex<double> k(1/tau,
sign*
omega);
873 static double root2(sqrt(2.)) ;
893 std::cout <<
"epsilon method" << std::endl ;
894 static double epsilon = 1
e-4 ;
905 std::complex<double>
diff;
907 diff = std::complex<double>(2,0) ;
911 return std::complex<double>(tau/(1.+
wt*
wt),0)*std::complex<double>(1,
wt)*
diff;
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
static int verboseEval()
Return global level of verbosity for p.d.f. evaluations.
Abstract base class for objects that represent a real value that may appear on the left hand side of ...
Abstract base class for objects that represent a real value and implements functionality common to al...
double getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
bool matchArgs(const RooArgSet &allDeps, RooArgSet &numDeps, const RooArgProxy &a) const
Utility function for use in getAnalyticalIntegral().
RooArgSet is a container object that can hold multiple RooAbsArg objects.
The RooGExpModel is a RooResolutionModel implementation that models a resolution function that is the...
std::complex< double > evalCerfInt(double sign, double wt, double tau, double umin, double umax, double c) const
std::complex< double > calcSinConv(double sign, double sig, double tau, double omega, double rtau, double fsign) const
double calcDecayConv(double sign, double tau, double sig, double rtau, double fsign) const
double evaluate() const override
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
void generateEvent(Int_t code) override
Interface for generation of an event using the algorithm corresponding to the specified code.
Int_t getGenerator(const RooArgSet &directVars, RooArgSet &generateVars, bool staticInitOK=true) const override
Load generatedVars with the subset of directVars that we can generate events for, and return a code t...
std::complex< double > calcSinConvNorm(double sign, double tau, double omega, double sig, double rtau, double fsign, const char *rangeName) const
old code (asymptotic normalization only) std::complex<double> z(1/tau,sign*omega); return z*2/(omega*...
double analyticalIntegral(Int_t code, const char *rangeName=nullptr) const override
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral.
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=nullptr) const override
Interface function getAnalyticalIntergral advertises the analytical integrals that are supported.
Int_t basisCode(const char *name) const override
static std::complex< double > erfc(const std::complex< double > z)
complex erfc function
static std::complex< double > erf(const std::complex< double > z)
complex erf function
static std::complex< double > faddeeva_fast(std::complex< double > z)
evaluate Faddeeva function for complex argument (fast version)
static double uniform(TRandom *generator=randomGenerator())
Return a number uniformly distributed from (0,1)
static TRandom * randomGenerator()
Return a pointer to a singleton random-number generator implementation.
Provides static functions to create and keep track of RooRealVar constants.
RooResolutionModel is the base class for PDFs that represent a resolution model that can be convolute...
Int_t _basisCode
Identifier code for selected basis function.
RooAbsRealLValue & convVar() const
Return the convolution variable of the resolution model.
const RooFormulaVar & basis() const
RooTemplateProxy< RooAbsRealLValue > x
Dependent/convolution variable.
double max(const char *rname=nullptr) const
Query upper limit of range. This requires the payload to be RooAbsRealLValue or derived.
const T & arg() const
Return reference to object held in proxy.
double min(const char *rname=nullptr) const
Query lower limit of range. This requires the payload to be RooAbsRealLValue or derived.
const char * GetName() const override
Returns name of object.