30 cout <<
"ERROR: cannot open file: " <<
fname << endl;
73 frameS->SetMarkerSize( 0.1 );
74 frameS->SetMarkerColor( 4 );
76 frameB->SetMarkerSize( 0.1 );
77 frameB->SetMarkerColor( 2 );
80 frameS->SetTitle(
var1+
" versus "+
var0+
" for signal and background" );
84 frameS->SetLabelSize( 0.04,
"X" );
85 frameS->SetLabelSize( 0.04,
"Y" );
86 frameS->SetTitleSize( 0.05,
"X" );
87 frameS->SetTitleSize( 0.05,
"Y" );
95 1 -
c->GetRightMargin(), 1 -
c->GetTopMargin() );
136 if (
size !=
v.GetSize())
137 cout <<
"<getGaussRnd> too short input vector: " <<
size <<
" " <<
v.GetSize() << endl;
160 const Int_t nvar = 4;
171 cout <<
"Creating branch var" <<
ivar+1 <<
" in signal tree" << endl;
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 };
211 cout <<
"signal covariance matrix: " << endl;
213 cout <<
"background covariance matrix: " << endl;
226 else {
x =
xB;
m =
sqrtMatB; cout <<
"- produce background" << endl; }
231 for (
Int_t i=0; i<
N; i++) {
233 if (i%1000 == 0) cout <<
"... event: " << i <<
" (" <<
N <<
")" << endl;
256 cout <<
"created data file: " <<
dataFile->GetName() << endl;
300 for (
Int_t i=0; i<
N; i++) {
302 if (i%1000 == 0) cout <<
"... event: " << i <<
" (" <<
N <<
")" << endl;
315 cout <<
"created tree: " << tree->
GetName() << endl;
342 for (
Int_t i=0; i<
N; i++) {
376 cout <<
"created tree: " << tree->
GetName() << endl;
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 };
406 cout <<
"created data file: " <<
dataFile->GetName() << endl;
415 const Int_t nvar = 4;
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 };
456 cout <<
"signal covariance matrix: " << endl;
458 cout <<
"background covariance matrix: " << endl;
471 else {
x =
xB;
m =
sqrtMatB; cout <<
"- produce background" << endl; }
475 for (
Int_t i=0; i<
N; i++) {
477 if (i%1000 == 0) cout <<
"... event: " << i <<
" (" <<
N <<
")" << endl;
494 cout <<
"created data file: " <<
dataFile->GetName() << endl;
501 const Int_t nvar = 4;
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 };
555 cout <<
"signal covariance matrix: " << endl;
557 cout <<
"background covariance matrix: " << endl;
570 else {
x =
xB;
m =
sqrtMatB; cout <<
"- produce background" << endl; }
574 for (
Int_t i=0; i<
N; i++) {
576 if (i%1000 == 0) cout <<
"... event: " << i <<
" (" <<
N <<
")" << endl;
579 eta = 2.5*2*(
R.Rndm() - 0.5);
597 cout <<
"created data file: " <<
dataFile->GetName() << endl;
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;
618 else fileName =
Form(
"linCorGauss%d_weighted.root",seed);
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 };
659 cout <<
"signal covariance matrix: " << endl;
661 cout <<
"background covariance matrix: " << endl;
674 else {
x =
xB;
m =
sqrtMatB; cout <<
"- produce background" << endl; }
687 weight = 0.8 / (
TMath::Gaus( ((*
v)[nvar-1]), 0, 1.09) );
702 if (i%10 == 0) cout <<
"... event: " << i <<
" (" <<
N <<
")" << endl;
716 if (i%1000 == 0) cout <<
"... event: " << i <<
" (" <<
N <<
")" << endl;
739 for (
Int_t i=0;i<4;i++){
742 h[i]=
new TH1F(buffer,
"",100,-5,5);
744 hw[i] =
new TH1F(buffer,
"",100,-5,5);
745 hw[i]->SetLineColor(3);
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;
775 const Int_t nvar = 4;
776 std::vector<float>*
xvar[nvar];
785 xvar[
ivar] =
new std::vector<float>();
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 };
817 cout <<
"signal covariance matrix: " << endl;
819 cout <<
"background covariance matrix: " << endl;
832 else {
x =
xB;
m =
sqrtMatB; cout <<
"- produce background" << endl; }
836 for (
Int_t i=0; i<
N; i++) {
838 if (i%100 == 0) cout <<
"... event: " << i <<
" (" <<
N <<
")" << endl;
863 cout <<
"created data file: " <<
dataFile->GetName() << endl;
874 const Int_t nvar = 4;
898 Double_t xB[nvar] = { -0.2, -0.3, -0.5, -0.6 };
923 cout <<
"signal covariance matrix: " << endl;
925 cout <<
"background covariance matrix: " << endl;
938 else {
x =
xB;
m =
sqrtMatB; cout <<
"- produce background" << endl; }
942 for (
Int_t i=0; i<
N; i++) {
944 if (i%1000 == 0) cout <<
"... event: " << i <<
" (" <<
N <<
")" << endl;
965 cout <<
"created data file: " <<
dataFile->GetName() << endl;
974 const Int_t nvar = 4;
1006 for (
int i=0; i<20; i++) rho[i] = 0;
1022 cout <<
"signal covariance matrix: " << endl;
1024 cout <<
"background covariance matrix: " << endl;
1037 else {
x =
xB;
m =
sqrtMatB; cout <<
"- produce background" << endl; }
1041 for (
Int_t i=0; i<
N; i++) {
1043 if (i%1000 == 0) cout <<
"... event: " << i <<
" (" <<
N <<
")" << endl;
1063 cout <<
"created data file: " <<
dataFile->GetName() << endl;
1072 const Int_t nvar = 20;
1125 for (
Int_t i=0; i<
N; i++) {
1127 if (i%1000 == 0) cout <<
"... event: " << i <<
" (" <<
N <<
")" << endl;
1146 cout <<
"created data file: " <<
dataFile->GetName() << endl;
1153 const Int_t nvar = 20;
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;
1195 cout <<
"signal covariance matrix: " << endl;
1197 cout <<
"background covariance matrix: " << endl;
1210 else {
x =
xB;
m =
sqrtMatB; cout <<
"- produce background" << endl; }
1214 for (
Int_t i=0; i<
N; i++) {
1216 if (i%1000 == 0) cout <<
"... event: " << i <<
" (" <<
N <<
")" << endl;
1233 cout <<
"created data file: " <<
dataFile->GetName() << endl;
1241 const Int_t nvar = 2;
1255 treeS->Branch(
"weight", &weight,
"weight/F" );
1256 treeB->Branch(
"weight", &weight,
"weight/F" );
1280 cout <<
"signal covariance matrix: " << endl;
1282 cout <<
"background covariance matrix: " << endl;
1295 else {
x =
xB;
m =
sqrtMatB; cout <<
"- produce background" << endl; }
1299 for (
Int_t i=0; i<
N; i++) {
1301 if (i%1000 == 0) cout <<
"... event: " << i <<
" (" <<
N <<
")" << endl;
1306 if (
itype == 0) weight = 1.0;
1321 cout <<
"created data file: " <<
dataFile->GetName() << endl;
1342 treeS->Branch(
"weight", &weight,
"weight/F");
1343 treeB->Branch(
"weight", &weight,
"weight/F");
1349 if (
nsig<10) cout <<
"xout = " <<
xout<<endl;
1371 const Int_t nvar = 2;
1407 for (
Int_t i=0; i<
N; i++) {
1442 cout <<
"created data file: " <<
dataFile->GetName() << endl;
1450 const Int_t nvar = 2;
1473 while (
iev < nEvents){
1501 cout <<
"created data file: " <<
dataFile->GetName() << endl;
1509 const Int_t nvar = 5;
1532 while (
iev < nEvents){
1544 for (
Int_t i=0;i<nvar;i++){
1571 cout <<
"created data file: " <<
dataFile->GetName() << endl;
1580 const Int_t nvar = 4;
1603 while (
iev < nEvents){
1613 for (
Int_t i=0;i<nvar;i++){
1638 cout <<
"created data file: " <<
dataFile->GetName() << endl;
1647 const Int_t nvar = 3;
1670 while (
iev < nEvents){
1678 for (
Int_t i=0;i<nvar;i++){
1701 cout <<
"created data file: " <<
dataFile->GetName() << endl;
1710 const Int_t nvar = 2;
1733 while (
iev < nEvents){
1739 for (
Int_t i=0;i<nvar;i++){
1760 cout <<
"created data file: " <<
dataFile->GetName() << endl;
1774 const Int_t nvar = 2;
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;
1818 cout <<
"created data file: " <<
dataFile->GetName() << endl;
1842 if (
nsig<100) cout <<
"xout = " <<
xout<<endl;
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 }} ;
1884 treeR->Branch(
"weight", &weight,
"weight/F");
1896 if (
ndat<30) cout <<
"cls=" <<
cls <<
" xvar = " <<
xvar[0]<<
" " <<
xvar[1]<<
" " <<
xvar[2]<<
" " <<
xvar[3]<<endl;
1915 const Int_t nvar = 4;
1926 treeS->Branch(
"arr",
xvar,
"arr[arrSize]/F" );
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 };
1957 cout <<
"signal covariance matrix: " << endl;
1959 cout <<
"background covariance matrix: " << endl;
1972 else {
x =
xB;
m =
sqrtMatB; cout <<
"- produce background" << endl; }
1976 for (
Int_t i=0; i<
N; i++) {
1978 if (i%1000 == 0) cout <<
"... event: " << i <<
" (" <<
N <<
")" << endl;
1998 cout <<
"created data file: " <<
dataFile->GetName() << endl;
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 };
2016 Float_t dx1[nvar] = { -1.0, -1.0, -1.0, -1.0 };
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.
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
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).
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
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.
1-D histogram with a float per channel (see TH1 documentation)
2-D histogram with a float per channel (see TH1 documentation)
This class displays a legend box (TPaveText) containing several legend entries.
const char * GetName() const override
Returns name of object.
This is the base class for the ROOT Random number generators.
Double_t Rndm() override
Machine independent random number generator.
const char * Data() const
TStyle objects may be created to define special styles.
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.
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.
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)