3 // Example macro to create the 1/pt resolution plot for Marek
5 TFile * f = TFile::Open("Filtered.root");
6 TTree * treePt= (TTree*)f->Get("highPt");
10 TCut cutNcl = "esdTrack.GetTPCClusterInfo(3,1)>120&&esdTrack.fITSncls>4";
11 TH2 *phis1PtPt[3]={0};
12 TH1 *his1PtPtRes[3]={0};
13 TObjArray * fitArray = new TObjArray(3);
16 treePt->Draw("abs(esdTrack.fP[4])-1/particle.Pt():1/particle.Pt()>>his1Pt1Pt(20,0,0.5,100,-0.01,0.01)",cutNcl,"colz");
17 phis1PtPt[0] = (TH2*)treePt->GetHistogram()->Clone();
18 phis1PtPt[0]->FitSlicesY(0,0,-1,0,"QNR",fitArray);
19 his1PtPtRes[0]=(TH1*)fitArray->At(2)->Clone();
21 his1PtPtRes[0]->Draw();
25 void DrawMatchingEffiency(){
27 // problem with ITS simulation looks like
29 TFile * f = TFile::Open("Filtered.root");
30 TTree * treePt= (TTree*)f->Get("highPt");
31 treePt->SetAlias("ITSrefit","(esdTrack.fFlags&0x4)!=0");
34 TCut cutNcl = "esdTrack.GetTPCClusterInfo(3,1)>120&&abs(esdTrack.fP[3])<0.9";
35 TCut cutPileUp = "abs(particle.fVt)<0.000000001&&abs(esdTrack.fP[1])<15";
36 TCut cutFindable = "particle.R()<0.2&&nrefITS>5";
37 treePt->Draw("ITSrefit:1/particle.Pt()>>hisMatching(20,0,2)",cutNcl+cutPileUp+cutFindable,"prof");
43 void DrawMatchingEffiency(){
47 TCut cutNcl = "esdTrack.GetTPCClusterInfo(3,1)>120&&abs(esdTrack.fP[3])<0.9";
48 TCut cutPileUp = "abs(particle.fVt)<0.000000001";
49 TCut cutFindable = "particle.R()<0.2&&tpcTrackLength";
50 TCut cutBug="abs(vtxESD.fPosition[2]-particle.fVz)<0.01"; // fix the bug after
53 TChain* chains[20]={0};
54 TProfile * hefFindable[20]={0};
55 chains[0]=AliXRDPROOFtoolkit::MakeChain("pileup_4.list","MCEffTree",0,1000,0);
58 chains[2]=AliXRDPROOFtoolkit::MakeChain("pileup_6.list","MCEffTree",0,1000,0);
59 chains[3]=AliXRDPROOFtoolkit::MakeChain("pileup_6_gem.list","MCEffTree",0,1000,0);
61 chains[4]=AliXRDPROOFtoolkit::MakeChain("pileup_8.list","MCEffTree",0,1000,0);
63 chains[6]=AliXRDPROOFtoolkit::MakeChain("pileup_10.list","MCEffTree",0,1000,0);
64 chains[7]=AliXRDPROOFtoolkit::MakeChain("pileup_10_gem.list","MCEffTree",0,1000,0);
67 TFile *fhisto = TFile::Open("histoEff.root","update");
68 for (Int_t ihis=0;ihis<20; ihis++){
69 if (!chains[ihis]) continue;
71 snprintf(hname,100,"EffFindable_%d_%d",ihis%2,((ihis/2)+2)*2);
72 printf("%d\t%s\n",ihis,hname);
74 hefFindable[ihis] = (TProfile*)fhisto->Get(hname);
75 if (!hefFindable[ihis]){
76 chains[ihis]->SetMarkerStyle(25);
77 chains[ihis]->SetCacheSize(1000000000);
78 chains[ihis]->Draw("isRec:1/particle.Pt()>>his(10,0,4)",cutPileUp+cutFindable+cutBug,"prof");
79 hefFindable[ihis]=(TProfile*)(chains[ihis]->GetHistogram()->Clone());
80 hefFindable[ihis]->SetName(hname);
82 hefFindable[ihis]->Write(hname);
86 TLegend * legend = new TLegend(0.11,0.11,0.5,0.4,"TPC Efficiency for findable tracks");
87 for (Int_t ihis=0; ihis<20; ihis++){
88 if (hefFindable[ihis]==0) continue;
89 hefFindable[ihis]->GetXaxis()->SetTitle("1/p_{T}");
90 hefFindable[ihis]->GetYaxis()->SetTitle("#epsilon");
91 hefFindable[ihis]->SetMinimum(0.85);
92 hefFindable[ihis]->SetMaximum(1.01);
93 if (ihis%2==0) hefFindable[ihis]->SetMarkerStyle(21);
94 if (ihis%2==1) hefFindable[ihis]->SetMarkerStyle(25);
95 hefFindable[ihis]->SetMarkerColor(1+ihis/2);
96 if (ihis==0) hefFindable[ihis]->Draw();
97 hefFindable[ihis]->Draw("same");
98 legend->AddEntry(hefFindable[ihis],Form("GEM%d Pileup%d",ihis%2,((ihis/2)+2)*2));
107 for a in `ls -d /hera/alice/mkowalsk/alice/simulations/gas/pileup*/`; do
110 ls $a/Filtered/*/F*.root > $dname.list