Gaudi Framework, version v23r4

Home   Generated: Mon Sep 17 2012

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 #ifdef WIN32
00008 // Disable warning
00009 //   warning C4996: 'sprintf': This function or variable may be unsafe.
00010 // coming from TString.h
00011 #pragma warning(disable:4996)
00012 #endif
00013 // ============================================================================
00014 // Include files
00015 // ============================================================================
00016 // AIDA
00017 // ============================================================================
00018 #include "GaudiKernel/Kernel.h"
00019 //-- to avoid that the class macro trick affects them
00020 #include <string>
00021 #include <vector>
00023 #define class class GAUDI_API
00024 #include "AIDA/IHistogram1D.h"
00025 #include "AIDA/IHistogram2D.h"
00026 #include "AIDA/IHistogram3D.h"
00027 #include "AIDA/IProfile1D.h"
00028 #include "AIDA/IProfile2D.h"
00029 #undef class
00030 // ============================================================================
00031 // ROOT
00032 // ============================================================================
00033 #include "TH1D.h"
00034 #include "TH2D.h"
00035 #include "TH3D.h"
00036 #include "TProfile.h"
00037 #include "TProfile2D.h"
00038 // ============================================================================
00039 // GaudiKernel
00040 // ============================================================================
00041 #include "GaudiKernel/HistogramBase.h"
00042 // ============================================================================
00043 // GaudiAlg
00044 // ============================================================================
00045 #include "GaudiUtils/Aida2ROOT.h"
00046 // ============================================================================
00052 // ============================================================================
00053 // get the underlying pointer for 1D-histogram
00054 // ============================================================================
00055 TH1D* Gaudi::Utils::Aida2ROOT::aida2root ( AIDA::IHistogram1D* aida )
00056 {
00057   if ( 0 == aida ) { return 0 ; }
00058   Gaudi::HistogramBase* base = dynamic_cast<Gaudi::HistogramBase*> ( aida ) ;
00059   if ( 0 == base ) { return 0 ; }
00060   return dynamic_cast<TH1D*>( base->representation() ) ;
00061 }
00062 // ============================================================================
00063 // get the underlying pointer for 2D-histogram
00064 // ============================================================================
00065 TH2D* Gaudi::Utils::Aida2ROOT::aida2root ( AIDA::IHistogram2D* aida )
00066 {
00067   if ( 0 == aida ) { return 0 ; }
00068   Gaudi::HistogramBase* base = dynamic_cast<Gaudi::HistogramBase*> ( aida ) ;
00069   if ( 0 == base ) { return 0 ; }
00070   return dynamic_cast<TH2D*>( base->representation() ) ;
00071 }
00072 // ============================================================================
00073 // get the underlying pointer for 3D-histogram
00074 // ============================================================================
00075 TH3D* Gaudi::Utils::Aida2ROOT::aida2root ( AIDA::IHistogram3D* aida )
00076 {
00077   if ( 0 == aida ) { return 0 ; }
00078   Gaudi::HistogramBase* base = dynamic_cast<Gaudi::HistogramBase*> ( aida ) ;
00079   if ( 0 == base ) { return 0 ; }
00080   return dynamic_cast<TH3D*>( base->representation() ) ;
00081 }
00082 // ============================================================================
00083 // get the underlying pointer for 1D-profile
00084 // ============================================================================
00085 TProfile* Gaudi::Utils::Aida2ROOT::aida2root ( AIDA::IProfile1D*   aida )
00086 {
00087   if ( 0 == aida ) { return 0 ; }
00088   Gaudi::HistogramBase* base = dynamic_cast<Gaudi::HistogramBase*> ( aida ) ;
00089   if ( 0 == base ) { return 0 ; }
00090   return dynamic_cast<TProfile*>( base->representation() ) ;
00091 }
00092 // ============================================================================
00093 // get the underlying pointer for 2D-profile
00094 // ============================================================================
00095 TProfile2D* Gaudi::Utils::Aida2ROOT::aida2root ( AIDA::IProfile2D*   aida )
00096 {
00097   if ( 0 == aida ) { return 0 ; }
00098   Gaudi::HistogramBase* base = dynamic_cast<Gaudi::HistogramBase*> ( aida ) ;
00099   if ( 0 == base ) { return 0 ; }
00100   return dynamic_cast<TProfile2D*>( base->representation() ) ;
00101 }
00102 // ============================================================================
00103 // get root representation for other cases
00104 // ============================================================================
00105 TObject* Gaudi::Utils::Aida2ROOT::aida2root ( AIDA::IHistogram*   aida )
00106 {
00107   if ( 0 == aida ) { return 0 ; }
00108   Gaudi::HistogramBase* base = dynamic_cast<Gaudi::HistogramBase*> ( aida ) ;
00109   if ( 0 == base ) { return 0 ; }
00110   return base->representation() ;
00111 }
00112 // ============================================================================
00113 // The END
00114 // ============================================================================
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines

Generated at Mon Sep 17 2012 13:49:37 for Gaudi Framework, version v23r4 by Doxygen version 1.7.2 written by Dimitri van Heesch, © 1997-2004