1 //--------------------------------------------------------------------------
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.
8 // Copyright Information: See EvtGen/COPYRIGHT
9 // Copyright (C) 1998 Caltech, UCSB
11 // Module: EvtPropSLPole.cc
13 // Description: Routine to implement semileptonic decays according
14 // to light cone sum rules
16 // Modification history:
18 // DJL April 23, 1998 Module created
20 //------------------------------------------------------------------------
22 #include "EvtGenBase/EvtPatches.hh"
24 #include "EvtGenBase/EvtParticle.hh"
25 #include "EvtGenBase/EvtGenKine.hh"
26 #include "EvtGenBase/EvtPDL.hh"
27 #include "EvtGenBase/EvtReport.hh"
28 #include "EvtGenModels/EvtPropSLPole.hh"
29 #include "EvtGenModels/EvtSLPoleFF.hh"
30 #include "EvtGenBase/EvtSemiLeptonicScalarAmp.hh"
31 #include "EvtGenBase/EvtSemiLeptonicVectorAmp.hh"
32 #include "EvtGenBase/EvtSemiLeptonicTensorAmp.hh"
33 #include "EvtGenBase/EvtIntervalFlatPdf.hh"
34 #include "EvtGenBase/EvtScalarParticle.hh"
35 #include "EvtGenBase/EvtVectorParticle.hh"
36 #include "EvtGenBase/EvtTensorParticle.hh"
37 #include "EvtGenBase/EvtTwoBodyVertex.hh"
38 #include "EvtGenBase/EvtPropBreitWignerRel.hh"
39 #include "EvtGenBase/EvtPDL.hh"
40 #include "EvtGenBase/EvtAmpPdf.hh"
41 #include "EvtGenBase/EvtMassAmp.hh"
42 #include "EvtGenBase/EvtSpinType.hh"
43 #include "EvtGenBase/EvtDecayTable.hh"
46 EvtPropSLPole::~EvtPropSLPole() {}
48 std::string EvtPropSLPole::getName(){
55 EvtDecayBase* EvtPropSLPole::clone(){
57 return new EvtPropSLPole;
61 void EvtPropSLPole::decay( EvtParticle *p ){
65 EvtId parnum,mesnum,lnum,nunum;
67 parnum = getParentId();
72 double mymaxprob = calcMaxProb(parnum,mesnum,
73 lnum,nunum,SLPoleffmodel);
75 setProbMax(mymaxprob);
81 double minKstMass = EvtPDL::getMinMass(p->getDaug(0)->getId());
82 double maxKstMass = EvtPDL::getMaxMass(p->getDaug(0)->getId());
84 EvtIntervalFlatPdf flat(minKstMass, maxKstMass);
85 EvtPdfGen<EvtPoint1D> gen(flat);
86 EvtPoint1D point = gen();
88 double massKst = point.value();
90 p->getDaug(0)->setMass(massKst);
91 p->initializePhaseSpace(getNDaug(),getDaugs());
93 // EvtVector4R p4meson = p->getDaug(0)->getP4();
95 calcamp->CalcAmp(p,_amp2,SLPoleffmodel);
97 EvtParticle *mesonPart = p->getDaug(0);
99 double meson_BWAmp = calBreitWigner(mesonPart, point);
102 list[0]=0; list[1]=0;
103 _amp2.vertex(0,0,_amp2.getAmp(list)*meson_BWAmp);
104 list[0]=0; list[1]=1;
105 _amp2.vertex(0,1,_amp2.getAmp(list)*meson_BWAmp);
107 list[0]=1; list[1]=0;
108 _amp2.vertex(1,0,_amp2.getAmp(list)*meson_BWAmp);
109 list[0]=1; list[1]=1;
110 _amp2.vertex(1,1,_amp2.getAmp(list)*meson_BWAmp);
112 list[0]=2; list[1]=0;
113 _amp2.vertex(2,0,_amp2.getAmp(list)*meson_BWAmp);
114 list[0]=2; list[1]=1;
115 _amp2.vertex(2,1,_amp2.getAmp(list)*meson_BWAmp);
122 void EvtPropSLPole::initProbMax(){
124 _isProbMaxSet = false;
131 void EvtPropSLPole::init(){
135 //We expect the parent to be a scalar
136 //and the daughters to be X lepton neutrino
138 checkSpinParent(EvtSpinType::SCALAR);
139 checkSpinDaughter(1,EvtSpinType::DIRAC);
140 checkSpinDaughter(2,EvtSpinType::NEUTRINO);
142 EvtSpinType::spintype mesontype=EvtPDL::getSpinType(getDaug(0));
144 SLPoleffmodel = new EvtSLPoleFF(getNArg(),getArgs());
146 if ( mesontype==EvtSpinType::SCALAR ) {
147 calcamp = new EvtSemiLeptonicScalarAmp;
149 if ( mesontype==EvtSpinType::VECTOR ) {
150 calcamp = new EvtSemiLeptonicVectorAmp;
152 if ( mesontype==EvtSpinType::TENSOR ) {
153 calcamp = new EvtSemiLeptonicTensorAmp;
159 double EvtPropSLPole::calBreitWignerBasic(double maxMass){
161 if ( _width< 0.0001) return 1.0;
162 //its not flat - but generated according to a BW
164 double mMin=_massMin;
165 double mMax=_massMax;
166 if ( maxMass>-0.5 && maxMass< mMax) mMax=maxMass;
168 double massGood = EvtRandom::Flat(mMin, mMax);
170 double ampVal = sqrt(1.0/(pow(massGood-_mass, 2.0) + pow(_width, 2.0)/4.0));
177 double EvtPropSLPole::calBreitWigner(EvtParticle *pmeson, EvtPoint1D point){
179 EvtId mesnum = pmeson->getId();
180 double _mass = EvtPDL::getMeanMass(mesnum);
181 double _width = EvtPDL::getWidth(mesnum);
182 double _maxRange = EvtPDL::getMaxRange(mesnum);
183 EvtSpinType::spintype mesontype=EvtPDL::getSpinType(mesnum);
184 _includeDecayFact=true;
185 _includeBirthFact=true;
189 double maxdelta = 15.0*_width;
191 if ( _maxRange > 0.00001 ) {
192 _massMax=_mass+maxdelta;
193 _massMin=_mass-_maxRange;
196 _massMax=_mass+maxdelta;
197 _massMin=_mass-15.0*_width;
200 _massMax=_mass+maxdelta;
201 if ( _massMin< 0. ) _massMin=0.;
204 EvtParticle* par=pmeson->getParent();
207 if ( par->hasValidP4() ) maxMass=par->mass();
208 for ( size_t i=0;i<par->getNDaug();i++) {
209 EvtParticle *tDaug=par->getDaug(i);
210 if ( pmeson != tDaug )
211 maxMass-=EvtPDL::getMinMass(tDaug->getId());
217 size_t nDaug = pmeson->getNDaug();
219 dauId=new EvtId[nDaug];
220 dauMasses=new double[nDaug];
221 for (size_t j=0;j<nDaug;j++) {
222 dauId[j]=pmeson->getDaug(j)->getId();
223 dauMasses[j]=pmeson->getDaug(j)->mass();
228 EvtParticle *tempPar=pmeson->getParent();
230 parId=new EvtId(tempPar->getId());
231 if ( tempPar->getNDaug()==2 ) {
232 if ( tempPar->getDaug(0) == pmeson ) othDaugId=new EvtId(tempPar->getDaug(1)->getId());
233 else othDaugId=new EvtId(tempPar->getDaug(0)->getId());
237 if ( nDaug!=2) return calBreitWignerBasic(maxMass);
239 if ( _width< 0.00001) return 1.0;
241 //first figure out L - take the lowest allowed.
243 EvtSpinType::spintype spinD1=EvtPDL::getSpinType(dauId[0]);
244 EvtSpinType::spintype spinD2=EvtPDL::getSpinType(dauId[1]);
246 int t1=EvtSpinType::getSpin2(spinD1);
247 int t2=EvtSpinType::getSpin2(spinD2);
248 int t3=EvtSpinType::getSpin2(_spin);
252 // allow for special cases.
255 //There are some things I don't know how to deal with
256 if ( t3>4) return calBreitWignerBasic(maxMass);
257 if ( t1>4) return calBreitWignerBasic(maxMass);
258 if ( t2>4) return calBreitWignerBasic(maxMass);
260 //figure the min and max allowwed "spins" for the daughters state
261 Lmin=std::max(t3-t2-t1,std::max(t2-t3-t1,t1-t3-t2));
263 assert(Lmin==0||Lmin==2||Lmin==4);
266 //double massD1=EvtPDL::getMeanMass(dauId[0]);
267 //double massD2=EvtPDL::getMeanMass(dauId[1]);
268 double massD1=dauMasses[0];
269 double massD2=dauMasses[1];
271 // I'm not sure how to define the vertex factor here - so retreat to nonRel code.
272 if ( (massD1+massD2)> _mass ) return calBreitWignerBasic(maxMass);
274 //parent vertex factor not yet implemented
275 double massOthD=-10.;
276 double massParent=-10.;
279 EvtSpinType::spintype spinOth=EvtPDL::getSpinType(*othDaugId);
280 EvtSpinType::spintype spinPar=EvtPDL::getSpinType(*parId);
282 int tt1=EvtSpinType::getSpin2(spinOth);
283 int tt2=EvtSpinType::getSpin2(spinPar);
284 int tt3=EvtSpinType::getSpin2(_spin);
286 //figure the min and max allowwed "spins" for the daughters state
287 if ( (tt1<=4) && ( tt2<=4) ) {
288 birthl=std::max(tt3-tt2-tt1,std::max(tt2-tt3-tt1,tt1-tt3-tt2));
289 if (birthl<0) birthl=0;
291 massOthD=EvtPDL::getMeanMass(*othDaugId);
292 massParent=EvtPDL::getMeanMass(*parId);
297 double massM=_massMax;
298 if ( (maxMass > -0.5) && (maxMass < massM) ) massM=maxMass;
300 //special case... if the parent mass is _fixed_ we can do a little better
301 //and only for a two body decay as that seems to be where we have problems
303 // Define relativistic propagator amplitude
305 EvtTwoBodyVertex vd(massD1,massD2,_mass,Lmin/2);
307 EvtPropBreitWignerRel bw(_mass,_width);
308 EvtMassAmp amp(bw,vd);
309 // if ( _fixMassForMax) amp.fixUpMassForMax();
310 // else std::cout << "problem problem\n";
311 if ( _includeDecayFact) {
313 amp.addDeathFactFF();
315 if ( massParent>-1.) {
316 if ( _includeBirthFact ) {
318 EvtTwoBodyVertex vb(_mass,massOthD,massParent,birthl/2);
321 amp.addBirthFactFF();
325 EvtAmpPdf<EvtPoint1D> pdf(amp);
327 double ampVal = sqrt(pdf.evaluate(point));
329 if ( parId) delete parId;
330 if ( othDaugId) delete othDaugId;
331 if ( dauId) delete [] dauId;
332 if ( dauMasses) delete [] dauMasses;
339 double EvtPropSLPole::calcMaxProb( EvtId parent, EvtId meson,
340 EvtId lepton, EvtId nudaug,
341 EvtSemiLeptonicFF *FormFactors ) {
343 //This routine takes the arguements parent, meson, and lepton
344 //number, and a form factor model, and returns a maximum
345 //probability for this semileptonic form factor model. A
346 //brute force method is used. The 2D cos theta lepton and
347 //q2 phase space is probed.
349 //Start by declaring a particle at rest.
351 //It only makes sense to have a scalar parent. For now.
352 //This should be generalized later.
354 EvtScalarParticle *scalar_part;
355 EvtParticle *root_part;
357 scalar_part=new EvtScalarParticle;
359 //cludge to avoid generating random numbers!
360 scalar_part->noLifeTime();
364 p_init.set(EvtPDL::getMass(parent),0.0,0.0,0.0);
365 scalar_part->init(parent,p_init);
366 root_part=(EvtParticle *)scalar_part;
367 // root_part->set_type(EvtSpinType::SCALAR);
368 root_part->setDiagonalSpinDensity();
370 EvtParticle *daughter, *lep, *trino;
376 listdaug[1] = lepton;
377 listdaug[2] = nudaug;
379 amp.init(parent,3,listdaug);
381 root_part->makeDaughters(3,listdaug);
382 daughter=root_part->getDaug(0);
383 lep=root_part->getDaug(1);
384 trino=root_part->getDaug(2);
386 EvtDecayBase *decayer;
387 decayer = EvtDecayTable::getDecayFunc(daughter);
389 daughter->makeDaughters(decayer->nRealDaughters(),decayer->getDaugs());
390 for(int ii=0; ii<decayer->nRealDaughters(); ii++){
391 daughter->getDaug(ii)->setMass(EvtPDL::getMeanMass(daughter->getDaug(ii)->getId()));
395 //cludge to avoid generating random numbers!
396 daughter->noLifeTime();
400 //Initial particle is unpolarized, well it is a scalar so it is
403 rho.setDiag(root_part->getSpinStates());
407 double m = root_part->mass();
409 EvtVector4R p4meson, p4lepton, p4nu, p4w;
412 double q2, elepton, plepton;
414 double erho,prho,costl;
416 double maxfoundprob = 0.0;
420 for (massiter=0;massiter<3;massiter++){
422 mass[0] = EvtPDL::getMeanMass(meson);
423 mass[1] = EvtPDL::getMeanMass(lepton);
424 mass[2] = EvtPDL::getMeanMass(nudaug);
426 mass[0] = EvtPDL::getMinMass(meson);
429 mass[0] = EvtPDL::getMaxMass(meson);
430 if ( (mass[0]+mass[1]+mass[2])>m) mass[0]=m-mass[1]-mass[2]-0.00001;
433 q2max = (m-mass[0])*(m-mass[0]);
438 q2 = ((i+0.5)*q2max)/25.0;
440 erho = ( m*m + mass[0]*mass[0] - q2 )/(2.0*m);
442 prho = sqrt(erho*erho-mass[0]*mass[0]);
444 p4meson.set(erho,0.0,0.0,-1.0*prho);
445 p4w.set(m-erho,0.0,0.0,prho);
447 //This is in the W rest frame
448 elepton = (q2+mass[1]*mass[1])/(2.0*sqrt(q2));
449 plepton = sqrt(elepton*elepton-mass[1]*mass[1]);
455 costl = 0.99*(j - 1.0);
457 //These are in the W rest frame. Need to boost out into
459 p4lepton.set(elepton,0.0,
460 plepton*sqrt(1.0-costl*costl),plepton*costl);
461 p4nu.set(plepton,0.0,
462 -1.0*plepton*sqrt(1.0-costl*costl),-1.0*plepton*costl);
464 EvtVector4R boost((m-erho),0.0,0.0,1.0*prho);
465 p4lepton=boostTo(p4lepton,boost);
466 p4nu=boostTo(p4nu,boost);
468 //Now initialize the daughters...
470 daughter->init(meson,p4meson);
471 lep->init(lepton,p4lepton);
472 trino->init(nudaug,p4nu);
474 calcamp->CalcAmp(root_part,amp,FormFactors);
476 EvtPoint1D *point = new EvtPoint1D(mass[0]);
478 double meson_BWAmp = calBreitWigner(daughter, *point);
481 list[0]=0; list[1]=0;
482 amp.vertex(0,0,amp.getAmp(list)*meson_BWAmp);
483 list[0]=0; list[1]=1;
484 amp.vertex(0,1,amp.getAmp(list)*meson_BWAmp);
486 list[0]=1; list[1]=0;
487 amp.vertex(1,0,amp.getAmp(list)*meson_BWAmp);
488 list[0]=1; list[1]=1;
489 amp.vertex(1,1,amp.getAmp(list)*meson_BWAmp);
491 list[0]=2; list[1]=0;
492 amp.vertex(2,0,amp.getAmp(list)*meson_BWAmp);
493 list[0]=2; list[1]=1;
494 amp.vertex(2,1,amp.getAmp(list)*meson_BWAmp);
496 //Now find the probability at this q2 and cos theta lepton point
497 //and compare to maxfoundprob.
499 //Do a little magic to get the probability!!
500 prob = rho.normalizedProb(amp.getSpinDensity());
505 //probclt contains prob at ctl=-1,0,1.
506 //prob=a+b*ctl+c*ctl^2
509 double b=0.5*(probctl[2]-probctl[0]);
510 double c=0.5*(probctl[2]+probctl[0])-probctl[1];
513 if (probctl[1]>prob) prob=probctl[1];
514 if (probctl[2]>prob) prob=probctl[2];
517 double ctlx=-0.5*b/c;
519 double probtmp=a+b*ctlx+c*ctlx*ctlx;
520 if (probtmp>prob) prob=probtmp;
525 //report(DEBUG,"EvtGen") << "prob,probctl:"<<prob<<" "
526 // << probctl[0]<<" "
527 // << probctl[1]<<" "
528 // << probctl[2]<<endl;
530 if ( prob > maxfoundprob ) {
535 if ( EvtPDL::getWidth(meson) <= 0.0 ) {
536 //if the particle is narrow dont bother with changing the mass.
541 root_part->deleteTree();