Gaudi Framework, version v22r0

Home   Generated: 9 Feb 2011

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 #ifdef __ICC
00003 // disable icc remark #2259: non-pointer conversion from "X" to "Y" may lose significant bits
00004 //   TODO: To be removed, since it comes from ROOT TMathBase.h
00005 #pragma warning(disable:2259)
00006 #endif
00007 // ============================================================================
00008 // Include files
00009 // ============================================================================
00010 // AIDA
00011 // ============================================================================
00012 #include "GaudiKernel/Kernel.h"
00013 //-- to avoid that the class macro trick affects them
00014 #include <string>
00015 #include <vector>
00017 #define class class GAUDI_API
00018 #include "AIDA/IHistogram1D.h"
00019 #include "AIDA/IHistogram2D.h"
00020 #include "AIDA/IHistogram3D.h"
00021 #include "AIDA/IProfile1D.h"
00022 #include "AIDA/IProfile2D.h"
00023 #undef class
00024 // ============================================================================
00025 // ROOT
00026 // ============================================================================
00027 #include "TH1D.h"
00028 #include "TH2D.h"
00029 #include "TH3D.h"
00030 #include "TProfile.h"
00031 #include "TProfile2D.h"
00032 // ============================================================================
00033 // GaudiKernel
00034 // ============================================================================
00035 #include "GaudiKernel/HistogramBase.h"
00036 // ============================================================================
00037 // GaudiAlg
00038 // ============================================================================
00039 #include "GaudiUtils/Aida2ROOT.h"
00040 // ============================================================================
00046 // ============================================================================
00047 // get the underlying pointer for 1D-histogram
00048 // ============================================================================
00049 TH1D* Gaudi::Utils::Aida2ROOT::aida2root ( AIDA::IHistogram1D* aida )
00050 {
00051   if ( 0 == aida ) { return 0 ; }
00052   Gaudi::HistogramBase* base = dynamic_cast<Gaudi::HistogramBase*> ( aida ) ;
00053   if ( 0 == base ) { return 0 ; }
00054   return dynamic_cast<TH1D*>( base->representation() ) ;
00055 }
00056 // ============================================================================
00057 // get the underlying pointer for 2D-histogram
00058 // ============================================================================
00059 TH2D* Gaudi::Utils::Aida2ROOT::aida2root ( AIDA::IHistogram2D* aida )
00060 {
00061   if ( 0 == aida ) { return 0 ; }
00062   Gaudi::HistogramBase* base = dynamic_cast<Gaudi::HistogramBase*> ( aida ) ;
00063   if ( 0 == base ) { return 0 ; }
00064   return dynamic_cast<TH2D*>( base->representation() ) ;
00065 }
00066 // ============================================================================
00067 // get the underlying pointer for 3D-histogram
00068 // ============================================================================
00069 TH3D* Gaudi::Utils::Aida2ROOT::aida2root ( AIDA::IHistogram3D* aida )
00070 {
00071   if ( 0 == aida ) { return 0 ; }
00072   Gaudi::HistogramBase* base = dynamic_cast<Gaudi::HistogramBase*> ( aida ) ;
00073   if ( 0 == base ) { return 0 ; }
00074   return dynamic_cast<TH3D*>( base->representation() ) ;
00075 }
00076 // ============================================================================
00077 // get the underlying pointer for 1D-profile
00078 // ============================================================================
00079 TProfile* Gaudi::Utils::Aida2ROOT::aida2root ( AIDA::IProfile1D*   aida )
00080 {
00081   if ( 0 == aida ) { return 0 ; }
00082   Gaudi::HistogramBase* base = dynamic_cast<Gaudi::HistogramBase*> ( aida ) ;
00083   if ( 0 == base ) { return 0 ; }
00084   return dynamic_cast<TProfile*>( base->representation() ) ;
00085 }
00086 // ============================================================================
00087 // get the underlying pointer for 2D-profile
00088 // ============================================================================
00089 TProfile2D* Gaudi::Utils::Aida2ROOT::aida2root ( AIDA::IProfile2D*   aida )
00090 {
00091   if ( 0 == aida ) { return 0 ; }
00092   Gaudi::HistogramBase* base = dynamic_cast<Gaudi::HistogramBase*> ( aida ) ;
00093   if ( 0 == base ) { return 0 ; }
00094   return dynamic_cast<TProfile2D*>( base->representation() ) ;
00095 }
00096 // ============================================================================
00097 // get root representation for other cases
00098 // ============================================================================
00099 TObject* Gaudi::Utils::Aida2ROOT::aida2root ( AIDA::IHistogram*   aida )
00100 {
00101   if ( 0 == aida ) { return 0 ; }
00102   Gaudi::HistogramBase* base = dynamic_cast<Gaudi::HistogramBase*> ( aida ) ;
00103   if ( 0 == base ) { return 0 ; }
00104   return base->representation() ;
00105 }
00106 // ============================================================================
00107 // The END
00108 // ============================================================================
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines

Generated at Wed Feb 9 16:25:05 2011 for Gaudi Framework, version v22r0 by Doxygen version 1.6.2 written by Dimitri van Heesch, © 1997-2004