Could not restore the pointer while reading back the saved event from tree: Pythia8219

Hello,

I am having trouble in restoring a pointer/s while reading back the events saved in a ROOT tree. The events were generated by pythia8219.

The following is mymacro.C I did ACLiC compilation for the macro. 
[code]TFile f("whist.root");
TTree *T = (TTree*)f.Get("T");
Event *event = new Event();
T->SetBranchAddress("event", &event);
Int_t nevents = T->GetEntries();

for (Int_t j = 0; j < nevents; j++) {
	T->GetEntry(j);
	for (Int_t i = 0; i < event->size(); i++) {
		if(event->at(i).idAbs() == 24) {
			cout << i << " name: " << event->at(i).name() << endl;
			break;
		}
	}
	
} [/code]

The following is the output:

Processing mymacro.C++...
Info in <TUnixSystem::ACLiC>: creating shared library /home/nabin/pythia8219/examples/./mymacro_C.so
5 name:  
5 name:  
5 name:  
5 name:  
5 name:  
5 name:

Since I could not restore the pointer to particleDateEntry class, I could not get the name of a particle.
I would be glad if anyone could help me how to get the name of 5th particle (e.g) in saved event vector( from Pythia8219).
The following link might be useful:
home.thep.lu.se/~torbjorn/doxyge … 6b357ce636

[quote]
Since I could not restore the pointer to particleDateEntry class, I could not get the name of a particle. [/quote]What do you mean? How did it fail?

[quote=“pcanal”][quote]
Since I could not restore the pointer to particleDateEntry class, I could not get the name of a particle. [/quote]What do you mean? How did it fail?[/quote]

Sorry for unclear statement. As explained in the online manual of Pythia8, home.thep.lu.se/~torbjorn/pythia … elcome.php Study Output/ Event Record. I guessed I need to have a pointer to ParticleDataEntry Class. May be I am wrong. I wish to get the name of the particle ( e.g. W-). In the macro above, “event->at(i).name()” returns null instead the name of the ith particle.

In the macro above, “event->at(i).name()” returns null instead the name of the ith particle.

Hi,

Maybe this is a question more for the Pythia support?

Anyway, I am still confused. What did you actually try and how did it fail?

Cheers,
Philippe.

[quote]In the macro above, “event->at(i).name()” returns null instead the name of the ith particle.[/quote]From the look of it, you have done ‘right’ things to load the Event objects, you would need to confirm with the Pythia developer whether this use case is supported by their Event class.

Cheers,
Philippe.