6 #include <TPostScript.h>
12 #include <TPaveText.h>
15 #include <StEmcPool/StPhotonCommon/MyEvent.h>
16 #include <StEmcPool/StPhotonCommon/MyPoint.h>
17 #include <StEmcPool/StPhotonCommon/MyMcTrack.h>
21 #include "dAuBackground.h"
32 gStyle->SetPadGridX(kFALSE);
33 gStyle->SetPadGridY(kFALSE);
35 for(Int_t i=0;i<2400;i++)
39 Int_t badIds[]={82,156,240,264,733,756,818,853,931,1289,1292,1355,1359,1527,1759,1943,2011,2025,2090,2152,2369,-1};
48 cout<<
"constructed!!"<<endl;
50 dAuBackground::~dAuBackground()
52 if (cuts)
delete cuts; cuts = 0;
53 cout<<
"destructed!!"<<endl;
56 void dAuBackground::run(
const char *file)
59 TH1F *ratio_mb_020=
new TH1F(
"ratio_mb_020",
"2001&&2003, FTPC-Au:0-20%", 25,0.,1.);
60 TH1F *ratio_ht1_020=
new TH1F(
"ratio_ht1_020",
"2201, FTPC-Au:0-20%", 25,0.,1.);
61 TH1F *ratio_ht2_020=
new TH1F(
"ratio_ht2_020",
"2202, FTPC-Au:0-20%", 25,0.,1.);
62 TH1F *ratio_sn_020=
new TH1F(
"ratio_sn_020",
"2002, FTPC-Au:0-20%", 25,0.,1.);
65 TH1F *ratio_mb_2040=
new TH1F(
"ratio_mb_2040",
"2001&&2003, FTPC-Au:20-40%", 25,0.,1.);
66 TH1F *ratio_ht1_2040=
new TH1F(
"ratio_ht1_2040",
"2201, FTPC-Au:20-40%", 25,0.,1.);
67 TH1F *ratio_ht2_2040=
new TH1F(
"ratio_ht2_2040",
"2202, FTPC-Au:20-40%", 25,0.,1.);
68 TH1F *ratio_sn_2040=
new TH1F(
"ratio_sn_2040",
"2002, FTPC-Au:20-40%", 25,0.,1.);
71 TH1F *ratio_mb_40100=
new TH1F(
"ratio_mb_40100",
"2001&&2003, FTPC-Au:40-100%", 25,0.,1.);
72 TH1F *ratio_ht1_40100=
new TH1F(
"ratio_ht1_40100",
"2201, FTPC-Au:40-100%", 25,0.,1.);
73 TH1F *ratio_ht2_40100=
new TH1F(
"ratio_ht2_40100",
"2202, FTPC-Au:40-100%", 25,0.,1.);
74 TH1F *ratio_sn_40100=
new TH1F(
"ratio_sn_40100",
"2002, FTPC-Au:40-100%", 25,0.,1.);
76 TH1F *hfrac_mb=
new TH1F(
"frac_mb",
"2001&&2003, I[0.8,1.0]/I[0.0,1.0], 40-100%",50,0.0,0.05);
77 TH1F *hfrac_ht1=
new TH1F(
"frac_ht1",
"2201, I[0.8,1.0]/I[0.0,1.0], 40-100%",50,0.0,0.5);
78 TH1F *hfrac_ht2=
new TH1F(
"frac_ht2",
"2202, I[0.8,1.0]/I[0.0,1.0], 40-100%",50,0.0,0.5);
79 TH1F *hfrac_sn=
new TH1F(
"frac_sn",
"2000, I[0.8,1.0]/I[0.0,1.0], 40-100%",50,0.0,0.05);
83 TH1F *Ratio_mb_020=
new TH1F(
"Ratio_mb_020",
"2001&&2003, FTPC-Au:0-20%", 25,0.,1.);
84 TH1F *Ratio_ht1_020=
new TH1F(
"Ratio_ht1_020",
"2201, FTPC-Au:0-20%", 25,0.,1.);
85 TH1F *Ratio_ht2_020=
new TH1F(
"Ratio_ht2_020",
"2202, FTPC-Au:0-20%", 25,0.,1.);
86 TH1F *Ratio_sn_020=
new TH1F(
"Ratio_sn_020",
"2002, FTPC-Au:0-20%", 25,0.,1.);
89 TH1F *Ratio_mb_2040=
new TH1F(
"Ratio_mb_2040",
"2001&&2003, FTPC-Au:20-40%", 25,0.,1.);
90 TH1F *Ratio_ht1_2040=
new TH1F(
"Ratio_ht1_2040",
"2201, FTPC-Au:20-40%", 25,0.,1.);
91 TH1F *Ratio_ht2_2040=
new TH1F(
"Ratio_ht2_2040",
"2202, FTPC-Au:20-40%", 25,0.,1.);
92 TH1F *Ratio_sn_2040=
new TH1F(
"Ratio_sn_2040",
"2002, FTPC-Au:20-40%", 25,0.,1.);
95 TH1F *Ratio_mb_40100=
new TH1F(
"Ratio_mb_40100",
"2001&&2003, FTPC-Au:40-100%", 25,0.,1.);
96 TH1F *Ratio_ht1_40100=
new TH1F(
"Ratio_ht1_40100",
"2201, FTPC-Au:40-100%", 25,0.,1.);
97 TH1F *Ratio_ht2_40100=
new TH1F(
"Ratio_ht2_40100",
"2202, FTPC-Au:40-100%", 25,0.,1.);
98 TH1F *Ratio_sn_40100=
new TH1F(
"Ratio_sn_40100",
"2002, FTPC-Au:40-100%", 25,0.,1.);
100 TH2F *EvsE_mb=
new TH2F(
"EvsE_mb",
"2001&&2003, neutral Energy vs TPC pT",240,0.,80,240,0.,80.);
101 TH2F *EvsE_ht1=
new TH2F(
"EvsE_ht1",
"2201, neutral Energy vs TPC pT",124,0.,80,240,0.,80.);
102 TH2F *EvsE_ht2=
new TH2F(
"EvsE_ht2",
"2202, neutral Energy vs TPC pT",124,0.,80,240,0.,80.);
103 TH2F *EvsE_sn=
new TH2F(
"EvsE_sn",
"2002, neutral Energy vs TPC pT",240,0.,80,240,0.,80.);
107 TH1F *ptspec_mb_020=
new TH1F(
"ptspec_mb_020",
"2001&&2003, pT spectrum neutral points, 0-20%",30,0.,15.);
108 TH1F *ptspec_ht1_020=
new TH1F(
"ptspec_ht1_020",
"2201, pT spectrum neutral points, 0-20%",30,0.,15.);
109 TH1F *ptspec_ht2_020=
new TH1F(
"ptspec_ht2_020",
"2202, pT spectrum neutral points, 0-20%",30,0.,15.);
110 TH1F *ptspec_sn_020=
new TH1F(
"ptspec_sn_020",
"2002, pT spectrum neutral points, 0-20%",30,0.,15.);
112 TH1F *ptspec_mb_cut_020=
new TH1F(
"ptspec_mb_cut_020",
"2001&&2003, pT spectrum neutral points after cut, 0-20%",30,0.,15.);
113 TH1F *ptspec_ht1_cut_020=
new TH1F(
"ptspec_ht1_cut_020",
"2201, pT spectrum neutral points after cut, 0-20%",30,0.,15.);
114 TH1F *ptspec_ht2_cut_020=
new TH1F(
"ptspec_ht2_cut_020",
"2202, pT spectrum neutral points after cut, 0-20%",30,0.,15.);
115 TH1F *ptspec_sn_cut_020=
new TH1F(
"ptspec_sn_cut_020",
"2002, pT spectrum neutral points after cut, 0-20%",30,0.,15.);
117 TH1F *ptspec_mb_bg_020=
new TH1F(
"ptspec_mb_bg_020",
"2001&&2003, pT spectrum neutral points, 0-20%",30,0.,15.);
118 TH1F *ptspec_ht1_bg_020=
new TH1F(
"ptspec_ht1_bg_020",
"2201, pT spectrum neutral points, 0-20%",30,0.,15.);
119 TH1F *ptspec_ht2_bg_020=
new TH1F(
"ptspec_ht2_bg_020",
"2202, pT spectrum neutral points, 0-20%",30,0.,15.);
120 TH1F *ptspec_sn_bg_020=
new TH1F(
"ptspec_sn_bg_020",
"2002, pT spectrum neutral points, 0-20%",30,0.,15.);
123 TH1F *ptspec_mb_2040=
new TH1F(
"ptspec_mb_2040",
"2001&&2003, pT spectrum neutral points, 20-40%",30,0.,15.);
124 TH1F *ptspec_ht1_2040=
new TH1F(
"ptspec_ht1_2040",
"2201, pT spectrum neutral points, 20-40%",30,0.,15.);
125 TH1F *ptspec_ht2_2040=
new TH1F(
"ptspec_ht2_2040",
"2202, pT spectrum neutral points, 20-40%",30,0.,15.);
126 TH1F *ptspec_sn_2040=
new TH1F(
"ptspec_sn_2040",
"2002, pT spectrum neutral points, 20-40%",30,0.,15.);
128 TH1F *ptspec_mb_cut_2040=
new TH1F(
"ptspec_mb_cut_2040",
"2001&&2003, pT spectrum neutral points after cut, 20-40%",30,0.,15.);
129 TH1F *ptspec_ht1_cut_2040=
new TH1F(
"ptspec_ht1_cut_2040",
"2201, pT spectrum neutral points after cut, 20-40%",30,0.,15.);
130 TH1F *ptspec_ht2_cut_2040=
new TH1F(
"ptspec_ht2_cut_2040",
"2202, pT spectrum neutral points after cut, 20-40%",30,0.,15.);
131 TH1F *ptspec_sn_cut_2040=
new TH1F(
"ptspec_sn_cut_2040",
"2002, pT spectrum neutral points after cut, 20-40%",30,0.,15.);
133 TH1F *ptspec_mb_bg_2040=
new TH1F(
"ptspec_mb_bg_2040",
"2001&&2003, pT spectrum neutral points, 20-40%",30,0.,15.);
134 TH1F *ptspec_ht1_bg_2040=
new TH1F(
"ptspec_ht1_bg_2040",
"2201, pT spectrum neutral points, 20-40%",30,0.,15.);
135 TH1F *ptspec_ht2_bg_2040=
new TH1F(
"ptspec_ht2_bg_2040",
"2202, pT spectrum neutral points, 20-40%",30,0.,15.);
136 TH1F *ptspec_sn_bg_2040=
new TH1F(
"ptspec_sn_bg_2040",
"2002, pT spectrum neutral points, 20-40%",30,0.,15.);
139 TH1F *ptspec_mb_40100=
new TH1F(
"ptspec_mb_40100",
"2001&&2003, pT spectrum neutral points, 40-100%",30,0.,15.);
140 TH1F *ptspec_ht1_40100=
new TH1F(
"ptspec_ht1_40100",
"2201, pT spectrum neutral points, 40-100%",30,0.,15.);
141 TH1F *ptspec_ht2_40100=
new TH1F(
"ptspec_ht2_40100",
"2202, pT spectrum neutral points, 40-100%",30,0.,15.);
142 TH1F *ptspec_sn_40100=
new TH1F(
"ptspec_sn_40100",
"2002, pT spectrum neutral points, 40-100%",30,0.,15.);
144 TH1F *ptspec_mb_cut_40100=
new TH1F(
"ptspec_mb_cut_40100",
"2001&&2003, pT spectrum neutral points after cut, 40-100%",30,0.,15.);
145 TH1F *ptspec_ht1_cut_40100=
new TH1F(
"ptspec_ht1_cut_40100",
"2201, pT spectrum neutral points after cut, 40-100%",30,0.,15.);
146 TH1F *ptspec_ht2_cut_40100=
new TH1F(
"ptspec_ht2_cut_40100",
"2202, pT spectrum neutral points after cut, 40-100%",30,0.,15.);
147 TH1F *ptspec_sn_cut_40100=
new TH1F(
"ptspec_sn_cut_40100",
"2002, pT spectrum neutral points after cut, 40-100%",30,0.,15.);
149 TH1F *ptspec_mb_bg_40100=
new TH1F(
"ptspec_mb_bg_40100",
"2001&&2003, pT spectrum neutral points, 40-100%",30,0.,15.);
150 TH1F *ptspec_ht1_bg_40100=
new TH1F(
"ptspec_ht1_bg_40100",
"2201, pT spectrum neutral points, 40-100%",30,0.,15.);
151 TH1F *ptspec_ht2_bg_40100=
new TH1F(
"ptspec_ht2_bg_40100",
"2202, pT spectrum neutral points, 40-100%",30,0.,15.);
152 TH1F *ptspec_sn_bg_40100=
new TH1F(
"ptspec_sn_bg_40100",
"2002, pT spectrum neutral points, 40-100%",30,0.,15.);
155 TH1F *ftpc_mb=
new TH1F(
"ftpc_mb",
"2001&&2003, ftpc-Au mult.",60,0.,60.);
156 TH1F *ftpc_ht1=
new TH1F(
"ftpc_ht1",
"2201, ftpc-Au mult.",60,0.,60.);
157 TH1F *ftpc_ht2=
new TH1F(
"ftpc_ht2",
"2202, ftpc-Au mult.",60,0.,60.);
158 TH1F *ftpc_sn=
new TH1F(
"ftpc_sn",
"2002, ftpc-Au mult.",60,0.,60.);
160 TH1F *ftpc_mb_cut=
new TH1F(
"ftpc_mb_cut",
"2001&&2003, ftpc-Au mult. for r<.8",60,0.,60.);
161 TH1F *ftpc_ht1_cut=
new TH1F(
"ftpc_ht1_cut",
"2201, ftpc-Au mult. for r<.8",60,0.,60.);
162 TH1F *ftpc_ht2_cut=
new TH1F(
"ftpc_ht2_cut",
"2202, ftpc-Au mult. for r<.8",60,0.,60.);
163 TH1F *ftpc_sn_cut=
new TH1F(
"ftpc_sn_cut",
"2002, ftpc-Au mult. for r<.8",60,0.,60.);
165 TH1F *tpc_mb=
new TH1F(
"tpc_mb",
"2001&&2003, tpc mult.",100,0.,100.);
166 TH1F *tpc_ht1=
new TH1F(
"tpc_ht1",
"2201, tpc mult.",100,0.,100.);
167 TH1F *tpc_ht2=
new TH1F(
"tpc_ht2",
"2202, tpc mult.",100,0.,100.);
168 TH1F *tpc_sn=
new TH1F(
"tpc_sn",
"2002, tpc mult.",100,0.,100.);
170 TH1F *tpc_mb_cut=
new TH1F(
"tpc_mb_cut",
"2001&&2003, tpc mult. for r<.8",100,0.,100.);
171 TH1F *tpc_ht1_cut=
new TH1F(
"tpc_ht1_cut",
"2201, tpc mult. for r<.8",100,0.,100.);
172 TH1F *tpc_ht2_cut=
new TH1F(
"tpc_ht2_cut",
"2202, tpc mult. for r<.8",100,0.,100.);
173 TH1F *tpc_sn_cut=
new TH1F(
"tpc_sn_cut",
"2002, tpc mult. for r<.8",100,0.,100.);
175 TH1F *bemc_mb=
new TH1F(
"bemc_mb",
"2001&&2003, bemc mult.",60,0.,60.);
176 TH1F *bemc_ht1=
new TH1F(
"bemc_ht1",
"2201, bemc mult.",60,0.,60.);
177 TH1F *bemc_ht2=
new TH1F(
"bemc_ht2",
"2202, bemc mult.",60,0.,60.);
178 TH1F *bemc_sn=
new TH1F(
"bemc_sn",
"2002, bemc mult.",60,0.,60.);
180 TH1F *bemc_mb_cut=
new TH1F(
"bemc_mb_cut",
"2001&&2003, bemc mult. for r<.8",60,0.,60.);
181 TH1F *bemc_ht1_cut=
new TH1F(
"bemc_ht1_cut",
"2201, bemc mult. for r<.8",60,0.,60.);
182 TH1F *bemc_ht2_cut=
new TH1F(
"bemc_ht2_cut",
"2202, bemc mult. for r<.8",60,0.,60.);
183 TH1F *bemc_sn_cut=
new TH1F(
"bemc_sn_cut",
"2002, bemc mult. for r<.8",60,0.,60.);
185 TH2F *etaphi_fill3085_sn=
new TH2F(
"etaphi_fill3085_sn",
"eta/phi for 3085 sn 40-100%",500,0.0,1.0,1000,-3.2,3.2);
186 TH2F *etaphi_fill3085_ht2=
new TH2F(
"etaphi_fill3085_ht2",
"eta/phi for 3085 ht-2 40-100%",500,0.0,1.0,1000,-3.2,3.2);
187 TH2F *etaphi_fill3088_sn=
new TH2F(
"etaphi_fill3088_sn",
"eta/phi for 3088 sn 40-100%",500,0.0,1.0,1000,-3.2,3.2);
188 TH2F *etaphi_fill3088_ht2=
new TH2F(
"etaphi_fill3088_ht2",
"eta/phi for 3088 ht-2 40-100%",500,0.0,1.0,1000,-3.2,3.2);
189 TH2F *etaphi_fill3088b_ht2=
new TH2F(
"etaphi_fill3088b_ht2",
"eta/phi for 3088 ht-2 40-100% and R<0.7",500,0.0,1.0,1000,-3.2,3.2);
191 TH2F *etaphi_sn=
new TH2F(
"etaphi_sn",
"eta/phi sn 40-100%",500,0.0,1.0,1000,-3.2,3.2);
194 TH1F *h_trigger=
new TH1F(
"h_trigger",
"trigger ids after cut",2400,0.5,2400.5);
197 fout.open(
"bgfrac.dat");
198 fout<<
"pagina\trunid\tmb\tnmb\tht1\tnht1\tht2\tnht2\tsn\tnsn"<<endl<<endl;
200 TFile *inf=
new TFile(file,
"OPEN");
201 TTree *eventTree=(TTree*)inf->Get(
"mEventTree");
204 eventTree->SetBranchAddress(
"branch",&ev);
206 TPostScript *ps=
new TPostScript(
"dAu_bgperrun.ps",111);
207 TCanvas *c9=
new TCanvas(
"c9",
"c9",800,600);
213 while(eventTree->GetEntry(entry))
226 if(ev->runId()!=runprev && runprev!=0)
228 if(ev->runId()<runprev)
230 cout<<
"Something wrong!"<<endl;
233 cout<<endl<<
"new run: "<<ev->runId()<<endl<<endl;
236 Float_t total_mb=ratio_mb_40100->Integral();
237 Float_t bg_mb=ratio_mb_40100->Integral(21,25);
238 Float_t total_ht1=ratio_ht1_40100->Integral();
239 Float_t bg_ht1=ratio_ht1_40100->Integral(21,25);
240 Float_t total_ht2=ratio_ht2_40100->Integral();
241 Float_t bg_ht2=ratio_ht2_40100->Integral(21,25);
242 Float_t total_sn=ratio_sn_40100->Integral();
243 Float_t bg_sn=ratio_sn_40100->Integral(21,25);
245 Float_t frac_mb=total_mb>0 ? bg_mb/total_mb : 0.;
246 Float_t frac_ht1=total_ht1>0 ? bg_ht1/total_ht1 : 0.;
247 Float_t frac_ht2=total_ht2>0 ? bg_ht2/total_ht2 : 0.;
248 Float_t frac_sn=total_sn>0 ? bg_sn/total_sn : 0.;
249 fout<<pagina<<
"\t"<<runprev<<
"\t"<<frac_mb<<
"\t"<<total_mb<<
"\t"<<frac_ht1<<
"\t"<<total_ht1<<
"\t"<<frac_ht2<<
"\t"<<total_ht2<<
"\t"<<frac_sn<<
"\t"<<total_sn<<endl;
251 hfrac_mb->Fill(frac_mb,total_mb);
252 hfrac_ht1->Fill(frac_ht1,total_ht1);
253 hfrac_ht2->Fill(frac_ht2,total_ht2);
254 hfrac_sn->Fill(frac_sn,total_sn);
259 ratio_mb_020->Draw();
261 ratio_ht1_020->Draw();
263 ratio_ht2_020->Draw();
265 ratio_sn_020->Draw();
267 ratio_mb_2040->Draw();
269 ratio_ht1_2040->Draw();
271 ratio_ht2_2040->Draw();
273 ratio_sn_2040->Draw();
275 ratio_mb_40100->Draw();
277 ratio_ht1_40100->Draw();
279 ratio_ht2_40100->Draw();
281 ratio_sn_40100->Draw();
283 TPaveText *pave=
new TPaveText(.1,.1,.9,.9);
285 sprintf(label,
"run %d",runprev);
286 pave->AddText(label);
292 ratio_mb_020->Reset();
293 ratio_ht1_020->Reset();
294 ratio_ht2_020->Reset();
295 ratio_sn_020->Reset();
296 ratio_mb_2040->Reset();
297 ratio_ht1_2040->Reset();
298 ratio_ht2_2040->Reset();
299 ratio_sn_2040->Reset();
300 ratio_mb_40100->Reset();
301 ratio_ht1_40100->Reset();
302 ratio_ht2_40100->Reset();
303 ratio_sn_40100->Reset();
309 else if(ev->runId()!=runprev)
311 cout<<endl<<
"first run: "<<ev->runId()<<endl<<endl;
316 if(ev->runId()==0&&ev->trigger()==0)
319 if(ev->highTowerAdc()>cuts->ht1AdcCUT) nTrig+=2;
320 if(ev->highTowerAdc()>cuts->ht2AdcCUT) nTrig+=4;
321 ev->setTrigger(nTrig);
325 Bool_t eventOK=kTRUE;
326 TVector3 vPos=ev->vertex();
328 if(TMath::Abs(vPos.Z())>cuts->vertexzCUT) eventOK=kFALSE;
329 if(TMath::Abs(vPos.X())>cuts->vertexxCUT) eventOK=kFALSE;
330 if(TMath::Abs(vPos.Y())>cuts->vertexyCUT) eventOK=kFALSE;
331 if(vPos.Mag()<.000001) eventOK=kFALSE;
332 if(ev->trigger()<1 && ev->getMcTrack()->id()==0) eventOK=kFALSE;
334 if(ev->trigger()&2||ev->trigger()&4)
336 if(ev->highTowerEnergy()<0.0001) eventOK=kFALSE;
337 if(isBad[ev->highTowerId()-1]==1) eventOK=kFALSE;
347 if(ev->trigger()&2||ev->trigger()&4) h_trigger->Fill(ev->highTowerId());
349 Int_t t=ev->trigger();
350 Float_t en=ev->energyInBarrel();
351 Float_t pt=ev->momentumInTpc();
352 Float_t ratio=TMath::Abs(en+pt)>0 ? en/(en+pt) : -.1;
356 if(t&1) {ratio_mb_020->Fill(ratio); Ratio_mb_020->Fill(ratio);}
357 if(t&2) {ratio_ht1_020->Fill(ratio); Ratio_ht1_020->Fill(ratio);}
358 if(t&4) {ratio_ht2_020->Fill(ratio); Ratio_ht2_020->Fill(ratio);}
359 if(t&8) {ratio_sn_020->Fill(ratio); Ratio_sn_020->Fill(ratio);}
361 else if(ev->refMult()>11)
363 if(t&1) {ratio_mb_2040->Fill(ratio); Ratio_mb_2040->Fill(ratio);}
364 if(t&2) {ratio_ht1_2040->Fill(ratio); Ratio_ht1_2040->Fill(ratio);}
365 if(t&4) {ratio_ht2_2040->Fill(ratio); Ratio_ht2_2040->Fill(ratio);}
366 if(t&8) {ratio_sn_2040->Fill(ratio); Ratio_sn_2040->Fill(ratio);}
368 else if(ev->refMult()>=0)
371 if(t&1) {ratio_mb_40100->Fill(ratio); Ratio_mb_40100->Fill(ratio);}
372 if(t&2) {ratio_ht1_40100->Fill(ratio); Ratio_ht1_40100->Fill(ratio);}
373 if(t&4) {ratio_ht2_40100->Fill(ratio); Ratio_ht2_40100->Fill(ratio);}
374 if(t&8) {ratio_sn_40100->Fill(ratio); Ratio_sn_40100->Fill(ratio);}
378 tpc_mb->Fill(ev->goodPrimaries());
379 ftpc_mb->Fill(ev->refMult());
380 bemc_mb->Fill(ev->numberOfPoints());
381 EvsE_mb->Fill(ev->momentumInTpc(),ev->energyInBarrel());
382 if(ratio<cuts->ratioCUT){
383 tpc_mb_cut->Fill(ev->goodPrimaries());
384 ftpc_mb_cut->Fill(ev->refMult());
385 bemc_mb_cut->Fill(ev->numberOfPoints());
389 tpc_ht1->Fill(ev->goodPrimaries());
390 ftpc_ht1->Fill(ev->refMult());
391 bemc_ht1->Fill(ev->numberOfPoints());
392 EvsE_ht1->Fill(ev->momentumInTpc(),ev->energyInBarrel());
393 if(ratio<cuts->ratioCUT){
394 tpc_ht1_cut->Fill(ev->goodPrimaries());
395 ftpc_ht1_cut->Fill(ev->refMult());
396 bemc_ht1_cut->Fill(ev->numberOfPoints());
400 tpc_ht2->Fill(ev->goodPrimaries());
401 ftpc_ht2->Fill(ev->refMult());
402 bemc_ht2->Fill(ev->numberOfPoints());
403 EvsE_ht2->Fill(ev->momentumInTpc(),ev->energyInBarrel());
404 if(ratio<cuts->ratioCUT){
405 tpc_ht2_cut->Fill(ev->goodPrimaries());
406 ftpc_ht2_cut->Fill(ev->refMult());
407 bemc_ht2_cut->Fill(ev->numberOfPoints());
411 tpc_sn->Fill(ev->goodPrimaries());
412 ftpc_sn->Fill(ev->refMult());
413 bemc_sn->Fill(ev->numberOfPoints());
414 EvsE_sn->Fill(ev->momentumInTpc(),ev->energyInBarrel());
415 if(ratio<cuts->ratioCUT){
416 tpc_sn_cut->Fill(ev->goodPrimaries());
417 ftpc_sn_cut->Fill(ev->refMult());
418 bemc_sn_cut->Fill(ev->numberOfPoints());
424 TClonesArray *clA=(TClonesArray*)ev->getPointArray();
425 for(Int_t j=0;j<clA->GetEntries();j++)
428 TVector3 pPos=p->position();
429 TVector3 pMom=pPos-vPos;
430 pMom.SetMag(p->energy());
432 if(p->distanceToTrack()<cuts->neutralCUT)
continue;
433 if(p->nHitsEta()<cuts->etaHitsCUT)
continue;
434 if(p->nHitsPhi()<cuts->phiHitsCUT)
continue;
435 if(pPos.PseudoRapidity()<cuts->etaMinCUT)
continue;
436 if(pPos.PseudoRapidity()>cuts->etaMaxCUT)
continue;
438 Float_t pT=pMom.Pt();
439 if(pMom.PseudoRapidity()>cuts->rapidityMinCUT && pMom.PseudoRapidity()<cuts->rapidityMaxCUT)
445 ptspec_mb_020->Fill(pT);
446 if(ratio>=cuts->ratioCUT)
447 ptspec_mb_bg_020->Fill(pT);
449 ptspec_mb_cut_020->Fill(pT);
453 ptspec_ht1_020->Fill(pT);
454 if(ratio>=cuts->ratioCUT)
455 ptspec_ht1_bg_020->Fill(pT);
457 ptspec_ht1_cut_020->Fill(pT);
461 ptspec_ht2_020->Fill(pT);
462 if(ratio>=cuts->ratioCUT)
463 ptspec_ht2_bg_020->Fill(pT);
465 ptspec_ht2_cut_020->Fill(pT);
469 ptspec_sn_020->Fill(pT);
470 if(ratio>=cuts->ratioCUT)
471 ptspec_sn_bg_020->Fill(pT);
473 ptspec_sn_cut_020->Fill(pT);
476 else if(ev->refMult()>11)
480 ptspec_mb_2040->Fill(pT);
481 if(ratio>=cuts->ratioCUT)
482 ptspec_mb_bg_2040->Fill(pT);
484 ptspec_mb_cut_2040->Fill(pT);
488 ptspec_ht1_2040->Fill(pT);
489 if(ratio>=cuts->ratioCUT)
490 ptspec_ht1_bg_2040->Fill(pT);
492 ptspec_ht1_cut_2040->Fill(pT);
496 ptspec_ht2_2040->Fill(pT);
497 if(ratio>=cuts->ratioCUT)
498 ptspec_ht2_bg_2040->Fill(pT);
500 ptspec_ht2_cut_2040->Fill(pT);
504 ptspec_sn_2040->Fill(pT);
505 if(ratio>=cuts->ratioCUT)
506 ptspec_sn_bg_2040->Fill(pT);
508 ptspec_sn_cut_2040->Fill(pT);
511 else if(ev->refMult()>=0)
515 ptspec_mb_40100->Fill(pT);
516 if(ratio>=cuts->ratioCUT)
517 ptspec_mb_bg_40100->Fill(pT);
519 ptspec_mb_cut_40100->Fill(pT);
523 ptspec_ht1_40100->Fill(pT);
524 if(ratio>=cuts->ratioCUT)
525 ptspec_ht1_bg_40100->Fill(pT);
527 ptspec_ht1_cut_40100->Fill(pT);
531 ptspec_ht2_40100->Fill(pT);
532 if(ratio<0.7) etaphi_fill3088b_ht2->Fill(pPos.PseudoRapidity(),pPos.Phi());
533 if(ratio>=cuts->ratioCUT)
535 ptspec_ht2_bg_40100->Fill(pT);
536 if(ev->runId()>=4060055&&ev->runId()<=4060088) etaphi_fill3085_ht2->Fill(pPos.PseudoRapidity(),pPos.Phi());
537 if(ev->runId()>=4061003&&ev->runId()<=4061025) etaphi_fill3088_ht2->Fill(pPos.PseudoRapidity(),pPos.Phi());
540 ptspec_ht2_cut_40100->Fill(pT);
544 ptspec_sn_40100->Fill(pT);
545 if(ratio>=cuts->ratioCUT)
547 ptspec_sn_bg_40100->Fill(pT);
548 etaphi_sn->Fill(pPos.PseudoRapidity(),pPos.Phi());
549 if(ev->runId()>=4060055&&ev->runId()<=4060088) etaphi_fill3085_sn->Fill(pPos.PseudoRapidity(),pPos.Phi());
550 if(ev->runId()>=4061003&&ev->runId()<=4061025) etaphi_fill3088_sn->Fill(pPos.PseudoRapidity(),pPos.Phi());
553 ptspec_sn_cut_40100->Fill(pT);
569 oname.Prepend(
"outputBg113005_");
570 TFile o(oname.Data(),
"RECREATE");
572 etaphi_fill3085_ht2->Write();
573 etaphi_fill3088_ht2->Write();
574 etaphi_fill3085_sn->Write();
575 etaphi_fill3088_sn->Write();
576 etaphi_fill3088b_ht2->Write();
585 Ratio_mb_020->Write();
586 Ratio_ht1_020->Write();
587 Ratio_ht2_020->Write();
588 Ratio_sn_020->Write();
589 Ratio_mb_2040->Write();
590 Ratio_ht1_2040->Write();
591 Ratio_ht2_2040->Write();
592 Ratio_sn_2040->Write();
593 Ratio_mb_40100->Write();
594 Ratio_ht1_40100->Write();
595 Ratio_ht2_40100->Write();
596 Ratio_sn_40100->Write();
603 ptspec_mb_020->Write();
604 ptspec_mb_cut_020->Write();
605 ptspec_mb_bg_020->Write();
606 ptspec_ht1_020->Write();
607 ptspec_ht1_cut_020->Write();
608 ptspec_ht1_bg_020->Write();
609 ptspec_ht2_020->Write();
610 ptspec_ht2_cut_020->Write();
611 ptspec_ht2_bg_020->Write();
612 ptspec_sn_020->Write();
613 ptspec_sn_cut_020->Write();
614 ptspec_sn_bg_020->Write();
616 ptspec_mb_2040->Write();
617 ptspec_mb_cut_2040->Write();
618 ptspec_mb_bg_2040->Write();
619 ptspec_ht1_2040->Write();
620 ptspec_ht1_cut_2040->Write();
621 ptspec_ht1_bg_2040->Write();
622 ptspec_ht2_2040->Write();
623 ptspec_ht2_cut_2040->Write();
624 ptspec_ht2_bg_2040->Write();
625 ptspec_sn_2040->Write();
626 ptspec_sn_cut_2040->Write();
627 ptspec_sn_bg_2040->Write();
629 ptspec_mb_40100->Write();
630 ptspec_mb_cut_40100->Write();
631 ptspec_mb_bg_40100->Write();
632 ptspec_ht1_40100->Write();
633 ptspec_ht1_cut_40100->Write();
634 ptspec_ht1_bg_40100->Write();
635 ptspec_ht2_40100->Write();
636 ptspec_ht2_cut_40100->Write();
637 ptspec_ht2_bg_40100->Write();
638 ptspec_sn_40100->Write();
639 ptspec_sn_cut_40100->Write();
640 ptspec_sn_bg_40100->Write();
645 tpc_ht1_cut->Write();
647 tpc_ht2_cut->Write();
651 ftpc_mb_cut->Write();
653 ftpc_ht1_cut->Write();
655 ftpc_ht2_cut->Write();
657 ftpc_sn_cut->Write();
659 bemc_mb_cut->Write();
661 bemc_ht1_cut->Write();
663 bemc_ht2_cut->Write();
665 bemc_sn_cut->Write();
672 void dAuBackground::runSim(
const char *file)
674 TH1F *ratio_pythia=
new TH1F(
"ratio_pythia",
"pythia, E over pT", 25,0.,1.);
675 TH1F *energy_pythia=
new TH1F(
"energy_pythia",
"energy spectrum",200,0.,100.);
676 TH1F *tpcpt_pythia=
new TH1F(
"tpcpt_pythia",
"TPC pT spectrum",200,0.,100.);
677 TH1F *spec_pythia=
new TH1F(
"spec_pythia",
"pT spectrum neutral points",30,0.,15.);
678 TH1F *spec_pythia_bg=
new TH1F(
"spec_pythia_bg",
"pT spectrum neutral points",30,0.,15.);
680 TH1F *ratio_pythia_ht1=
new TH1F(
"ratio_pythia_ht1",
"pythia, E over pT ht1", 25,0.,1.);
681 TH1F *energy_pythia_ht1=
new TH1F(
"energy_pythia_ht1",
"energy spectrum ht1",200,0.,100.);
682 TH1F *tpcpt_pythia_ht1=
new TH1F(
"tpcpt_pythia_ht1",
"TPC pT spectrum ht1",200,0.,100.);
683 TH1F *spec_pythia_ht1=
new TH1F(
"spec_pythia_ht1",
"pT spectrum neutral points ht1",30,0.,15.);
684 TH1F *spec_pythia_bg_ht1=
new TH1F(
"spec_pythia_bg_ht1",
"pT spectrum neutral points ht1",30,0.,15.);
685 TH1F *spec_pythia_ht1_cut=
new TH1F(
"spec_pythia_ht1_cut",
"pT spectrum neutral points ht1 after cut",30,0.,15.);
687 TH1F *pythia_tpc_ht1=
new TH1F(
"pythia_tpc_ht1",
"tpc mult. ht-1 sim",100,0.,100.);
688 TH1F *pythia_tpc_ht1_cut=
new TH1F(
"pythia_tpc_ht1_cut",
"tpc mult. ht-1 sim after cut",100,0.,100.);
689 TH1F *pythia_bemc_ht1=
new TH1F(
"pythia_bemc_ht1",
"bemc mult. ht-1 sim",60,0.,60.);
690 TH1F *pythia_bemc_ht1_cut=
new TH1F(
"pythia_bemc_ht1_cut",
"bemc mult. ht-1 sim after cut",60,0.,60.);
692 TFile *inf=
new TFile(file,
"OPEN");
693 TTree *eventTree=(TTree*)inf->Get(
"mEventTree");
695 eventTree->SetBranchAddress(
"branch",&ev);
697 TPostScript *ps=
new TPostScript(
"dAu_bgPythia.ps",111);
698 TCanvas *c9=
new TCanvas(
"c9",
"c9",800,1000);
702 while(eventTree->GetEntry(entry))
704 if(entry%10000==0) cout<<entry<<endl;
706 Bool_t eventOK=kTRUE;
707 TVector3 vPos=ev->vertex();
710 if(TMath::Abs(vPos.Z())>cuts->vertexzCUT) eventOK=kFALSE;
711 if(TMath::Abs(vPos.X())>cuts->vertexxCUT) eventOK=kFALSE;
712 if(TMath::Abs(vPos.Y())>cuts->vertexyCUT) eventOK=kFALSE;
713 if(vPos.Mag()<.000001) eventOK=kFALSE;
721 Float_t en=ev->energyInBarrel();
722 Float_t pt=ev->momentumInTpc();
723 Float_t ratio=TMath::Abs(en+pt)>0 ? en/(en+pt) : 2.;
725 ratio_pythia->Fill(ratio);
726 energy_pythia->Fill(en);
727 tpcpt_pythia->Fill(pt);
728 if(ev->highTowerAdc()>cuts->ht1AdcCUT)
730 pythia_tpc_ht1->Fill(ev->goodPrimaries());
731 pythia_bemc_ht1->Fill(ev->numberOfPoints());
732 ratio_pythia_ht1->Fill(ratio);
733 energy_pythia_ht1->Fill(en);
734 tpcpt_pythia_ht1->Fill(pt);
735 if(ratio<cuts->ratioCUT)
737 pythia_tpc_ht1_cut->Fill(ev->goodPrimaries());
738 pythia_bemc_ht1_cut->Fill(ev->numberOfPoints());
745 TClonesArray *clA=(TClonesArray*)ev->getPointArray();
746 for(Int_t j=0;j<clA->GetEntries();j++)
749 TVector3 pPos=p->position();
750 TVector3 pMom=pPos-vPos;
751 pMom.SetMag(p->energy());
753 if(p->distanceToTrack()<cuts->neutralCUT)
continue;
754 if(p->nHitsEta()<cuts->etaHitsCUT)
continue;
755 if(p->nHitsPhi()<cuts->phiHitsCUT)
continue;
756 if(pPos.PseudoRapidity()<cuts->etaMinCUT)
continue;
757 if(pPos.PseudoRapidity()>cuts->etaMaxCUT)
continue;
759 Float_t pT=pMom.Pt();
760 if(pMom.PseudoRapidity()>cuts->rapidityMinCUT && pMom.PseudoRapidity()<cuts->rapidityMaxCUT)
762 spec_pythia->Fill(pT);
763 if(ratio>=cuts->ratioCUT) spec_pythia_bg->Fill(pT);
764 if(ev->highTowerAdc()>cuts->ht1AdcCUT)
766 spec_pythia_ht1->Fill(pT);
767 if(ratio>=cuts->ratioCUT) spec_pythia_bg_ht1->Fill(pT);
768 else spec_pythia_ht1_cut->Fill(pT);
779 TFile f(
"hijing_tryout.root",
"RECREATE");
780 spec_pythia_ht1->Write();
781 spec_pythia_ht1_cut->Write();
782 spec_pythia_bg_ht1->Write();
783 ratio_pythia_ht1->Write();
785 pythia_tpc_ht1->Write();
786 pythia_tpc_ht1_cut->Write();
787 pythia_bemc_ht1->Write();
788 pythia_bemc_ht1_cut->Write();
793 ratio_pythia->Draw();
795 ratio_pythia_ht1->Draw();
797 energy_pythia->Draw();
800 energy_pythia_ht1->Draw();
803 tpcpt_pythia->Draw();
806 tpcpt_pythia_ht1->Draw();
810 spec_pythia_bg->SetLineColor(6);
811 spec_pythia_bg->Draw(
"same");
814 spec_pythia_ht1->Draw();
815 spec_pythia_bg_ht1->SetLineColor(6);
816 spec_pythia_bg_ht1->Draw(
"same");