36 void rf401_importttreethx()
42 TH1* hh_1 = makeTH1(
"hh1",0,3) ;
43 TH1* hh_2 = makeTH1(
"hh2",-3,1) ;
44 TH1* hh_3 = makeTH1(
"hh3",+3,4) ;
51 c.defineType(
"SampleA") ;
52 c.defineType(
"SampleB") ;
53 c.defineType(
"SampleC") ;
60 map<string,TH1*> hmap ;
61 hmap[
"SampleA"] = hh_1 ;
62 hmap[
"SampleB"] = hh_2 ;
63 hmap[
"SampleC"] = hh_3 ;
72 TTree*
tree = makeTTree() ;
98 icat.defineType(
"State0",0) ;
99 icat.defineType(
"State1",1) ;
117 RooDataSet* dsABC =
new RooDataSet(
"dsABC",
"dsABC",
RooArgSet(
x,
y),
Index(
c),
Import(
"SampleA",*dsA),
Import(
"SampleB",*dsB),
Import(
"SampleC",*dsC)) ;
129 TH1D* hh =
new TH1D(name,name,100,-10,10) ;
130 for (
int i=0 ; i<1000 ; i++) {
142 TTree* tree =
new TTree(
"tree",
"tree") ;
147 tree->Branch(
"x",px,
"x/D") ;
148 tree->Branch(
"y",py,
"y/D") ;
149 tree->Branch(
"z",pz,
"z/D") ;
150 tree->Branch(
"i",pi,
"i/I") ;
151 for (
int i=0 ; i<100 ; i++) {
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
static constexpr double pi
RooCmdArg Cut(const char *cutSpec)
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...
RooAbsData * reduce(const RooCmdArg &arg1, const RooCmdArg &arg2=RooCmdArg(), const RooCmdArg &arg3=RooCmdArg(), const RooCmdArg &arg4=RooCmdArg(), const RooCmdArg &arg5=RooCmdArg(), const RooCmdArg &arg6=RooCmdArg(), const RooCmdArg &arg7=RooCmdArg(), const RooCmdArg &arg8=RooCmdArg())
Create a reduced copy of this dataset.
RooDataSet is a container class to hold N-dimensional binned data.
RooRealVar represents a fundamental (non-derived) real valued object.
R__EXTERN TRandom * gRandom
1-D histogram with a double per channel (see TH1 documentation)}
RooDataSet is a container class to hold unbinned data.
RooCategory represents a fundamental (non-derived) discrete value object.
RooCmdArg Import(const char *state, TH1 &histo)
RooCmdArg Index(RooCategory &icat)
virtual void Print(Option_t *options=0) const
Print TNamed name and title.
virtual Double_t Uniform(Double_t x1=1)
Returns a uniform deviate on the interval (0, x1).
you should not use this method at all Int_t Int_t z
THist< 1, double, THistStatContent, THistStatUncertainty > TH1D