Fix bug in building local list of valid files.
[u/mrichter/AliRoot.git] / TEvtGen / EvtGenModels / EvtSVS.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: EvtSVS.cc
12//
13// Description: Routine to decay scalar -> vector + scalar
14//
15// Modification history:
16//
17// RYD November 24, 1996 Module created
18//
19//------------------------------------------------------------------------
20//
21#include "EvtGenBase/EvtPatches.hh"
22#include <stdlib.h>
23#include "EvtGenBase/EvtParticle.hh"
24#include "EvtGenBase/EvtGenKine.hh"
25#include "EvtGenBase/EvtReport.hh"
26#include "EvtGenBase/EvtPDL.hh"
27#include "EvtGenBase/EvtVector4C.hh"
28#include "EvtGenModels/EvtSVS.hh"
29#include <string>
30
31EvtSVS::~EvtSVS() {}
32
33std::string EvtSVS::getName(){
34
35 return "SVS";
36
37}
38
39
40EvtDecayBase* EvtSVS::clone(){
41
42 return new EvtSVS;
43
44}
45
46void EvtSVS::init(){
47
48 // check that there are 0 arguments
49 checkNArg(0);
50 checkNDaug(2);
51
52 checkSpinParent(EvtSpinType::SCALAR);
53
54 checkSpinDaughter(0,EvtSpinType::VECTOR);
55 checkSpinDaughter(1,EvtSpinType::SCALAR);
56
57
58}
59
60
61
62void EvtSVS::initProbMax(){
63
64 setProbMax(1.0);
65
66}
67
68void EvtSVS::decay( EvtParticle *p){
69
70 p->initializePhaseSpace(getNDaug(),getDaugs());
71
72 EvtParticle *v;
73 v = p->getDaug(0);
74 double massv = v->mass();
75 EvtVector4R momv = v->getP4();
76 EvtVector4R moms = p->getDaug(1)->getP4();
77 double m_parent = p->mass();
78 EvtVector4R p4_parent = momv+moms;
79
80 double norm=massv/(momv.d3mag()*m_parent);
81 p4_parent = norm*p4_parent;
82 vertex(0,p4_parent*(v->epsParent(0)));
83 vertex(1,p4_parent*(v->epsParent(1)));
84 vertex(2,p4_parent*(v->epsParent(2)));
85
86 return ;
87}
88