BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtManyDeltaFuncLineShape.cc
Go to the documentation of this file.
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 "EvtPatches.hh"
22
23#include "EvtBlattWeisskopf.hh"
25#include "EvtPDL.hh"
26#include "EvtPatches.hh"
27#include "EvtPropBreitWigner.hh"
29#include "EvtRandom.hh"
30#include "EvtSpinType.hh"
31#include "EvtTwoBodyVertex.hh"
32
34
36
38 double maxRange,
40
41 _mass = mass;
42 _width = width;
43 _spin = sp;
44 _maxRange = maxRange;
45
46 double maxdelta = width;
47
48 _massMax = mass + maxdelta;
49 _massMin = mass - maxdelta;
50
51 if ( _massMin < 0. ) _massMin = 0.;
52}
53
55 _mass = x._mass;
56 _width = x._width;
57 _spin = x._spin;
58 _massMax = x._massMax;
59 _massMin = x._massMin;
60 _maxRange = x._maxRange;
61}
62
65 _mass = x._mass;
66 _massMax = x._massMax;
67 _massMin = x._massMin;
68 _width = x._width;
69 _maxRange = x._maxRange;
70 _spin = x._spin;
71 return *this;
72}
73
78
79double EvtManyDeltaFuncLineShape::getMassProb( double mass, double massPar, int nDaug,
80 double* massDau ) {
81
82 double dTotMass = 0.;
83
84 int i;
85 for ( i = 0; i < nDaug; i++ ) { dTotMass += massDau[i]; }
86 if ( ( mass < dTotMass ) ) return 0.;
87
88 if ( massPar > 0.0000000001 )
89 {
90 if ( mass > massPar ) return 0.;
91 }
92
93 return 1.;
94}
95
96double EvtManyDeltaFuncLineShape::getRandMass( EvtId* parId, int nDaug, EvtId* dauId,
97 EvtId* othDaugId, double maxMass,
98 double* dauMasses ) {
99
100 int nDelta = int( ( _massMax - _massMin ) / _width );
101 nDelta++;
102 double rand = EvtRandom::Flat( 0., float( nDelta ) );
103 int randI = int( rand );
104 return _massMin + randI * _width;
105}
double mass
EvtSpinType::spintype _spin
Definition EvtId.hh:27
double getMassProb(double mass, double massPar, int nDaug, double *massDau)
double getRandMass(EvtId *parId, int nDaug, EvtId *dauId, EvtId *othDaugId, double maxMass, double *dauMasses)
EvtManyDeltaFuncLineShape & operator=(const EvtManyDeltaFuncLineShape &x)
static double Flat()
Definition EvtRandom.cc:69