39 ResonanceGenFrame::ResonanceGenFrame(
const std::string& sname,
40 const std::string& stitle)
41 : DecayGenFrame(sname,stitle)
47 ResonanceGenFrame::ResonanceGenFrame() : DecayGenFrame()
53 ResonanceGenFrame::~ResonanceGenFrame() {}
55 ResonanceGenFrame& ResonanceGenFrame::Empty(){
56 return ResonanceGenFrame::m_Empty;
59 void ResonanceGenFrame::SetMass(
double val){
64 m_Log <<
"Unable to set mass to negative value ";
65 m_Log << val <<
". Setting to zero." << LogEnd;
74 void ResonanceGenFrame::SetWidth(
double val){
79 m_Log <<
"Unable to set width to negative value ";
80 m_Log << val <<
". Setting to zero." << LogEnd;
82 SetVariableMassMCMC(
false);
85 SetVariableMassMCMC(
true);
89 void ResonanceGenFrame::SetVariableMass(
bool varymass) {
94 SetVariableMassMCMC(
true);
98 m_Log <<
"Unable to set variable mass. ";
99 m_Log <<
"Resonance width is set to zero. " << LogEnd;
103 SetVariableMassMCMC(
false);
108 double ResonanceGenFrame::GetPoleMass()
const {
112 double ResonanceGenFrame::GetWidth()
const {
116 double ResonanceGenFrame::GetProbMCMC(
double mass)
const {
120 double den = mass*mass-m_PoleMass*m_PoleMass;
122 den += m_PoleMass*m_PoleMass*m_Width*m_Width;
125 return (DecayGenFrame::GetProbMCMC(mass)*mass*mass)/den;
130 void ResonanceGenFrame::GenerateMassMCMC(
double& mass,
double&
131 prob,
double max)
const {
133 int N = GetNChildren();
134 for(
int i = 0; i < N; i++)
137 if(((max < min) && (max > 0)) || m_Width <= 0.){
146 double M2 = m_PoleMass*m_PoleMass;
147 double MW = m_PoleMass*m_Width;
148 double Imin = atan((min*min-M2)/MW);
151 Imax = TMath::Pi()/2.;
153 Imax = atan((max*max-M2)/MW);
155 mass = sqrt(M2 + MW*tan(Imin+GetRandom()*(Imax-Imin)));
157 double den = mass*mass-m_PoleMass*m_PoleMass;
159 den += m_PoleMass*m_PoleMass*m_Width*m_Width;
166 ResonanceGenFrame ResonanceGenFrame::m_Empty;
virtual double GetMass() const
Get the mass of this frame.
virtual GeneratorFrame & GetChildFrame(int i=0) const
Get the frame of the i th child.