Hi Matt, Matt Palmer wrote: > > Hi everyone, > > I've been using ROOT now for the past few months - I've generally been quite > impressed- it's nice to work with 4-vectors and deal with things in an OO > way, but I have a few queries/observations about it.... > > 1. I have signal and background files and when I generate my output I want to > be able to plot the signal and backgrounds stacked on top of each other > whilst still seeing which contribution came from where. The only way I've > found to do this so far is to add all the histograms together and plot that, > then add all but one of them and plot that on top in a different colour and > so on. This seems a very 'clunky' way of doing this - is there a better way? > The coming release (already in CVS) includes a new class THStack to draw stacked histograms and lego plots. For more details, see: http://root.cern.ch/root/htmldoc/THStack.html as well as the new tutorial in $ROOTSYS/tutorials/hstack.C > 2. I made a simple little 3D viewer for some of my data (which was > impressively easy :) ). However, I use TPolyLine3D to do the drawing and I > can't get any of the lines to be drawn in different colours. Currently I do > something like: > TPolyLine3D* beamaxis = new TPolyLine3D(2); > beamaxis->SetPoint(0, 1000, 1000, 0); > beamaxis->SetPoint(1, 1000, 1000, 2000); > gStyle->SetLineColor(2); > beamaxis->UseCurrentStyle(); > beamaxis->Draw(); use beamaxis->SetLineColor instead of gStyle->SetLineColor > For each of the lines I want to draw, but they all come out the same colour > (the colour that I set the last one to). I tried using DrawCopy instead, but > that didn't help. (When I was doing the histograms above, I had to use > DrawClone, but there is no DrawClone for TPolyLine3Ds). Oh, one other thing, > when viewing a 3D object in a TCanvas, it appears that you can only rotate it > about 2 axes but not the third - to do that you have to launch an X3D window. > > 3. Why do the histogram classes derive from the TArray classes? I assume > this multiple inheritance is the reason for the TArray classes being some of > the very few in ROOT *not* to derive from TObject. Why not have the array as > a data member - then maybe you wouldn't have to have a different class for > each data type. As a general point tho, I think I am right in saying that > multiple inheritance of non-pure virtual classes (ie non-interfaces) in > object hierachies with a single shared parent base class (ie TObject) cannot > work ...that's why it isn't allowed in Java, .NET etc > We support multiple histogram types (TH1C,S,F,D,etc). Using composition instead of inheritance will not solve the problem. Inheritance has the advantage that you do not have to repeat the interface in each class. I will not anything to the previous exchange about multiple inheritance. > 4. When using TTree::Draw methods, would it be possible to have CINT > interpret the cut/draw strings because then any valid C++ code should work, > right? At the moment I'm doing things like: > MyTree->Draw("Pjet1.Eta()", "Pjet2.Pt()>50") > which works fine, but it'd be nice to do things like: > MyTree->Draw("(Pjet1+Pjet2).M()") or > MyTree->Draw("Pjet1.deltaR(Pjet2)") > neither of which work atm. > I agree that it would be nice to have this form supported by TTree::Draw. However, for complex queries, I recommend using directly C++, for example, via the code generated by TTree::MakeClass or better TTree::MakeSelector. In particular, the code generated by MakeSelector will be able to run under PROOF (Parallel Root Facility) to be introduced with the next version 3.03. Rene Brun > Thanks > > Matt
This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:51:11 MET