| 678 |
// |
// |
| 679 |
letmax = -1; |
letmax = -1; |
| 680 |
heavytail = false; |
heavytail = false; |
| 681 |
lmipth = 100.; |
// 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 |
if ( letmax < 0. ) letmax = etmax; |
letmax = etmax; |
| 988 |
// |
// |
| 989 |
if ( debug ) this->Print(); |
if ( debug ) this->Print(); |
| 990 |
if ( debug ) printf(" exit \n"); |
if ( debug ) printf(" exit \n"); |
| 1166 |
exx[numpo] = 0.1; |
exx[numpo] = 0.1; |
| 1167 |
yyy[numpo] = enemip; |
yyy[numpo] = enemip; |
| 1168 |
eyy[numpo] = sqrt(enemip*3.)+sqrt(5.); |
eyy[numpo] = sqrt(enemip*3.)+sqrt(5.); |
| 1169 |
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; |
| 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++; |
numpo++; |
| 1175 |
// th->Fill(xpos,enemip); |
// th->Fill(xpos,enemip); |
| 1176 |
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); |
| 1177 |
}; |
}; |
| 1178 |
} else { |
} else { |
| 1179 |
for (Int_t jj=0; jj<2; jj++){ |
for (Int_t jj=0; jj<2; jj++){ |
| 1244 |
TF1 *lfit = dynamic_cast<TF1*>(gDirectory->FindObject(fnam)); |
TF1 *lfit = dynamic_cast<TF1*>(gDirectory->FindObject(fnam)); |
| 1245 |
if ( lfit ) lfit->Delete(); |
if ( lfit ) lfit->Delete(); |
| 1246 |
lfit = new TF1(fnam,ccurve,0.,xmax,3); |
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; |
| 1275 |
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()); |
| 1276 |
// |
// |
| 1277 |
// fitresult = th->Fit("lfit",optio); |
// fitresult = th->Fit("lfit",optio); |
| 1278 |
|
// lfit->Update(); |
| 1279 |
fitresult = gh->Fit("lfit",optio); |
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 |
// |
// |
| 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 |
// |
// |
| 1373 |
if ( th ) th->Delete(); |
if ( th ) th->Delete(); |
| 1374 |
}; |
}; |
| 1375 |
// |
// |
| 1376 |
|
// 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; |
// delete lfit; |
| 1386 |
// |
// |
| 1387 |
}; |
}; |