32void rf401_importttreethx()
40 TH1 *hh_1 = makeTH1(trnd,
"hh1", 0, 3);
41 TH1 *hh_2 = makeTH1(trnd,
"hh2", -3, 1);
42 TH1 *hh_3 = makeTH1(trnd,
"hh3", +3, 4);
48 RooCategory c(
"c",
"c", {{
"SampleA",0}, {
"SampleB",1}, {
"SampleC",2}});
56 std::map<std::string, TH1 *> hmap;
57 hmap[
"SampleA"] = hh_1;
58 hmap[
"SampleB"] = hh_2;
59 hmap[
"SampleC"] = hh_3;
66 TTree *tree = makeTTree(trnd);
90 icat.defineType(
"State0", 0);
91 icat.defineType(
"State1", 1);
102 std::unique_ptr<RooAbsData> dsA{ds2.reduce({
x,
y},
"z<-5")};
103 std::unique_ptr<RooAbsData> dsB{ds2.reduce({
x,
y},
"abs(z)<5")};
104 std::unique_ptr<RooAbsData> dsC{ds2.reduce({
x,
y},
"z>5")};
118 for (
int i = 0; i < 1000; i++) {
133 tree->
Branch(
"x", px,
"x/D");
134 tree->
Branch(
"y", py,
"y/D");
135 tree->
Branch(
"z", pz,
"z/D");
136 tree->
Branch(
"i", pi,
"i/I");
137 for (
int i = 0; i < 100; i++) {
138 *px = trnd.
Gaus(0, 3);
139 *py = trnd.
Uniform() * 30 - 15;
140 *pz = trnd.
Gaus(0, 5);
int Int_t
Signed integer 4 bytes (int).
void Print(Option_t *options=nullptr) const override
This method must be overridden when a class wants to print itself.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Object to represent discrete states.
Container class to hold N-dimensional binned data.
Container class to hold unbinned data.
Variable that can be changed from the outside.
1-D histogram with a double per channel (see TH1 documentation)
TH1 is the base class of all histogram classes in ROOT.
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
Random number generator class based on M.
This is the base class for the ROOT Random number generators.
virtual Double_t Gaus(Double_t mean=0, Double_t sigma=1)
Samples a random number from the standard Normal (Gaussian) Distribution with the given mean and sigm...
virtual Double_t Uniform(Double_t x1=1)
Returns a uniform deviate on the interval (0, x1).
A TTree represents a columnar dataset.
virtual Int_t Fill()
Fill all branches.
TBranch * Branch(const char *name, T *obj, Int_t bufsize=32000, Int_t splitlevel=99)
Add a new branch, and infer the data type from the type of obj being passed.
RooCmdArg Import(const char *state, TH1 &histo)
RooCmdArg Cut(const char *cutSpec)
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...