30 cout <<
"ERROR: cannot open file: " << fname << endl;
68 treeS->
Draw(
Form(
"%s:%s>>DataS",var1.Data(),var0.Data()),
"",
"0" );
69 treeB->
Draw(
Form(
"%s:%s>>DataB",var1.Data(),var0.Data()
80 frameS->
SetTitle( var1+
" versus "+var0+
" for signal and background" );
91 frameB->
Draw(
"same" );
94 TLegend *legend =
new TLegend( 1 -
c->GetRightMargin() - 0.32, 1 -
c->GetTopMargin() - 0.12,
95 1 -
c->GetRightMargin(), 1 -
c->GetTopMargin() );
97 legend->
AddEntry(frameS,
"Signal",
"p");
98 legend->
AddEntry(frameB,
"Background",
"p");
114 for (
Int_t j=0;j< i; j++)
sum += (*sqrtMat)(i,j) * (*sqrtMat)(i,j);
121 for (
Int_t l=0;
l<i;
l++)
sum += (*sqrtMat)(k,
l) * (*sqrtMat)(i,
l);
123 (*sqrtMat)(k,i) = (covMat(k,i) -
sum) / (*sqrtMat)(i,i);
136 if (
size !=
v.GetSize())
137 cout <<
"<getGaussRnd> too short input vector: " <<
size <<
" " <<
v.GetSize() << endl;
151 for (
Int_t j=0; j<=i; j++)
v[i] += sqrtMat(i,j) * tmpVec[j];
158void create_lin_Nvar_withFriend(
Int_t N = 2000)
160 const Int_t nvar = 4;
161 const Int_t nvar2 = 1;
168 TTree* treeS =
new TTree(
"TreeS",
"TreeS", 1 );
169 TTree* treeB =
new TTree(
"TreeB",
"TreeB", 1 );
170 for (
Int_t ivar=0; ivar<nvar-nvar2; ivar++) {
171 cout <<
"Creating branch var" << ivar+1 <<
" in signal tree" << endl;
175 TTree* treeSF =
new TTree(
"TreeSF",
"TreeS", 1 );
176 TTree* treeBF =
new TTree(
"TreeBF",
"TreeB", 1 );
177 for (
Int_t ivar=nvar-nvar2; ivar<nvar; ivar++) {
184 Float_t xS[nvar] = { 0.2, 0.3, 0.5, 0.9 };
185 Float_t xB[nvar] = { -0.2, -0.3, -0.5, -0.6 };
186 Float_t dx[nvar] = { 1.0, 1.0, 1.0, 1.0 };
199 for (
Int_t ivar=0; ivar<nvar; ivar++) {
200 (*covMatS)(ivar,ivar) = dx[ivar]*dx[ivar];
201 (*covMatB)(ivar,ivar) = dx[ivar]*dx[ivar];
202 for (
Int_t jvar=ivar+1; jvar<nvar; jvar++) {
203 (*covMatS)(ivar,jvar) = rho[(ivar+1)*(jvar+1)]*dx[ivar]*dx[jvar];
204 (*covMatS)(jvar,ivar) = (*covMatS)(ivar,jvar);
206 (*covMatB)(ivar,jvar) = rho[(ivar+1)*(jvar+1)]*dx[ivar]*dx[jvar];
207 (*covMatB)(jvar,ivar) = (*covMatB)(ivar,jvar);
211 cout <<
"signal covariance matrix: " << endl;
213 cout <<
"background covariance matrix: " << endl;
217 TMatrixD* sqrtMatS = produceSqrtMat( *covMatS );
218 TMatrixD* sqrtMatB = produceSqrtMat( *covMatB );
221 for (
Int_t itype=0; itype<2; itype++) {
225 if (itype == 0) {
x = xS;
m = sqrtMatS; cout <<
"- produce signal" << endl; }
226 else {
x = xB;
m = sqrtMatB; cout <<
"- produce background" << endl; }
229 TTree* tree = (itype==0) ? treeS : treeB;
230 TTree* treeF = (itype==0) ? treeSF : treeBF;
231 for (
Int_t i=0; i<
N; i++) {
233 if (i%1000 == 0) cout <<
"... event: " << i <<
" (" <<
N <<
")" << endl;
234 getGaussRnd( *
v, *
m,
R );
236 for (
Int_t ivar=0; ivar<nvar; ivar++) xvar[ivar] = (*
v)[ivar] +
x[ivar];
256 cout <<
"created data file: " << dataFile->
GetName() << endl;
268 TTree* tree =
new TTree(treeName, treeTitle, 1);
270 for (
Int_t ivar=0; ivar<nvar; ivar++) {
286 for (
Int_t ivar=0; ivar<nvar; ivar++) {
287 (*covMat)(ivar,ivar) = dx[ivar]*dx[ivar];
288 for (
Int_t jvar=ivar+1; jvar<nvar; jvar++) {
289 (*covMat)(ivar,jvar) = rho[(ivar+1)*(jvar+1)]*dx[ivar]*dx[jvar];
290 (*covMat)(jvar,ivar) = (*covMat)(ivar,jvar);
297 TMatrixD* sqrtMat = produceSqrtMat( *covMat );
300 for (
Int_t i=0; i<
N; i++) {
302 if (i%1000 == 0) cout <<
"... event: " << i <<
" (" <<
N <<
")" << endl;
303 getGaussRnd( *
v, *sqrtMat,
R );
305 for (
Int_t ivar=0; ivar<nvar; ivar++) xvar[ivar] = (*
v)[ivar] +
x[ivar];
315 cout <<
"created tree: " << tree->
GetName() << endl;
327 TTree* tree =
new TTree( treeName, treeTitle, 1 );
328 for (
Int_t ivar=0; ivar<nvar; ivar++) {
334 Float_t phimin = -70, phimax = 130;
337 Float_t fnmin = -(radius+4.0*rsig);
338 Float_t fnmax = +(radius+4.0*rsig);
342 for (
Int_t i=0; i<
N; i++) {
346 if (distort) phi = r3*(phimax - phimin) + phimin;
347 else phi =
R.Rndm()*(phimax - phimin) + phimin;
348 phi +=
R.Gaus()*phisig;
356 for(
Int_t j = 2; j<nvar; ++j )
357 xvar[j] = dfn*
R.Rndm()+fnmin;
362 for (
Int_t i=0; i<Nn; i++) {
364 xvar[0] = dfn*
R.Rndm()+fnmin;
365 xvar[1] = dfn*
R.Rndm()+fnmin;
367 for(
Int_t j = 2; j<nvar; ++j )
368 xvar[j] = dfn*
R.Rndm()+fnmin;
376 cout <<
"created tree: " << tree->
GetName() << endl;
383void create_lin_Nvar_2(
Int_t N = 50000)
391 Float_t xS[nvar] = { 0.2, 0.3, 0.5, 0.9 };
392 Float_t xB[nvar] = { -0.2, -0.3, -0.5, -0.6 };
393 Float_t dx[nvar] = { 1.0, 1.0, 1.0, 1.0 };
396 TTree* treeS = makeTree_lin_Nvar(
"TreeS",
"Signal tree", xS, dx, nvar,
N );
397 TTree* treeB = makeTree_lin_Nvar(
"TreeB",
"Background tree", xB, dx, nvar,
N );
406 cout <<
"created data file: " << dataFile->
GetName() << endl;
413void create_lin_Nvar(
Int_t N = 50000)
415 const Int_t nvar = 4;
422 TTree* treeS =
new TTree(
"TreeS",
"TreeS", 1 );
423 TTree* treeB =
new TTree(
"TreeB",
"TreeB", 1 );
424 for (
Int_t ivar=0; ivar<nvar; ivar++) {
430 Float_t xS[nvar] = { 0.2, 0.3, 0.5, 0.9 };
431 Float_t xB[nvar] = { -0.2, -0.3, -0.5, -0.6 };
432 Float_t dx[nvar] = { 1.0, 1.0, 1.0, 1.0 };
445 for (
Int_t ivar=0; ivar<nvar; ivar++) {
446 (*covMatS)(ivar,ivar) = dx[ivar]*dx[ivar];
447 (*covMatB)(ivar,ivar) = dx[ivar]*dx[ivar];
448 for (
Int_t jvar=ivar+1; jvar<nvar; jvar++) {
449 (*covMatS)(ivar,jvar) = rho[(ivar+1)*(jvar+1)]*dx[ivar]*dx[jvar];
450 (*covMatS)(jvar,ivar) = (*covMatS)(ivar,jvar);
452 (*covMatB)(ivar,jvar) = rho[(ivar+1)*(jvar+1)]*dx[ivar]*dx[jvar];
453 (*covMatB)(jvar,ivar) = (*covMatB)(ivar,jvar);
456 cout <<
"signal covariance matrix: " << endl;
458 cout <<
"background covariance matrix: " << endl;
462 TMatrixD* sqrtMatS = produceSqrtMat( *covMatS );
463 TMatrixD* sqrtMatB = produceSqrtMat( *covMatB );
466 for (
Int_t itype=0; itype<2; itype++) {
470 if (itype == 0) {
x = xS;
m = sqrtMatS; cout <<
"- produce signal" << endl; }
471 else {
x = xB;
m = sqrtMatB; cout <<
"- produce background" << endl; }
474 TTree* tree = (itype==0) ? treeS : treeB;
475 for (
Int_t i=0; i<
N; i++) {
477 if (i%1000 == 0) cout <<
"... event: " << i <<
" (" <<
N <<
")" << endl;
478 getGaussRnd( *
v, *
m,
R );
480 for (
Int_t ivar=0; ivar<nvar; ivar++) xvar[ivar] = (*
v)[ivar] +
x[ivar];
494 cout <<
"created data file: " << dataFile->
GetName() << endl;
501 const Int_t nvar = 4;
509 TTree* treeS =
new TTree(
"TreeS",
"TreeS", 1 );
510 TTree* treeB =
new TTree(
"TreeB",
"TreeB", 1 );
511 for (
Int_t ivar=0; ivar<nvar; ivar++) {
517 treeS->
Branch(
"eta", &eta,
"eta/F" );
518 treeB->
Branch(
"eta", &eta,
"eta/F" );
521 Float_t xS[nvar] = { 0.2, 0.3, 0.5, 0.9 };
522 Float_t xB[nvar] = { -0.2, -0.3, -0.5, -0.6 };
523 Float_t dx[nvar] = { 1.0, 1.0, 1.0, 1.0 };
544 for (
Int_t ivar=0; ivar<nvar; ivar++) {
545 (*covMatS)(ivar,ivar) = dx[ivar]*dx[ivar];
546 (*covMatB)(ivar,ivar) = dx[ivar]*dx[ivar];
547 for (
Int_t jvar=ivar+1; jvar<nvar; jvar++) {
548 (*covMatS)(ivar,jvar) = rho[(ivar+1)*(jvar+1)]*dx[ivar]*dx[jvar];
549 (*covMatS)(jvar,ivar) = (*covMatS)(ivar,jvar);
551 (*covMatB)(ivar,jvar) = rho[(ivar+1)*(jvar+1)]*dx[ivar]*dx[jvar];
552 (*covMatB)(jvar,ivar) = (*covMatB)(ivar,jvar);
555 cout <<
"signal covariance matrix: " << endl;
557 cout <<
"background covariance matrix: " << endl;
561 TMatrixD* sqrtMatS = produceSqrtMat( *covMatS );
562 TMatrixD* sqrtMatB = produceSqrtMat( *covMatB );
565 for (
Int_t itype=0; itype<2; itype++) {
569 if (itype == 0) {
x = xS;
m = sqrtMatS; cout <<
"- produce signal" << endl; }
570 else {
x = xB;
m = sqrtMatB; cout <<
"- produce background" << endl; }
573 TTree* tree = (itype==0) ? treeS : treeB;
574 for (
Int_t i=0; i<
N; i++) {
576 if (i%1000 == 0) cout <<
"... event: " << i <<
" (" <<
N <<
")" << endl;
577 getGaussRnd( *
v, *
m,
R );
579 eta = 2.5*2*(
R.Rndm() - 0.5);
582 for (
Int_t ivar=0; ivar<nvar; ivar++) xvar[ivar] = (*
v)[ivar] +
x[ivar] +
offset;
597 cout <<
"created data file: " << dataFile->
GetName() << endl;
602void create_lin_Nvar_weighted(
Int_t N = 10000,
int WeightedSignal=0,
int WeightedBkg=1,
Float_t BackgroundContamination=0,
Int_t seed=100)
604 const Int_t nvar = 4;
609 cout << endl << endl << endl;
610 cout <<
"please use .L createData.C++ if you want to run this MC generation" <<endl;
611 cout <<
"otherwise you will wait for ages!!! " << endl;
612 cout << endl << endl << endl;
617 if (BackgroundContamination) fileName =
Form(
"linCorGauss%d_weighted+background.root",seed);
618 else fileName =
Form(
"linCorGauss%d_weighted.root",seed);
623 TTree* treeS =
new TTree(
"TreeS",
"TreeS", 1 );
624 TTree* treeB =
new TTree(
"TreeB",
"TreeB", 1 );
625 for (
Int_t ivar=0; ivar<nvar; ivar++) {
629 if (WeightedSignal||BackgroundContamination>0||1) treeS->
Branch(
"weight", &weight,
"weight/F" );
630 if (WeightedBkg) treeB->
Branch(
"weight", &weight,
"weight/F" );
633 Float_t xS[nvar] = { 0.2, 0.3, 0.4, 0.8 };
634 Float_t xB[nvar] = { -0.2, -0.3, -0.4, -0.5 };
635 Float_t dx[nvar] = { 1.0, 1.0, 1.0, 1.0 };
648 for (
Int_t ivar=0; ivar<nvar; ivar++) {
649 (*covMatS)(ivar,ivar) = dx[ivar]*dx[ivar];
650 (*covMatB)(ivar,ivar) = dx[ivar]*dx[ivar];
651 for (
Int_t jvar=ivar+1; jvar<nvar; jvar++) {
652 (*covMatS)(ivar,jvar) = rho[(ivar+1)*(jvar+1)]*dx[ivar]*dx[jvar];
653 (*covMatS)(jvar,ivar) = (*covMatS)(ivar,jvar);
655 (*covMatB)(ivar,jvar) = rho[(ivar+1)*(jvar+1)]*dx[ivar]*dx[jvar];
656 (*covMatB)(jvar,ivar) = (*covMatB)(ivar,jvar);
659 cout <<
"signal covariance matrix: " << endl;
661 cout <<
"background covariance matrix: " << endl;
665 TMatrixD* sqrtMatS = produceSqrtMat( *covMatS );
666 TMatrixD* sqrtMatB = produceSqrtMat( *covMatB );
669 for (
Int_t itype=0; itype<2; itype++) {
673 if (itype == 0) {
x = xS;
m = sqrtMatS; cout <<
"- produce signal" << endl; }
674 else {
x = xB;
m = sqrtMatB; cout <<
"- produce background" << endl; }
677 TTree* tree = (itype==0) ? treeS : treeB;
680 getGaussRnd( *
v, *
m,
R );
682 for (
Int_t ivar=0; ivar<nvar; ivar++) xvar[ivar] = (*
v)[ivar] +
x[ivar];
687 weight = 0.8 / (
TMath::Gaus( ((*
v)[nvar-1]), 0, 1.09) );
689 if (itype==0 && !WeightedSignal) {
693 }
else if (itype==1 && !WeightedBkg) {
702 if (i%10 == 0) cout <<
"... event: " << i <<
" (" <<
N <<
")" << endl;
710 if (BackgroundContamination > 0){
715 for (
Int_t i=0; i<
N*BackgroundContamination*2; i++) {
716 if (i%1000 == 0) cout <<
"... event: " << i <<
" (" <<
N <<
")" << endl;
717 getGaussRnd( *
v, *
m,
R );
718 for (
Int_t ivar=0; ivar<nvar; ivar++) xvar[ivar] = (*
v)[ivar] +
x[ivar];
739 for (
Int_t i=0;i<4;i++){
741 sprintf(buffer,
"h%d",i);
742 h[i]=
new TH1F(buffer,
"",100,-5,5);
743 sprintf(buffer,
"hw%d",i);
744 hw[i] =
new TH1F(buffer,
"",100,-5,5);
750 for (
Int_t i=0;i<4;i++){
752 hw[i]->
Fill(xvar[i],weight);
759 for (
Int_t i=0;i<4;i++){
767 cout <<
"created data file: " << dataFile->
GetName() << endl;
773void create_lin_Nvar_Arr(
Int_t N = 1000)
775 const Int_t nvar = 4;
776 std::vector<float>* xvar[nvar];
782 TTree* treeS =
new TTree(
"TreeS",
"TreeS", 1 );
783 TTree* treeB =
new TTree(
"TreeB",
"TreeB", 1 );
784 for (
Int_t ivar=0; ivar<nvar; ivar++) {
785 xvar[ivar] =
new std::vector<float>();
786 treeS->
Branch(
TString(
Form(
"var%i", ivar+1 )).Data(),
"vector<float>", &xvar[ivar], 64000, 1 );
787 treeB->
Branch(
TString(
Form(
"var%i", ivar+1 )).Data(),
"vector<float>", &xvar[ivar], 64000, 1 );
791 Float_t xS[nvar] = { 0.2, 0.3, 0.5, 0.9 };
792 Float_t xB[nvar] = { -0.2, -0.3, -0.5, -0.6 };
793 Float_t dx[nvar] = { 1.0, 1.0, 1.0, 1.0 };
806 for (
Int_t ivar=0; ivar<nvar; ivar++) {
807 (*covMatS)(ivar,ivar) = dx[ivar]*dx[ivar];
808 (*covMatB)(ivar,ivar) = dx[ivar]*dx[ivar];
809 for (
Int_t jvar=ivar+1; jvar<nvar; jvar++) {
810 (*covMatS)(ivar,jvar) = rho[(ivar+1)*(jvar+1)]*dx[ivar]*dx[jvar];
811 (*covMatS)(jvar,ivar) = (*covMatS)(ivar,jvar);
813 (*covMatB)(ivar,jvar) = rho[(ivar+1)*(jvar+1)]*dx[ivar]*dx[jvar];
814 (*covMatB)(jvar,ivar) = (*covMatB)(ivar,jvar);
817 cout <<
"signal covariance matrix: " << endl;
819 cout <<
"background covariance matrix: " << endl;
823 TMatrixD* sqrtMatS = produceSqrtMat( *covMatS );
824 TMatrixD* sqrtMatB = produceSqrtMat( *covMatB );
827 for (
Int_t itype=0; itype<2; itype++) {
831 if (itype == 0) {
x = xS;
m = sqrtMatS; cout <<
"- produce signal" << endl; }
832 else {
x = xB;
m = sqrtMatB; cout <<
"- produce background" << endl; }
835 TTree* tree = (itype==0) ? treeS : treeB;
836 for (
Int_t i=0; i<
N; i++) {
838 if (i%100 == 0) cout <<
"... event: " << i <<
" (" <<
N <<
")" << endl;
841 for (
Int_t ivar=0; ivar<nvar; ivar++) {
843 xvar[ivar]->reserve(aSize);
845 for(
Int_t iA = 0; iA<aSize; iA++) {
847 getGaussRnd( *
v, *
m,
R );
848 for (
Int_t ivar=0; ivar<nvar; ivar++) xvar[ivar]->push_back((*
v)[ivar] +
x[ivar]);
863 cout <<
"created data file: " << dataFile->
GetName() << endl;
871void create_lin_Nvar_double()
874 const Int_t nvar = 4;
883 TTree* treeS =
new TTree(
"TreeS",
"TreeS", 1 );
884 TTree* treeB =
new TTree(
"TreeB",
"TreeB", 1 );
885 for (
Int_t ivar=0; ivar<nvar; ivar++) {
897 Double_t xS[nvar] = { 0.2, 0.3, 0.5, 0.6 };
898 Double_t xB[nvar] = { -0.2, -0.3, -0.5, -0.6 };
899 Double_t dx[nvar] = { 1.0, 1.0, 1.0, 1.0 };
912 for (
Int_t ivar=0; ivar<nvar; ivar++) {
913 (*covMatS)(ivar,ivar) = dx[ivar]*dx[ivar];
914 (*covMatB)(ivar,ivar) = dx[ivar]*dx[ivar];
915 for (
Int_t jvar=ivar+1; jvar<nvar; jvar++) {
916 (*covMatS)(ivar,jvar) = rho[(ivar+1)*(jvar+1)]*dx[ivar]*dx[jvar];
917 (*covMatS)(jvar,ivar) = (*covMatS)(ivar,jvar);
919 (*covMatB)(ivar,jvar) = rho[(ivar+1)*(jvar+1)]*dx[ivar]*dx[jvar];
920 (*covMatB)(jvar,ivar) = (*covMatB)(ivar,jvar);
923 cout <<
"signal covariance matrix: " << endl;
925 cout <<
"background covariance matrix: " << endl;
929 TMatrixD* sqrtMatS = produceSqrtMat( *covMatS );
930 TMatrixD* sqrtMatB = produceSqrtMat( *covMatB );
933 for (
Int_t itype=0; itype<2; itype++) {
937 if (itype == 0) {
x = xS;
m = sqrtMatS; cout <<
"- produce signal" << endl; }
938 else {
x = xB;
m = sqrtMatB; cout <<
"- produce background" << endl; }
941 TTree* tree = (itype==0) ? treeS : treeB;
942 for (
Int_t i=0; i<
N; i++) {
944 if (i%1000 == 0) cout <<
"... event: " << i <<
" (" <<
N <<
")" << endl;
945 getGaussRnd( *
v, *
m,
R );
947 for (
Int_t ivar=0; ivar<nvar; ivar++) xvar[ivar] = (*
v)[ivar] +
x[ivar];
948 for (
Int_t ivar=0; ivar<nvar; ivar++) {
949 if (ivar<2) xvarD[ivar] = xvar[ivar];
950 else xvarF[ivar] = xvar[ivar];
965 cout <<
"created data file: " << dataFile->
GetName() << endl;
971void create_lin_Nvar_discrete()
974 const Int_t nvar = 4;
982 TTree* treeS =
new TTree(
"TreeS",
"TreeS", 1 );
983 TTree* treeB =
new TTree(
"TreeB",
"TreeB", 1 );
984 for (
Int_t ivar=0; ivar<nvar-2; ivar++) {
988 for (
Int_t ivar=0; ivar<2; ivar++) {
994 Float_t xS[nvar] = { 0.2, 0.3, 1, 2 };
995 Float_t xB[nvar] = { -0.2, -0.3, 0, 0 };
996 Float_t dx[nvar] = { 1.0, 1.0, 1, 2 };
1006 for (
int i=0; i<20; i++) rho[i] = 0;
1011 for (
Int_t ivar=0; ivar<nvar; ivar++) {
1012 (*covMatS)(ivar,ivar) = dx[ivar]*dx[ivar];
1013 (*covMatB)(ivar,ivar) = dx[ivar]*dx[ivar];
1014 for (
Int_t jvar=ivar+1; jvar<nvar; jvar++) {
1015 (*covMatS)(ivar,jvar) = rho[(ivar+1)*(jvar+1)]*dx[ivar]*dx[jvar];
1016 (*covMatS)(jvar,ivar) = (*covMatS)(ivar,jvar);
1018 (*covMatB)(ivar,jvar) = rho[(ivar+1)*(jvar+1)]*dx[ivar]*dx[jvar];
1019 (*covMatB)(jvar,ivar) = (*covMatB)(ivar,jvar);
1022 cout <<
"signal covariance matrix: " << endl;
1024 cout <<
"background covariance matrix: " << endl;
1028 TMatrixD* sqrtMatS = produceSqrtMat( *covMatS );
1029 TMatrixD* sqrtMatB = produceSqrtMat( *covMatB );
1032 for (
Int_t itype=0; itype<2; itype++) {
1036 if (itype == 0) {
x = xS;
m = sqrtMatS; cout <<
"- produce signal" << endl; }
1037 else {
x = xB;
m = sqrtMatB; cout <<
"- produce background" << endl; }
1040 TTree* tree = (itype==0) ? treeS : treeB;
1041 for (
Int_t i=0; i<
N; i++) {
1043 if (i%1000 == 0) cout <<
"... event: " << i <<
" (" <<
N <<
")" << endl;
1044 getGaussRnd( *
v, *
m,
R );
1046 for (
Int_t ivar=0; ivar<nvar; ivar++) xvar[ivar] = (*
v)[ivar] +
x[ivar];
1063 cout <<
"created data file: " << dataFile->
GetName() << endl;
1069void create_ManyVars()
1072 const Int_t nvar = 20;
1079 TTree* treeS =
new TTree(
"TreeS",
"TreeS", 1 );
1080 TTree* treeB =
new TTree(
"TreeB",
"TreeB", 1 );
1081 for (
Int_t ivar=0; ivar<nvar; ivar++) {
1089 for (
Int_t ivar=0; ivar<nvar; ivar++) {
1090 xS[ivar] = 0 + ivar*0.05;
1091 xB[ivar] = 0 - ivar*0.05;
1119 for (
Int_t itype=0; itype<2; itype++) {
1121 Float_t*
x = (itype == 0) ? xS : xB;
1124 TTree* tree = (itype == 0) ? treeS : treeB;
1125 for (
Int_t i=0; i<
N; i++) {
1127 if (i%1000 == 0) cout <<
"... event: " << i <<
" (" <<
N <<
")" << endl;
1128 for (
Int_t ivar=0; ivar<nvar; ivar++) {
1129 if (ivar == 1500 && itype!=10) xvar[ivar] = 1;
1130 else xvar[ivar] =
x[ivar] +
R.Gaus()*dx[ivar];
1146 cout <<
"created data file: " << dataFile->
GetName() << endl;
1150void create_lin_NvarObsolete()
1153 const Int_t nvar = 20;
1160 TTree* treeS =
new TTree(
"TreeS",
"TreeS", 1 );
1161 TTree* treeB =
new TTree(
"TreeB",
"TreeB", 1 );
1162 for (
Int_t ivar=0; ivar<nvar; ivar++) {
1168 Float_t xS[nvar] = { 0.5, 0.5, 0.0, 0.0, 0.0, 0.0 };
1169 Float_t xB[nvar] = { -0.5, -0.5, -0.0, -0.0, -0.0, -0.0 };
1170 Float_t dx[nvar] = { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 };
1173 for (
Int_t i=0; i<50; i++) rho[i] = 0;
1184 for (
Int_t ivar=0; ivar<nvar; ivar++) {
1185 (*covMatS)(ivar,ivar) = dx[ivar]*dx[ivar];
1186 (*covMatB)(ivar,ivar) = dx[ivar]*dx[ivar];
1187 for (
Int_t jvar=ivar+1; jvar<nvar; jvar++) {
1188 (*covMatS)(ivar,jvar) = rho[(ivar+1)*(jvar+1)]*dx[ivar]*dx[jvar];
1189 (*covMatS)(jvar,ivar) = (*covMatS)(ivar,jvar);
1191 (*covMatB)(ivar,jvar) = rho[(ivar+1)*(jvar+1)]*dx[ivar]*dx[jvar];
1192 (*covMatB)(jvar,ivar) = (*covMatB)(ivar,jvar);
1195 cout <<
"signal covariance matrix: " << endl;
1197 cout <<
"background covariance matrix: " << endl;
1201 TMatrixD* sqrtMatS = produceSqrtMat( *covMatS );
1202 TMatrixD* sqrtMatB = produceSqrtMat( *covMatB );
1205 for (
Int_t itype=0; itype<2; itype++) {
1209 if (itype == 0) {
x = xS;
m = sqrtMatS; cout <<
"- produce signal" << endl; }
1210 else {
x = xB;
m = sqrtMatB; cout <<
"- produce background" << endl; }
1213 TTree* tree = (itype==0) ? treeS : treeB;
1214 for (
Int_t i=0; i<
N; i++) {
1216 if (i%1000 == 0) cout <<
"... event: " << i <<
" (" <<
N <<
")" << endl;
1217 getGaussRnd( *
v, *
m,
R );
1219 for (
Int_t ivar=0; ivar<nvar; ivar++) xvar[ivar] = (*
v)[ivar] +
x[ivar];
1233 cout <<
"created data file: " << dataFile->
GetName() << endl;
1239void create_lin(
Int_t N = 2000)
1241 const Int_t nvar = 2;
1249 TTree* treeS =
new TTree(
"TreeS",
"TreeS", 1 );
1250 TTree* treeB =
new TTree(
"TreeB",
"TreeB", 1 );
1251 for (
Int_t ivar=0; ivar<nvar; ivar++) {
1255 treeS->
Branch(
"weight", &weight,
"weight/F" );
1256 treeB->
Branch(
"weight", &weight,
"weight/F" );
1259 Float_t xS[nvar] = { 0.0, 0.0 };
1260 Float_t xB[nvar] = { -0.0, -0.0 };
1261 Float_t dx[nvar] = { 1.0, 1.0 };
1269 for (
Int_t ivar=0; ivar<nvar; ivar++) {
1270 (*covMatS)(ivar,ivar) = dx[ivar]*dx[ivar];
1271 (*covMatB)(ivar,ivar) = dx[ivar]*dx[ivar];
1272 for (
Int_t jvar=ivar+1; jvar<nvar; jvar++) {
1273 (*covMatS)(ivar,jvar) = rhoS*dx[ivar]*dx[jvar];
1274 (*covMatS)(jvar,ivar) = (*covMatS)(ivar,jvar);
1276 (*covMatB)(ivar,jvar) = rhoB*dx[ivar]*dx[jvar];
1277 (*covMatB)(jvar,ivar) = (*covMatB)(ivar,jvar);
1280 cout <<
"signal covariance matrix: " << endl;
1282 cout <<
"background covariance matrix: " << endl;
1286 TMatrixD* sqrtMatS = produceSqrtMat( *covMatS );
1287 TMatrixD* sqrtMatB = produceSqrtMat( *covMatB );
1290 for (
Int_t itype=0; itype<2; itype++) {
1294 if (itype == 0) {
x = xS;
m = sqrtMatS; cout <<
"- produce signal" << endl; }
1295 else {
x = xB;
m = sqrtMatB; cout <<
"- produce background" << endl; }
1298 TTree* tree = (itype==0) ? treeS : treeB;
1299 for (
Int_t i=0; i<
N; i++) {
1301 if (i%1000 == 0) cout <<
"... event: " << i <<
" (" <<
N <<
")" << endl;
1302 getGaussRnd( *
v, *
m,
R );
1303 for (
Int_t ivar=0; ivar<nvar; ivar++) xvar[ivar] = (*
v)[ivar] +
x[ivar];
1306 if (itype == 0) weight = 1.0;
1321 cout <<
"created data file: " << dataFile->
GetName() << endl;
1328void create_fullcirc(
Int_t nmax = 20000,
Bool_t distort=
false)
1332 int nsig = 0, nbgd=0;
1336 TTree* treeS =
new TTree(
"TreeS",
"TreeS", 1 );
1337 TTree* treeB =
new TTree(
"TreeB",
"TreeB", 1 );
1338 for (
Int_t ivar=0; ivar<nvar; ivar++) {
1342 treeS->
Branch(
"weight", &weight,
"weight/F");
1343 treeB->
Branch(
"weight", &weight,
"weight/F");
1347 for (
Int_t ivar=0; ivar<nvar; ivar++) { xvar[ivar]=2.*
R.Rndm()-1.;}
1348 Float_t xout = xvar[0]*xvar[0]+xvar[1]*xvar[1];
1349 if (nsig<10) cout <<
"xout = " << xout<<endl;
1350 if (xout < 0.3 || (xout >0.3 && xout<0.5 &&
R.Rndm() > xout)) {
1351 if (distort && xvar[0] < 0 &&
R.Rndm()>0.1)
continue;
1356 if (distort && xvar[0] > 0 &&
R.Rndm()>0.1)
continue;
1360 }
while ( nsig < nmax || nbgd < nmax);
1368void create_circ(
Int_t N = 6000,
Bool_t distort =
false)
1371 const Int_t nvar = 2;
1378 TTree* treeS =
new TTree(
"TreeS",
"TreeS", 1 );
1379 TTree* treeB =
new TTree(
"TreeB",
"TreeB", 1 );
1380 for (
Int_t ivar=0; ivar<nvar; ivar++) {
1394 Float_t phimin = -70, phimax = 130;
1399 Float_t fnmin = -(rS+4.0*rsig);
1400 Float_t fnmax = +(rS+4.0*rsig);
1403 for (
Int_t itype=0; itype<2; itype++) {
1406 TTree* tree = (itype==0) ? treeS : treeB;
1407 for (
Int_t i=0; i<
N; i++) {
1409 if (itype==0) r3= r1>r2? r1 :r2;
1412 if (distort) phi = r3*(phimax - phimin) + phimin;
1413 else phi =
R.Rndm()*(phimax - phimin) + phimin;
1414 phi +=
R.Gaus()*phisig;
1425 for (
Int_t i=0; i<Nn; i++) {
1427 xvar[0] = dfn*
R.Rndm()+fnmin;
1428 xvar[1] = dfn*
R.Rndm()+fnmin;
1442 cout <<
"created data file: " << dataFile->
GetName() << endl;
1448void create_schachbrett(
Int_t nEvents = 20000) {
1450 const Int_t nvar = 2;
1457 TTree* treeS =
new TTree(
"TreeS",
"TreeS", 1 );
1458 TTree* treeB =
new TTree(
"TreeB",
"TreeB", 1 );
1459 for (
Int_t ivar=0; ivar<nvar; ivar++) {
1464 Int_t nSeed = 12345;
1469 Int_t xtype=1, ytype=1;
1473 while (iev < nEvents){
1475 for (
Int_t i=-m_nDim; i <= m_nDim; i++){
1477 for (
Int_t j=-m_nDim; j <= m_nDim; j++){
1483 TTree* tree = (
type==1) ? treeS : treeB;
1501 cout <<
"created data file: " << dataFile->
GetName() << endl;
1508void create_schachbrett_5D(
Int_t nEvents = 200000) {
1509 const Int_t nvar = 5;
1516 TTree* treeS =
new TTree(
"TreeS",
"TreeS", 1 );
1517 TTree* treeB =
new TTree(
"TreeB",
"TreeB", 1 );
1518 for (
Int_t ivar=0; ivar<nvar; ivar++) {
1523 Int_t nSeed = 12345;
1532 while (iev < nEvents){
1534 for (idx[0]=-m_nDim; idx[0] <= m_nDim; idx[0]++){
1536 for (idx[1]=-m_nDim; idx[1] <= m_nDim; idx[1]++){
1538 for (idx[2]=-m_nDim; idx[2] <= m_nDim; idx[2]++){
1540 for (idx[3]=-m_nDim; idx[3] <= m_nDim; idx[3]++){
1542 for (idx[4]=-m_nDim; idx[4] <= m_nDim; idx[4]++){
1544 for (
Int_t i=0;i<nvar;i++){
1546 if (i>0)
type *= itype[i];
1548 TTree* tree = (
type==1) ? treeS : treeB;
1571 cout <<
"created data file: " << dataFile->
GetName() << endl;
1578void create_schachbrett_4D(
Int_t nEvents = 200000) {
1580 const Int_t nvar = 4;
1587 TTree* treeS =
new TTree(
"TreeS",
"TreeS", 1 );
1588 TTree* treeB =
new TTree(
"TreeB",
"TreeB", 1 );
1589 for (
Int_t ivar=0; ivar<nvar; ivar++) {
1594 Int_t nSeed = 12345;
1603 while (iev < nEvents){
1605 for (idx[0]=-m_nDim; idx[0] <= m_nDim; idx[0]++){
1607 for (idx[1]=-m_nDim; idx[1] <= m_nDim; idx[1]++){
1609 for (idx[2]=-m_nDim; idx[2] <= m_nDim; idx[2]++){
1611 for (idx[3]=-m_nDim; idx[3] <= m_nDim; idx[3]++){
1613 for (
Int_t i=0;i<nvar;i++){
1615 if (i>0)
type *= itype[i];
1617 TTree* tree = (
type==1) ? treeS : treeB;
1638 cout <<
"created data file: " << dataFile->
GetName() << endl;
1645void create_schachbrett_3D(
Int_t nEvents = 20000) {
1647 const Int_t nvar = 3;
1654 TTree* treeS =
new TTree(
"TreeS",
"TreeS", 1 );
1655 TTree* treeB =
new TTree(
"TreeB",
"TreeB", 1 );
1656 for (
Int_t ivar=0; ivar<nvar; ivar++) {
1661 Int_t nSeed = 12345;
1670 while (iev < nEvents){
1672 for (idx[0]=-m_nDim; idx[0] <= m_nDim; idx[0]++){
1674 for (idx[1]=-m_nDim; idx[1] <= m_nDim; idx[1]++){
1676 for (idx[2]=-m_nDim; idx[2] <= m_nDim; idx[2]++){
1678 for (
Int_t i=0;i<nvar;i++){
1680 if (i>0)
type *= itype[i];
1682 TTree* tree = (
type==1) ? treeS : treeB;
1701 cout <<
"created data file: " << dataFile->
GetName() << endl;
1708void create_schachbrett_2D(
Int_t nEvents = 100000,
Int_t nbumps=2) {
1710 const Int_t nvar = 2;
1717 TTree* treeS =
new TTree(
"TreeS",
"TreeS", 1 );
1718 TTree* treeB =
new TTree(
"TreeB",
"TreeB", 1 );
1719 for (
Int_t ivar=0; ivar<nvar; ivar++) {
1729 Int_t m_nDim = nbumps;
1733 while (iev < nEvents){
1735 for (idx[0]=-m_nDim; idx[0] <= m_nDim; idx[0]++){
1737 for (idx[1]=-m_nDim; idx[1] <= m_nDim; idx[1]++){
1739 for (
Int_t i=0;i<nvar;i++){
1741 if (i>0)
type *= itype[i];
1743 TTree* tree = (
type==1) ? treeS : treeB;
1760 cout <<
"created data file: " << dataFile->
GetName() << endl;
1768void create_3Bumps(
Int_t nEvents = 5000) {
1774 const Int_t nvar = 2;
1782 TTree* treeS =
new TTree(
"TreeS",
"TreeS", 1 );
1783 TTree* treeB =
new TTree(
"TreeB",
"TreeB", 1 );
1784 for (
Int_t ivar=0; ivar<nvar; ivar++) {
1789 Int_t nSeed = 12345;
1794 Double_t Centers[nvar][6] = {{-1,0,0,0,1,1},{0,0,0,0,0,0}};
1797 while (iev < nEvents){
1798 for (
int idx=0; idx<6; idx++){
1799 if (idx==1 || idx==2 || idx==3)
type = 0;
1801 for (
Int_t ivar=0;ivar<nvar;ivar++){
1802 xvar[ivar]=m_rand->
Gaus(Centers[ivar][idx],
sigma);
1804 TTree* tree = (
type==1) ? treeS : treeB;
1818 cout <<
"created data file: " << dataFile->
GetName() << endl;
1824void createOnionData(
Int_t nmax = 50000){
1828 int nsig = 0, nbgd=0;
1831 TTree* treeS =
new TTree(
"TreeS",
"TreeS", 1 );
1832 TTree* treeB =
new TTree(
"TreeB",
"TreeB", 1 );
1833 for (
Int_t ivar=0; ivar<nvar; ivar++) {
1840 for (
Int_t ivar=0; ivar<nvar; ivar++) { xvar[ivar]=
R.Rndm();}
1841 Float_t xout =
sin(2.*
acos(-1.)*(xvar[0]*xvar[1]*xvar[2]*xvar[3]+xvar[0]*xvar[1]));
1842 if (nsig<100) cout <<
"xout = " << xout<<endl;
1844 if (i%2 == 0 && nsig < nmax) {
1848 if (i%2 != 0 && nbgd < nmax){
1852 }
while ( nsig < nmax || nbgd < nmax);
1858void create_multiclassdata(
Int_t nmax = 20000)
1869 { 0. , 0.3, 0.5, 0.9 },
1870 { -0.2 , -0.3, 0.5, 0.4 },
1871 { 0.2 , 0.1, -0.1, 0.7 }} ;
1875 TTree* treeR =
new TTree(
"TreeR",
"TreeR", 1 );
1876 for (
Int_t ivar=0; ivar<nvar; ivar++) {
1879 for (
Int_t icls=0; icls<ncls; icls++) {
1883 treeR->
Branch(
"cls", &thecls,
"cls/F");
1884 treeR->
Branch(
"weight", &weight,
"weight/F");
1888 for (
Int_t icls=0; icls<ncls; icls++) xcls[icls]=0.;
1889 cls =
R.Integer(ncls);
1892 for (
Int_t ivar=0; ivar<nvar; ivar++) {
1893 xvar[ivar]=
R.Gaus(xmean[cls][ivar],1.);
1896 if (ndat<30) cout <<
"cls=" << cls <<
" xvar = " << xvar[0]<<
" " <<xvar[1]<<
" " << xvar[2]<<
" " <<xvar[3]<<endl;
1900 }
while ( ndat < nmax );
1913void create_array_with_different_lengths(
Int_t N = 100)
1915 const Int_t nvar = 4;
1916 Int_t nvarCurrent = 4;
1923 TTree* treeS =
new TTree(
"TreeS",
"TreeS", 1 );
1924 TTree* treeB =
new TTree(
"TreeB",
"TreeB", 1 );
1925 treeS->
Branch(
"arrSize", &nvarCurrent,
"arrSize/I" );
1926 treeS->
Branch(
"arr", xvar,
"arr[arrSize]/F" );
1927 treeB->
Branch(
"arrSize", &nvarCurrent,
"arrSize/I" );
1928 treeB->
Branch(
"arr", xvar,
"arr[arrSize]/F" );
1931 Float_t xS[nvar] = { 0.2, 0.3, 0.5, 0.9 };
1932 Float_t xB[nvar] = { -0.2, -0.3, -0.5, -0.6 };
1933 Float_t dx[nvar] = { 1.0, 1.0, 1.0, 1.0 };
1946 for (
Int_t ivar=0; ivar<nvar; ivar++) {
1947 (*covMatS)(ivar,ivar) = dx[ivar]*dx[ivar];
1948 (*covMatB)(ivar,ivar) = dx[ivar]*dx[ivar];
1949 for (
Int_t jvar=ivar+1; jvar<nvar; jvar++) {
1950 (*covMatS)(ivar,jvar) = rho[(ivar+1)*(jvar+1)]*dx[ivar]*dx[jvar];
1951 (*covMatS)(jvar,ivar) = (*covMatS)(ivar,jvar);
1953 (*covMatB)(ivar,jvar) = rho[(ivar+1)*(jvar+1)]*dx[ivar]*dx[jvar];
1954 (*covMatB)(jvar,ivar) = (*covMatB)(ivar,jvar);
1957 cout <<
"signal covariance matrix: " << endl;
1959 cout <<
"background covariance matrix: " << endl;
1963 TMatrixD* sqrtMatS = produceSqrtMat( *covMatS );
1964 TMatrixD* sqrtMatB = produceSqrtMat( *covMatB );
1967 for (
Int_t itype=0; itype<2; itype++) {
1971 if (itype == 0) {
x = xS;
m = sqrtMatS; cout <<
"- produce signal" << endl; }
1972 else {
x = xB;
m = sqrtMatB; cout <<
"- produce background" << endl; }
1975 TTree* tree = (itype==0) ? treeS : treeB;
1976 for (
Int_t i=0; i<
N; i++) {
1978 if (i%1000 == 0) cout <<
"... event: " << i <<
" (" <<
N <<
")" << endl;
1979 getGaussRnd( *
v, *
m,
R );
1981 for (
Int_t ivar=0; ivar<nvar; ivar++) xvar[ivar] = (*
v)[ivar] +
x[ivar];
1984 nvarCurrent = (i%4)+1;
1998 cout <<
"created data file: " << dataFile->
GetName() << endl;
2004void create_MultipleBackground(
Int_t N = 50000)
2009 TFile* dataFile =
TFile::Open(
"tmva_example_multiple_background.root",
"RECREATE" );
2012 Float_t xS[nvar] = { 0.2, 0.3, 0.5, 0.9 };
2013 Float_t xB0[nvar] = { -0.2, -0.3, -0.5, -0.6 };
2014 Float_t xB1[nvar] = { -0.2, 0.3, 0.5, -0.6 };
2015 Float_t dx0[nvar] = { 1.0, 1.0, 1.0, 1.0 };
2016 Float_t dx1[nvar] = { -1.0, -1.0, -1.0, -1.0 };
2019 TTree* treeS = makeTree_lin_Nvar(
"TreeS",
"Signal tree", xS, dx0, nvar,
N );
2020 TTree* treeB0 = makeTree_lin_Nvar(
"TreeB0",
"Background 0", xB0, dx0, nvar,
N );
2021 TTree* treeB1 = makeTree_lin_Nvar(
"TreeB1",
"Background 1", xB1, dx1, nvar,
N );
2022 TTree* treeB2 = makeTree_circ(
"TreeB2",
"Background 2", nvar,
N, 1.5,
true);
2035 cout <<
"created data file: " << dataFile->
GetName() << endl;
#define R(a, b, c, d, e, f, g, h, i)
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
bool Bool_t
Boolean (0=false, 1=true) (bool)
int Int_t
Signed integer 4 bytes (int)
float Float_t
Float 4 bytes (float)
double Double_t
Double 8 bytes.
winID h TVirtualViewer3D TVirtualGLPainter char TVirtualGLPainter plot
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
TMatrixT< Double_t > TMatrixD
R__EXTERN TRandom * gRandom
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Array of doubles (64 bits per element).
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
TObject * Get(const char *namecycle) override
Return pointer to object identified by namecycle.
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
Int_t Write(const char *name=nullptr, Int_t opt=0, Int_t bufsize=0) override
Write memory objects to this file.
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
void Close(Option_t *option="") override
Close a file.
1-D histogram with a float per channel (see TH1 documentation)
virtual void SetTitleSize(Float_t size=0.02, Option_t *axis="X")
Set the axis' title size.
void SetTitle(const char *title) override
Change/set the title.
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
void Draw(Option_t *option="") override
Draw this histogram with options.
virtual void SetLabelSize(Float_t size=0.02, Option_t *axis="X")
Set size of axis' labels.
2-D histogram with a float per channel (see TH1 documentation)
This class displays a legend box (TPaveText) containing several legend entries.
TLegendEntry * AddEntry(const TObject *obj, const char *label="", Option_t *option="lpf")
Add a new entry to this legend.
void Draw(Option_t *option="") override
Draw this legend with its current attributes.
void SetMargin(Float_t margin)
void Print(Option_t *name="") const override
Print the matrix as a table of elements.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetName() const override
Returns name of object.
virtual void SetBorderSize(Int_t bordersize=4)
Sets the border size of the TPave box and shadow.
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...
Double_t Rndm() override
Machine independent random number generator.
const char * Data() const
TStyle objects may be created to define special styles.
void SetOptTitle(Int_t tit=1)
void SetPadTopMargin(Float_t margin=0.1)
void SetTitleX(Float_t x=0)
void SetOptStat(Int_t stat=1)
The type of information printed in the histogram statistics box can be selected via the parameter mod...
void SetPadBottomMargin(Float_t margin=0.1)
void SetPadRightMargin(Float_t margin=0.1)
void SetPadGridX(Bool_t gridx)
void SetPadLeftMargin(Float_t margin=0.1)
void SetPadGridY(Bool_t gridy)
virtual void cd()
Change current style.
void SetTitleW(Float_t w=0)
void SetTitleH(Float_t h=0)
void SetTitleY(Float_t y=0.985)
A TTree represents a columnar dataset.
virtual Int_t Fill()
Fill all branches.
virtual void Show(Long64_t entry=-1, Int_t lenmax=20)
Print values of all active leaves for entry.
virtual Int_t GetEntry(Long64_t entry, Int_t getall=0)
Read all branches of entry and return total number of bytes read.
void Draw(Option_t *opt) override
Default Draw method for all objects.
virtual Double_t GetMaximum(const char *columname)
Return maximum of column with name columname.
virtual Long64_t GetEntries() const
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.
virtual Double_t GetMinimum(const char *columname)
Return minimum of column with name columname.
Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0) override
Write this object to the current directory.
RVec< PromoteType< T > > cos(const RVec< T > &v)
RVec< PromoteType< T > > acos(const RVec< T > &v)
RVec< PromoteType< T > > sin(const RVec< T > &v)
Double_t Gaus(Double_t x, Double_t mean=0, Double_t sigma=1, Bool_t norm=kFALSE)
Calculates a gaussian function with mean and sigma.
Int_t Nint(T x)
Round to nearest integer. Rounds half integers to the nearest even integer.
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Double_t Log(Double_t x)
Returns the natural logarithm of x.
constexpr Double_t DegToRad()
Conversion from degree to radian: .
Double_t Sqrt(Double_t x)
Returns the square root of x.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
static uint64_t sum(uint64_t i)