Issues accessing array from tree

I downloaded the binary root_v5.34.36.win32.vc12.exe , I have had to build the test directory seperately in order for some data types to work, however. It was installed just by running the application and selecting install directory etc…

This also looks weird. It seems you are mixing different environments… I don’t see how I can help you with your installation, it should really work out of the box (and it does).
Please try to clean-up your environment, forget about Cygwin (why do you need it anyway ?), and try with a fresh binary version of ROOT, taken from a tar (zip) file (and not from an installer), and use it in an isolated environment (limited PATH). Good luck with that. And then, you’ll have to fix your code… (but you can also fix it on Linux)

I have managed to debug the code on my University SL6 system, at least get it to compile, just need to look up more examples of extracting data from trees now! I only use cygwin for SSH accesss so I can access files on the University network from home (and probably run root remotely, come to think of it). Given properly compilable code, the macro should work correctly on my windows machine, even if ACLiC doesn’t, right?

Right. Once it runs (and not only compile) properly on Linux, you can use it on Windows. But still, I would recommend to fix the problems on your Windows machine, I would not trust something with a behavior such as you described…

So it turns out the linux machines do not have the test directory properly built in order to create event objects (surprising for one of the largest HEP departments in the UK) but will speak to the sysadmin tomorrow. Another strange thing that appears in my code is when, out of curiosity I decided to print out some memory addresses of assorted objects/variables in my code with

int* x= &Thit; int*y= &eventhit; int*z=&arrayindex;
	cout<<x <<"	"<<y<<"	"<<z<<endl;   

the values returned are all 1, which, assuming I’m using pointers correctly is complete nonsense- I’d at least expect them to be hex values. Could this be related to the dodgy installation? Would also explain why root crashes when I try and use any access operators on Thit. [quote=“bellenot, post:22, topic:24172”]
Please try to clean-up your environment, forget about Cygwin (why do you need it anyway ?), and try with a fresh binary version of ROOT, taken from a tar (zip) file (and not from an installer), and use it in an isolated environment (limited PATH). Good luck with that. And then, you’ll have to fix your code… (but you can also fix it on Linux)
[/quote]
Sorry I’m very much a novice programmer, does this (isolated environment) entail opening the code in visual studio and compiling, or also deleting uneccesary path variables (removing windows definition of %ROOTSYS% etc?).

Well, no, nothing to do with Visual Studio. But if you’re novice in programming and in using the command prompt and setting the environment variables on Windows, then I think you should simply try on Linux…

Bertand is right, I think you should really run on linux using the compiled execution of your macro (we call this the ACLIC mode). Then you will start debugging your problem. Your initial question was not on how to install ROOT on Windows but it was related to TTree … better concentrate on that.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.