Drawing one of histograms in THnSparseT <TArrayD>


I want to draw a plot, which is defined as one of histograms (axis) in THnSparseT .
I tried to do ‘FindObject(“axis#”)’ and Draw(), but it didn’t work because the histograms are defined as TAxis.
I think my explanation is quite insufficient. so I attached screen-shots for your information.
It would be great to tell me how to draw a histogram in THnSparseT.

Many Thanks for your help in advance.

It is not really clear what you are trying to do. Can you provide a small script ?


I’m sorry my explanation was not enough.
I’m just trying to make a drawing macro with my result file (.root file).
I attached a part of my drawing macro. I want to know that how I can load histograms from the object, which is defined as THnSparseT.
If you need, you can also download one sample of my result file via the below link.
( dropbox.com/s/dgspel26k75o4 … .root?dl=0 , 6MB)

Thanks a lot !

  TFile* file = new TFile(TString::Format("%s%s", sharedPath.Data(), path.Data())); //Data file path
  TKey* key2 = (TKey*) file->FindKeyAny("AliAnalysisTaskEmcalJetSpectraQA_histos");

    TObject* obj = (TObject*) key2->ReadObj();
    THashList* list1 = (THashList*) obj->FindObject("Jet_AKTChargedR040_tracks_pT0150_pt_scheme"); 
    THnSparseT<TArrayD> *Thn = (THnSparseT<TArrayD>*) list1->FindObject("fHistJetObservables");

    //I want to know next command to load histograms from fHistJetObservables.


Please see e.g. tutorials/fit/fit1.C for how to get an object from a ROOT file. In your case something like this should work:

TFile* file = TFile::Open(sharedPath + path);
THnSparseD* hns = 0;
file->Get("AliAnalysisTaskEmcalJetSpectraQA_histos/fHistJetObservables", hns);

See tutorials/tree/drawsparse.C for how to draw it. As humans are notoriously bad at looking at 9-dimensional space (and screens have a hard time visualizing them) I’d recommend that you create projections first, as shown in that tutorial.

Cheers, Axel.