Changeset 1809 for trunk/MagicSoft/Mars/mhist/MHHadronness.cc
- Timestamp:
- 03/08/03 14:00:30 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MHHadronness.cc
r1668 r1809 235 235 } 236 236 237 return val1y - (val2y-val1y)/(val2x-val1x) * (val1x-0.5); 237 Float_t retValue; 238 if (val2x-val1x != 0.0) 239 retValue = val1y - (val2y-val1y)/(val2x-val1x) * (val1x-0.5); 240 else 241 retValue = 0.0; 242 243 return retValue; 238 244 } 239 245 … … 252 258 fQfac->Set(n); 253 259 254 const Stat_t sumg = fGhness->Integral(1, n+1); 255 const Stat_t sump = fPhness->Integral(1, n+1); 260 Stat_t sumg; 261 Stat_t sump; 262 263 sumg = fGhness->Integral(1, n); 264 sump = fPhness->Integral(1, n); 265 266 if (sumg == 0.0 || sump == 0.0) 267 { 268 *fLog << "MHHadronness::Finalize; sumg or sump is zero; sumg, sump = " 269 << sumg << ", " << sump << ". Cannot calculate hadronness" 270 << endl; 271 } 272 273 274 // Normalize photon distribution 275 Stat_t con; 276 if (sumg > 0.0) 277 for (Int_t i=1; i<=n; i++) 278 { 279 con = (fGhness->GetBinContent(i)) / sumg; 280 fGhness->SetBinContent(i, con); 281 } 282 283 // Normalize hadron distribution 284 if (sump > 0.0) 285 for (Int_t i=1; i<=n; i++) 286 { 287 con = (fPhness->GetBinContent(i)) / sump; 288 fPhness->SetBinContent(i, con); 289 } 290 291 // Calculate acceptances 292 sumg = fGhness->Integral(1, n); 293 sump = fPhness->Integral(1, n); 294 295 *fLog << "MHHadronness::Finalize; sumg, sump = " << sumg << ", " 296 << sump << endl; 256 297 257 298 Float_t max=0; … … 259 300 for (Int_t i=1; i<=n; i++) 260 301 { 261 const Stat_t ip = fPhness->Integral(1, i)/sump; 262 const Stat_t ig = fGhness->Integral(1, i)/sumg; 302 Stat_t ip; 303 if (sump != 0.0) 304 ip = fPhness->Integral(1, i)/sump; 305 else 306 ip = 0; 307 308 Stat_t ig; 309 if (sumg != 0.0) 310 ig = fGhness->Integral(1, i)/sumg; 311 else 312 ig = 0; 263 313 264 314 fIntPhness->SetBinContent(i, ip); … … 409 459 410 460 c.cd(1); 411 gStyle->SetOptStat(10);461 //gStyle->SetOptStat(10); 412 462 Getghness()->DrawCopy(); 413 463 Getphness()->SetLineColor(kRed); 414 464 Getphness()->DrawCopy("same"); 415 465 c.cd(2); 416 gStyle->SetOptStat(0);466 //gStyle->SetOptStat(0); 417 467 Getighness()->DrawCopy(); 418 468 Getiphness()->SetLineColor(kRed); … … 483 533 484 534 gPad->cd(1); 485 gStyle->SetOptStat(10);535 //gStyle->SetOptStat(10); 486 536 Getghness()->Draw(); 487 537 Getphness()->SetLineColor(kRed); 488 538 Getphness()->Draw("same"); 489 539 gPad->cd(2); 490 gStyle->SetOptStat(0);540 //gStyle->SetOptStat(0); 491 541 Getighness()->Draw(); 492 542 Getiphness()->SetLineColor(kRed);
Note:
See TracChangeset
for help on using the changeset viewer.