]>
Commit | Line | Data |
---|---|---|
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: EvtLineShape.cc | |
12 | // | |
13 | // Description: Store particle properties for one particle. | |
14 | // | |
15 | // Modification history: | |
16 | // | |
17 | // Lange March 10, 2001 Module created | |
18 | // Dvoretskii June 03, 2002 Reimplemented rollMass() | |
19 | // | |
20 | //------------------------------------------------------------------------ | |
21 | #include "EvtGenBase/EvtPatches.hh" | |
22 | ||
23 | #include "EvtGenBase/EvtPatches.hh" | |
24 | #include "EvtGenBase/EvtManyDeltaFuncLineShape.hh" | |
25 | #include "EvtGenBase/EvtRandom.hh" | |
26 | #include "EvtGenBase/EvtTwoBodyVertex.hh" | |
27 | #include "EvtGenBase/EvtBlattWeisskopf.hh" | |
28 | #include "EvtGenBase/EvtPropBreitWignerRel.hh" | |
29 | #include "EvtGenBase/EvtPropBreitWigner.hh" | |
30 | #include "EvtGenBase/EvtPDL.hh" | |
31 | #include "EvtGenBase/EvtSpinType.hh" | |
32 | ||
33 | EvtManyDeltaFuncLineShape::EvtManyDeltaFuncLineShape() { | |
34 | ||
35 | } | |
36 | ||
37 | EvtManyDeltaFuncLineShape::~EvtManyDeltaFuncLineShape() { | |
38 | } | |
39 | ||
40 | EvtManyDeltaFuncLineShape::EvtManyDeltaFuncLineShape(double mass, double width, double maxRange, EvtSpinType::spintype sp) { | |
41 | ||
42 | _mass=mass; | |
43 | _width=width; | |
44 | _spin=sp; | |
45 | _maxRange=maxRange; | |
46 | ||
47 | double maxdelta = width; | |
48 | ||
49 | _massMax=mass+maxdelta; | |
50 | _massMin=mass-maxdelta; | |
51 | ||
52 | if ( _massMin< 0. ) _massMin=0.; | |
53 | ||
54 | } | |
55 | ||
56 | EvtManyDeltaFuncLineShape::EvtManyDeltaFuncLineShape(const EvtManyDeltaFuncLineShape& x): | |
57 | EvtAbsLineShape( x ) { | |
58 | _mass=x._mass; | |
59 | _width=x._width; | |
60 | _spin=x._spin; | |
61 | _massMax=x._massMax; | |
62 | _massMin=x._massMin; | |
63 | _maxRange=x._maxRange; | |
64 | ||
65 | } | |
66 | ||
67 | EvtManyDeltaFuncLineShape& EvtManyDeltaFuncLineShape::operator=(const EvtManyDeltaFuncLineShape& x){ | |
68 | _mass=x._mass; | |
69 | _massMax=x._massMax; | |
70 | _massMin=x._massMin; | |
71 | _width=x._width; | |
72 | _maxRange=x._maxRange; | |
73 | _spin=x._spin; | |
74 | return *this; | |
75 | ||
76 | } | |
77 | ||
78 | EvtAbsLineShape* EvtManyDeltaFuncLineShape::clone() { | |
79 | ||
80 | return new EvtManyDeltaFuncLineShape(*this); | |
81 | } | |
82 | ||
83 | ||
84 | double EvtManyDeltaFuncLineShape::getMassProb(double mass, double massPar,int nDaug, double *massDau) { | |
85 | ||
86 | ||
87 | double dTotMass=0.; | |
88 | ||
89 | int i; | |
90 | for (i=0; i<nDaug; i++) { | |
91 | dTotMass+=massDau[i]; | |
92 | } | |
93 | if ( (mass<dTotMass) ) return 0.; | |
94 | ||
95 | if ( massPar>0.0000000001 ) { | |
96 | if ( mass > massPar) return 0.; | |
97 | } | |
98 | ||
99 | return 1.; | |
100 | } | |
101 | ||
102 | double EvtManyDeltaFuncLineShape::getRandMass(EvtId*,int, EvtId*, EvtId*, double, double *) { | |
103 | ||
104 | int nDelta = int((_massMax - _massMin)/_width); | |
105 | nDelta++; | |
106 | double rand=EvtRandom::Flat(0.,float(nDelta)); | |
107 | int randI=int(rand); | |
108 | return _massMin+randI*_width; | |
109 | } | |
110 | ||
111 | ||
112 | ||
113 |