evtgen is hosted by Hepforge, IPPP Durham
EvtGen  2.0.0
Monte Carlo generator of particle decays, in particular the weak decays of heavy flavour particles such as B mesons.
EvtPartProp.cpp
Go to the documentation of this file.
1 
2 /***********************************************************************
3 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
4 * *
5 * This file is part of EvtGen. *
6 * *
7 * EvtGen is free software: you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation, either version 3 of the License, or *
10 * (at your option) any later version. *
11 * *
12 * EvtGen is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU General Public License *
18 * along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
19 ***********************************************************************/
20 
22 
26 #include "EvtGenBase/EvtPatches.hh"
28 
29 #include <ctype.h>
30 #include <fstream>
31 #include <iostream>
32 #include <stdlib.h>
33 #include <string>
34 using std::fstream;
35 
37  _id( -1, -1 ), _idchgconj( -1, -1 ), _chg3( 0 ), _stdhep( 0 ), _lundkc( 0 )
38 {
39  _ctau = 0.0;
40  _name = "*******";
42 }
43 
45 {
46  _lineShape.reset( x._lineShape ? x._lineShape->clone() : nullptr );
47  _ctau = x._ctau;
48  _name = x._name;
49  _spintype = x._spintype;
50  _id = x._id;
52  _chg3 = x._chg3;
53  _stdhep = x._stdhep;
54  _lundkc = x._lundkc;
55 }
56 
57 void EvtPartProp::setName( std::string pname )
58 {
59  _name = pname;
60 }
61 
63 {
64  _lineShape.reset( x._lineShape ? x._lineShape->clone() : nullptr );
65 
66  _ctau = x._ctau;
67  _name = x._name;
68  _chg3 = x._chg3;
69  _spintype = x._spintype;
70  return *this;
71 }
72 
73 void EvtPartProp::initLineShape( double mass, double width, double maxRange )
74 {
75  _lineShape = std::make_unique<EvtRelBreitWignerBarrierFact>( mass, width,
76  maxRange,
77  _spintype );
78 }
79 
80 void EvtPartProp::newLineShape( std::string type )
81 {
82  double m = _lineShape->getMass();
83  double w = _lineShape->getWidth();
84  double mR = _lineShape->getMaxRange();
85  EvtSpinType::spintype st = _lineShape->getSpinType();
86  if ( type == "RELBW" ) {
87  _lineShape = std::make_unique<EvtRelBreitWignerBarrierFact>( m, w, mR,
88  st );
89  } else if ( type == "NONRELBW" ) {
90  _lineShape = std::make_unique<EvtAbsLineShape>( m, w, mR, st );
91  } else if ( type == "FLAT" ) {
92  _lineShape = std::make_unique<EvtFlatLineShape>( m, w, mR, st );
93  } else if ( type == "MANYDELTAFUNC" ) {
94  _lineShape = std::make_unique<EvtManyDeltaFuncLineShape>( m, w, mR, st );
95  } else {
96  _lineShape.reset();
97  }
98 }
99 
100 void EvtPartProp::reSetMass( double mass )
101 {
102  if ( !_lineShape )
103  ::abort();
104  _lineShape->reSetMass( mass );
105 }
106 void EvtPartProp::reSetWidth( double width )
107 {
108  if ( !_lineShape )
109  ::abort();
110  _lineShape->reSetWidth( width );
111 }
112 
113 void EvtPartProp::setPWForDecay( int spin, EvtId d1, EvtId d2 )
114 {
115  if ( !_lineShape )
116  ::abort();
117  _lineShape->setPWForDecay( spin, d1, d2 );
118 }
119 
120 void EvtPartProp::setPWForBirthL( int spin, EvtId par, EvtId othD )
121 {
122  if ( !_lineShape )
123  ::abort();
124  _lineShape->setPWForBirthL( spin, par, othD );
125 }
126 
127 void EvtPartProp::reSetMassMin( double mass )
128 {
129  if ( !_lineShape )
130  ::abort();
131  _lineShape->reSetMassMin( mass );
132 }
133 void EvtPartProp::reSetMassMax( double mass )
134 {
135  if ( !_lineShape )
136  ::abort();
137  _lineShape->reSetMassMax( mass );
138 }
139 void EvtPartProp::reSetBlatt( double blatt )
140 {
141  if ( !_lineShape )
142  ::abort();
143  _lineShape->reSetBlatt( blatt );
144 }
145 void EvtPartProp::reSetBlattBirth( double blatt )
146 {
147  if ( !_lineShape )
148  ::abort();
149  _lineShape->reSetBlattBirth( blatt );
150 }
152 {
153  if ( !_lineShape )
154  ::abort();
155  _lineShape->includeBirthFactor( yesno );
156 }
158 {
159  if ( !_lineShape )
160  ::abort();
161  _lineShape->includeDecayFactor( yesno );
162 }
EvtSpinType::spintype _spintype
Definition: EvtPartProp.hh:106
std::string _name
Definition: EvtPartProp.hh:110
void setPWForDecay(int spin, EvtId d1, EvtId d2)
void includeDecayFactor(bool yesno)
EvtId _idchgconj
Definition: EvtPartProp.hh:105
double _ctau
Definition: EvtPartProp.hh:103
void setPWForBirthL(int spin, EvtId par, EvtId othD)
Definition: EvtId.hh:27
void reSetMassMax(double mass)
void setName(std::string pname)
Definition: EvtPartProp.cpp:57
EvtPartProp & operator=(const EvtPartProp &x)
Definition: EvtPartProp.cpp:62
void reSetMassMin(double mass)
std::unique_ptr< EvtAbsLineShape > _lineShape
Definition: EvtPartProp.hh:101
void reSetBlattBirth(double blatt)
void reSetMass(double mass)
void includeBirthFactor(bool yesno)
void reSetBlatt(double blatt)
void newLineShape(std::string type)
Definition: EvtPartProp.cpp:80
void initLineShape(double mass, double width, double maxRange)
Definition: EvtPartProp.cpp:73
void reSetWidth(double width)