| 283 |
// |
// |
| 284 |
suf = ""; |
suf = ""; |
| 285 |
debug = false; |
debug = false; |
| 286 |
|
usepl18x = false; |
| 287 |
// |
// |
| 288 |
}; |
}; |
| 289 |
|
|
| 301 |
// |
// |
| 302 |
suf = ""; |
suf = ""; |
| 303 |
debug = false; |
debug = false; |
| 304 |
|
usepl18x = false; |
| 305 |
// |
// |
| 306 |
}; |
}; |
| 307 |
|
|
| 529 |
// |
// |
| 530 |
for (Int_t i=0; i<L2->GetCaloLevel1()->istrip ; i++){ |
for (Int_t i=0; i<L2->GetCaloLevel1()->istrip ; i++){ |
| 531 |
mip1 = L2->GetCaloLevel1()->DecodeEstrip(i,view1,plane1,strip1); |
mip1 = L2->GetCaloLevel1()->DecodeEstrip(i,view1,plane1,strip1); |
| 532 |
|
// |
| 533 |
|
if ( !usepl18x && view1==0 && plane1==18 ) mip1 = 0.; |
| 534 |
|
// |
| 535 |
estrip[view1][plane1][strip1] = mip1; |
estrip[view1][plane1][strip1] = mip1; |
| 536 |
}; |
}; |
| 537 |
// |
// |
| 579 |
// |
// |
| 580 |
for (Int_t i=0; i<L2->GetCaloLevel1()->istrip ; i++){ |
for (Int_t i=0; i<L2->GetCaloLevel1()->istrip ; i++){ |
| 581 |
mip1 = L2->GetCaloLevel1()->DecodeEstrip(i,view1,plane1,strip1); |
mip1 = L2->GetCaloLevel1()->DecodeEstrip(i,view1,plane1,strip1); |
| 582 |
|
// |
| 583 |
|
if ( !usepl18x && view1==0 && plane1==18 ) mip1 = 0.; |
| 584 |
|
// |
| 585 |
es[view1][plane1][strip1] = mip1; |
es[view1][plane1][strip1] = mip1; |
| 586 |
}; |
}; |
| 587 |
// |
// |
| 671 |
mask18b = -1; |
mask18b = -1; |
| 672 |
// |
// |
| 673 |
no18x = true; |
no18x = true; |
| 674 |
|
usepl18x = !no18x; |
| 675 |
debug = false; |
debug = false; |
| 676 |
maskXE = false; |
maskXE = false; |
| 677 |
maskXO = false; |
maskXO = false; |
| 687 |
// |
// |
| 688 |
letmax = -1; |
letmax = -1; |
| 689 |
heavytail = false; |
heavytail = false; |
| 690 |
lmipth = 100.; |
// lmipth = 100.; |
| 691 |
|
lmipth = 0.; |
| 692 |
// |
// |
| 693 |
}; |
}; |
| 694 |
|
|
| 714 |
|
|
| 715 |
void CaloLong::Clear(){ |
void CaloLong::Clear(){ |
| 716 |
// |
// |
| 717 |
|
if ( debug ) printf(" Clear called \n"); |
| 718 |
|
// |
| 719 |
memset(eplane,0, 2*22*sizeof(Float_t)); |
memset(eplane,0, 2*22*sizeof(Float_t)); |
| 720 |
// |
// |
| 721 |
chi2 = 0.; |
chi2 = 0.; |
| 858 |
Bool_t gof = true; |
Bool_t gof = true; |
| 859 |
for (Int_t i=0; i < L2->GetCaloLevel1()->istrip; i++){ |
for (Int_t i=0; i < L2->GetCaloLevel1()->istrip; i++){ |
| 860 |
mip = L2->GetCaloLevel1()->DecodeEstrip(i,view,plane,strip); |
mip = L2->GetCaloLevel1()->DecodeEstrip(i,view,plane,strip); |
| 861 |
|
// |
| 862 |
|
if ( !usepl18x && view==0 && plane==18 ) mip = 0.; |
| 863 |
|
// |
| 864 |
gof = true; |
gof = true; |
| 865 |
if ( maskXE && (plane%2)==0 && view==1 ) gof = false; |
if ( maskXE && (plane%2)==0 && view==1 ) gof = false; |
| 866 |
if ( maskXO && (plane%2)!=0 && view==1 ) gof = false; |
if ( maskXO && (plane%2)!=0 && view==1 ) gof = false; |
| 871 |
// |
// |
| 872 |
// inclination factor (stolen from Daniele's code) |
// inclination factor (stolen from Daniele's code) |
| 873 |
// |
// |
| 874 |
Float_t ytgx = 0; |
Float_t ytgx = 0.; |
| 875 |
Float_t ytgy = 0; |
Float_t ytgy = 0.; |
| 876 |
ytgx = 0.76 * clp->tanx[0]; |
ytgx = 0.76 * clp->tanx[0]; |
| 877 |
ytgy = 0.76 * clp->tany[0]; |
ytgy = 0.76 * clp->tany[0]; |
| 878 |
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 |
}; |
}; |
| 967 |
}; |
}; |
| 968 |
// |
// |
| 969 |
|
if ( !clp && debug ) printf(" ERROR!! no CaloLevel2 obj!!\n"); |
| 970 |
|
// |
| 971 |
// inclination factor (stolen from Daniele's code) |
// inclination factor (stolen from Daniele's code) |
| 972 |
// |
// |
| 973 |
Float_t ytgx = 0; |
Float_t ytgx = 0.; |
| 974 |
Float_t ytgy = 0; |
Float_t ytgy = 0.; |
| 975 |
ytgx = 0.76 * clp->tanx[0]; |
ytgx = 0.76 * clp->tanx[0]; |
| 976 |
ytgy = 0.76 * clp->tany[0]; |
ytgy = 0.76 * clp->tany[0]; |
| 977 |
X0pl = sqrt( pow(0.76,2.) + pow(ytgx,2.) + pow(ytgy,2.) ); |
X0pl = sqrt( pow(0.76,2.) + pow(ytgx,2.) + pow(ytgy,2.) ); |
| 978 |
|
if ( debug ) printf(" X0pl %f tanx %f tany %f \n",X0pl,ytgx,ytgy); |
| 979 |
// |
// |
| 980 |
// Find experimental plane of maximum |
// Find experimental plane of maximum |
| 981 |
// |
// |
| 996 |
// |
// |
| 997 |
if ( vmax == 0 ) pmax++; |
if ( vmax == 0 ) pmax++; |
| 998 |
etmax = pmax * X0pl; |
etmax = pmax * X0pl; |
| 999 |
if ( letmax < 0. ) letmax = etmax; |
letmax = etmax; |
| 1000 |
// |
// |
| 1001 |
if ( debug ) this->Print(); |
if ( debug ) this->Print(); |
| 1002 |
if ( debug ) printf(" exit \n"); |
if ( debug ) printf(" exit \n"); |
| 1178 |
exx[numpo] = 0.1; |
exx[numpo] = 0.1; |
| 1179 |
yyy[numpo] = enemip; |
yyy[numpo] = enemip; |
| 1180 |
eyy[numpo] = sqrt(enemip*3.)+sqrt(5.); |
eyy[numpo] = sqrt(enemip*3.)+sqrt(5.); |
| 1181 |
if ( xpos > letmax && enemip > lmipth && heavytail) eyy[numpo] = (sqrt(enemip*3.)+sqrt(5.))/numpo; |
//if ( xpos > letmax && enemip > lmipth && heavytail) eyy[numpo] = (sqrt(enemip*3.)+sqrt(5.))/numpo; |
| 1182 |
|
if ( xpos > letmax && enemip > lmipth && heavytail) eyy[numpo] = sqrt(enemip)/5.; |
| 1183 |
|
if ( xpos > letmax-1 && xpos < letmax+1 && heavytail ) eyy[numpo] /= 5.; |
| 1184 |
|
//if ( xpos > letmax-2 && xpos < letmax+1 && heavytail ) eyy[numpo] /= 7.; |
| 1185 |
|
if ( xpos < 3. && heavytail ) eyy[numpo] /= 5.; |
| 1186 |
numpo++; |
numpo++; |
| 1187 |
// th->Fill(xpos,enemip); |
// th->Fill(xpos,enemip); |
| 1188 |
if ( debug ) printf(" AVE Filling: st %i xpos %f energy %f \n",st,xpos,enemip); |
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); |
| 1189 |
}; |
}; |
| 1190 |
} else { |
} else { |
| 1191 |
for (Int_t jj=0; jj<2; jj++){ |
for (Int_t jj=0; jj<2; jj++){ |
| 1215 |
exx[numpo] = 0.1; |
exx[numpo] = 0.1; |
| 1216 |
yyy[numpo] = enemip; |
yyy[numpo] = enemip; |
| 1217 |
eyy[numpo] = sqrt(enemip*3.)+sqrt(5.); |
eyy[numpo] = sqrt(enemip*3.)+sqrt(5.); |
| 1218 |
if ( xpos > letmax && enemip > lmipth && heavytail ) eyy[numpo] = (sqrt(enemip*3.)+sqrt(5.))/numpo; |
//if ( xpos > letmax && enemip > lmipth && heavytail) eyy[numpo] = (sqrt(enemip*3.)+sqrt(5.))/numpo; |
| 1219 |
|
//if ( xpos > letmax && enemip > lmipth && heavytail ) eyy[numpo] = (sqrt(enemip*3.)+sqrt(5.))/numpo; |
| 1220 |
|
if ( xpos > letmax && enemip > lmipth && heavytail) eyy[numpo] = sqrt(enemip)/5.; |
| 1221 |
|
if ( xpos > letmax-1 && xpos < letmax+1 && heavytail ) eyy[numpo] /= 5.; |
| 1222 |
|
//if ( xpos > letmax-2 && xpos < letmax+1 && heavytail ) eyy[numpo] /= 7.; |
| 1223 |
|
if ( xpos < 3. && heavytail ) eyy[numpo] /= 5.; |
| 1224 |
// eyy[numpo] = sqrt(enemip)/(st*0.95); |
// eyy[numpo] = sqrt(enemip)/(st*0.95); |
| 1225 |
numpo++; |
numpo++; |
| 1226 |
// th->Fill(xpos,enemip); |
// th->Fill(xpos,enemip); |
| 1261 |
TF1 *lfit = dynamic_cast<TF1*>(gDirectory->FindObject(fnam)); |
TF1 *lfit = dynamic_cast<TF1*>(gDirectory->FindObject(fnam)); |
| 1262 |
if ( lfit ) lfit->Delete(); |
if ( lfit ) lfit->Delete(); |
| 1263 |
lfit = new TF1(fnam,ccurve,0.,xmax,3); |
lfit = new TF1(fnam,ccurve,0.,xmax,3); |
| 1264 |
|
// if ( !lfit ){ |
| 1265 |
|
// lfit = new TF1(fnam,ccurve,0.,xmax,3); |
| 1266 |
|
// }; |
| 1267 |
|
// lfit->Clear(); |
| 1268 |
|
// lfit->SetName(fnam); |
| 1269 |
|
// lfit->SetRange(0.,xmax); |
| 1270 |
|
// lfit->Print(); |
| 1271 |
|
// |
| 1272 |
if ( debug ) printf("qtot %f qtotparz %f \n",clp->qtot,qtotparz); |
if ( debug ) printf("qtot %f qtotparz %f \n",clp->qtot,qtotparz); |
| 1273 |
E0 = qtotparz; |
E0 = qtotparz; |
| 1274 |
// E0 = clp->qtot; |
// E0 = clp->qtot; |
| 1292 |
if ( debug ) printf(" OK, start the fitting procedure... options: %s \n",optio.Data()); |
if ( debug ) printf(" OK, start the fitting procedure... options: %s \n",optio.Data()); |
| 1293 |
// |
// |
| 1294 |
// fitresult = th->Fit("lfit",optio); |
// fitresult = th->Fit("lfit",optio); |
| 1295 |
|
// lfit->Update(); |
| 1296 |
fitresult = gh->Fit("lfit",optio); |
fitresult = gh->Fit("lfit",optio); |
| 1297 |
|
// fitresult = gh->Fit("lfit","ROQW"); |
| 1298 |
// |
// |
| 1299 |
if ( debug ) printf(" the fit is done! result: %i \n",fitresult); |
if ( debug ) printf(" the fit is done! result: %i \n",fitresult); |
| 1300 |
// |
// |
| 1338 |
delete w; |
delete w; |
| 1339 |
delete xp; |
delete xp; |
| 1340 |
delete wp; |
delete wp; |
| 1341 |
|
delete xpp; |
| 1342 |
|
delete wpp; |
| 1343 |
// Float_t i10max = lfit->Integral(0.,10.*tmax); |
// Float_t i10max = lfit->Integral(0.,10.*tmax); |
| 1344 |
if ( debug ) printf(" Integral: %f \n",i10max); |
if ( debug ) printf(" Integral: %f \n",i10max); |
| 1345 |
// |
// |
| 1390 |
if ( th ) th->Delete(); |
if ( th ) th->Delete(); |
| 1391 |
}; |
}; |
| 1392 |
// |
// |
| 1393 |
|
// gMinuit->SetPrintLevel(1); |
| 1394 |
|
// gMinuit->mnamin(); |
| 1395 |
|
// // gMinuit->mnfree(0); |
| 1396 |
|
// gMinuit->mncler(); |
| 1397 |
|
// gMinuit->mnrset(1); |
| 1398 |
|
// gMinuit->Delete(); |
| 1399 |
|
//ROOT::Math::Minimizer::Clear(); |
| 1400 |
|
// gMinuit->mnhelp("*"); |
| 1401 |
|
// |
| 1402 |
// delete lfit; |
// delete lfit; |
| 1403 |
// |
// |
| 1404 |
}; |
}; |