BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtBtoXsgammaFlatEnergy.cc
Go to the documentation of this file.
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// Module: EvtBtoXsgammaKagan.cc
9//
10// Description:
11// Routine to perform two-body B->Xs,gamma decays with a fixed hadronic
12// mass. For spectrum measurements.
13// The input parameters are 1: the hadronic mass
15
16// Modification history:
17//
18// Jim Libby October 11 2002
19//------------------------------------------------------------------------
20//
21
23#include "EvtBtoXsgamma.hh"
25#include <fstream>
26#include <stdlib.h>
27using std::endl;
28using std::fstream;
29
31
32void EvtBtoXsgammaFlatEnergy::init( int nArg, double* args ) {
33
34 if ( ( nArg ) > 3 || ( nArg > 1 && nArg < 3 ) )
35 {
36
37 report( ERROR, "EvtGen" ) << "EvtBtoXsgamma generator model "
38 << "EvtBtoXsgammaFlatEnergy expected "
39 << "either 1(default config) or two arguments but found: "
40 << nArg << endl;
41 report( ERROR, "EvtGen" ) << "Will terminate execution!" << endl;
42 ::abort();
43 }
44 _mB0 = 5.2794;
45 double mPi = 0.140;
46 double mK = 0.494;
47 if ( nArg == 1 )
48 {
49 _eMin = 1.7;
50 // Invariant mass of Xsd must be greater the m_pi+m_K leads to
51 // Egamma < (m_B**2-(m_pi+m_k)**2)/(2m_B)
52 _eMax = ( pow( _mB0, 2 ) - pow( mPi + mK, 2 ) ) / ( 2.0 * _mB0 );
53 }
54 else
55 {
56 _eMin = args[1];
57 _eMax = args[2];
58 }
59 if ( _eMax > ( pow( _mB0, 2 ) - pow( mPi + mK, 2 ) ) / ( 2.0 * _mB0 ) )
60 {
61 report( ERROR, "EvtGen" ) << "Emax greater than Kinematic limit" << endl;
62 report( ERROR, "EvtGen" ) << "Reset to the kinematic limit" << endl;
63 report( ERROR, "EvtGen" ) << "(m_B**2-(m_pi+m_k)**2)/(2m_B)" << endl;
64 _eMax = ( pow( _mB0, 2 ) - pow( mPi + mK, 2 ) ) / ( 2.0 * _mB0 );
65 }
66 _eRange = _eMax - _eMin;
67}
68
70
71 double eGamma = EvtRandom::Flat( _eRange ) + _eMin;
72 double mH = sqrt( pow( _mB0, 2 ) - 2.0 * _mB0 * eGamma );
73 return mH;
74}
ostream & report(Severity severity, const char *facility)
Definition EvtReport.cc:34
@ ERROR
Definition EvtReport.hh:49
double mPi
static double Flat()
Definition EvtRandom.cc:69