From 51ec15193dd90d10a95020132cc4b199eb74fe6d Mon Sep 17 00:00:00 2001
From: Nicolas de Sereville <deserevi@ipno.in2p3.fr>
Date: Fri, 11 Dec 2015 20:54:00 +0100
Subject: [PATCH] + Update README file

---
 Benchmarks/cats/README.txt     |  6 ++----
 Benchmarks/cats/ShowResult.C   | 38 ++++++++++++++++++++++++++++++++++
 Benchmarks/cats/ShowResult.cxx | 30 ---------------------------
 3 files changed, 40 insertions(+), 34 deletions(-)
 create mode 100644 Benchmarks/cats/ShowResult.C
 delete mode 100644 Benchmarks/cats/ShowResult.cxx

diff --git a/Benchmarks/cats/README.txt b/Benchmarks/cats/README.txt
index 2b3ad4ca4..714df721e 100644
--- a/Benchmarks/cats/README.txt
+++ b/Benchmarks/cats/README.txt
@@ -1,7 +1,5 @@
 1. Type the following command line to execute the benchmark:
-  npanalysis -D benchmark_cats.detector -R RunToTreat.txt -C calibration.txt
+  npanalysis -D benchmark_cats.detector -C calibration.txt -R RunToTreat.txt -O benchmark_cats
 
-2. To see the results of the analysis, launch root and execute the macro ShowResult.C
+2. To see the results of the analysis and a comparison with a reference, do:
   .x ShowResult.C
-
-3. You can compare the results of the benchmark with the reference figure ResultBenchmark.png
diff --git a/Benchmarks/cats/ShowResult.C b/Benchmarks/cats/ShowResult.C
new file mode 100644
index 000000000..607030c81
--- /dev/null
+++ b/Benchmarks/cats/ShowResult.C
@@ -0,0 +1,38 @@
+TChain* chain=NULL;
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+void ShowResult()
+{
+   // load chain from resul
+   LoadChain();
+
+   // draw canvas
+   TCanvas *c1 = new TCanvas("Mask CATS E644 experiment", "Mask CATS E644 experiment", 1200, 600);
+   c1->Divide(2,1);
+   c1->Draw();
+
+   // draw results from benchmark
+   c1->cd(1);
+   chain->Draw("PositionY[0]:PositionX[0]>>h(600,-30,30,600,-30,30)", "", "colz");
+   TLatex *texO = new TLatex(-17.5, 22, "Obtained");
+   texO->Draw();
+
+   // draw results from reference result
+   c1->cd(2);
+   TFile* ref = new TFile("reference.root", "READ");
+   TH2* href = (TH2*) ref->FindObjectAny("href");
+   href->Draw("colz");
+   TLatex *texR = new TLatex(-17.5,22, "Reference");
+   texR->Draw();
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+void LoadChain()
+{
+    chain = new TChain("PhysicsTree");
+    chain->Add("../../Outputs/Analysis/benchmark_cats.root");
+}
diff --git a/Benchmarks/cats/ShowResult.cxx b/Benchmarks/cats/ShowResult.cxx
deleted file mode 100644
index 7609299df..000000000
--- a/Benchmarks/cats/ShowResult.cxx
+++ /dev/null
@@ -1,30 +0,0 @@
-TChain* chain=NULL;
-TCanvas* c1=NULL;
-void LoadChain();
-
-void ShowResult()
-{
-    LoadChain();
-    c1 = new TCanvas("Mask CATS E644 experiment","Mask CATS E644 experiment",1200,600);
-    c1->Divide(2,1);
-    c1->cd(1);
-    // Y versus X for CATS1 detector
-    chain->Draw("PositionY[0]:PositionX[0]>>h(600,-30,30,600,-30,30)","","colz");
-    TLatex *   texO = new TLatex(-17.5,22,"Obtained");
-    texO->Draw();
-    
-    c1->cd(2);
-    TFile* ref = new TFile("reference.root","READ");
-    TH2* href = (TH2*) ref->FindObjectAny("href");
-    href->Draw("colz");
-    TLatex *   texR = new TLatex(-17.5,22,"Reference");
-    texR->Draw();
-    
-}
-
-
-////////////////////////////////////////////////////////////////////////////////
-void LoadChain(){
-    chain = new TChain("PhysicsTree");
-    chain->Add("../../Outputs/Analysis/benchmark_cats.root");
-}
-- 
GitLab