Calculate 12C*->3-alpha decay & fill TTree with generated events
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.
To execute this function, do
$ kaliveda
kaliveda[0] .L KVGenPhaseSpace_example.C+
kaliveda[1] example()
#include "KVNucleus.h"
#include "KVSimEvent.h"
#include "KVGenPhaseSpace.h"
#define NPARTS 3
#define AddArrBrI(type,name) \
type name[NPARTS];\
tri->Branch( #name , name , #name "[3]/I" )
#define AddArrBrD(type,name) \
type name[NPARTS];\
tri->Branch( #name , name , #name "[3]/D" )
void example(
double E0 = 50,
int nevents = 100000)
{
printf("Break-up channel is not allowed\n");
return;
}
TTree* tri =
new TTree(
"ThreeAlphaDecay",
Form(
"12C(E*=%lf.2MeV) -> 3(4He)", E0));
while (nevents--) {
mult = 0;
for (auto& nuc : decay) {
Z[mult] = nuc.GetZ();
A[mult] = nuc.GetA();
Theta[mult] = nuc.GetTheta();
Phi[mult] = nuc.GetPhi();
++mult;
}
}
}
char * Form(const char *fmt,...)
Generate momenta for an event using microcanonical phase space sampling.
Bool_t SetBreakUpChannel(const KVNucleus &CN, KVEvent *e)
virtual Double_t Generate()
Description of properties and kinematics of atomic nuclei.
void SetExcitEnergy(Double_t e)
Container class for simulated nuclei, KVSimNucleus.
virtual Int_t Branch(const char *folder, Int_t bufsize=32000, Int_t splitlevel=99)