20 #ifndef EVT_INTERVAL_DECAY_AMP
21 #define EVT_INTERVAL_DECAY_AMP
26 #include "EvtGenBase/EvtDecayAmp.hh"
27 #include "EvtGenBase/EvtParticle.hh"
28 #include "EvtGenBase/EvtMacros.hh"
29 #include "EvtGenBase/EvtPdf.hh"
30 #include "EvtGenBase/EvtAmpFactory.hh"
31 #include "EvtGenBase/EvtMultiChannelParser.hh"
32 #include "EvtGenBase/EvtAmpPdf.hh"
33 #include "EvtGenBase/EvtCPUtil.hh"
34 #include "EvtGenBase/EvtPDL.hh"
35 #include "EvtGenBase/EvtCyclic3.hh"
36 #include "EvtGenBase/EvtReport.hh"
44 : _probMax(0.), _nScan(0), _fact(0)
48 : _probMax(other._probMax), _nScan(other._nScan),
64 vector<std::string> args;
66 for(i=0;i<getNArg();i++) args.push_back(getArgStr(i));
72 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"Create factory and interval" << std::endl;
73 _fact = createFactory(parser);
78 _probMax = parser.pdfMax();
79 _nScan = parser.nScan();
80 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"Pdf maximum " << _probMax << std::endl;
81 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"Scan number " << _nScan << std::endl;
85 virtual void initProbMax()
89 if(_probMax > 0) setProbMax(_probMax);
98 printf(
"Sampling %d points to find maximum\n",_nScan);
100 _probMax = factor * x.value();
101 printf(
"Found maximum %f\n",x.value());
102 printf(
"Increase to %f\n",_probMax);
103 setProbMax(_probMax);
111 static EvtId B0=EvtPDL::getId(
"B0");
112 static EvtId B0B=EvtPDL::getId(
"anti-B0");
120 _x = pc->randomPoint();
122 if(_fact->isCPModel()) {
128 EvtComplex Abar = _fact->getAmpConj()->evaluate(_x);
130 EvtCPUtil::getInstance()->OtherB(p,t,other_b);
132 double dm = _fact->dm();
133 double mixAmpli = _fact->mixAmpli();
134 double mixPhase = _fact->mixPhase();
135 EvtComplex qoverp( cos(mixPhase)*mixAmpli, sin(mixPhase)*mixAmpli);
136 EvtComplex poverq( cos(mixPhase)/mixAmpli, -sin(mixPhase)/mixAmpli);
139 if (other_b==B0B) ampl = A*cos(dm*t/(2*EvtConst::c)) +
140 EvtComplex(0.,1.)*Abar*sin(dm*t/(2*EvtConst::c))*qoverp;
141 if (other_b==B0) ampl = Abar*cos(dm*t/(2*EvtConst::c)) +
142 EvtComplex(0.,1.)*A*sin(dm*t/(2*EvtConst::c))*poverq;
148 ampl = amplNonCP(_x);
153 double comp = sqrt(pc->evaluate(_x));
160 std::vector<EvtVector4R> v = initDaughters(_x);
165 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"Number of daughters " << N << std::endl;
166 EvtGenReport(EVTGEN_INFO,
"EvtGen") <<
"Momentum vector size " << v.size() << std::endl;
170 for(
size_t i=0;i<N;i++){
177 virtual std::vector<EvtVector4R> initDaughters(
const T& p)
const = 0;
181 const T & x()
const {
return _x;}
182 EvtComplex amplNonCP(
const T & x) {
return _fact->getAmp()->evaluate(x);}
virtual void init(EvtId part_n, const EvtVector4R &p4)=0
EvtParticle * getDaug(int i)
void vertex(const EvtComplex &)