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  static const int maxCorner_ = 8;
20  static const int maxPoints_ = 3*maxCorner_;
21  struct Info
22  {
24  float points[maxPoints_]; // x1,y1,z1...x8,y8,z8,...,x12,y12,z12
25  float topology[9];
26  Info( const std::string& iname )
27  : name( iname )
28  {
29  init();
30  }
31  Info( void )
32  {
33  init();
34  }
35  void
36  init( void )
37  {
38  for( unsigned int i = 0; i < maxPoints_; ++i ) points[i] = 0;
39  for( unsigned int i = 0; i < 9; ++i ) topology[i] = 0;
40  }
41  void
42  fillPoints( std::vector<GlobalPoint>::const_iterator begin, std::vector<GlobalPoint>::const_iterator end )
43  {
44  unsigned int index( 0 );
45  for( std::vector<GlobalPoint>::const_iterator i = begin; i != end; ++i )
46  {
47  assert( index < maxCorner_);
48  points[index*3] = i->x();
49  points[index*3+1] = i->y();
50  points[index*3+2] = i->z();
51  ++index;
52  }
53  }
54  };
55  typedef std::map<unsigned int, FWTGeoRecoGeometry::Info> InfoMap;
56 
57  InfoMap idToName;
58 
59  TGeoManager* manager( void ) const
60  {
61  return m_manager;
62  }
63  void manager( TGeoManager* geom )
64  {
65  m_manager = geom;
66  }
67 
68 private:
69  TGeoManager* m_manager;
70 };
71 
72 #endif // GEOMETRY_FWTGEO_RECO_GEOMETRY_H
void fillPoints(std::vector< GlobalPoint >::const_iterator begin, std::vector< GlobalPoint >::const_iterator end)
static const int maxPoints_
void manager(TGeoManager *geom)
Info(const std::string &iname)
TGeoManager * manager(void) const
static const int maxCorner_
#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