4 AddChains(872); // AddChains(runNumber);
6 Select(); // make default selection of data
11 void AddChains(Int_t run);
12 void PRFYZ(TCut cut0, TCut cut1, char * description);
13 void ResYZ(TCut cut0, TCut cut1, char * description);
14 TProfile * ProfileARow(TCut cut0, Int_t max);
22 TChain chaincl("Tracks","Tracks"); // tpc tracks and clusters
23 TChain chainFit("Fit","Fit"); // fitted signals with fit parameters
24 TChain chainPed("Fit","Fit"); // fitted pedestal with noise
26 AliComparisonDraw comp;
27 comp.fTree = &chaincl;
28 AliComparisonDraw compF;
29 compF.fTree = &chainFit;
30 AliComparisonDraw compP;
31 compP.fTree = &chainPed;
34 // selection of data for analysis
36 TEventList * listTracks = new TEventList("listTracks","listTracks");
37 TEventList * listFitS = new TEventList("listFitS","listFitS");
38 TEventList * listFitPed = new TEventList("listFitPed","listFitPed");
41 void AddChains(Int_t run){
43 // add files to the chains
52 sprintf(strcl,"ls run%d*/TPCtracks.root > /tmp/files.txt", run);
54 in0.open("/tmp/files.txt");
56 if (sfile.Length()==0) break;
57 printf("%s\n",sfile.Data());
58 chaincl.Add(sfile.Data());
62 sprintf(strcl,"ls run%d*/FitSignal.root > /tmp/files.txt", run);
64 in1.open("/tmp/files.txt");
66 if (sfile.Length()==0) break;
67 printf("%s\n",sfile.Data());
68 chainFit.Add(sfile.Data());
72 sprintf(strcl,"ls run%d*/TPCsignal.root > /tmp/files.txt", run);
74 in2.open("/tmp/files.txt");
76 if (sfile.Length()==0) break;
77 printf("%s\n",sfile.Data());
78 chainPed.Add(sfile.Data());
84 // base cut on the tracks
86 comp.fTree->Draw(">>listTracks","Track.fN>50&&abs(Track.fP4)<0.001");
87 comp.fTree->SetEventList(listTracks);
93 void PRFYZ(TCut cut0, TCut cut1, char * description){
95 // plot Pad response function as funtion of drift z
98 TF1 * f1 = new TF1("fdiff","sqrt([0]*[0]+(250-x)*[1]*[1])");
99 f1->SetParameter(1,0.2);
100 f1->SetParameter(0,0.2);
101 comp.DrawXY("Cl.fZ","sqrt(Cl.fSigmaY2)","Track.fTrackPoints.GetAngleY()<0.05","Track.fTrackPoints.fTX>0"+cut0,5,10,240,-0,1);
102 TH1F * prfInnerY = (TH1F*)comp.fMean->Clone();
104 comp.DrawXY("Cl.fZ","sqrt(Cl.fSigmaY2)","Track.fTrackPoints.GetAngleY()<0.05","Track.fTrackPoints.fTX>0"+cut1,5,10,240,-0,1);
105 TH1F * prfOuterY = (TH1F*)comp.fMean->Clone();
108 prfOuterY->SetMinimum(0);
109 prfOuterY->SetMarkerStyle(23);
110 prfInnerY->SetMarkerStyle(24);
111 prfOuterY->SetXTitle("Z position (cm)");
112 prfOuterY->SetYTitle("PRF width (cm)");
116 sprintf(chouter,"Outer sector : p_{0} = %f p_{1} = %f",f1->GetParameter(0),f1->GetParameter(1));
118 sprintf(chinner,"Inner sector : p_{0} = %f p_{1} = %f",f1->GetParameter(0),f1->GetParameter(1));
120 prfInnerY->Draw("same");
121 TString desc = description;
122 TLegend *legend = new TLegend(0.25,0.12,0.85,0.35, desc+"\nTPC cluster shape Fit: #sigma = #sqrt{p_{0}^{2}+(z_{d}-z)p_{1}^{2}}");
123 legend->SetBorderSize(1);
124 legend->AddEntry(prfOuterY,chouter);
125 legend->AddEntry(prfInnerY,chinner);
130 void ResYZ(TCut cut0, TCut cut1, char * description){
132 // resolution in y coordinate as function of z
134 TF1 * f1 = new TF1("fdiff","sqrt([0]*[0]+(250-x)*[1]*[1])");
135 f1->SetParameter(1,0.2);
136 f1->SetParameter(0,0.2);
137 comp.DrawXY("Cl.fZ","Track.fTrackPoints.GetY()-Cl.GetY()","Track.fTrackPoints.GetAngleY()<0.05","Track.fTrackPoints.fTX>0"+cut0,5,10,240,-0.5,0.5);
138 TH1F * prfInnerY = (TH1F*)comp.fRes->Clone();
140 comp.DrawXY("Cl.fZ","Track.fTrackPoints.GetY()-Cl.GetY()","Track.fTrackPoints.GetAngleY()<0.05","Track.fTrackPoints.fTX>0"+cut1,5,10,240,-0.5,0.5);
141 TH1F * prfOuterY = (TH1F*)comp.fRes->Clone();
144 prfOuterY->SetMinimum(0);
145 prfOuterY->SetMaximum(0.15);
146 prfOuterY->SetMarkerStyle(23);
147 prfInnerY->SetMarkerStyle(24);
148 prfOuterY->SetXTitle("Z position (cm)");
149 prfOuterY->SetYTitle("Y resolution (cm)");
153 sprintf(chouter,"Outer sector : p_{0} = %f p_{1} = %f",f1->GetParameter(0),f1->GetParameter(1));
155 sprintf(chinner,"Inner sector : p_{0} = %f p_{1} = %f",f1->GetParameter(0),f1->GetParameter(1));
157 prfInnerY->Draw("same");
158 TString desc = description;
159 TLegend *legend = new TLegend(0.25,0.12,0.85,0.35, desc+"TPC cluster resolution: #sigma = #sqrt{p_{0}^{2}+(z_{d}-z)p_{1}^{2}}");
160 legend->SetBorderSize(1);
161 legend->AddEntry(prfOuterY,chouter);
162 legend->AddEntry(prfInnerY,chinner);
167 TProfile * ProfileARow(TCut cut0, char *name, Int_t max){
169 // make profile histrogram of amplitudes
171 TProfile *profA = new TProfile(name,name,max,0,max-1);
173 sprintf(expr,"Cl.fMax:Cl.fRow>>%s",name);
174 comp.fTree->Draw(expr,"Cl.fZ>0&&Cl.fMax<500"+cut0,"prof");
175 profA->SetXTitle("Pad Row");
176 profA->SetYTitle("Amplitude (ADC)");