File indexing completed on 2025-08-06 08:11:56
0001 void ShSizePrep (const char *part="e")
0002 {
0003 char infile[100];
0004 int rad[11] = {0,1,2,3,4,5,6,7,8,9,100};
0005 double xr[11];
0006 int pz[8] = {1,2,4,8,16,32,40,50};
0007 double x[8];
0008 char *calo[] = {"E","HO","HI","BH","MAG"};
0009
0010 for (int i=0; i<8; i++)
0011 {
0012 for (int j=0; j<11; j++)
0013 {
0014 for (int k=0;k<5;k++)
0015 {
0016 x[i] = pz[i];
0017 xr[j] = rad[j];
0018 sprintf(infile, "/sphenix/user/pinkenbu/jade/ntuple/%s_eta0_%dGeV.root",part, pz[i]);
0019 char hname [100];
0020 sprintf(hname, "%sSH%dRad%d%s",part,pz[i],rad[j],calo[k]);
0021 TH1F *h1 = new TH1F(hname, hname, 1000, 0, (pz[i]+1));
0022 TFile *f = TFile::Open(infile);
0023 if (! f)
0024 {
0025 cout << infile << " not found - bozo!!!" << endl;
0026 gSystem->Exit(1);
0027 }
0028 gROOT->cd();
0029 TNtuple *nt = (TNtuple *)f->Get("de");
0030 char radn[100];
0031 sprintf(radn, "RAD==%d", rad[j]);
0032 nt->Project(hname,calo[k],radn);
0033 if (! nt)
0034 {
0035 cout << "sz" << " not found - bozo!!!" << endl;
0036 gSystem->Exit(1);
0037 }
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065 f->Close();
0066 h1->Draw();
0067 char fname [100];
0068 sprintf(fname, "%scondor.root",part);
0069 TFile *fout = TFile::Open(fname,"UPDATE");
0070 h1->Write();
0071 fout->Write();
0072 cout << h1->Integral() << " " << hname << endl;
0073
0074 fout->Close();
0075 }
0076 }
0077 }
0078 }