]>
Commit | Line | Data |
---|---|---|
5f9ad509 | 1 | /* |
2 | .L AliGenInfo.C+ | |
3 | .L TestAnalisys.C | |
4 | AddChains(872); // AddChains(runNumber); | |
5 | AddChains(873); | |
6 | Select(); // make default selection of data | |
7 | */ | |
8 | ||
9 | ||
10 | void Select(); | |
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); | |
15 | ||
16 | ||
17 | ||
18 | ||
19 | // | |
20 | // global variables | |
21 | // | |
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 | |
25 | // | |
26 | AliComparisonDraw comp; | |
27 | comp.fTree = &chaincl; | |
28 | AliComparisonDraw compF; | |
29 | compF.fTree = &chainFit; | |
30 | AliComparisonDraw compP; | |
31 | compP.fTree = &chainPed; | |
32 | // | |
33 | // | |
34 | // selection of data for analysis | |
35 | // | |
36 | TEventList * listTracks = new TEventList("listTracks","listTracks"); | |
37 | TEventList * listFitS = new TEventList("listFitS","listFitS"); | |
38 | TEventList * listFitPed = new TEventList("listFitPed","listFitPed"); | |
39 | ||
40 | ||
41 | void AddChains(Int_t run){ | |
42 | // | |
43 | // add files to the chains | |
44 | // | |
45 | ifstream in0; | |
46 | ifstream in1; | |
47 | ifstream in2; | |
48 | TString sfile; | |
49 | char strcl[100]; | |
50 | // TPC tracks | |
51 | // | |
52 | sprintf(strcl,"ls run%d*/TPCtracks.root > /tmp/files.txt", run); | |
53 | gSystem->Exec(strcl); | |
54 | in0.open("/tmp/files.txt"); | |
55 | for (;in0>>sfile;){ | |
56 | if (sfile.Length()==0) break; | |
57 | printf("%s\n",sfile.Data()); | |
58 | chaincl.Add(sfile.Data()); | |
59 | } | |
60 | // | |
61 | // Fitted signals | |
62 | sprintf(strcl,"ls run%d*/FitSignal.root > /tmp/files.txt", run); | |
63 | gSystem->Exec(strcl); | |
64 | in1.open("/tmp/files.txt"); | |
65 | for (;in1>>sfile;){ | |
66 | if (sfile.Length()==0) break; | |
67 | printf("%s\n",sfile.Data()); | |
68 | chainFit.Add(sfile.Data()); | |
69 | } | |
70 | // | |
71 | // Fitted pedestal | |
72 | sprintf(strcl,"ls run%d*/TPCsignal.root > /tmp/files.txt", run); | |
73 | gSystem->Exec(strcl); | |
74 | in2.open("/tmp/files.txt"); | |
75 | for (;in2>>sfile;){ | |
76 | if (sfile.Length()==0) break; | |
77 | printf("%s\n",sfile.Data()); | |
78 | chainPed.Add(sfile.Data()); | |
79 | } | |
80 | } | |
81 | ||
82 | void Select(){ | |
83 | // | |
84 | // base cut on the tracks | |
85 | // | |
86 | comp.fTree->Draw(">>listTracks","Track.fN>50&&abs(Track.fP4)<0.001"); | |
87 | comp.fTree->SetEventList(listTracks); | |
88 | // | |
89 | } | |
90 | ||
91 | ||
92 | ||
93 | void PRFYZ(TCut cut0, TCut cut1, char * description){ | |
94 | // | |
95 | // plot Pad response function as funtion of drift z | |
96 | // | |
97 | // | |
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(); | |
103 | ||
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(); | |
106 | // | |
107 | // | |
108 | prfOuterY->SetMinimum(0); | |
109 | prfOuterY->SetMarkerStyle(23); | |
110 | prfInnerY->SetMarkerStyle(24); | |
111 | prfOuterY->SetXTitle("Z position (cm)"); | |
112 | prfOuterY->SetYTitle("PRF width (cm)"); | |
113 | char chouter[100]; | |
114 | char chinner[100]; | |
115 | prfOuterY->Fit(f1); | |
116 | sprintf(chouter,"Outer sector : p_{0} = %f p_{1} = %f",f1->GetParameter(0),f1->GetParameter(1)); | |
117 | prfInnerY->Fit(f1); | |
118 | sprintf(chinner,"Inner sector : p_{0} = %f p_{1} = %f",f1->GetParameter(0),f1->GetParameter(1)); | |
119 | prfOuterY->Draw(); | |
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); | |
126 | legend->Draw(); | |
127 | } | |
128 | ||
129 | ||
130 | void ResYZ(TCut cut0, TCut cut1, char * description){ | |
131 | // | |
132 | // resolution in y coordinate as function of z | |
133 | // | |
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(); | |
139 | ||
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(); | |
142 | // | |
143 | // | |
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)"); | |
150 | char chouter[100]; | |
151 | char chinner[100]; | |
152 | prfOuterY->Fit(f1); | |
153 | sprintf(chouter,"Outer sector : p_{0} = %f p_{1} = %f",f1->GetParameter(0),f1->GetParameter(1)); | |
154 | prfInnerY->Fit(f1); | |
155 | sprintf(chinner,"Inner sector : p_{0} = %f p_{1} = %f",f1->GetParameter(0),f1->GetParameter(1)); | |
156 | prfOuterY->Draw(); | |
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); | |
163 | legend->Draw(); | |
164 | } | |
165 | ||
166 | ||
167 | TProfile * ProfileARow(TCut cut0, char *name, Int_t max){ | |
168 | // | |
169 | // make profile histrogram of amplitudes | |
170 | // | |
171 | TProfile *profA = new TProfile(name,name,max,0,max-1); | |
172 | char expr[100]; | |
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)"); | |
177 | return profA; | |
178 | } |