$ kaliveda kaliveda[0] .L globvars_kvzmax.C+ kaliveda[1] zmax_example1() kaliveda[2] zmax_example2()
#include <iostream>
#include <vector>
#include <algorithm>
#include <random>
void zmax_example1()
{
for (int i = 0; i < mult; ++i) {
}
std::cout << "Random event :\n\n";
event.Print();
while ((nunuc =
event.GetNextParticle())) zmax.
Fill(nunuc);
std::cout << "\nSorted event :\n\n";
}
void zmax_example2()
{
zmax.SetMaxNumBranches(5);
zmax2.SetMaxNumBranches(1);
std::vector<int> zlist(10);
int z = 1;
std::generate_n(zlist.begin(), 10, [&z]() {
return z++;
});
std::random_device rd;
for (int i = 0; i < 1000; ++i) {
std::shuffle(zlist.begin(), zlist.end(),
g);
event.Clear();
for (auto z : zlist) {
event.AddParticle()->SetZ(z);
}
if (i == 0) {
event.Print();
}
}
for (int i = 1; i <= 5; ++i) {
}
tree.Draw(
"ZMAX_UPTO6.Zmax1");
}
KVTemplateParticleCondition< KVNucleus > KVParticleCondition
R__EXTERN TRandom * gRandom
char * Form(const char *fmt,...)
Manage a list of global variables.
void Reset(void)
Reset all variables before treating an event.
void CalculateGlobalVariables(KVEvent *e)
virtual void Add(TObject *obj)
void MakeBranches(TTree *)
Description of properties and kinematics of atomic nuclei.
virtual void Print(Option_t *t="") const
Display nucleus parameters.
Container class for simulated nuclei, KVSimNucleus.
void Fill(const KVNucleus *c)
Global variable used to sort particles in order of decreasing atomic number
KVNucleus * GetZmax(Int_t i) const
TVirtualPad * cd(Int_t subpadnumber=0) override
void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0) override
virtual UInt_t Integer(UInt_t imax)
const long double g
masses