void genr8_mix_eta(void) { // // Generate combinatorical background events // Input the ascii file produced by genr8 and generate ascii output with photons from different events // //#include #include #include gROOT->Reset(); //TTree *Bfield = (TTree *) gROOT->FindObject("Bfield"); //gROOT->LoadMacro("$ROOTSYS/test/libEvent.so"); gStyle->SetPalette(1,0); gStyle->SetOptStat(kFALSE); gStyle->SetOptFit(kFALSE); // gStyle->SetOptFit(1111); gStyle->SetPadRightMargin(0.15); gStyle->SetPadLeftMargin(0.15); gStyle->SetPadBottomMargin(0.15); gStyle->SetFillColor(0); // char string[256]; char filename[132]; char name[10]; Double_t pi=3.14159; Int_t j,jj; #define npts 8; Int_t maxevents=100000; Double_t xmin=2; Double_t xmax=4; Double_t ymin=0.5; Double_t ymax=2.5; Double_t Ebeam=11; // open output files Int_t runno, eventno, nparticles; Int_t partid, q; Float_t mass,px,py,pz,E; sprintf(filename,"eta_%dgev.list",Ebeam); printf ("Input filename=%s\n",filename); FILE *in1; in1 = fopen(filename,"r"); sprintf(filename,"eta_mixed_%dgev.list",Ebeam); printf ("Output filename=%s\n",filename); FILE *out1; out1 = fopen(filename,"w+"); Float_t g1_px=0; Float_t g1_py=0; Float_t g1_pz=0; Float_t g1_E=0; Float_t px1; Float_t py1; Float_t pz1; Float_t E1; // get information from first event do not output fgets(string, 256, in1); // fprintf (out1,"%s",string); sscanf (string,"%d %d %d",&runno,&eventno,&nparticles); // printf ("runno=%d, eventno=%d, nparticles=%d\n",runno,eventno,nparticles); for (j=0;j