61enum BasisSign {
Both = 0, Plus = +1, Minus = -1 };
89 _mean(
"mean",
"Mean of Gaussian component",
this,
meanIn),
92 _meanSF(
"meanSF",
"Scale factor for mean",
this,
meanSF),
147 ssf(
"ssf",
"Sigma Scale Factor",
this,
_rsSF),
148 rsf(
"rsf",
"RLife Scale Factor",
this,
_rsSF),
149 _flip(
type==Flipped),
179 _flip(
type==Flipped),
198 _flatSFInt(
other._flatSFInt),
199 _asympInt(
other._asympInt)
207 std::string str =
name;
210 str.erase(remove(str.begin(),str.end(),
' '),str.end());
214 if (str ==
"exp(-abs(@0)/@1)")
return expBasisSum ;
215 if (str ==
"exp(-@0/@1)*sin(@0*@2)")
return sinBasisPlus ;
217 if (str ==
"exp(-abs(@0)/@1)*sin(@0*@2)")
return sinBasisSum ;
218 if (str ==
"exp(-@0/@1)*cos(@0*@2)")
return cosBasisPlus ;
220 if (str ==
"exp(-abs(@0)/@1)*cos(@0*@2)")
return cosBasisSum ;
221 if (str ==
"exp(-@0/@1)*sinh(@0*@2/2)")
return sinhBasisPlus;
223 if (str ==
"exp(-abs(@0)/@1)*sinh(@0*@2/2)")
return sinhBasisSum;
224 if (str ==
"exp(-@0/@1)*cosh(@0*@2/2)")
return coshBasisPlus;
226 if (str ==
"exp(-abs(@0)/@1)*cosh(@0*@2/2)")
return coshBasisSum;
245 (-z * z - 1.26551223 +
251 t * (-1.13520398 + t * (1.48851587 + t * (-0.82215223 + t * 0.17087277)))))))));
256 exp(-z * z - 1.26551223 +
261 t * (0.27886807 + t * (-1.13520398 +
262 t * (1.48851587 + t * (-0.82215223 + t * 0.17087277))))))))));
273std::complex<double> evalCerfApprox(
double swt,
double u,
double c)
275 static double rootpi= sqrt(atan2(0.,-1.));
276 std::complex<double> z(
swt*
c,
u+
c);
277 std::complex<double>
zc(
u+
c,-
swt*
c);
278 std::complex<double>
zsq= z*z;
279 std::complex<double>
v= -
zsq -
u*
u;
281 return std::exp(
v)*(-std::exp(
zsq)/(
zc*
rootpi) + 1.)*2.;
286std::complex<double> evalCerf(
double swt,
double u,
double c)
288 std::complex<double> z(
swt*
c,
u+
c);
312 static double root2(sqrt(2.)) ;
331 if (
verboseEval()>2) std::cout <<
"RooGExpModel::evaluate(" <<
GetName() <<
") 1st form" << std::endl ;
361 if (
verboseEval()>2) std::cout <<
"RooGExpModel::evaluate(" <<
GetName() <<
") 2nd form" << std::endl ;
369 if (
verboseEval()>2) std::cout <<
"RooGExpModel::evaluate(" <<
GetName() <<
") 3d form tau=" << tau << std::endl ;
380 if (
verboseEval()>2) std::cout <<
"RooGExpModel::evaluate(" <<
GetName() <<
") 4th form omega = "
381 <<
omega <<
", tau = " << tau << std::endl ;
393 <<
") 5th form omega = " <<
omega <<
", tau = " << tau << std::endl ;
407 <<
") 6th form = " <<
dgamma <<
", tau = " << tau << std::endl;
427 <<
") 7th form = " <<
dgamma <<
", tau = " << tau << std::endl;
450 static double root2(sqrt(2.)) ;
461 std::complex<double>
eins(1,0);
462 std::complex<double> k(1/tau,
sign*
omega);
476 static double root2(sqrt(2.)) ;
499 static double root2(sqrt(2.)) ;
500 static double root2pi(sqrt(2*atan2(0.,-1.))) ;
501 static double rootpi(sqrt(atan2(0.,-1.)));
504 double xp(
x - _mean*_meanSF) ;
513 if ((
sign<0)&&(std::abs(tau-
rtau)<tau/260)) {
522 *(sig*exp(-1/(2*sig*sig)*std::pow((sig*sig/
MeanTau+
xp),2))
526 double epsilon=0.5*(tau-
rtau);
580double RooGExpModel::calcCoshConv(double sign, double tau, double dgamma, double sig, double rtau, double fsign) const
584 static double root2(sqrt(2.)) ;
585 static double root2pi(sqrt(2*atan2(0.,-1.))) ;
586 static double rootpi(sqrt(atan2(0.,-1.)));
587 double tau1 = 1/(1/tau-dgamma/2);
588 double tau2 = 1/(1/tau+dgamma/2);
596 xp *= fsign ; // modified FMV,08/13/03
597 sign *= fsign ; // modified FMV,08/13/03
599 cFly=tau1*(exp(sig*sig/(2*tau1*tau1)-sign*xp/tau1)
600 *RooMath::erfc(sig/(root2*tau1)-sign*xp/(root2*sig))
601 +sign*exp(sig*sig/(2*rtau*rtau)+xp/rtau)
602 *RooMath::erfc(sig/(root2*rtau)+xp/(root2*sig)))/(2*(tau1+sign*rtau))
603 +tau2*(exp(sig*sig/(2*tau2*tau2)-sign*xp/tau2)
604 *RooMath::erfc(sig/(root2*tau2)-sign*xp/(root2*sig))
605 +sign*exp(sig*sig/(2*rtau*rtau)+xp/rtau)
606 *RooMath::erfc(sig/(root2*rtau)+xp/(root2*sig)))/(2*(tau2+sign*rtau));;
615double RooGExpModel::calcSinhConv(double sign, double sign1, double sign2, double tau, double dgamma, double sig, double rtau, double fsign) const
617 static double root2(sqrt(2.)) ;
618 static double root2pi(sqrt(2*atan2(0.,-1.))) ;
619 static double rootpi(sqrt(atan2(0.,-1.)));
620 double tau1 = 1/(1/tau-dgamma/2);
621 double tau2 = 1/(1/tau+dgamma/2);
630 xp *= fsign ; // modified FMV,08/13/03
631 sign1 *= fsign ; // modified FMV,08/13/03
632 sign2 *= fsign ; // modified FMV,08/13/03
634 cFly=sign1*tau1*(exp(sig*sig/(2*tau1*tau1)-sign*xp/tau1)
635 *RooMath::erfc(sig/(root2*tau1)-sign*xp/(root2*sig))
636 +sign*exp(sig*sig/(2*rtau*rtau)+xp/rtau)
637 *RooMath::erfc(sig/(root2*rtau)+xp/(root2*sig)))/(2*(tau1+sign*rtau))
638 +sign2*tau2*(exp(sig*sig/(2*tau2*tau2)-sign*xp/tau2)
639 *RooMath::erfc(sig/(root2*tau2)-sign*xp/(root2*sig))
640 +sign*exp(sig*sig/(2*rtau*rtau)+xp/rtau)
641 *RooMath::erfc(sig/(root2*rtau)+xp/(root2*sig)))/(2*(tau2+sign*rtau));;
692 static double root2 = sqrt(2.) ;
718 if (
verboseEval()>0) std::cout <<
"RooGExpModel::analyticalIntegral(" <<
GetName() <<
") 1st form" << std::endl ;
744 if (
verboseEval()>0) std::cout <<
"RooGExpModel::analyticalIntegral(" <<
GetName() <<
") 2nd form" << std::endl ;
763 if (
verboseEval()>0) std::cout <<
"RooGExpModel::analyticalIntegral(" <<
GetName() <<
") 4th form omega = "
764 <<
omega <<
", tau = " << tau << std::endl ;
780 <<
") 5th form omega = " <<
omega <<
", tau = " << tau << std::endl ;
797 <<
") 6th form dgamma = " <<
dgamma <<
", tau = " << tau << std::endl ;
816 <<
") 6th form dgamma = " <<
dgamma <<
", tau = " << tau << std::endl ;
845 double sig,
double rtau,
double fsign,
const char* rangeName)
const
847 static double root2(sqrt(2.)) ;
860 std::complex<double>
eins(1,0);
861 std::complex<double> k(1/tau,
sign*
omega);
874 static double root2(sqrt(2.)) ;
894 std::cout <<
"epsilon method" << std::endl ;
895 static double epsilon = 1
e-4 ;
906 std::complex<double>
diff;
908 diff = std::complex<double>(2,0) ;
912 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.
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.