CGEM BOSS 6.6.5.g
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtDMix.cc
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2//
3// Environment:
4// This software is part of the EvtGen package developed jointly
5// for the BaBar and CLEO collaborations. If you use all or part
6// of it, please give an appropriate acknowledgement.
7//
8// Copyright Information: See EvtGen/COPYRIGHT
9// Copyright (C) 1998 Caltech, UCSB
10//
11// Module: EvtDMix.cc
12//
13// Description: Routine to decay a particle according th phase space
14//
15// Modification history:
16//
17// RYD January 8, 1997 Module created
18//
19//------------------------------------------------------------------------
20//
22#include <stdlib.h>
25#include "EvtGenBase/EvtPDL.hh"
29#include <string>
30
32
33void EvtDMix::getName(std::string& model_name){
34
35 model_name="DMIX";
36
37}
38
40
41 return new EvtDMix;
42
43}
44
45
47
48 // check that there are 0 arguments
49 checkNArg(3);
50 _rd=getArg(0);
51 _xpr=getArg(1);
52 _ypr=getArg(2);
53}
54
56
57 noProbMax();
58
59}
60
62
63 //unneeded - lange - may13-02
64 //if ( p->getNDaug() != 0 ) {
65 //Will end up here because maxrate multiplies by 1.2
66 // report(DEBUG,"EvtGen") << "In EvtDMix: has "
67 // <<" daugthers should not be here!"<<endl;
68 // return;
69 //}
70
72
73 double ctau=EvtPDL::getctau(p->getId());
74 if ( ctau==0. ) return;
75
76
77 double pdf, random, gt, weight;
78
79 double maxPdf=_rd + sqrt(_rd)*_ypr*50. + 2500.0*(_xpr*_xpr+_ypr*_ypr)/4.0;
80 bool keepGoing=true;
81 while ( keepGoing ) {
82 random=EvtRandom::Flat();
83 gt=-log(random);
84 weight=random;
85 pdf=_rd + sqrt(_rd)*_ypr*gt + gt*gt*(_xpr*_xpr+_ypr*_ypr)/4.0;
86 pdf*=exp(-1.0*gt);
87 pdf/=weight;
88 if ( pdf > maxPdf )
89 std::cout << pdf << " " << weight << " " << maxPdf << " " << gt << std::endl;
90 if ( pdf > maxPdf*EvtRandom::Flat()) keepGoing=false;
91 }
92
93
94 p->setLifetime(gt*ctau);
95
96 return ;
97}
98
99
EvtComplex exp(const EvtComplex &c)
Definition: EvtComplex.hh:252
*********Class see also m_nmax DOUBLE PRECISION m_MasPhot DOUBLE PRECISION m_phsu DOUBLE PRECISION m_Xenph DOUBLE PRECISION m_r2 DOUBLE PRECISION m_WtMass INTEGER m_nmax INTEGER m_Nevgen INTEGER m_IsFSR INTEGER m_MarTot *COMMON c_KarFin $ !Output file $ !Event serial number $ !alpha QED at Thomson limit $ !minimum energy at CMS for remooval $ !infrared dimensionless $ !dummy photon IR regulator $ !crude photon multiplicity enhancement factor *EVENT $ !MC crude volume of PhhSpace *Sfactors $ !YFS formfactor IR part only $ !YFS formfactor non IR finite part $ !mass weight
Definition: KarFin.h:34
void initProbMax()
Definition: EvtDMix.cc:55
EvtDMix()
Definition: EvtDMix.hh:34
EvtDecayBase * clone()
Definition: EvtDMix.cc:39
virtual ~EvtDMix()
Definition: EvtDMix.cc:31
void getName(std::string &name)
Definition: EvtDMix.cc:33
void init()
Definition: EvtDMix.cc:46
void decay(EvtParticle *p)
Definition: EvtDMix.cc:61
double getArg(int j)
void noProbMax()
EvtId * getDaugs()
Definition: EvtDecayBase.hh:65
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
static double getctau(EvtId i)
Definition: EvtPDL.hh:55
EvtId getId() const
Definition: EvtParticle.cc:113
void setLifetime(double tau)
Definition: EvtParticle.cc:89
double initializePhaseSpace(int numdaughter, EvtId *daughters, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
static double Flat()
Definition: EvtRandom.cc:73