Hello,
I recently have had problems running ROOT on my Windows Vista Computer. I changed the MyClass script to fill a histogram using a .root data file. When I ran it on my computer, ROOT crashed, but when my Prof ran it on his computer it worked.
So I looked into why this might be - and it appears that I should install a Linux environment onto my laptop so I can run ROOT from Xterm. I tried downloading MobaXterm and Cygwin but I haven’t been able to start ROOT successfully.
Any help relating to this matter would be very much appreciated!
David
Hi David,
No, you don’t need any Linux environment to run Root on Windows. The default is native (win32).
What kind of crash did you get?
Cheers, Bertrand.
I load my script and run it by typing in:
root[] .L myScript.C
root[] myScript t
root[] t.Loop();
And I get the notification:
“ROOT application root has stopped working … close application”
Thanks for replying! I’d appreciate if you could tell me if I am doing something wrong.
This is my code for myScript. It uses a .root data file to fill a histogram:
#define myScript_cxx
#include “myScript.h”
#include <TH2.h>
#include <TStyle.h>
#include <TCanvas.h>
void myScript::Loop()
{
// In a ROOT session, you can do:
// Root > .L myScript.C
// Root > myScript t
// Root > t.GetEntry(12); // Fill t data members with entry number 12
// Root > t.Show(); // Show values of entry 12
// Root > t.Show(16); // Read and show values of entry 16
// Root > t.Loop(); // Loop on all entries
if (fChain == 0) return;
Long64_t nentries = Long64_t(fChain->GetEntriesFast());
TH1F *myHisto;
myHisto= new TH1F(“myHisto”,“fPx”,100,-5,5);
Long64_t nbytes = 0, nb = 0;
for (Long64_t jentry=0; jentry<nentries;jentry++) {
GetEntry(jentry);
Long64_t ientry = LoadTree(jentry);
if (ientry < 0) break;
nb = fChain->GetEntry(jentry); nbytes += nb;
// if (Cut(ientry) < 0) continue;
for (Int_t j=0; j<100; j++) {
myHisto->Fill(Ptll01);
}
}
myHisto->Draw();
}
Hi David,
I’m afraid there is not enough information… I don’t know what your class looks like. For example, what are doing the GetEntry(jentry) and LoadTree(jentry) methods?
And what is this code doing?
for (Int_t j=0; j<100; j++) {
myHisto->Fill(Ptll01);
}
Filling 100 times the histogram with the same value? And what is Ptll01?
To make it short, please post running piece code allowing us to reproduce the problem.
And BTW, which version of ROOT did you download? (which tar - or msi - file)
Are you able to properly run the ROOT tutorials?
Cheers, Bertrand.
And ya I’m not sure about that code now that you mention it hahaha, although it did work on my profs computer!
Ya I downloaded the VC++9 MSI version. I can run the demos fine, although it did crash once while running them. I’ll get back to you about the tutorials.
Thanks again