]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TEvtGen/EvtGenBase/EvtPartProp.cxx
Adding CMakeLists.txt
[u/mrichter/AliRoot.git] / TEvtGen / EvtGenBase / EvtPartProp.cxx
1 #include "EvtGenBase/EvtPatches.hh"
2  //--------------------------------------------------------------------------
3 //
4 // Environment:
5 //      This software is part of the EvtGen package developed jointly
6 //      for the BaBar and CLEO collaborations.  If you use all or part
7 //      of it, please give an appropriate acknowledgement.
8 //
9 // Copyright Information: See EvtGen/COPYRIGHT
10 //      Copyright (C) 1998      Caltech, UCSB
11 //
12 // Module: EvtPartProp.cc
13 //
14 // Description: Store particle properties for one particle.
15 //
16 // Modification history:
17 //
18 //    RYD     April 4, 1997        Module created
19 //
20 //------------------------------------------------------------------------
21 //
22 #include <iostream>
23 #include <fstream>
24 #include <stdlib.h>
25 #include <ctype.h>
26 #include "EvtGenBase/EvtPartProp.hh"
27 #include "EvtGenBase/EvtAbsLineShape.hh"
28 #include "EvtGenBase/EvtFlatLineShape.hh"
29 #include "EvtGenBase/EvtManyDeltaFuncLineShape.hh"
30 #include "EvtGenBase/EvtRelBreitWignerBarrierFact.hh"
31 #include <string>
32 using std::fstream;
33
34 EvtPartProp::EvtPartProp():
35   _id(-1,-1)
36   ,_idchgconj(-1,-1)
37   ,_chg3(0)
38   ,_stdhep(0)
39   ,_lundkc(0)
40 {
41   _lineShape=0;
42   _ctau=0.0;
43   _name="*******";
44   _spintype=EvtSpinType::SCALAR;
45 }
46
47 EvtPartProp::EvtPartProp(const EvtPartProp& x){
48
49   if (0!=x._lineShape){
50     _lineShape=x._lineShape->clone();
51   }
52   else{
53     _lineShape=0;
54   }
55   _ctau=x._ctau;
56   _name=x._name;
57   _spintype=x._spintype;
58   _id=x._id;
59   _idchgconj=x._idchgconj;
60   _chg3=x._chg3;
61   _stdhep=x._stdhep;
62   _lundkc=x._lundkc;
63
64 }
65
66 EvtPartProp::~EvtPartProp() {
67   if ( _lineShape ) delete _lineShape;
68   _lineShape=0;
69 }
70
71
72 void EvtPartProp::setName(std::string pname) {
73
74   _name=pname;
75
76 }
77
78
79 EvtPartProp& EvtPartProp::operator=(const EvtPartProp& x){
80
81   _lineShape=x._lineShape->clone();
82
83   _ctau=x._ctau;
84   _name=x._name;
85   _chg3=x._chg3;
86   _spintype=x._spintype;
87   return *this;
88 }
89
90 void EvtPartProp::initLineShape(double mass, double width, double maxRange){
91
92   _lineShape=new EvtRelBreitWignerBarrierFact(mass,width,maxRange,_spintype);
93
94 }
95
96 void EvtPartProp::newLineShape(std::string type){
97
98   double m=_lineShape->getMass();
99   double w=_lineShape->getWidth();
100   double mR=_lineShape->getMaxRange();
101   EvtSpinType::spintype  st=_lineShape->getSpinType();
102   delete _lineShape;
103   if ( type == "RELBW" ) {
104     _lineShape=new EvtRelBreitWignerBarrierFact(m,w,mR,st);
105   }
106   if ( type == "NONRELBW" ) {
107     _lineShape = new EvtAbsLineShape(m,w,mR,st);
108   }
109   if ( type == "FLAT" ) {
110     _lineShape = new EvtFlatLineShape(m,w,mR,st);
111   }
112   if ( type == "MANYDELTAFUNC" ) {
113     _lineShape = new EvtManyDeltaFuncLineShape(m,w,mR,st);
114   }
115 }
116
117
118 void EvtPartProp::reSetMass(double mass) {
119   if (!_lineShape) ::abort();
120   _lineShape->reSetMass(mass);
121 }
122 void EvtPartProp::reSetWidth(double width){
123   if (!_lineShape) ::abort();
124   _lineShape->reSetWidth(width);
125 }
126
127 void EvtPartProp::setPWForDecay( int spin, EvtId d1, EvtId d2) { 
128   if (!_lineShape) ::abort();
129   _lineShape->setPWForDecay(spin,d1,d2);
130 }
131
132 void EvtPartProp::setPWForBirthL( int spin, EvtId par, EvtId othD) { 
133   if (!_lineShape) ::abort();
134   _lineShape->setPWForBirthL(spin,par,othD);
135 }
136
137
138 void EvtPartProp::reSetMassMin(double mass){
139   if (!_lineShape) ::abort();
140   _lineShape->reSetMassMin(mass);
141 }
142 void EvtPartProp::reSetMassMax(double mass){
143   if (!_lineShape) ::abort();
144   _lineShape->reSetMassMax(mass);
145 }
146 void EvtPartProp::reSetBlatt(double blatt){
147   if (!_lineShape) ::abort();
148   _lineShape->reSetBlatt(blatt);
149 }
150 void EvtPartProp::includeBirthFactor(bool yesno){
151   if (!_lineShape) ::abort();
152   _lineShape->includeBirthFactor(yesno);
153 }
154 void EvtPartProp::includeDecayFactor(bool yesno){
155   if (!_lineShape) ::abort();
156   _lineShape->includeDecayFactor(yesno);
157 }
158
159
160
161
162
163