60 EvtId parnum, mesnum, lnum, nunum;
67 double mymaxprob =
calcMaxProb( parnum, mesnum, lnum, nunum,
82 double massKst = point.
value();
142 switch ( mesontype ) {
144 calcamp = std::make_unique<EvtSemiLeptonicScalarAmp>();
147 calcamp = std::make_unique<EvtSemiLeptonicVectorAmp>();
150 calcamp = std::make_unique<EvtSemiLeptonicTensorAmp>();
164 if ( maxMass > -0.5 && maxMass < mMax )
169 double ampVal = sqrt(
170 1.0 / ( pow( massGood -
_mass, 2.0 ) + pow(
_width, 2.0 ) / 4.0 ) );
187 double maxdelta = 15.0 *
_width;
202 double maxMass = -1.;
205 maxMass = par->
mass();
206 for (
size_t i = 0; i < par->
getNDaug(); i++ ) {
208 if ( pmeson != tDaug )
214 double* dauMasses = 0;
217 dauId =
new EvtId[nDaug];
218 dauMasses =
new double[nDaug];
219 for (
size_t j = 0; j < nDaug; j++ ) {
225 EvtId* othDaugId = 0;
230 if ( tempPar->
getDaug( 0 ) == pmeson )
265 Lmin = std::max( t3 - t2 - t1, std::max( t2 - t3 - t1, t1 - t3 - t2 ) );
268 assert( Lmin == 0 || Lmin == 2 || Lmin == 4 );
273 double massD1 = dauMasses[0];
274 double massD2 = dauMasses[1];
277 if ( ( massD1 + massD2 ) >
_mass )
281 double massOthD = -10.;
282 double massParent = -10.;
293 if ( ( tt1 <= 4 ) && ( tt2 <= 4 ) ) {
294 birthl = std::max( tt3 - tt2 - tt1,
295 std::max( tt2 - tt3 - tt1, tt1 - tt3 - tt2 ) );
304 if ( ( maxMass > -0.5 ) && ( maxMass < massM ) )
322 if ( massParent > -1. ) {
333 double ampVal = sqrt( pdf.
evaluate( point ) );
372 scalar_part->
init( parent, p_init );
383 listdaug[1] = lepton;
384 listdaug[2] = nudaug;
386 amp.
init( parent, 3, listdaug );
389 daughter = root_part->
getDaug( 0 );
391 trino = root_part->
getDaug( 2 );
415 double m = root_part->
mass();
420 double q2, elepton, plepton;
422 double erho, prho, costl;
424 double maxfoundprob = 0.0;
428 for ( massiter = 0; massiter < 3; massiter++ ) {
432 if ( massiter == 1 ) {
435 if ( massiter == 2 ) {
437 if ( ( mass[0] + mass[1] + mass[2] ) > m )
438 mass[0] = m - mass[1] - mass[2] - 0.00001;
441 q2max = ( m - mass[0] ) * ( m - mass[0] );
445 for ( i = 0; i < 25; i++ ) {
446 q2 = ( ( i + 0.5 ) * q2max ) / 25.0;
448 erho = ( m * m + mass[0] * mass[0] - q2 ) / ( 2.0 * m );
450 prho = sqrt( erho * erho - mass[0] * mass[0] );
452 p4meson.
set( erho, 0.0, 0.0, -1.0 * prho );
453 p4w.
set( m - erho, 0.0, 0.0, prho );
456 elepton = ( q2 + mass[1] * mass[1] ) / ( 2.0 * sqrt( q2 ) );
457 plepton = sqrt( elepton * elepton - mass[1] * mass[1] );
461 for ( j = 0; j < 3; j++ ) {
462 costl = 0.99 * ( j - 1.0 );
466 p4lepton.
set( elepton, 0.0, plepton * sqrt( 1.0 - costl * costl ),
468 p4nu.
set( plepton, 0.0,
469 -1.0 * plepton * sqrt( 1.0 - costl * costl ),
470 -1.0 * plepton * costl );
472 EvtVector4R boost( ( m - erho ), 0.0, 0.0, 1.0 * prho );
473 p4lepton =
boostTo( p4lepton, boost );
478 daughter->
init( meson, p4meson );
479 lep->
init( lepton, p4lepton );
480 trino->
init( nudaug, p4nu );
482 calcamp->CalcAmp( root_part, amp, FormFactors );
522 double a = probctl[1];
523 double b = 0.5 * ( probctl[2] - probctl[0] );
524 double c = 0.5 * ( probctl[2] + probctl[0] ) - probctl[1];
527 if ( probctl[1] > prob )
529 if ( probctl[2] > prob )
532 if ( fabs( c ) > 1e-20 ) {
533 double ctlx = -0.5 * b / c;
534 if ( fabs( ctlx ) < 1.0 ) {
535 double probtmp = a + b * ctlx + c * ctlx * ctlx;
536 if ( probtmp > prob )
546 if ( prob > maxfoundprob ) {
void setBirthVtx(const EvtTwoBodyVertex &vb)
virtual int nRealDaughters()
static EvtDecayTable * getInstance()
EvtParticle * getParent() const
double evaluate(const T &p) const
static EvtSpinType::spintype getSpinType(EvtId i)
virtual void init(EvtId part_n, const EvtVector4R &p4)=0
void initProbMax() override
double calBreitWignerBasic(double maxMass)
static double getMeanMass(EvtId i)
int getSpinStates() const
void makeDaughters(unsigned int ndaug, EvtId *id)
void set(int i, double d)
EvtRaritaSchwinger boostTo(const EvtRaritaSchwinger &rs, const EvtVector4R p4)
EvtSpinDensity getSpinDensity()
std::unique_ptr< EvtSemiLeptonicAmp > calcamp
void setProbMax(double prbmx)
const EvtComplex & getAmp(int *ind) const
void vertex(const EvtComplex &)
EvtDecayBase * getDecayFunc(EvtParticle *p)
std::unique_ptr< EvtSemiLeptonicFF > SLPoleffmodel
EvtId getParentId() const
double calcMaxProb(EvtId parent, EvtId meson, EvtId lepton, EvtId nudaug, EvtSemiLeptonicFF *FormFactors)
double initializePhaseSpace(unsigned int numdaughter, EvtId *daughters, bool forceResetMasses=false, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
void checkNDaug(int d1, int d2=-1)
static double getMinMass(EvtId i)
void checkSpinParent(EvtSpinType::spintype sp)
void init(EvtId part_n, double e, double px, double py, double pz)
static int getSpin2(spintype stype)
void checkSpinDaughter(int d1, EvtSpinType::spintype sp)
static double getWidth(EvtId i)
std::string getName() override
void setDiagonalSpinDensity()
EvtParticle * getDaug(int i)
static double getMaxRange(EvtId i)
void decay(EvtParticle *p) override
static double getMass(EvtId i)
EvtSpinType::spintype _spin
EvtDecayBase * clone() override
void init(EvtId p, int ndaug, EvtId *daug)
double calBreitWigner(EvtParticle *pmeson, EvtPoint1D point)
static double getMaxMass(EvtId i)
double normalizedProb(const EvtSpinDensity &d)
EvtId getDaug(int i) const