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()
#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;
}
TFile* out =
new TFile(
"ThreeAlphaDecay.root",
"recreate");
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;
}
}
delete out;
}
char * Form(const char *fmt,...)
Base class container for multi-particle events.
KVNucleus * AddParticle()
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)
Int_t Write(const char *name=nullptr, Int_t opt=0, Int_t bufsiz=0) const override
virtual Int_t Branch(const char *folder, Int_t bufsize=32000, Int_t splitlevel=99)