CGEM BOSS 6.6.5.h
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//------------------------------------------------------------------------
22
30#include "EvtGenBase/EvtPDL.hh"
32
36
39
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
57 _mass=x._mass;
58 _width=x._width;
59 _spin=x._spin;
60 _massMax=x._massMax;
61 _massMin=x._massMin;
62 _maxRange=x._maxRange;
63
64}
65
67 _mass=x._mass;
68 _massMax=x._massMax;
69 _massMin=x._massMin;
70 _width=x._width;
71 _maxRange=x._maxRange;
72 _spin=x._spin;
73 return *this;
74
75}
76
81
82
83double EvtManyDeltaFuncLineShape::getMassProb(double mass, double massPar,int nDaug, double *massDau) {
84
85
86 double dTotMass=0.;
87
88 int i;
89 for (i=0; i<nDaug; i++) {
90 dTotMass+=massDau[i];
91 }
92 if ( (mass<dTotMass) ) return 0.;
93
94 if ( massPar>0.0000000001 ) {
95 if ( mass > massPar) return 0.;
96 }
97
98 return 1.;
99}
100
101double EvtManyDeltaFuncLineShape::getRandMass(EvtId *parId,int nDaug, EvtId *dauId, EvtId *othDaugId, double maxMass, double *dauMasses) {
102
103 int nDelta = int((_massMax - _massMin)/_width);
104 nDelta++;
105 double rand=EvtRandom::Flat(0.,float(nDelta));
106 int randI=int(rand);
107 return _massMin+randI*_width;
108}
109
110
111
112
double mass
Double_t x[10]
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:73