Index: /trunk/MagicSoft/Mars/mtemp/mifae/macros/signal.C
===================================================================
--- /trunk/MagicSoft/Mars/mtemp/mifae/macros/signal.C	(revision 4048)
+++ /trunk/MagicSoft/Mars/mtemp/mifae/macros/signal.C	(revision 4049)
@@ -2,5 +2,5 @@
 //
 //       This macro makes the two-dimension plot of the False Source Method:
-//        root > .x signal.C(TString name)
+//        root > .x signal.C(TString name, TString psname)
 //
 //                 Ester Aliu   <aliu@ifae.es>
@@ -8,5 +8,7 @@
 //                 Javier Rico  <jrico@ifae.es>
 ////////////////////////////////////////////////////////////////////////////
-void signal(TString fname ="hillasCrab/falseSourceCrab20040215Derotate.root")
+void signal(
+TString fname ="hillasCrab/falseSourceCrab20040215.root",
+TString psname ="kk.ps")
 {
   Float_t excess;
@@ -14,12 +16,19 @@
   Float_t array[2];
   
-  Int_t nbin2d = 5;
+  Int_t nbin2d = 10;
   Int_t ntotal = 2*nbin2d+1;
   
   Int_t nx = 0;
   Int_t ny = 0;
-    
+  
+  Float_t max = -10000;
+  Int_t imax;
+  Int_t jmax;
+  Float_t A ;
+  Float_t B;
+  
   TH2F *hsignif = new TH2F("hsignif","Significance", ntotal, -1.0, 1.0, ntotal, -1.0, 1.0);
   TH2F *hexcess = new TH2F("hexcess","Excess", ntotal, -1.0, 1.0, ntotal, -1.0, 1.0);
+  
   
   // loop on the histos and compute excess and significance
@@ -35,17 +44,46 @@
 	  excess = array[0];
 	  significance = array[1];
+
 	  hexcess->SetBinContent(nx, ny, excess);
-	  hsignif->SetBinContent(nx, ny, significance);	      
+	  hsignif->SetBinContent(nx, ny, significance);
+
+	  if ( significance > max)
+	    {
+	      max = significance;
+	      imax = i;
+	      jmax = j;
+	      A = excess;
+	      B = significance;
+	    }
 	}
     }
   
+  cout << "The position of maximum significance is ( " << imax << " , " << jmax << " )" << endl;
+  cout << "Excess: " << A << endl;
+  cout << "Significance: " << B << endl;
     
   // Plot 
-  TPostScript myps("signal.ps",111);
+  gROOT->Reset();
+  gStyle->SetCanvasColor(0);
+  gStyle->SetCanvasBorderMode(0);
+  gStyle->SetPadBorderMode(0);
+  gStyle->SetFrameBorderMode(0);
+  gStyle->SetOptTitle(0);
+  gStyle->SetTitleOffset(1.7,"y");
+  gStyle->SetPadLeftMargin(0.15);
+  gStyle->SetOptStat(kFALSE);
+  gStyle->SetStatColor(0);
+  gStyle->SetStatBorderSize(1);
+  gStyle->SetStatW(0.2);
+  gStyle->SetStatH(0.1);
+  gStyle->SetStatX(0.9);
+  gStyle->SetStatY(0.9);
+  
+
+  TPostScript myps(psname,111);
   myps.Range(15,15);
   TCanvas *c2d = new TCanvas("c2d", "Matrices", 0, 0, 800,800);  
   c2d->Divide(2,2);
   gStyle->SetPalette(1); 
-  gStyle->SetOptStat(kFALSE);
   
   c2d->cd(1);
