KaliVeda
Toolkit for HIC analysis
Loading...
Searching...
No Matches
MCSampler.h
1
3
4#ifndef __MCSAMPLER_H
5#define __MCSAMPLER_H
6
7#include "KVBase.h"
8#include "KVNucleusEvent.h"
9#include "TTree.h"
10#include "TLegend.h"
11#include "StatWeight.h"
12
13namespace MicroStat {
14
22 class MCSampler : public KVBase {
23 private:
24 void init();
28
29 void SetBranch(TTree* theTree, const TString& name, void* variable, const TString& vartype);
30
31 protected:
42
44
46
47 public:
48 MCSampler();
49 MCSampler(const Char_t* name, const Char_t* title = "");
50 virtual ~MCSampler();
51
52 void SetEventList(TTree* t, const TString& branchname);
53 void SetStatWeight(const TString&);
54
56 {
58
59 fBranch->GetEntry(i);
60 return fPartition;
61 }
62 void SetModifyMasses(Bool_t yes = kTRUE)
63 {
64 fModifyMasses = yes;
65 }
66 void UpdateMasses();
67
68 void CalculateWeights(Double_t excitation_energy);
70 {
71 return fWeightList;
72 }
74 {
75 return (StatWeight*)(*fWeightList)[i];
76 }
78 {
79 return fSumWeights;
80 }
81
84 {
85 return fLastPicked;
86 }
87
88 void SetUpTreeBranches(KVEvent*& event, TTree* theTree, const TString& bname);
89 void GenerateEvents(TTree*, KVEvent* event, Double_t, Long64_t npartitions, Long64_t nev_part = 10);
92 void GenerateEvent(TTree* theTree, KVEvent* event);
93
94 void PlotMultiplicities(double emin = 0., double emax = 100., double estep = 1., Option_t* opt = "");
95 void PlotProbabilities(double emin = 0., double emax = 100., double estep = 1., Option_t* opt = "");
97 {
104 };
106 {
107 return fLegendProbaMin;
108 };
110 {
116 if (fTheLegend) fTheLegend->Draw();
117 };
118
119 ClassDef(MCSampler, 1) //Monte-Carlo sampling of events with statistical weights
120 };
121
122}
123#endif
int Int_t
bool Bool_t
char Char_t
double Double_t
const char Option_t
#define ClassDef(name, id)
winID h TVirtualViewer3D TVirtualGLPainter p
Base class for KaliVeda framework.
Definition KVBase.h:142
Abstract base class container for multi-particle events.
Definition KVEvent.h:67
Monte-Carlo sampling of events with statistical weights .
Definition MCSampler.h:22
virtual ~MCSampler()
Destructor.
Definition MCSampler.cpp:71
Bool_t fModifyMasses
the partition index
Definition MCSampler.h:43
KVEvent * fPartition
branch containing events
Definition MCSampler.h:34
StatWeight * GetRandomChannelWeight() const
Definition MCSampler.h:83
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()
Definition MCSampler.h:26
void PlotMultiplicities(double emin=0., double emax=100., double estep=1., Option_t *opt="")
MCSampler()
Default constructor.
Definition MCSampler.cpp:48
void SetBranch(TTree *theTree, const TString &name, void *variable, const TString &vartype)
automatically generated legend for PlotProbabilities
Double_t ESTAR
variables for TTree branches
Definition MCSampler.h:39
TLegend * fTheLegend
minimum probability for which channels are included in automatically generated TLegend when PlotProba...
Definition MCSampler.h:27
void initialiseWeightList()
if nuclear masses are modified
Definition MCSampler.cpp:36
void SetUpTreeBranches(KVEvent *&event, TTree *theTree, const TString &bname)
Double_t EDISP
the excitation energy (Exx)
Definition MCSampler.h:40
Long64_t IPART
the available kinetic energy
Definition MCSampler.h:41
void SetEventList(TTree *t, const TString &branchname)
Define the TTree or TChain containing all possible events (partitions).
Definition MCSampler.cpp:83
StatWeight * fLastPicked
Definition MCSampler.h:25
void SetLegendProbaMin(Double_t p)
Definition MCSampler.h:96
TClonesArray * fWeightList
statistical weight class
Definition MCSampler.h:36
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
Definition MCSampler.h:37
Long64_t PickRandomChannel()
void CalculateWeights(Double_t excitation_energy)
Double_t GetLegendProbaMin() const
Definition MCSampler.h:105
void SetModifyMasses(Bool_t yes=kTRUE)
Definition MCSampler.h:62
void init()
default initialisations
Definition MCSampler.cpp:21
TClonesArray * GetWeights() const
Definition MCSampler.h:69
void SetStatWeight(const TString &)
KVEvent * GetPartition(Long64_t i)
Definition MCSampler.h:55
void GenerateEvent(TTree *theTree, KVEvent *event)
TBranch * fBranch
number of partitions in TTree/TChain
Definition MCSampler.h:33
TClass * fWeight
event read from fPartitionList tree
Definition MCSampler.h:35
Double_t GetSumWeights() const
Definition MCSampler.h:77
StatWeight * GetWeight(Int_t i) const
Definition MCSampler.h:73
Abstract base class for calculating statistical weights for events .
Definition StatWeight.h:21
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
void Draw(Option_t *option="") override
long long Long64_t