Changeset 4049
- Timestamp:
- 05/11/04 16:44:53 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mtemp/mifae/macros/signal.C
r3984 r4049 2 2 // 3 3 // This macro makes the two-dimension plot of the False Source Method: 4 // root > .x signal.C(TString name )4 // root > .x signal.C(TString name, TString psname) 5 5 // 6 6 // Ester Aliu <aliu@ifae.es> … … 8 8 // Javier Rico <jrico@ifae.es> 9 9 //////////////////////////////////////////////////////////////////////////// 10 void signal(TString fname ="hillasCrab/falseSourceCrab20040215Derotate.root") 10 void signal( 11 TString fname ="hillasCrab/falseSourceCrab20040215.root", 12 TString psname ="kk.ps") 11 13 { 12 14 Float_t excess; … … 14 16 Float_t array[2]; 15 17 16 Int_t nbin2d = 5;18 Int_t nbin2d = 10; 17 19 Int_t ntotal = 2*nbin2d+1; 18 20 19 21 Int_t nx = 0; 20 22 Int_t ny = 0; 21 23 24 Float_t max = -10000; 25 Int_t imax; 26 Int_t jmax; 27 Float_t A ; 28 Float_t B; 29 22 30 TH2F *hsignif = new TH2F("hsignif","Significance", ntotal, -1.0, 1.0, ntotal, -1.0, 1.0); 23 31 TH2F *hexcess = new TH2F("hexcess","Excess", ntotal, -1.0, 1.0, ntotal, -1.0, 1.0); 32 24 33 25 34 // loop on the histos and compute excess and significance … … 35 44 excess = array[0]; 36 45 significance = array[1]; 46 37 47 hexcess->SetBinContent(nx, ny, excess); 38 hsignif->SetBinContent(nx, ny, significance); 48 hsignif->SetBinContent(nx, ny, significance); 49 50 if ( significance > max) 51 { 52 max = significance; 53 imax = i; 54 jmax = j; 55 A = excess; 56 B = significance; 57 } 39 58 } 40 59 } 41 60 61 cout << "The position of maximum significance is ( " << imax << " , " << jmax << " )" << endl; 62 cout << "Excess: " << A << endl; 63 cout << "Significance: " << B << endl; 42 64 43 65 // Plot 44 TPostScript myps("signal.ps",111); 66 gROOT->Reset(); 67 gStyle->SetCanvasColor(0); 68 gStyle->SetCanvasBorderMode(0); 69 gStyle->SetPadBorderMode(0); 70 gStyle->SetFrameBorderMode(0); 71 gStyle->SetOptTitle(0); 72 gStyle->SetTitleOffset(1.7,"y"); 73 gStyle->SetPadLeftMargin(0.15); 74 gStyle->SetOptStat(kFALSE); 75 gStyle->SetStatColor(0); 76 gStyle->SetStatBorderSize(1); 77 gStyle->SetStatW(0.2); 78 gStyle->SetStatH(0.1); 79 gStyle->SetStatX(0.9); 80 gStyle->SetStatY(0.9); 81 82 83 TPostScript myps(psname,111); 45 84 myps.Range(15,15); 46 85 TCanvas *c2d = new TCanvas("c2d", "Matrices", 0, 0, 800,800); 47 86 c2d->Divide(2,2); 48 87 gStyle->SetPalette(1); 49 gStyle->SetOptStat(kFALSE);50 88 51 89 c2d->cd(1);
Note:
See TracChangeset
for help on using the changeset viewer.