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());
200 TString leaflist = bname +
"/";
203 if (!
b) theTree->
Branch(bname, variable, leaflist);
204 else b->SetAddress(variable);
262 Info(
"GenerateEvents",
"Generating events for E*=%f", Exx);
265 Error(
"GenerateEvents",
"Excitation energy is too low, no channels are open");
270 while (npartitions--) {
275 for (
Long64_t iev = 0; iev < nev_part; iev++) {
393 if (!i && !strcmp(opt,
"E*/A")) fac =
pt->GetSum(
"GetA");
395 g[i]->SetName(
pt->GetPartitionName());
396 g[i]->SetMarkerStyle(
mark);
397 g[i]->SetMarkerColor((i % 9) + 1);
398 g[i]->SetLineColor((i % 9) + 1);
399 g[i]->SetFillColor(0);
400 g[i]->ResetBit(
BIT(20));
410 for (
double E = emin;
E <= emax;
E += estep) {
421 g[voie]->SetPoint(
g[voie]->GetN(),
E, proba * 100.);
431 if (!strcmp(opt,
"E*/A")) {
432 mg->GetHistogram()->SetXTitle(
"E*/A (MeV)");
439 mg->GetHistogram()->SetXTitle(
"E* (MeV)");
445 mg->GetHistogram()->SetYTitle(
"Probability");
451 for (i = 0; i <
mg->GetListOfGraphs()->GetSize(); i++) {
476 const int nparticles = 7;
479 TString particles[] = {
"1n",
"1H",
"2H",
"3H",
"3He",
"4He",
"Z>2"};
484 if (!strcmp(opt,
"E*/A")) {
486 fac =
pt->GetSum(
"GetA");
493 for (
int i = 0; i < nparticles; i++) {
495 g[i]->SetName(particles[i]);
496 g[i]->SetMarkerStyle(
mark);
497 g[i]->SetMarkerColor((i % 9) + 1);
498 g[i]->SetLineColor((i % 9) + 1);
499 g[i]->SetFillColor(0);
500 g[i]->ResetBit(
BIT(20));
514 for (
double E = emin;
E <= emax;
E += estep) {
517 Double_t multiplicities[nparticles];
518 memset(multiplicities, 0,
sizeof(
double)*nparticles);
526 if (proba > 1.e-06) {
529 for (
int j = 0; j < nparticles - 1; j++) {
530 if (!strcmp(
n.GetSymbol(), particles[j].
Data())) multiplicities[j] += proba;
532 if (
n.GetZ() > 2) multiplicities[nparticles - 1] += proba;
538 for (
int i = 0; i < nparticles; i++) {
539 g[i]->SetPoint(
g[i]->GetN(),
E, multiplicities[i]);
548 if (!strcmp(opt,
"E*/A")) {
549 mg->GetHistogram()->SetXTitle(
"E*/A (MeV)");
552 mg->GetHistogram()->SetXTitle(
"E* (MeV)");
555 mg->GetHistogram()->SetYTitle(
"Multiplicity");
KVTemplateEvent< KVNucleus >::EventIterator EventIterator
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
R__EXTERN TRandom * gRandom
char * Form(const char *fmt,...)
Base class for KaliVeda framework.
Abstract base class container for multi-particle events.
virtual Double_t GetChannelQValue() const =0
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