Changeset 7667 for trunk/MagicSoft/Mars/mjtrain
- Timestamp:
- 04/30/06 16:53:27 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mjtrain/MJTrainSeparation.cc
r7666 r7667 113 113 const Float_t s = gx->Integral(1, y+1); 114 114 const Float_t b = hx->Integral(1, y+1); 115 const Float_t sig1 = MMath::SignificanceLiMa Signed(s+b, b);116 const Float_t sig2 = s<1 ? 0 : MMath::SignificanceLiMa Signed(s+b, b)*TMath::Log10(s);115 const Float_t sig1 = MMath::SignificanceLiMa(s+b, b); 116 const Float_t sig2 = s<1 ? 0 : MMath::SignificanceLiMa(s+b, b)*TMath::Log10(s); 117 117 if (sig1>max1) 118 118 { … … 137 137 } 138 138 139 TGraph gr3; 140 TGraph gr4; 141 142 TH1 *hx = h.ProjectionY("H_py"); 143 TH1 *gx = g.ProjectionY("G_py"); 144 for (int y=0; y<ny; y++) 145 { 146 const Float_t s = gx->Integral(1, y+1); 147 const Float_t b = hx->Integral(1, y+1); 148 const Float_t sig1 = MMath::SignificanceLiMa(s+b, b); 149 const Float_t sig2 = s<1 ? 0 : MMath::SignificanceLiMa(s+b, b)*TMath::Log10(s); 150 151 gr3.SetPoint(y, h.GetYaxis()->GetBinLowEdge(y+2), sig1); 152 gr4.SetPoint(y, h.GetYaxis()->GetBinLowEdge(y+2), sig2); 153 } 154 delete hx; 155 delete gx; 156 139 157 TCanvas &c = fDisplay->AddTab("OptCut"); 158 c.SetBorderMode(0); 140 159 c.Divide(2,2); 141 160 … … 152 171 gr2.DrawClone("LP")->SetBit(kCanDelete); 153 172 173 c.cd(3); 174 gPad->SetBorderMode(0); 175 gPad->SetFrameBorderMode(0); 176 gr4.SetMarkerStyle(kFullDotMedium); 177 gr4.DrawClone("ALP")->SetBit(kCanDelete); 178 gr3.SetLineColor(kBlue); 179 gr3.SetMarkerStyle(kFullDotMedium); 180 gr3.DrawClone("LP")->SetBit(kCanDelete); 181 154 182 c.cd(2); 155 183 gPad->SetBorderMode(0); … … 304 332 } 305 333 306 *fLog << inf << "Found " << num << " background events in " << ontime << "s" << endl;307 308 334 return num/ontime; 309 335 } … … 382 408 if (data<n) 383 409 { 384 on = TMath::Nint(nummc*data/n); //(UInt_t)-1;410 on = TMath::Nint(nummc*data/n); 385 411 off = TMath::Nint(data); 386 412 *fLog << "Not enough data events available... scaling by " << data/n << endl; … … 405 431 *fLog << "Target number of MC events: " << fNumTrainOn << endl; 406 432 *fLog << "Target number of data events: " << fNumTrainOff << endl; 433 434 fNumTestOn = fNumTrainOn; 435 fNumTestOff = fNumTrainOff; 407 436 408 437 /* … … 548 577 *fLog << " * Gammas: " << numgammas << endl; 549 578 *fLog << " * Background: " << numbackgrnd << endl; 579 *fLog << endl; 580 *fLog << "Gamma/Background ratio:" << endl; 581 *fLog << " * Requested: " << (float)fNumTrainOn/fNumTrainOff << endl; 582 *fLog << " * Result: " << (float)numgammas/numbackgrnd << endl; 550 583 551 584 if (!fDataSetTest.IsValid()) … … 565 598 // ----- Setup histograms ----- 566 599 MBinning binsy(100, 0 , 1, "BinningMH3Y", "lin"); 567 MBinning binsx( 50, 10, 100000, "BinningMH3X", "log");600 MBinning binsx( 40, 10, 100000, "BinningMH3X", "log"); 568 601 569 602 plist.AddToList(&binsx); … … 599 632 600 633 MFEventSelector sel; 601 sel.SetNumSelectEvts(fNumTestO n);634 sel.SetNumSelectEvts(fNumTestOff); 602 635 603 636 MContinue c1(&sel); … … 622 655 623 656 // ----- Setup and run eventloop on background ----- 624 sel.SetNumSelectEvts(fNumTestO ff);657 sel.SetNumSelectEvts(fNumTestOn); 625 658 fillh0.ResetBit(MFillH::kDoNotDisplay); 626 659
Note:
See TracChangeset
for help on using the changeset viewer.