Fix bug in building local list of valid files.
[u/mrichter/AliRoot.git] / TEvtGen / EvtGenModels / EvtBToVlnuBall.cpp
CommitLineData
da0e9ce3 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: EvtGenModels/EvtBToVlnuBall.cc
12//
13// Description: B->Xu l nu with the Ball/Zwicky decay model
14// Xu is a vector (rho, rho0, omega)
15//
16//
17// Modification history:
18//
19// Wells Wulsin 2008 Aug 14 Module created
20//
21//------------------------------------------------------------------------
22//
23#include "EvtGenBase/EvtPatches.hh"
24#include <stdlib.h>
25#include <assert.h>
26#include "EvtGenBase/EvtParticle.hh"
27#include "EvtGenBase/EvtGenKine.hh"
28#include "EvtGenBase/EvtPDL.hh"
29#include "EvtGenBase/EvtReport.hh"
30#include "EvtGenModels/EvtBToVlnuBall.hh"
31#include "EvtGenModels/EvtBToVlnuBallFF.hh"
32#include "EvtGenBase/EvtSemiLeptonicVectorAmp.hh"
33#include "EvtGenBase/EvtSemiLeptonicScalarAmp.hh"
34#include <string>
35using std::endl;
36
37EvtBToVlnuBall::EvtBToVlnuBall():
38 _Ballmodel(0)
39 ,_calcamp(0)
40{}
41
42EvtBToVlnuBall::~EvtBToVlnuBall() {
43 delete _Ballmodel;
44 _Ballmodel=0;
45 delete _calcamp;
46 _calcamp=0;
47}
48
49
50std::string EvtBToVlnuBall::getName(){
51 return "BTOVLNUBALL";
52}
53
54
55EvtDecayBase* EvtBToVlnuBall::clone(){
56 return new EvtBToVlnuBall;
57}
58
59
60void EvtBToVlnuBall::decay( EvtParticle *p ){
61
62 p->initializePhaseSpace(getNDaug(),getDaugs());
63 _calcamp->CalcAmp(p,_amp2,_Ballmodel);
64
65
66
67
68}
69
70void EvtBToVlnuBall::initProbMax(){
71
72EvtId parnum,mesnum,lnum,nunum;
73
74parnum = getParentId();
75mesnum = getDaug(0);
76lnum = getDaug(1);
77nunum = getDaug(2);
78
79double mymaxprob = _calcamp->CalcMaxProb(parnum,mesnum,
80 lnum,nunum,_Ballmodel);
81
82setProbMax(mymaxprob);
83
84}
85
86
87void EvtBToVlnuBall::init(){
88
89 checkNDaug(3);
90
91 //We expect the parent to be a scalar
92 //and the daughters to be X lepton neutrino
93 checkSpinParent(EvtSpinType::SCALAR);
94
95 checkSpinDaughter(1,EvtSpinType::DIRAC);
96 checkSpinDaughter(2,EvtSpinType::NEUTRINO);
97
98 EvtSpinType::spintype d1type = EvtPDL::getSpinType(getDaug(0));
99 if ( d1type==EvtSpinType::VECTOR) {
100 checkNArg(8); // the number of arguments needed for the Ball model
101 _Ballmodel = new EvtBToVlnuBallFF(getArg(0),getArg(1),getArg(2),getArg(3),getArg(4),getArg(5),getArg(6),getArg(7));
102 _calcamp = new EvtSemiLeptonicVectorAmp;
103 } else {
104 report(ERROR,"EvtGen") << "Ball model handles only vector meson daughters. Sorry." << endl;
105 ::abort();
106 }
107
108
109}
110