RootBranch.h

Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 
00014 #ifndef RootBranch_H
00015 #define RootBranch_H
00016 
00017 #include "RootDataType.h"
00018 
00019 #include "pattern/libhippo.h"
00020 
00021 #include "TLeaf.h"
00022 #include "TObjArray.h"
00023 
00024 #include <string>
00025 #include <vector>
00026 #include <boost/tokenizer.hpp>
00027 #include <boost/lexical_cast.hpp>
00028 
00029 class TBranch;
00030 
00031 namespace hippodraw {
00032 
00040 class MDL_HIPPOPLOT_API RootBranch
00041 {
00042 
00043 private:
00044   
00047   mutable TBranch * m_branch;
00048 
00051   TLeaf * m_leaf;
00052 
00056   hippodraw::RootData::Type m_leaf_type;
00057   
00060   int  m_number_leaves;
00061 
00065   int m_number_elements;
00066   
00071   mutable Double_t m_double_data;
00072   
00077   mutable Float_t m_float_data;
00078   
00083   mutable Int_t m_int_data;
00084   
00089   mutable UInt_t m_uint_data;
00094   mutable Short_t m_short_data;
00095   
00100   mutable UShort_t m_ushort_data;
00101   
00106   mutable Long64_t m_long64_data;
00107   
00112   mutable ULong64_t m_ulong64_data;
00113   
00121   mutable Double_t * m_vector_double_data;
00122 
00128   mutable Float_t * m_vector_float_data;
00129 
00135   mutable Int_t * m_vector_int_data;
00136 
00142   mutable UInt_t * m_vector_uint_data;
00143 
00144 
00150   mutable Short_t * m_vector_short_data;
00151 
00157   mutable UShort_t * m_vector_ushort_data;
00158 
00164   mutable Long64_t * m_vector_long64_data;
00165 
00171   mutable ULong64_t * m_vector_ulong64_data;
00172 
00176   std::vector < int > m_shape;
00177 
00182   int m_releventIndex;
00183   
00186   mutable bool m_branch_set;
00187 
00194   bool m_useable;
00195 
00196  public:
00197 
00200   RootBranch ( TBranch * );
00201 
00202 private:
00203 
00206   RootBranch ( const RootBranch & );  
00207 
00210   RootBranch ();
00211 
00212 public:
00213 
00216   ~RootBranch();
00217 
00218 
00220   bool isMultiDimensional() const;
00221 
00225   int numberOfElements() const;
00226   
00229   unsigned int size () const;
00230 
00233   bool empty () const;
00234 
00237   double valueAt ( unsigned int row ) const;
00238 
00241   hippodraw::RootData::Type getType () const;
00242 
00250   double * doubleArrayAt ( unsigned int row );
00251 
00254   float * floatArrayAt ( unsigned int row );
00255 
00258   int * intArrayAt ( unsigned int row );
00259 
00262   unsigned int * uintArrayAt ( unsigned int row );
00263 
00264   bool isFilled ( ) const;
00265   
00272   unsigned int getRank () const;
00273   
00277   void setReleventIndex( const std::vector< unsigned int >& index );
00278 
00282   const std::vector < int > & getShape ();
00283 
00285   TBranch * getTBranch();
00286 
00289   bool isUseable () const;
00290   
00291 private:
00292 
00295   void setBranchAddress () const;
00296 
00301   void initShape ( const char* title );
00302 
00303 };
00304 
00305 } // namespace hippodraw
00306 
00307 #endif // RootBranch_H

Generated for HippoDraw Class Library by doxygen