| 281 |
PKT = 0; |
PKT = 0; |
| 282 |
atime = 0; |
atime = 0; |
| 283 |
// |
// |
| 284 |
|
suf = ""; |
| 285 |
debug = false; |
debug = false; |
| 286 |
// |
// |
| 287 |
}; |
}; |
| 298 |
PKT = 0; |
PKT = 0; |
| 299 |
atime = 0; |
atime = 0; |
| 300 |
// |
// |
| 301 |
|
suf = ""; |
| 302 |
debug = false; |
debug = false; |
| 303 |
// |
// |
| 304 |
}; |
}; |
| 377 |
// |
// |
| 378 |
for (Int_t v=minv; v<maxv;v++){ |
for (Int_t v=minv; v<maxv;v++){ |
| 379 |
for (Int_t p=minp; p<maxp;p++){ |
for (Int_t p=minp; p<maxp;p++){ |
| 380 |
TString hid = Form("clatv%ip%i",v,p); |
TString hid = Form("clatv%ip%i%s",v,p,suf.Data()); |
| 381 |
TCanvas *tc = dynamic_cast<TCanvas*>(gDirectory->FindObject(hid)); |
TCanvas *tc = dynamic_cast<TCanvas*>(gDirectory->FindObject(hid)); |
| 382 |
if ( tc ){ |
if ( tc ){ |
| 383 |
// tc->Clear(); |
// tc->Clear(); |
| 385 |
tc = new TCanvas(hid,hid); |
tc = new TCanvas(hid,hid); |
| 386 |
}; |
}; |
| 387 |
// |
// |
| 388 |
TString thid = Form("hlatv%ip%i",v,p); |
TString thid = Form("hlatv%ip%i%s",v,p,suf.Data()); |
| 389 |
TH1F *th = dynamic_cast<TH1F*>(gDirectory->FindObject(thid)); |
TH1F *th = dynamic_cast<TH1F*>(gDirectory->FindObject(thid)); |
| 390 |
if ( th ) th->Delete(); |
if ( th ) th->Delete(); |
| 391 |
// th->Clear(); |
// th->Clear(); |
| 428 |
gStyle->SetNdivisions(510,"XY"); |
gStyle->SetNdivisions(510,"XY"); |
| 429 |
// |
// |
| 430 |
for (Int_t p=minp; p<maxp;p++){ |
for (Int_t p=minp; p<maxp;p++){ |
| 431 |
TString hid = Form("c2dp%i",p); |
TString hid = Form("c2dp%i%s",p,suf.Data()); |
| 432 |
TCanvas *tc = dynamic_cast<TCanvas*>(gDirectory->FindObject(hid)); |
TCanvas *tc = dynamic_cast<TCanvas*>(gDirectory->FindObject(hid)); |
| 433 |
if ( tc ){ |
if ( tc ){ |
| 434 |
// tc->Clear(); |
// tc->Clear(); |
| 436 |
tc = new TCanvas(hid,hid); |
tc = new TCanvas(hid,hid); |
| 437 |
}; |
}; |
| 438 |
// |
// |
| 439 |
TString thid = Form("h2dp%i",p); |
TString thid = Form("h2dp%i%s",p,suf.Data()); |
| 440 |
TH2F *th = dynamic_cast<TH2F*>(gDirectory->FindObject(thid)); |
TH2F *th = dynamic_cast<TH2F*>(gDirectory->FindObject(thid)); |
| 441 |
if ( th ) th->Delete(); |
if ( th ) th->Delete(); |
| 442 |
// th->Clear(); |
// th->Clear(); |
| 673 |
umax = 100.; |
umax = 100.; |
| 674 |
slmax = ""; |
slmax = ""; |
| 675 |
sumax = ""; |
sumax = ""; |
| 676 |
|
suf = ""; |
| 677 |
|
xyaverage = true; |
| 678 |
|
// |
| 679 |
|
letmax = -1; |
| 680 |
|
heavytail = false; |
| 681 |
|
// lmipth = 100.; |
| 682 |
|
lmipth = 0.; |
| 683 |
// |
// |
| 684 |
}; |
}; |
| 685 |
|
|
| 705 |
|
|
| 706 |
void CaloLong::Clear(){ |
void CaloLong::Clear(){ |
| 707 |
// |
// |
| 708 |
|
if ( debug ) printf(" Clear called \n"); |
| 709 |
|
// |
| 710 |
memset(eplane,0, 2*22*sizeof(Float_t)); |
memset(eplane,0, 2*22*sizeof(Float_t)); |
| 711 |
// |
// |
| 712 |
chi2 = 0.; |
chi2 = 0.; |
| 859 |
// |
// |
| 860 |
// inclination factor (stolen from Daniele's code) |
// inclination factor (stolen from Daniele's code) |
| 861 |
// |
// |
| 862 |
Float_t ytgx = 0; |
Float_t ytgx = 0.; |
| 863 |
Float_t ytgy = 0; |
Float_t ytgy = 0.; |
| 864 |
ytgx = 0.76 * clp->tanx[0]; |
ytgx = 0.76 * clp->tanx[0]; |
| 865 |
ytgy = 0.76 * clp->tany[0]; |
ytgy = 0.76 * clp->tany[0]; |
| 866 |
X0pl = sqrt( pow(0.76,2.) + pow(ytgx,2.) + pow(ytgy,2.) ); |
X0pl = sqrt( pow(0.76,2.) + pow(ytgx,2.) + pow(ytgy,2.) ); |
| 954 |
}; |
}; |
| 955 |
}; |
}; |
| 956 |
// |
// |
| 957 |
|
if ( !clp && debug ) printf(" ERROR!! no CaloLevel2 obj!!\n"); |
| 958 |
|
// |
| 959 |
// inclination factor (stolen from Daniele's code) |
// inclination factor (stolen from Daniele's code) |
| 960 |
// |
// |
| 961 |
Float_t ytgx = 0; |
Float_t ytgx = 0.; |
| 962 |
Float_t ytgy = 0; |
Float_t ytgy = 0.; |
| 963 |
ytgx = 0.76 * clp->tanx[0]; |
ytgx = 0.76 * clp->tanx[0]; |
| 964 |
ytgy = 0.76 * clp->tany[0]; |
ytgy = 0.76 * clp->tany[0]; |
| 965 |
X0pl = sqrt( pow(0.76,2.) + pow(ytgx,2.) + pow(ytgy,2.) ); |
X0pl = sqrt( pow(0.76,2.) + pow(ytgx,2.) + pow(ytgy,2.) ); |
| 966 |
|
if ( debug ) printf(" X0pl %f tanx %f tany %f \n",X0pl,ytgx,ytgy); |
| 967 |
// |
// |
| 968 |
// Find experimental plane of maximum |
// Find experimental plane of maximum |
| 969 |
// |
// |
| 984 |
// |
// |
| 985 |
if ( vmax == 0 ) pmax++; |
if ( vmax == 0 ) pmax++; |
| 986 |
etmax = pmax * X0pl; |
etmax = pmax * X0pl; |
| 987 |
|
letmax = etmax; |
| 988 |
// |
// |
| 989 |
if ( debug ) this->Print(); |
if ( debug ) this->Print(); |
| 990 |
if ( debug ) printf(" exit \n"); |
if ( debug ) printf(" exit \n"); |
| 1009 |
this->Fit(false); |
this->Fit(false); |
| 1010 |
}; |
}; |
| 1011 |
|
|
| 1012 |
Float_t CaloLong::Evaluate(TString s, Float_t tmax){ |
Float_t CaloLong::Evaluate(TString s, Float_t tmax, Float_t X0pl){ |
| 1013 |
/* SAMPLE OUTPUT: |
/* SAMPLE OUTPUT: |
| 1014 |
Enter Infix Expression : A + B + C / (E - F) |
Enter Infix Expression : A + B + C / (E - F) |
| 1015 |
Postfix Expression is : A B + C E F - / + |
Postfix Expression is : A B + C E F - / + |
| 1016 |
*/ |
*/ |
| 1017 |
if ( !s.Contains("t") ){ |
if ( !s.Contains("tmax") && !s.Contains("X0pl") ){ |
| 1018 |
printf(" ERROR, the input formula must contain \"t\"\n"); |
printf(" ERROR, the input formula must contain \"t\"\n"); |
| 1019 |
return 0.; |
return 0.; |
| 1020 |
}; |
}; |
| 1023 |
return 0.; |
return 0.; |
| 1024 |
}; |
}; |
| 1025 |
TString g=Form("%f",tmax); |
TString g=Form("%f",tmax); |
| 1026 |
|
TString h=Form("%f",X0pl); |
| 1027 |
TString *ts= new TString(""); |
TString *ts= new TString(""); |
| 1028 |
ts->Prepend(s.Data()); |
ts->Prepend(s.Data()); |
| 1029 |
ts->ReplaceAll("t",1,g.Data(),g.Capacity()); |
ts->ReplaceAll("tmax",4,g.Data(),g.Capacity()); |
| 1030 |
|
ts->ReplaceAll("X0pl",4,h.Data(),h.Capacity()); |
| 1031 |
ts->Prepend("("); |
ts->Prepend("("); |
| 1032 |
ts->Append(")"); |
ts->Append(")"); |
| 1033 |
if ( debug ) printf(" ts %s tssize %i capac %i s %s g %s \n",ts->Data(),ts->Sizeof(),ts->Capacity(),s.Data(),g.Data()); |
if ( debug ) printf(" ts %s tssize %i capac %i s %s g %s \n",ts->Data(),ts->Sizeof(),ts->Capacity(),s.Data(),g.Data()); |
| 1080 |
gStyle->SetNdivisions(510,"XY"); |
gStyle->SetNdivisions(510,"XY"); |
| 1081 |
}; |
}; |
| 1082 |
// |
// |
| 1083 |
TString hid = Form("clongfit"); |
TString hid = Form("clongfit%s",suf.Data()); |
| 1084 |
TCanvas *tc = dynamic_cast<TCanvas*>(gDirectory->FindObject(hid)); |
TCanvas *tc = dynamic_cast<TCanvas*>(gDirectory->FindObject(hid)); |
| 1085 |
// if ( tc ) tc->Delete(); |
// if ( tc ) tc->Delete(); |
| 1086 |
// if ( tc ) tc->Close(); |
// if ( tc ) tc->Close(); |
| 1090 |
if ( tc ) tc->cd(); |
if ( tc ) tc->cd(); |
| 1091 |
}; |
}; |
| 1092 |
// |
// |
| 1093 |
TString thid = Form("hlongfit"); |
TString thid = Form("hlongfit%s",suf.Data()); |
| 1094 |
TH1F *th = dynamic_cast<TH1F*>(gDirectory->FindObject(thid)); |
TH2F *th = dynamic_cast<TH2F*>(gDirectory->FindObject(thid)); |
| 1095 |
if ( th ) th->Delete(); |
if ( th ) th->Delete(); |
| 1096 |
|
// |
| 1097 |
|
TString ghid = Form("glongfit%s",suf.Data()); |
| 1098 |
|
TGraphErrors *gh = dynamic_cast<TGraphErrors*>(gDirectory->FindObject(ghid)); |
| 1099 |
|
if ( gh ) gh->Delete(); |
| 1100 |
|
// |
| 1101 |
Float_t xpos = 0.; |
Float_t xpos = 0.; |
| 1102 |
Float_t enemip = 0.; |
Float_t enemip = 0.; |
| 1103 |
Float_t xmax = NC * X0pl + 0.2; |
Float_t xmax = NC * X0pl + 0.2; |
| 1104 |
// th = new TH1F(thid,thid,int(NC*1.5),-0.2,xmax); |
// |
| 1105 |
th = new TH1F(thid,thid,100,-0.2,xmax); |
Double_t xxx[50]; |
| 1106 |
|
Double_t exx[50]; |
| 1107 |
|
Double_t yyy[50]; |
| 1108 |
|
Double_t eyy[50]; |
| 1109 |
|
Int_t numpo = 0; |
| 1110 |
|
memset(xxx,0,50*sizeof(Double_t)); |
| 1111 |
|
memset(exx,0,50*sizeof(Double_t)); |
| 1112 |
|
memset(yyy,0,50*sizeof(Double_t)); |
| 1113 |
|
memset(eyy,0,50*sizeof(Double_t)); |
| 1114 |
// |
// |
| 1115 |
// AGH, BUG! |
// AGH, BUG! |
| 1116 |
// |
// |
| 1124 |
mmax = NC; |
mmax = NC; |
| 1125 |
}; |
}; |
| 1126 |
// |
// |
| 1127 |
|
Float_t emax = 0.; |
| 1128 |
Float_t qtotparz = 0.; |
Float_t qtotparz = 0.; |
| 1129 |
for (Int_t st=mmin;st<mmax+1;st++){ |
for (Int_t st=mmin;st<mmax+1;st++){ |
| 1130 |
enemip = 0.; |
enemip = 0.; |
| 1131 |
xpos = (st - mmin) * X0pl; |
xpos = (st - mmin) * X0pl; |
| 1132 |
if ( st > mmin && st < mmax ){ |
// |
| 1133 |
if ( no18x && ( st == 18+1 || st == mask18b+1 )){ |
if ( xyaverage ){ |
| 1134 |
if ( !maskYO ){ |
// |
| 1135 |
enemip = 2. * eplane[1][st]; |
if ( st > mmin && st < mmax ){ |
| 1136 |
|
if ( no18x && ( st == 18+1 || st == mask18b+1 )){ |
| 1137 |
|
if ( !maskYO ){ |
| 1138 |
|
enemip = 2. * eplane[1][st]; |
| 1139 |
|
} else { |
| 1140 |
|
enemip = eplane[1][st]; |
| 1141 |
|
}; |
| 1142 |
} else { |
} else { |
| 1143 |
enemip = eplane[1][st]; |
enemip = eplane[0][st-1] + eplane[1][st]; |
| 1144 |
}; |
}; |
| 1145 |
} else { |
} else { |
| 1146 |
enemip = eplane[0][st-1] + eplane[1][st]; |
if ( st == mmin ){ |
| 1147 |
|
if ( !maskYE ){ |
| 1148 |
|
enemip = 2. * eplane[1][st]; |
| 1149 |
|
} else { |
| 1150 |
|
enemip = eplane[1][st]; |
| 1151 |
|
}; |
| 1152 |
|
}; |
| 1153 |
|
if ( st == mmax ){ |
| 1154 |
|
if ( !maskXE ){ |
| 1155 |
|
enemip = 2. * eplane[0][st-1]; |
| 1156 |
|
} else { |
| 1157 |
|
enemip = eplane[0][st-1]; |
| 1158 |
|
}; |
| 1159 |
|
}; |
| 1160 |
|
}; |
| 1161 |
|
// |
| 1162 |
|
qtotparz += enemip; |
| 1163 |
|
if ( enemip > emax ) emax = enemip; |
| 1164 |
|
if ( enemip > 0. ){ |
| 1165 |
|
xxx[numpo] = xpos; |
| 1166 |
|
exx[numpo] = 0.1; |
| 1167 |
|
yyy[numpo] = enemip; |
| 1168 |
|
eyy[numpo] = sqrt(enemip*3.)+sqrt(5.); |
| 1169 |
|
// if ( xpos > letmax && enemip > lmipth && heavytail) eyy[numpo] = (sqrt(enemip*3.)+sqrt(5.))/numpo; |
| 1170 |
|
if ( xpos > letmax && enemip > lmipth && heavytail) eyy[numpo] = sqrt(enemip)/5.; |
| 1171 |
|
if ( xpos > letmax-1 && xpos < letmax+1 && heavytail ) eyy[numpo] /= 5.; |
| 1172 |
|
//if ( xpos > letmax-2 && xpos < letmax+1 && heavytail ) eyy[numpo] /= 7.; |
| 1173 |
|
if ( xpos < 3. && heavytail ) eyy[numpo] /= 5.; |
| 1174 |
|
numpo++; |
| 1175 |
|
// th->Fill(xpos,enemip); |
| 1176 |
|
if ( debug ) printf(" AVE Filling: st %i xpos %f energy %f error %f letmax %f lmpith %f \n",st,xpos,enemip,eyy[numpo-1],letmax,lmipth); |
| 1177 |
}; |
}; |
| 1178 |
} else { |
} else { |
| 1179 |
if ( st == mmin ){ |
for (Int_t jj=0; jj<2; jj++){ |
| 1180 |
if ( !maskYE ){ |
if ( st > mmin && st < mmax ){ |
| 1181 |
enemip = 2. * eplane[1][st]; |
if ( jj == 0 && no18x && ( st == 18+1 || st == mask18b+1 )){ |
| 1182 |
|
enemip = eplane[1][st]; |
| 1183 |
|
} else { |
| 1184 |
|
if ( jj == 0 ){ |
| 1185 |
|
enemip = eplane[jj][st-1]; |
| 1186 |
|
} else { |
| 1187 |
|
enemip = eplane[jj][st]; |
| 1188 |
|
}; |
| 1189 |
|
}; |
| 1190 |
} else { |
} else { |
| 1191 |
enemip = eplane[1][st]; |
if ( st == mmin && jj == 1 ){ |
| 1192 |
|
enemip = eplane[jj][st]; |
| 1193 |
|
}; |
| 1194 |
|
if ( st == mmax && jj == 0){ |
| 1195 |
|
enemip = eplane[jj][st-1]; |
| 1196 |
|
}; |
| 1197 |
}; |
}; |
| 1198 |
}; |
// |
| 1199 |
if ( st == mmax ){ |
qtotparz += enemip; |
| 1200 |
if ( !maskXE ){ |
if ( enemip > emax ) emax = enemip; |
| 1201 |
enemip = 2. * eplane[0][st-1]; |
if ( enemip > 0. ){ |
| 1202 |
} else { |
xxx[numpo] = xpos; |
| 1203 |
enemip = eplane[0][st-1]; |
exx[numpo] = 0.1; |
| 1204 |
|
yyy[numpo] = enemip; |
| 1205 |
|
eyy[numpo] = sqrt(enemip*3.)+sqrt(5.); |
| 1206 |
|
if ( xpos > letmax && enemip > lmipth && heavytail ) eyy[numpo] = (sqrt(enemip*3.)+sqrt(5.))/numpo; |
| 1207 |
|
// eyy[numpo] = sqrt(enemip)/(st*0.95); |
| 1208 |
|
numpo++; |
| 1209 |
|
// th->Fill(xpos,enemip); |
| 1210 |
|
if ( debug ) printf(" XY Filling: st %i xpos %f energy %f \n",st,xpos,enemip); |
| 1211 |
}; |
}; |
| 1212 |
}; |
}; |
|
}; |
|
|
// |
|
|
qtotparz += enemip; |
|
|
if ( enemip > 0. ){ |
|
|
th->Fill(xpos,enemip); |
|
|
if ( debug ) printf(" Filling: st %i xpos %f energy %f \n",st,xpos,enemip); |
|
| 1213 |
}; |
}; |
| 1214 |
|
|
| 1215 |
// |
// |
| 1216 |
// for (Int_t v=1; v>=0;v--)// { |
// for (Int_t v=1; v>=0;v--)// { |
| 1217 |
// // |
// // |
| 1237 |
// }; |
// }; |
| 1238 |
}; |
}; |
| 1239 |
// |
// |
| 1240 |
TF1 *lfit = new TF1("lfit",ccurve,0.,xmax,3); |
// th = new TH2F(thid,thid,int(NC*1.5),-0.2,xmax); |
| 1241 |
|
th = new TH2F(thid,thid,1000,-0.2,xmax,1000,0.,emax*1.2); |
| 1242 |
|
gh = new TGraphErrors(numpo,xxx,yyy,exx,eyy); |
| 1243 |
|
TString fnam=Form("lfit%s",suf.Data()); |
| 1244 |
|
TF1 *lfit = dynamic_cast<TF1*>(gDirectory->FindObject(fnam)); |
| 1245 |
|
if ( lfit ) lfit->Delete(); |
| 1246 |
|
lfit = new TF1(fnam,ccurve,0.,xmax,3); |
| 1247 |
|
// if ( !lfit ){ |
| 1248 |
|
// lfit = new TF1(fnam,ccurve,0.,xmax,3); |
| 1249 |
|
// }; |
| 1250 |
|
// lfit->Clear(); |
| 1251 |
|
// lfit->SetName(fnam); |
| 1252 |
|
// lfit->SetRange(0.,xmax); |
| 1253 |
|
// lfit->Print(); |
| 1254 |
|
// |
| 1255 |
if ( debug ) printf("qtot %f qtotparz %f \n",clp->qtot,qtotparz); |
if ( debug ) printf("qtot %f qtotparz %f \n",clp->qtot,qtotparz); |
| 1256 |
E0 = qtotparz; |
E0 = qtotparz; |
| 1257 |
// E0 = clp->qtot; |
// E0 = clp->qtot; |
| 1262 |
// lfit->SetParLimits(0,0.,1000.); |
// lfit->SetParLimits(0,0.,1000.); |
| 1263 |
// lfit->SetParLimits(1,-1.,80.); |
// lfit->SetParLimits(1,-1.,80.); |
| 1264 |
// lfit->SetParLimits(2,-1.,10.); |
// lfit->SetParLimits(2,-1.,10.); |
| 1265 |
TString optio; |
// TString optio = "ROW"; // "RO" |
| 1266 |
|
TString optio = "RO"; // "RO" |
| 1267 |
if ( debug ){ |
if ( debug ){ |
| 1268 |
// optio = "MERBOV"; |
optio += "NV"; |
| 1269 |
// optio = "MEROV"; |
if ( draw ) optio += "V"; |
|
// optio = "EROV"; |
|
|
optio = "RNOV"; |
|
|
if ( draw ) optio = "ROV"; |
|
| 1270 |
} else { |
} else { |
| 1271 |
// optio = "MERNOQ"; |
optio += "NQ"; |
| 1272 |
// optio = "ERNOQ"; |
if ( draw ) optio += "Q"; |
|
optio = "RNOQ"; |
|
|
if ( draw ) optio = "ROQ"; |
|
| 1273 |
}; |
}; |
| 1274 |
// |
// |
| 1275 |
if ( debug ) printf(" OK, start the fitting procedure...\n"); |
if ( debug ) printf(" OK, start the fitting procedure... options: %s \n",optio.Data()); |
| 1276 |
// |
// |
| 1277 |
fitresult = th->Fit("lfit",optio); |
// fitresult = th->Fit("lfit",optio); |
| 1278 |
|
// lfit->Update(); |
| 1279 |
|
fitresult = gh->Fit("lfit",optio); |
| 1280 |
|
// fitresult = gh->Fit("lfit","ROQW"); |
| 1281 |
// |
// |
| 1282 |
if ( debug ) printf(" the fit is done! result: %i \n",fitresult); |
if ( debug ) printf(" the fit is done! result: %i \n",fitresult); |
| 1283 |
// |
// |
| 1298 |
asymm = -1.; |
asymm = -1.; |
| 1299 |
defE0 = -1.; |
defE0 = -1.; |
| 1300 |
} else { |
} else { |
| 1301 |
if ( slmax.MaybeRegexp() ) lmax = this->Evaluate(slmax,tmax); |
if ( slmax.MaybeRegexp() ) lmax = this->Evaluate(slmax,tmax,X0pl); |
| 1302 |
if ( sumax.MaybeRegexp() ) umax = this->Evaluate(sumax,tmax); |
if ( sumax.MaybeRegexp() ) umax = this->Evaluate(sumax,tmax,X0pl); |
| 1303 |
Int_t npp = 1000; |
Int_t npp = 1000; |
| 1304 |
double *xpp=new double[npp]; |
double *xpp=new double[npp]; |
| 1305 |
double *wpp=new double[npp]; |
double *wpp=new double[npp]; |
| 1321 |
delete w; |
delete w; |
| 1322 |
delete xp; |
delete xp; |
| 1323 |
delete wp; |
delete wp; |
| 1324 |
|
delete xpp; |
| 1325 |
|
delete wpp; |
| 1326 |
// Float_t i10max = lfit->Integral(0.,10.*tmax); |
// Float_t i10max = lfit->Integral(0.,10.*tmax); |
| 1327 |
if ( debug ) printf(" Integral: %f \n",i10max); |
if ( debug ) printf(" Integral: %f \n",i10max); |
| 1328 |
// |
// |
| 1356 |
// axis titles |
// axis titles |
| 1357 |
th->SetXTitle("Depth [X0]"); |
th->SetXTitle("Depth [X0]"); |
| 1358 |
th->SetYTitle("Energy [MIP]"); |
th->SetYTitle("Energy [MIP]"); |
| 1359 |
th->DrawCopy("Perror"); |
// th->DrawCopy("Perror"); |
| 1360 |
|
th->DrawCopy(); |
| 1361 |
|
gh->SetMarkerSize(1.); |
| 1362 |
|
gh->SetMarkerStyle(21); |
| 1363 |
|
// gh->SetMarkerColor(kRed); |
| 1364 |
|
gh->Draw("Psame"); |
| 1365 |
lfit->Draw("same"); |
lfit->Draw("same"); |
| 1366 |
tc->Modified(); |
tc->Modified(); |
| 1367 |
tc->Update(); |
tc->Update(); |
| 1373 |
if ( th ) th->Delete(); |
if ( th ) th->Delete(); |
| 1374 |
}; |
}; |
| 1375 |
// |
// |
| 1376 |
delete lfit; |
// gMinuit->SetPrintLevel(1); |
| 1377 |
|
// gMinuit->mnamin(); |
| 1378 |
|
// // gMinuit->mnfree(0); |
| 1379 |
|
// gMinuit->mncler(); |
| 1380 |
|
// gMinuit->mnrset(1); |
| 1381 |
|
// gMinuit->Delete(); |
| 1382 |
|
//ROOT::Math::Minimizer::Clear(); |
| 1383 |
|
// gMinuit->mnhelp("*"); |
| 1384 |
|
// |
| 1385 |
|
// delete lfit; |
| 1386 |
// |
// |
| 1387 |
}; |
}; |
| 1388 |
|
|
| 1411 |
// |
// |
| 1412 |
if ( maxv != -1 ){ |
if ( maxv != -1 ){ |
| 1413 |
for (Int_t v=minv; v<maxv;v++){ |
for (Int_t v=minv; v<maxv;v++){ |
| 1414 |
TString hid = Form("clongv%i",v); |
TString hid = Form("clongv%i%s",v,suf.Data()); |
| 1415 |
TCanvas *tc = dynamic_cast<TCanvas*>(gDirectory->FindObject(hid)); |
TCanvas *tc = dynamic_cast<TCanvas*>(gDirectory->FindObject(hid)); |
| 1416 |
if ( tc ){ |
if ( tc ){ |
| 1417 |
// tc->Clear(); |
// tc->Clear(); |
| 1419 |
tc = new TCanvas(hid,hid); |
tc = new TCanvas(hid,hid); |
| 1420 |
}; |
}; |
| 1421 |
// |
// |
| 1422 |
TString thid = Form("hlongv%i",v); |
TString thid = Form("hlongv%i%s",v,suf.Data()); |
| 1423 |
TH1F *th = dynamic_cast<TH1F*>(gDirectory->FindObject(thid)); |
TH1F *th = dynamic_cast<TH1F*>(gDirectory->FindObject(thid)); |
| 1424 |
if ( th ) th->Delete(); |
if ( th ) th->Delete(); |
| 1425 |
// th->Clear(); |
// th->Clear(); |
| 1438 |
}; |
}; |
| 1439 |
} else { |
} else { |
| 1440 |
// |
// |
| 1441 |
TString hid = Form("clongvyvx"); |
TString hid = Form("clongvyvx%s",suf.Data()); |
| 1442 |
TCanvas *tc = dynamic_cast<TCanvas*>(gDirectory->FindObject(hid)); |
TCanvas *tc = dynamic_cast<TCanvas*>(gDirectory->FindObject(hid)); |
| 1443 |
if ( tc ){ |
if ( tc ){ |
| 1444 |
} else { |
} else { |
| 1445 |
tc = new TCanvas(hid,hid); |
tc = new TCanvas(hid,hid); |
| 1446 |
}; |
}; |
| 1447 |
// |
// |
| 1448 |
TString thid = Form("hlongvyvx"); |
TString thid = Form("hlongvyvx%s",suf.Data()); |
| 1449 |
TH1F *th = dynamic_cast<TH1F*>(gDirectory->FindObject(thid)); |
TH1F *th = dynamic_cast<TH1F*>(gDirectory->FindObject(thid)); |
| 1450 |
if ( th ) th->Delete(); |
if ( th ) th->Delete(); |
| 1451 |
th = new TH1F(thid,thid,44,-0.5,43.5); |
th = new TH1F(thid,thid,44,-0.5,43.5); |