]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TEvtGen/EvtGenBase/EvtMBreitWigner.cxx
Centrality update (Alberica)
[u/mrichter/AliRoot.git] / TEvtGen / EvtGenBase / EvtMBreitWigner.cxx
1 #include "EvtGenBase/EvtPatches.hh"
2 #include "EvtGenBase/EvtMBreitWigner.hh"
3 #include "EvtGenBase/EvtReport.hh"
4 #include <stdlib.h>
5
6 using std::endl;
7
8 EvtMBreitWigner::EvtMBreitWigner( const EvtId& id, const vector<string>& args )
9 {
10     if( args.size() != 0 ) {
11         report(ERROR, "EvtGen")<<"Unknown input arguments passed in to lineshape."<<endl;
12         ::abort();
13     }
14
15     _id = id;
16     _width = EvtPDL::getWidth( id );
17     _resmass = EvtPDL::getMeanMass( id );
18 }
19
20 EvtComplex EvtMBreitWigner::shape( const vector<EvtVector4R>& product ) const 
21 {
22     static EvtComplex I(0.0, 1.0);
23     double mass = _node->get4vector(product).mass();
24  
25     return sqrt(_width/( EvtConst::twoPi )) * 1/( mass - _resmass - I * _width/2 );
26 }
27
28
29 EvtMLineShape * EvtMBreitWigner::duplicate() const
30 {
31   vector<string> args;
32   EvtMLineShape* tmp=new EvtMBreitWigner( _id, args );
33   return tmp;
34 }
35