Changeset 4049


Ignore:
Timestamp:
05/11/04 16:44:53 (21 years ago)
Author:
aliu
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mtemp/mifae/macros/signal.C

    r3984 r4049  
    22//
    33//       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)
    55//
    66//                 Ester Aliu   <aliu@ifae.es>
     
    88//                 Javier Rico  <jrico@ifae.es>
    99////////////////////////////////////////////////////////////////////////////
    10 void signal(TString fname ="hillasCrab/falseSourceCrab20040215Derotate.root")
     10void signal(
     11TString fname ="hillasCrab/falseSourceCrab20040215.root",
     12TString psname ="kk.ps")
    1113{
    1214  Float_t excess;
     
    1416  Float_t array[2];
    1517 
    16   Int_t nbin2d = 5;
     18  Int_t nbin2d = 10;
    1719  Int_t ntotal = 2*nbin2d+1;
    1820 
    1921  Int_t nx = 0;
    2022  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 
    2230  TH2F *hsignif = new TH2F("hsignif","Significance", ntotal, -1.0, 1.0, ntotal, -1.0, 1.0);
    2331  TH2F *hexcess = new TH2F("hexcess","Excess", ntotal, -1.0, 1.0, ntotal, -1.0, 1.0);
     32 
    2433 
    2534  // loop on the histos and compute excess and significance
     
    3544          excess = array[0];
    3645          significance = array[1];
     46
    3747          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            }
    3958        }
    4059    }
    4160 
     61  cout << "The position of maximum significance is ( " << imax << " , " << jmax << " )" << endl;
     62  cout << "Excess: " << A << endl;
     63  cout << "Significance: " << B << endl;
    4264   
    4365  // 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);
    4584  myps.Range(15,15);
    4685  TCanvas *c2d = new TCanvas("c2d", "Matrices", 0, 0, 800,800); 
    4786  c2d->Divide(2,2);
    4887  gStyle->SetPalette(1);
    49   gStyle->SetOptStat(kFALSE);
    5088 
    5189  c2d->cd(1);
Note: See TracChangeset for help on using the changeset viewer.