You are here: TWiki> Online Web>HistoLabels (2009-05-05, EricVanHerwijnen)
create new tag
, view all tags

How to make labels on AIDA histograms that are seen in the Presenter

  • AIDA does not support labels on histograms, so in your Gaudi Job you need to get a pointer to the Root object underlying your AIDA histogram
  • in the code fragment below, my1Dhisto is a AIDA/IHistogram1D, declared via declareInfo or plot:
        TH1D *h = Gaudi::Utils::Aida2ROOT::aida2root(  my1Dhisto );
        if ( 0 != h ) {
            // get the axis:
            TAxis* axis = h->GetXaxis() ;     
            if( 0 != axis ) 
              axis-> SetBinLabel ( 1, "bin 1" );
              axis-> SetBinLabel ( 2, "bin 2" );
              axis-> SetBinLabel ( 3, "bin 3" );
              ... repeat this nb of bin times                                    
  • The MonitorSvc will recognize the fact that labels exist, because it serializes the Root methods from the Root object underlying the AIDA histograms. The presenter, saver and adder will all handle these labels correctly.

-- EricVanHerwijnen - 05 May 2009

Topic revision: r1 - 2009-05-05 - EricVanHerwijnen

This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback