21 void MCSampler::init()
36 void MCSampler::initialiseWeightList()
48 MCSampler::MCSampler()
90 Error(
"SetEventList",
"cannot find branch %s", branchname.
Data());
109 Error(
"SetStatWeight",
"class %s not found", w.
Data());
201 TString leaflist = bname +
"/";
204 if (!
b) theTree->
Branch(bname, variable, leaflist);
205 else b->SetAddress(variable);
263 Info(
"GenerateEvents",
"Generating events for E*=%f", Exx);
266 Error(
"GenerateEvents",
"Excitation energy is too low, no channels are open");
271 while (npartitions--) {
276 for (
Long64_t iev = 0; iev < nev_part; iev++) {
394 if (!i && !strcmp(opt,
"E*/A")) fac =
pt->GetSum(
"GetA");
396 g[i]->SetName(
pt->GetPartitionName());
397 g[i]->SetMarkerStyle(
mark);
398 g[i]->SetMarkerColor((i % 9) + 1);
399 g[i]->SetLineColor((i % 9) + 1);
400 g[i]->SetFillColor(0);
401 g[i]->ResetBit(
BIT(20));
411 for (
double E = emin;
E <= emax;
E += estep) {
422 g[voie]->SetPoint(
g[voie]->GetN(),
E, proba * 100.);
432 if (!strcmp(opt,
"E*/A")) {
433 mg->GetHistogram()->SetXTitle(
"E*/A (MeV)");
440 mg->GetHistogram()->SetXTitle(
"E* (MeV)");
446 mg->GetHistogram()->SetYTitle(
"Probability");
452 for (i = 0; i <
mg->GetListOfGraphs()->GetSize(); i++) {
477 const int nparticles = 7;
480 TString particles[] = {
"1n",
"1H",
"2H",
"3H",
"3He",
"4He",
"Z>2"};
485 if (!strcmp(opt,
"E*/A")) {
487 fac =
pt->GetSum(
"GetA");
494 for (
int i = 0; i < nparticles; i++) {
496 g[i]->SetName(particles[i]);
497 g[i]->SetMarkerStyle(
mark);
498 g[i]->SetMarkerColor((i % 9) + 1);
499 g[i]->SetLineColor((i % 9) + 1);
500 g[i]->SetFillColor(0);
501 g[i]->ResetBit(
BIT(20));
515 for (
double E = emin;
E <= emax;
E += estep) {
518 Double_t multiplicities[nparticles];
519 memset(multiplicities, 0,
sizeof(
double)*nparticles);
527 if (proba > 1.e-06) {
530 while ((
n =
pt->GetNextParticle())) {
531 for (
int j = 0; j < nparticles - 1; j++) {
532 if (!strcmp(
n->GetSymbol(), particles[j].
Data())) multiplicities[j] += proba;
534 if (
n->GetZ() > 2) multiplicities[nparticles - 1] += proba;
540 for (
int i = 0; i < nparticles; i++) {
541 g[i]->SetPoint(
g[i]->GetN(),
E, multiplicities[i]);
550 if (!strcmp(opt,
"E*/A")) {
551 mg->GetHistogram()->SetXTitle(
"E*/A (MeV)");
554 mg->GetHistogram()->SetXTitle(
"E* (MeV)");
557 mg->GetHistogram()->SetYTitle(
"Multiplicity");
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
R__EXTERN TRandom * gRandom
char * Form(const char *fmt,...)
Base class for KaliVeda framework.
Base class container for multi-particle events.
Double_t GetChannelQValue() const
KVNucleus * GetNextParticle(Option_t *opt="") const
Description of properties and kinematics of atomic nuclei.
Monte-Carlo sampling of events with statistical weights .
virtual ~MCSampler()
Destructor.
Bool_t fModifyMasses
the partition index
KVEvent * fPartition
branch containing events
void PlotProbabilities(double emin=0., double emax=100., double estep=1., Option_t *opt="")
Double_t fLegendProbaMin
weight of channel picked by call to PickRandomChannel()
void PlotMultiplicities(double emin=0., double emax=100., double estep=1., Option_t *opt="")
void SetBranch(TTree *theTree, const TString &name, void *variable, const TString &vartype)
automatically generated legend for PlotProbabilities
Double_t ESTAR
variables for TTree branches
TLegend * fTheLegend
minimum probability for which channels are included in automatically generated TLegend when PlotProba...
void initialiseWeightList()
if nuclear masses are modified
StatWeight * GetWeight(Int_t i) const
void SetUpTreeBranches(KVEvent *&event, TTree *theTree, const TString &bname)
Double_t EDISP
the excitation energy (Exx)
Long64_t IPART
the available kinetic energy
void SetEventList(TTree *t, const TString &branchname)
Define the TTree or TChain containing all possible events (partitions).
TClonesArray * fWeightList
statistical weight class
void GenerateEvents(TTree *, KVEvent *event, Double_t, Long64_t npartitions, Long64_t nev_part=10)
Bool_t SetExcitationEnergy(Double_t Exx)
Double_t fSumWeights
list of weights for all events
Long64_t PickRandomChannel()
void CalculateWeights(Double_t excitation_energy)
KVEvent * GetPartition(Long64_t i)
void init()
default initialisations
void SetStatWeight(const TString &)
void GenerateEvent(TTree *theTree, KVEvent *event)
TBranch * fBranch
number of partitions in TTree/TChain
TClass * fWeight
event read from fPartitionList tree
Double_t GetSumWeights() const
Abstract base class for calculating statistical weights for events .
void SetIndex(Long64_t i)
virtual void SetWeight(KVEvent *e, Double_t E)=0
void GenerateEvent(KVEvent *partition, KVEvent *event)
virtual void initGenerateEvent(KVEvent *partition)=0
Double_t GetAvailableEnergy() const
virtual void resetGenerateEvent()=0
Double_t GetWeight() const
Long64_t GetIndex() const
virtual void SetAddress(void *add)
static TClass * GetClass(Bool_t load=kTRUE, Bool_t silent=kFALSE)
TObject * ConstructedAt(Int_t idx)
virtual void Sort(Int_t upto=kMaxInt)
virtual void SetHeader(const char *header="", Option_t *option="")
TLegendEntry * AddEntry(const char *name, const char *label="", Option_t *option="lpf")
virtual const char * GetName() const
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual void Error(const char *method, const char *msgfmt,...) const
virtual void Info(const char *method, const char *msgfmt,...) const
virtual Double_t Uniform(Double_t x1, Double_t x2)
const char * Data() const
virtual TBranch * GetBranch(const char *name)
virtual Long64_t GetEntries() const
virtual Int_t Branch(const char *folder, Int_t bufsize=32000, Int_t splitlevel=99)
const long double g
masses