Gaudi Framework, version v21r8

Home   Generated: 17 Mar 2010

Aida2ROOT.cpp

Go to the documentation of this file.
00001 // $Id: Aida2ROOT.cpp,v 1.3 2007/08/06 14:49:36 hmd Exp $
00002 // ============================================================================
00003 // Include files
00004 // ============================================================================
00005 // AIDA
00006 // ============================================================================
00007 #include "GaudiKernel/Kernel.h"
00008 //-- to avoid that the class macro trick affects them
00009 #include <string>
00010 #include <vector>
00012 #define class class GAUDI_API
00013 #include "AIDA/IHistogram1D.h"
00014 #include "AIDA/IHistogram2D.h"
00015 #include "AIDA/IHistogram3D.h"
00016 #include "AIDA/IProfile1D.h"
00017 #include "AIDA/IProfile2D.h"
00018 #undef class
00019 // ============================================================================
00020 // ROOT
00021 // ============================================================================
00022 #include "TH1D.h"
00023 #include "TH2D.h"
00024 #include "TH3D.h"
00025 #include "TProfile.h"
00026 #include "TProfile2D.h"
00027 // ============================================================================
00028 // GaudiKernel
00029 // ============================================================================
00030 #include "GaudiKernel/HistogramBase.h"
00031 // ============================================================================
00032 // GaudiAlg
00033 // ============================================================================
00034 #include "GaudiUtils/Aida2ROOT.h"
00035 // ============================================================================
00041 // ============================================================================
00042 // get the underlying pointer for 1D-histogram
00043 // ============================================================================
00044 TH1D* Gaudi::Utils::Aida2ROOT::aida2root ( AIDA::IHistogram1D* aida )
00045 {
00046   if ( 0 == aida ) { return 0 ; }
00047   Gaudi::HistogramBase* base = dynamic_cast<Gaudi::HistogramBase*> ( aida ) ;
00048   if ( 0 == base ) { return 0 ; }
00049   return dynamic_cast<TH1D*>( base->representation() ) ;
00050 }
00051 // ============================================================================
00052 // get the underlying pointer for 2D-histogram
00053 // ============================================================================
00054 TH2D* Gaudi::Utils::Aida2ROOT::aida2root ( AIDA::IHistogram2D* aida )
00055 {
00056   if ( 0 == aida ) { return 0 ; }
00057   Gaudi::HistogramBase* base = dynamic_cast<Gaudi::HistogramBase*> ( aida ) ;
00058   if ( 0 == base ) { return 0 ; }
00059   return dynamic_cast<TH2D*>( base->representation() ) ;
00060 }
00061 // ============================================================================
00062 // get the underlying pointer for 3D-histogram
00063 // ============================================================================
00064 TH3D* Gaudi::Utils::Aida2ROOT::aida2root ( AIDA::IHistogram3D* aida )
00065 {
00066   if ( 0 == aida ) { return 0 ; }
00067   Gaudi::HistogramBase* base = dynamic_cast<Gaudi::HistogramBase*> ( aida ) ;
00068   if ( 0 == base ) { return 0 ; }
00069   return dynamic_cast<TH3D*>( base->representation() ) ;
00070 }
00071 // ============================================================================
00072 // get the underlying pointer for 1D-profile
00073 // ============================================================================
00074 TProfile* Gaudi::Utils::Aida2ROOT::aida2root ( AIDA::IProfile1D*   aida )
00075 {
00076   if ( 0 == aida ) { return 0 ; }
00077   Gaudi::HistogramBase* base = dynamic_cast<Gaudi::HistogramBase*> ( aida ) ;
00078   if ( 0 == base ) { return 0 ; }
00079   return dynamic_cast<TProfile*>( base->representation() ) ;
00080 }
00081 // ============================================================================
00082 // get the underlying pointer for 2D-profile
00083 // ============================================================================
00084 TProfile2D* Gaudi::Utils::Aida2ROOT::aida2root ( AIDA::IProfile2D*   aida )
00085 {
00086   if ( 0 == aida ) { return 0 ; }
00087   Gaudi::HistogramBase* base = dynamic_cast<Gaudi::HistogramBase*> ( aida ) ;
00088   if ( 0 == base ) { return 0 ; }
00089   return dynamic_cast<TProfile2D*>( base->representation() ) ;
00090 }
00091 // ============================================================================
00092 // get root representation for other cases
00093 // ============================================================================
00094 TObject* Gaudi::Utils::Aida2ROOT::aida2root ( AIDA::IHistogram*   aida )
00095 {
00096   if ( 0 == aida ) { return 0 ; }
00097   Gaudi::HistogramBase* base = dynamic_cast<Gaudi::HistogramBase*> ( aida ) ;
00098   if ( 0 == base ) { return 0 ; }
00099   return base->representation() ;
00100 }
00101 // ============================================================================
00102 // The END
00103 // ============================================================================

Generated at Wed Mar 17 18:06:52 2010 for Gaudi Framework, version v21r8 by Doxygen version 1.5.6 written by Dimitri van Heesch, © 1997-2004