GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » Scientific Computing » ROOT » works interactively but not in a macro
Re: works interactively but not in a macro [message #4760 is a reply to message #4684] Sun, 29 July 2007 10:36 Go to previous message
Ralf Kliemt is currently offline  Ralf Kliemt
Messages: 501
Registered: May 2007
Location: GSI, Darmstadt
first-grade participant

From: 141.30.239*
Hello Olaf,

I tried your macro and it runs.
{

partlist = TDatabasePDG::Instance();
TParticlePDG* part;
part = partlist->GetParticle("neutron");
Int_t mynumber = part->PdgCode();
std::cout<<mynumber<<std::endl;

}

I have root Version 5.14/00 and run on a SUSE 10.2.
Maybe you should try to catch if the pointer is not set properly. I've seen that you want to use this inside a macro for a particle generator. Maybe the TDatabasePDG is already loaded and modified by this.

Have a nice weekend,

Ralf.
 
Read Message icon5.gif
Read Message
Read Message
Read Message
Previous Topic: RootTalk Forum - HACKED!
Next Topic: ROOT and GCC3.4
Goto Forum:
  


Current Time: Thu Jul 09 16:17:42 CEST 2020

Total time taken to generate the page: 0.02200 seconds