CMS 3D CMS Logo

FWTGeoRecoGeometry.h
Go to the documentation of this file.
1 #ifndef GEOMETRY_FWTGEO_RECO_GEOMETRY_H
2 # define GEOMETRY_FWTGEO_RECO_GEOMETRY_H
3 
4 # include <cassert>
5 # include <map>
6 # include <string>
7 # include <vector>
8 
10 
11 class TGeoManager;
12 
14 {
15 public:
16  FWTGeoRecoGeometry( void );
17  virtual ~FWTGeoRecoGeometry( void );
18 
19  struct Info
20  {
22  float points[24]; // x1,y1,z1...x8,y8,z8
23  float topology[9];
24  Info( const std::string& iname )
25  : name( iname )
26  {
27  init();
28  }
29  Info( void )
30  {
31  init();
32  }
33  void
34  init( void )
35  {
36  for( unsigned int i = 0; i < 24; ++i ) points[i] = 0;
37  for( unsigned int i = 0; i < 9; ++i ) topology[i] = 0;
38  }
39  void
40  fillPoints( std::vector<GlobalPoint>::const_iterator begin, std::vector<GlobalPoint>::const_iterator end )
41  {
42  unsigned int index( 0 );
43  for( std::vector<GlobalPoint>::const_iterator i = begin; i != end; ++i )
44  {
45  assert( index < 8 );
46  points[index*3] = i->x();
47  points[index*3+1] = i->y();
48  points[index*3+2] = i->z();
49  ++index;
50  }
51  }
52  };
53  typedef std::map<unsigned int, FWTGeoRecoGeometry::Info> InfoMap;
54 
55  InfoMap idToName;
56 
57  TGeoManager* manager( void ) const
58  {
59  return m_manager;
60  }
61  void manager( TGeoManager* geom )
62  {
63  m_manager = geom;
64  }
65 
66 private:
67  TGeoManager* m_manager;
68 };
69 
70 #endif // GEOMETRY_FWTGEO_RECO_GEOMETRY_H
void fillPoints(std::vector< GlobalPoint >::const_iterator begin, std::vector< GlobalPoint >::const_iterator end)
void manager(TGeoManager *geom)
Info(const std::string &iname)
TGeoManager * manager(void) const
#define end
Definition: vmac.h:39
virtual ~FWTGeoRecoGeometry(void)
TGeoManager * m_manager
#define begin
Definition: vmac.h:32
std::map< unsigned int, FWTGeoRecoGeometry::Info > InfoMap