Calculate 12C*->3-alpha decay & compare alpha KE with exact microcanonical distribution
Example of use of KVGenPhaseSpace class, which uses TGenPhaseSpace to generate events according to microcanonical statistics. By default, 10**5 events are generated for the 3-alpha decay of a Carbon-12 nucleus with E*=50 MeV. A histogram is filled with the kinetic energy distribution of one of the alpha particles, which is then fitted using the exact microcanonical probability distribution for a classical gas of 3 equal-mass particles.
To execute this function, do
$ kaliveda kaliveda[0] .L KVGenPhaseSpace_example2.C+ kaliveda[1] example()
#include "KVNucleus.h"
#include "KVSimEvent.h"
#include "KVGenPhaseSpace.h"
 
double edist(
double* 
x, 
double* par)
 
{
   
   
   
   
   
   
 
   double k = par[2] / (par[2] - 1.);
   if (
E > 0 && 
E < par[1] / k) {
 
      double w = par[0] * 
pow(
E / 
pow(par[1], 3), 0.5);
 
      w *= 
pow((1. - k * 
E / par[1]), (3.*par[2] - 8.) / 2.);
 
   }
   return 0.;
}
 
void example(
double E0 = 50, 
int nevents = 100000)
 
{
   
   
   CN.SetExcitEnergy(E0);
 
   
 
      printf("Break-up channel is not allowed\n");
      return;
   }
 
 
 
   TH1F* 
h1 = 
new TH1F(
"h1", 
"Kinetic energy of alpha particle 3", 200, 0, etot * 2. / 3.);
 
 
   while (nevents--) {
   }
 
   TF1* EDis = 
new TF1(
"EDis", edist, 0., etot, 3);
 
}
R__EXTERN TStyle * gStyle
Generate momenta for an event using microcanonical phase space sampling.
Bool_t SetBreakUpChannel(const KVNucleus &CN, KVEvent *e)
virtual Double_t Generate()
Double_t GetAvailableEnergy() const
Description of properties and kinematics of atomic nuclei.
Container class for simulated nuclei, KVSimNucleus.
virtual void SetNpx(Int_t npx=100)
virtual void SetParLimits(Int_t ipar, Double_t parmin, Double_t parmax)
virtual void FixParameter(Int_t ipar, Double_t value)
virtual TFitResultPtr Fit(const char *formula, Option_t *option="", Option_t *goption="", Double_t xmin=0, Double_t xmax=0)
void Draw(Option_t *option="") override
virtual Int_t Fill(const char *name, Double_t w)
virtual void Sumw2(Bool_t flag=kTRUE)
void SetOptFit(Int_t fit=1)
RVec< PromoteTypes< T0, T1 > > pow(const T0 &x, const RVec< T1 > &v)