CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_1/src/Fireworks/Geometry/interface/FWTGeoRecoGeometry.h

Go to the documentation of this file.
00001 #ifndef GEOMETRY_FWTGEO_RECO_GEOMETRY_H
00002 # define GEOMETRY_FWTGEO_RECO_GEOMETRY_H
00003 
00004 # include <cassert>
00005 # include <map>
00006 # include <string>
00007 # include <vector>
00008 
00009 # include "DataFormats/GeometryVector/interface/GlobalPoint.h"
00010 
00011 class TGeoManager;
00012 
00013 class FWTGeoRecoGeometry
00014 {
00015 public:
00016   FWTGeoRecoGeometry( void );
00017   virtual ~FWTGeoRecoGeometry( void );
00018 
00019   struct Info
00020   {
00021     std::string name;
00022     float points[24]; // x1,y1,z1...x8,y8,z8
00023     float topology[9]; 
00024     Info( const std::string& iname )
00025       : name( iname )
00026       {
00027         init();
00028       }
00029     Info( void )
00030       {
00031         init();
00032       }
00033     void
00034     init( void )
00035       {
00036         for( unsigned int i = 0; i < 24; ++i ) points[i] = 0;
00037         for( unsigned int i = 0; i < 9; ++i ) topology[i] = 0;
00038       }
00039     void
00040     fillPoints( std::vector<GlobalPoint>::const_iterator begin, std::vector<GlobalPoint>::const_iterator end )
00041       {
00042          unsigned int index( 0 );
00043          for( std::vector<GlobalPoint>::const_iterator i = begin; i != end; ++i )
00044          {
00045             assert( index < 8 );
00046             points[index*3] = i->x();
00047             points[index*3+1] = i->y();
00048             points[index*3+2] = i->z();
00049             ++index;
00050          }
00051       }
00052   };
00053   typedef std::map<unsigned int, FWTGeoRecoGeometry::Info> InfoMap;
00054 
00055   InfoMap idToName;
00056   
00057   TGeoManager* manager( void ) const
00058     {
00059       return m_manager;
00060     }
00061   void manager( TGeoManager* geom )
00062     {
00063       m_manager = geom;
00064     }
00065 
00066 private:
00067   TGeoManager* m_manager;
00068 };
00069 
00070 #endif // GEOMETRY_FWTGEO_RECO_GEOMETRY_H