Pythia Histogram Problem

Dear Philippe,

Sorry for the late reply. I was out of CERN. Finally I can calculate the values but my tree is still not be filled these type of particles.

if (charge == 0 || fKS!=1)
{
prt->TClonesArray::RemoveAt(j)}
printf(“charge=%d\n, fKS=%d\n”,charge,fKS);
}

line my code gave same error. Then I changed my code with the code that you wrote me (I only change TParticle( *prt ); to TMCParticle (*prt)).

But the problem is if I change the conditions like when I change the charge value I get the same graphics. I think tree is not be filled with right particles.

I know I bored you too much and I’m so sory for this. I really try to solve this problem but unfortunately I could not do this.

Could you please help me to one more time.

Thank you very much again and kind regards.

Could you please help me how can i fill my tree with final state charged particles?

Kind regards,

[quote] (I only change TParticle( *prt ); to TMCParticle (*prt))[/quote]Indeed this was necessary, my apologies for the confusion.

[quote]But the problem is if I change the conditions like when I change the charge value I get the same graphics. I think tree is not be filled with right particles. [/quote]You might be drawing from the correct TTree, aka it depends what you do between the first and the 2nd (which changed condition) runs. Note that I am this week and the next at Cern. It might work out better if you stop by (I will be in Rene’s office).

Cheers,
Philippe.

Dear Philippe,

I think I have a bigger problem. I can calculate the right charge values. But I could not get the right histogram. Everytime I change the charge value, I always get the same histogram. Could you please let me know how can I fix this problem.

Kind regards.

Dear Philippe,

Thank you for your quick reply :slight_smile: I will come to meet you. But could you please give me some hint how can I fix this problem.I really need the solution especially this weekend. Because I have to plot 36 different histograms with using this macro.

Thank you very much and kind regards.

How to produce the histograms?
What do you do to run, change and run your scripts?

Philippe.

Dear Philippe,

I have sent you an e-mail and I have attached my whole code. If you have some time, could you please check it for me?

Thank you very much

Ayben

Dear Philippe,

My new code works great :smiley: Thank you for your help.

Kind regards.

Ayben

Hello
Everyone i am very new in pythia i want to create Root histogram using the pythia example or data how can i do this if some one has done it then kindly answer it …
it will be a great favour

Please don’t reply to a post which is 14 years old, but open a new topic instead.
And for the Pythia examples, look at the pythiaExample.C (Pythia 6) and pythia8.C tutorials, it’s all we have