Hello, root community
I’m trying to draw momentum “hedgehog” of two body scattering problem.
here is code
[code]#include “TMath.h”
void Gen() {
gSystem->Load(“libPhysics”);
//define initial 4-momentas
TLorentzVector target(0.0, 0.0, 0.0, 1.8);
TLorentzVector beam(0.0, 0.0, 0.71, 1.18);
TLorentzVector W = beam + target;
//(Momentum, Energy units are Gev/C, GeV)
//Masses of final-state particles
Double_t masses[2] = { 0.938, 1.8 };
//Define Decay for TGenPhaseSpace
TGenPhaseSpace event;
event. SetDecay(W, 2, masses);
TFile *scattering = new TFile(“histograms.root”,“RECREATE”);
TH3F *h5 = new TH3F(“hedgehog”, “Angle”, 1000, 0, 180, 1000, 0, 180, 1000, 0, 180);
for (Int_t n=0;n<100000;n++) {
event.Generate();
TLorentzVector *pProton = event.GetDecay(0);
TLorentzVector *dDeuterium = event.GetDecay(1);
h5->Fill(dDeuterium->Mag());
}
h5->Write();
scattering->Close();
}
[/code]
And i’m getting this error
.../test.cpp:30:9: error: 'Fill' is a protected member of 'TH3'
h5->Fill(dDeuterium->Mag());
~~~~^~~~
.../ROOT/root-6.04.00/include/TH3.h:62:13: note: declared protected here
Int_t Fill(Double_t); //MayNotUse
Hope someone will help me with this problem.
Thanks in advance