92 |
|
h->SetAxisRange(rangeMin,rangeMax); |
93 |
|
iMin = h->GetMaximumBin(); |
94 |
|
rangeMin = h->GetBinLowEdge(iMin); |
95 |
+ |
|
96 |
+ |
if(rangeMin > 1070) rangeMin -= 25; |
97 |
|
rangeMax = rangeMin + 24; |
98 |
|
|
99 |
|
TF1* f = new TF1("f","[0]-[1]*TMath::Erf((x-[2])/[3])",rangeMin,rangeMax); |
131 |
|
|
132 |
|
TCut channel(Form("ieta==%d&&iphi==%d&&idepth==%d",ieta,iphi,idepth)); |
133 |
|
TCut reasonable("ry > -0.2 && ry < 2"); |
134 |
< |
TCut wing("(s3+s0)<0.04*(s1+s2)"); |
134 |
> |
|
135 |
> |
TCut wing3("(s3+s0)<0.03*(s1+s2)"); |
136 |
> |
TCut wing5("(s3+s0)<0.05*(s1+s2)"); |
137 |
> |
TCut wing10("(s3+s0)<0.10*(s1+s2)"); |
138 |
> |
|
139 |
> |
TCut wing = wing3; |
140 |
|
|
141 |
|
TCut cut = channel && wing; |
142 |
|
|
143 |
< |
TF1* f = new TF1("f","gaus",0,2); |
144 |
< |
TH1D* h = new TH1D("h","",100,0,2); |
143 |
> |
TF1* f = new TF1(Form("fg_%d_%d_%d_%d",run,ieta,iphi,idepth),"gaus(0)+[3]",0,2); |
144 |
> |
|
145 |
> |
int Nbin = 50; |
146 |
> |
TH1D* h = new TH1D(Form("hg_%d_%d_%d_%d",run,ieta,iphi,idepth),"",Nbin,0,2); |
147 |
> |
TH1D* h3 = new TH1D(Form("hg3_%d_%d_%d_%d",run,ieta,iphi,idepth),"",Nbin,0,2); |
148 |
> |
TH1D* h5 = new TH1D(Form("hg5_%d_%d_%d_%d",run,ieta,iphi,idepth),"",Nbin,0,2); |
149 |
> |
TH1D* h10 = new TH1D(Form("hg10_%d_%d_%d_%d",run,ieta,iphi,idepth),"",Nbin,0,2); |
150 |
|
|
151 |
|
nt->SetAlias("ry","s1/s2"); |
152 |
+ |
if(0){ |
153 |
+ |
nt->Draw(Form("ry>>%s",h3->GetName()),cut&&wing3,""); |
154 |
+ |
nt->Draw(Form("ry>>%s",h5->GetName()),cut&&wing5,""); |
155 |
+ |
nt->Draw(Form("ry>>%s",h10->GetName()),cut&&wing10,""); |
156 |
+ |
} |
157 |
|
nt->Draw(Form("ry>>%s",h->GetName()),cut,""); |
158 |
|
|
159 |
+ |
f->SetParameter(0,h->GetMaximum()); |
160 |
+ |
f->SetParameter(1,h->GetMean()); |
161 |
+ |
f->SetParameter(2,h->GetRMS()); |
162 |
+ |
|
163 |
+ |
|
164 |
|
h->Fit(f,"R"); |
165 |
|
|
166 |
|
r = f->GetParameter(1); |
167 |
< |
|
167 |
> |
|
168 |
> |
new TCanvas(); |
169 |
|
return r; |
170 |
|
|
171 |
|
} |
175 |
|
|
176 |
|
|
177 |
|
|
178 |
< |
double getR(int run = 180622, int ieta = 30, int iphi = 57, int idepth = 1, bool useTime = 1){ |
178 |
> |
double getR(int run = 130158, int ieta = 30, int iphi = 57, int idepth = 1, bool useTime = 1){ |
179 |
|
|
180 |
|
|
181 |
|
double r2 = getRwithoutTime(run,ieta,iphi,idepth); |
182 |
|
double r1 = getRwithTime(run,ieta,iphi,idepth); |
183 |
|
|
184 |
< |
TLine* line = new TLine(1050,r2,1080,r2); |
184 |
> |
TLine* line = new TLine(1000,r2,1175,r2); |
185 |
> |
line->SetLineWidth(5); |
186 |
> |
line->SetLineColor(1); |
187 |
> |
line->SetLineStyle(2); |
188 |
> |
|
189 |
|
line->Draw("same"); |
190 |
|
if(useTime) return r1; |
191 |
|
else return r2; |