Changeset 6949 for trunk/MagicSoft/Mars/mhflux
- Timestamp:
- 04/18/05 10:35:54 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mhflux
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhflux/MAlphaFitter.cc
r6926 r6949 347 347 { 348 348 *fLog << "Result:" << endl; 349 *fLog << " - Significance 350 *fLog << " - Excess Events " << fEventsExcess << endl;351 *fLog << " - Signal Events " << fEventsSignal << endl;352 *fLog << " - Background Events " << fEventsBackground << endl;353 *fLog << " - Chi^2/ndf (Signal) " << fChiSqSignal << endl;354 *fLog << " - Chi^2/ndf (Background) " << fChiSqBg << endl;355 *fLog << " - Signal integrated 356 *fLog << " - Scale Factor (Off) " << fScaleFactor << endl;349 *fLog << " - Significance (Li/Ma) " << fSignificance << endl; 350 *fLog << " - Excess Events " << fEventsExcess << endl; 351 *fLog << " - Signal Events " << fEventsSignal << endl; 352 *fLog << " - Background Events " << fEventsBackground << endl; 353 *fLog << " - Chi^2/ndf (Signal) " << fChiSqSignal << endl; 354 *fLog << " - Chi^2/ndf (Background) " << fChiSqBg << endl; 355 *fLog << " - Signal integrated up to " << fIntegralMax << "°" << endl; 356 *fLog << " - Scale Factor (Off) " << fScaleFactor << endl; 357 357 } 358 358 } -
trunk/MagicSoft/Mars/mhflux/MAlphaFitter.h
r6892 r6949 86 86 87 87 void Clear(Option_t *o=""); 88 void Print(Option_t *o="") const; 88 void Print(Option_t *o="") const; //*MENU* 89 89 void Copy(TObject &o) const; 90 90 /* -
trunk/MagicSoft/Mars/mhflux/MHEffectiveOnTime.cc
r6283 r6949 660 660 { 661 661 TVirtualPad *p=gPad->GetPad(x+1)->GetPad(y+1); 662 if (!(st = (TPaveStats*)p->GetPrimitive("stats")))662 if (!(st = dynamic_cast<TPaveStats*>(p->GetPrimitive("stats")))) 663 663 continue; 664 664 -
trunk/MagicSoft/Mars/mhflux/MHEnergyEst.cc
r6932 r6949 36 36 37 37 #include <TLine.h> 38 #include <TCanvas.h> 38 #include <TCanvas.h> 39 #include <TStyle.h> 39 40 #include <TProfile.h> 41 #include <TPaveStats.h> 40 42 41 43 #include "MString.h" … … 78 80 fHResolution.SetDirectory(NULL); 79 81 fHResolution.SetName("EnergyRes"); 80 fHResolution.SetTitle("Histogram in \\ frac{\\Delta lg(E)}{lg(E_{mc})}vs E_{est} and E_{mc}");82 fHResolution.SetTitle("Histogram in \\Delta lg(E) vs E_{est} and E_{mc}"); 81 83 fHResolution.SetXTitle("E_{est} [GeV]"); 82 84 fHResolution.SetYTitle("E_{mc} [GeV]"); 83 fHResolution.SetZTitle(" \\frac{lg(E_{est}) - lg(E_{mc})}{lg(E_{mc})}");85 fHResolution.SetZTitle("lg(E_{est}) - lg(E_{mc})"); 84 86 85 87 fHImpact.SetDirectory(NULL); 86 88 fHImpact.SetName("Impact"); 87 fHImpact.SetTitle("\\ frac{\\Delta lg(E)}{lg(E)}vs Impact parameter");89 fHImpact.SetTitle("\\Delta lg(E) vs Impact parameter"); 88 90 fHImpact.SetXTitle("Impact parameter [m]"); 89 fHImpact.SetYTitle(" \\frac{lg(E_{est}) - lg(E_{mc})}{lg(E_{mc})}");91 fHImpact.SetYTitle("lg(E_{est}) - lg(E_{mc})"); 90 92 91 93 fHEnergy.Sumw2(); … … 147 149 148 150 fChisq = 0; 151 fBias = 0; 149 152 fHEnergy.Reset(); 150 153 fHImpact.Reset(); … … 164 167 const Double_t imp = fMatrix ? GetVal(1) : fMcEvt->GetImpact()/100; 165 168 const Double_t theta = fMatrix ? GetVal(2) : fMcEvt->GetTelescopeTheta()*TMath::RadToDeg(); 166 const Double_t res = (log10(eest)-log10(etru));///log10(etru);167 const Double_t resE 169 const Double_t res = log10(eest)-log10(etru);///log10(etru); 170 const Double_t resE = (eest-etru)/etru; 168 171 169 172 fHEnergy.Fill(eest, etru, theta, w); … … 171 174 fHImpact.Fill(imp, resE, w); 172 175 173 fChisq += res*res; 174 fBias += res; 176 //if (etru>125 && etru<750) 177 // return kCONTINUE; 178 179 // lg(N) = 4.3*lg(E)-6 180 // lg(N0) = 4.3*2.2-6 181 182 const Double_t n = 2; //pow(10, -4.3*(log10(etru)-2.2)); 183 184 fChisq += log10(etru)<2.2? res*res*n/2:res*res; 185 fBias += log10(etru)<2.2? res*sqrt(n/2):res; 175 186 176 187 return kTRUE; … … 192 203 void MHEnergyEst::Print(Option_t *o) const 193 204 { 205 const Double_t res = TMath::Sqrt(fChisq-fBias*fBias); 206 const Double_t resp = TMath::Power(10, res)-1; 207 const Double_t resm = 1-TMath::Power(10, -res); 208 209 if (TMath::IsNaN(res)) 210 { 211 *fLog << all << "MHEnergyEst::Print: ERROR - Resolution is NaN (not a number)." << endl; 212 return; 213 } 214 194 215 *fLog << all; 195 *fLog << "Mean log10(Energy) Resoltion: " << Form("%5.2f%%", TMath::Sqrt(fChisq-fBias*fBias)) << endl; 196 *fLog << "Mean log10(Energy) Bias: " << Form("%5.2f%%", fBias) << endl; 216 *fLog << "Mean log10(Energy) Resoltion: +/- " << Form("%4.2f", res) << endl; 217 *fLog << "Mean log10(Energy) Bias: " << Form("%+4.2f", fBias) << endl; 218 *fLog << "Asymmetric Energy Resoltion: +" << Form("%4.1f%%", resp*100) << " -" << Form("%4.1f%%", resm*100) << endl; 197 219 } 198 220 … … 246 268 247 269 pad->GetPad(1)->GetPad(2)->cd(2); 248 /*=*/fHResolution.ProjectionZ("Resolution"); 249 ///*h =*/ fHImpact.ProjectionX("Impact", -1, 9999, "e"); 270 hx = (TH1D*)fHResolution.ProjectionZ("Resolution"); 271 TPaveStats *stats = dynamic_cast<TPaveStats*>(hx->FindObject("stats")); 272 if (stats) 273 { 274 stats->SetBit(BIT(17)); // TStyle.cxx: kTakeStyle=BIT(17) 275 stats->SetX1NDC(0.63); 276 stats->SetY1NDC(0.68); 277 } 278 279 hx->Fit("gaus", "Q"); 280 gPad=NULL; 281 gStyle->SetOptFit(101); 250 282 } 251 283 } … … 325 357 // h1->Draw("Chistsame"); 326 358 327 return h 1;359 return h2; 328 360 } 329 361 … … 415 447 //h->SetXTitle("\\frac{lg(E_{est}) - lg(E_{mc})}{lg(E_{mc})}"); 416 448 h->SetYTitle("Counts"); 417 h->SetTitle("Distribution of \\Delta lg(E) / lg(E_{mc})");449 h->SetTitle("Distribution of \\Delta lg(E)"); 418 450 h->SetDirectory(NULL); 419 451 h->SetBit(kCanDelete); 420 452 h->GetXaxis()->SetRangeUser(-1.3, 1.3); 421 453 h->Draw(""); 454 //h->Fit("gaus"); 422 455 // ---------------------------------------- 423 456 … … 440 473 h = MakePlot(fHResolution, "zy"); 441 474 h->SetXTitle("E_{mc} [GeV]"); 442 h->SetYTitle(" \\frac{lg(E_{est}) - lg(E_{mc})}{lg(E_{mc})}");443 h->SetTitle("Energy resolution \\Delta lg(E) / lg(E)vs Monte Carlo energy E_{mc}");475 h->SetYTitle("lg(E_{est}) - lg(E_{mc})"); 476 h->SetTitle("Energy resolution \\Delta lg(E) vs Monte Carlo energy E_{mc}"); 444 477 h->SetMinimum(-1.3); 445 478 h->SetMaximum(1.3); … … 448 481 h = MakePlot(fHResolution, "zx"); 449 482 h->SetXTitle("E_{est} [GeV]"); 450 h->SetYTitle(" \\frac{lg(E_{est}) - lg(E_{mc})}{lg(E_{mc})}");451 h->SetTitle("Energy Resolution \\Delta lg(E) / lg(E)vs estimated Energy E_{est}");483 h->SetYTitle("lg(E_{est}) - lg(E_{mc})"); 484 h->SetTitle("Energy Resolution \\Delta lg(E) vs estimated Energy E_{est}"); 452 485 h->SetMinimum(-1.3); 453 486 h->SetMaximum(1.3);
Note:
See TracChangeset
for help on using the changeset viewer.