TExec & Axis Titles

Greetings,

I have a script where I invoked TExec and then drew ontop of this pad (See code below)
I do not see how to set titles once I invoke TExec. Can someone let me know what I am doing wrong.

For convenience I have put the issue at the bottom on the code provided.
Up_Stream.C (8.93 KB)
small.root (1.15 MB)

Happy New Year Rootr’s

Would like to resolve this issue of mine.

Happy new year too.
Can you make sure the macros you post here are running:

root [0] 
Processing Up_Stream.C...
Error in <TFile::TFile>: file /Volumes/Mac_Storage/YIELD/SINGLE_TRACK/YIELD_DATA/PRODUCTION/RUN_56515/Anal_Upstream0.root does not exist
Error: Non-static-const variable in array dimension Up_Stream.C:95:
 (cint allows this only in interactive command and special form macro which
  is special extension. It is not allowed in source code. Please ignore
  subsequent errors.)
Error: Non-static-const variable in array dimension Up_Stream.C:95:
 (cint allows this only in interactive command and special form macro which
  is special extension. It is not allowed in source code. Please ignore
  subsequent errors.)
*** Interpreter error recovered ***

It will save time and help us a lot … thanks…

Very strange, because it compiles fine on my machine.

Mike-Kunkels-MacBook:Desktop Mike$ root -b Up_Stream.C+
  *******************************************
  *                                         *
  *        W E L C O M E  to  R O O T       *
  *                                         *
  *   Version   5.30/00      27 June 2011   *
  *                                         *
  *  You are welcome to visit our Web site  *
  *          http://root.cern.ch            *
  *                                         *
  *******************************************

ROOT 5.30/00 (tags/v5-30-00@40062, Jun 28 2011, 11:49:57 on macosx64)

CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0] 
Processing Up_Stream.C+...
Info in <TUnixSystem::ACLiC>: creating shared library /Users/Mike/Desktop/./Up_Stream_C.so
done 0 out of 372500 ==> 0%
done 100000 out of 372500 ==> 26.8456%
done 200000 out of 372500 ==> 53.6913%
done 300000 out of 372500 ==> 80.5369%

If you go to line 40 and 41 and comment out / comment in

chain->Add("/Volumes/Mac_Storage/YIELD/SINGLE_TRACK/YIELD_DATA/PRODUCTION/RUN_56515/Anal_Upstream0.root"); //chain->Add("small.root");

The code should run with the given sample data I provided.

That’s what I meant, your macro had the wrong line commented out. I was just making the point that it’s better to check before posting …

Ok now I get:

Error: Non-static-const variable in array dimension Up_Stream.C:93:
 (cint allows this only in interactive command and special form macro which
  is special extension. It is not allowed in source code. Please ignore
  subsequent errors.)
Error: Non-static-const variable in array dimension Up_Stream.C:93:
 (cint allows this only in interactive command and special form macro which
  is special extension. It is not allowed in source code. Please ignore
  subsequent errors.)

so it is enough to do:

  const Int_t pt_xnbin = 12;
  const Int_t pt_ynbin = 24;

That is strange as well, as I cannot reproduce that error message.
As far as my machine is concerned, the code and data file run as is and still cannot produce titles when invoking TExec.

What can I do on my end?

I have made the minor changes and uploaded the code.
Up_Stream.C (8.95 KB)

Your new macro does not work for me… it seems to enter an endless loop and doesn’t show
anything. Can you post a working one ?

The code I posted works for me. I do not know how to post a working one when the one I posted works.

Ok my fault… sorry …

Does it work for you?
I am very curious on why my machine does not produce errors like it does when it is run by others.

yes yes now it is fine … a stupid mistake of my …
I am now looking at the macro

Instead of just doing DrawFrame() Do something like:

   TH1F *fr1 = gPad->DrawFrame(pt_xlo,pt_ylo,pt_xup,pt_yup); ex1->Draw();
   fr1->GetXaxis()->SetTitle("XXXXX");
   fr1->GetYaxis()->SetTitle("YYYYY");

Thank you very much.