]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TEvtGen/EvtGenBase/EvtFlatLineShape.cxx
revert calculation of Material Budget to previous version (TRD=Si) until
[u/mrichter/AliRoot.git] / TEvtGen / EvtGenBase / EvtFlatLineShape.cxx
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/EvtFlatLineShape.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 EvtFlatLineShape::EvtFlatLineShape() {
34
35 }
36
37 EvtFlatLineShape::~EvtFlatLineShape() {
38 }
39
40 EvtFlatLineShape::EvtFlatLineShape(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 EvtFlatLineShape::EvtFlatLineShape(const EvtFlatLineShape& 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 EvtFlatLineShape& EvtFlatLineShape::operator=(const EvtFlatLineShape& 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* EvtFlatLineShape::clone() {
79
80   return new EvtFlatLineShape(*this);
81 }
82
83
84 double EvtFlatLineShape::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 EvtFlatLineShape::getRandMass(EvtId*,int, EvtId*, EvtId*, double, double*) {
103
104   return EvtRandom::Flat(_massMin,_massMax);
105
106 }
107
108
109
110