4 gROOT->SetStyle(
"Plain");
7 gStyle->SetOptTitle(0);
9 TFile *
fout =
new TFile(
"root_files/ntp_quarkonium_out.root",
"recreate");
13 for(
int istate = 0; istate < 4; ++istate)
15 sprintf(name,
"recomass%i",istate);
17 recomass[istate] =
new TH1D(name,name,200,7.0,11.0);
21 TH2D *hdca2d =
new TH2D(
"hdca2d",
"hdca2d", 200, 0.0, 50.0, 1000, -0.002, 0.002);
22 TH2D *hpcaz =
new TH2D(
"hpcaz",
"hpcaz",200, 0.0, 50.0, 1000,-0.1,0.1);
38 Float_t decaymass=0.000511;
41 int events_per_file = 1;
42 int num_ups_per_event = 20;
54 int Npp[3] = {27120, 7053, 3932};
56 double suppr_state[3] = {0.535, 0.17, 0.035};
58 double tracking_eff = 0.95;
60 double quality_cut = 10;
62 bool no_suppression =
true;
64 int nupsmax[3] = {0,0,0};
65 for(
int istate = 0; istate < 3; ++istate)
67 if(no_suppression) suppr_state[istate] = 1.0;
69 nupsmax[istate] = eID_eff * tracking_eff * suppr_state[istate] * Npp[istate];
71 nupsmax[istate] = 100000;
72 cout <<
"Requested max Upsilon counts for istate " << istate <<
" = " << nupsmax[istate] << endl;
76 int nups[3] = {0,0,0};
78 cout <<
"Upsilons requested = " << nupsmax << endl;
80 for(
int ifile=0;ifile<1000;ifile++)
82 if(nups[0] > nupsmax[0])
89 sprintf(name,
"/sphenix/user/frawley/acts_qa/macros/macros/g4simulations/eval_output_2/g4svtx_eval_%i.root_g4svtx_eval.root",ifile);
91 cout <<
"Adding file number " << ifile <<
" with name " << name << endl;
93 TChain* ntp_vertex =
new TChain(
"ntp_vertex",
"reco events");
94 ntp_vertex->Add(name);
96 TChain* ntp_track =
new TChain(
"ntp_track",
"reco tracks");
99 ntp_track->SetBranchAddress(
"event",&event);
100 ntp_track->SetBranchAddress(
"px",&px);
101 ntp_track->SetBranchAddress(
"py",&py);
102 ntp_track->SetBranchAddress(
"pz",&pz);
103 ntp_track->SetBranchAddress(
"pt",&pt);
104 ntp_track->SetBranchAddress(
"charge",&charge);
105 ntp_track->SetBranchAddress(
"dca2d",&dca2d);
106 ntp_track->SetBranchAddress(
"pcaz",&pcaz);
107 ntp_track->SetBranchAddress(
"gvz",&gvz);
108 ntp_track->SetBranchAddress(
"gembed",&gembed);
109 ntp_track->SetBranchAddress(
"quality",&quality);
110 ntp_track->SetBranchAddress(
"ntpc",&ntpc);
111 ntp_track->SetBranchAddress(
"nmaps",&nmaps);
113 int ntracks=ntp_track->GetEntries();
118 ntp_track->GetEntry(
i);
123 hdca2d->Fill(pt, dca2d);
124 hpcaz->Fill(pt, pcaz-gvz);
128 cout <<
" events in this file = " << events_per_file << endl;
130 for(
int iev = 0;iev<events_per_file;iev++)
132 for(
int iups = 0;iups< num_ups_per_event; iups++)
137 if(nups[istate] > nupsmax[istate])
155 ntp_track->GetEntry(
i);
163 if(quality > quality_cut)
172 if(sqrt(px*px + py*py + pz*pz) < 1.0)
187 Float_t E1 = sqrt( pow(px1,2) + pow(py1,2) + pow(pz1,2) + pow(decaymass,2));
188 t1.SetPxPyPzE(px1,py1,pz1,E1);
200 Float_t E2 = sqrt( pow(px2,2) + pow(py2,2) + pow(pz2,2) + pow(decaymass,2));
201 t2.SetPxPyPzE(px2,py2,pz2,E2);
207 if(nlept1 == 1 && nlept2 == 1)
212 recomass[istate]->Fill(tsum.M());
213 recomass[3]->Fill(tsum.M());
214 if(tsum.M() > 7 && tsum.M() < 11)
225 cout <<
" requested: " << nupsmax[0] <<
" reconstructed: " << nups[0] <<
" Upsilons " << endl;
227 for(
int istate =0; istate < 3; ++istate)
229 recomass[istate]->Write();
230 cout <<
" requested for istate: " << istate <<
" nupsmax = " << nupsmax[istate] <<
" reconstructed = " << nups[istate] <<
" Upsilons " << endl;
232 recomass[3]->Write();