I really appreciate the job you do here.
And I have a small problem.
I create a TTree with variable length array based on the manual
and everything is ok. I have int arrays chan and val as channel and value.
I plot values for channel 2.
But, is there possible to draw 2D histogram, where x==values from channel 1
and y==values from channel 2?
It means probably to iterate two arrays separately…?
[quote]But, is there possible to draw 2D histogram, where x==values from channel 1
and y==values from channel 2? [/quote]If you want to do so for specific indices you could do:
To do what you want you probably need to do:
double *val1 = new double[nEmcPhotons->GetEntries()];
memcpy(val1, nEmcPhotons->GetV1(), nEmcPhotons->GetEntries()*sizeof(double));
TGraph *g = new TGraph(nEmcPhotons->GetEntries(),val1, nEmcPhotons->GetV1());[This assumes that every event has both a chan==1 and a chan==2]
Thank you, to see exactly what I have:
int chan; //new test
TFile f=new TFile(“w.root”, “RECREATE”);
TTree nEmcPhotons = new TTree(“nEmcPhotons”,“EMC Photons”);
// channel - value pair: <<<< this is my data
nEmcPhotons->Branch(“val”, val, “val[nPhot]/I”);
I have in general 1000 parameters, but I really use just few. The idea was to
keep in the variable field just parameter number in chan and parameter value in val.
I see that it is not possible to something very simple like
ttree->Draw(“val[Iteration1$]:val[Iteration2$]”,“chan[Iteration1$]==1 && chan[[Iteration2$]==2”)
Thank you anyway, I will try to store all array to see how much memory it will take…