CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 public:
15  FWTGeoRecoGeometry(void);
16  virtual ~FWTGeoRecoGeometry(void);
17 
18  static const int maxCorner_ = 8;
19  static const int maxPoints_ = 3 * maxCorner_;
20  struct Info {
22  float points[maxPoints_]; // x1,y1,z1...x8,y8,z8,...,x12,y12,z12
23  float topology[9];
24  Info(const std::string& iname) : name(iname) { init(); }
25  Info(void) { init(); }
26  void init(void) {
27  for (unsigned int i = 0; i < maxPoints_; ++i)
28  points[i] = 0;
29  for (unsigned int i = 0; i < 9; ++i)
30  topology[i] = 0;
31  }
32  void fillPoints(std::vector<GlobalPoint>::const_iterator begin, std::vector<GlobalPoint>::const_iterator end) {
33  unsigned int index(0);
34  for (std::vector<GlobalPoint>::const_iterator i = begin; i != end; ++i) {
35  assert(index < maxCorner_);
36  points[index * 3] = i->x();
37  points[index * 3 + 1] = i->y();
38  points[index * 3 + 2] = i->z();
39  ++index;
40  }
41  }
42  };
43  typedef std::map<unsigned int, FWTGeoRecoGeometry::Info> InfoMap;
44 
46 
47  TGeoManager* manager(void) const { return m_manager; }
48  void manager(TGeoManager* geom) { m_manager = geom; }
49 
50 private:
51  TGeoManager* m_manager;
52 };
53 
54 #endif // GEOMETRY_FWTGEO_RECO_GEOMETRY_H
void fillPoints(std::vector< GlobalPoint >::const_iterator begin, std::vector< GlobalPoint >::const_iterator end)
static const int maxPoints_
assert(be >=bs)
void manager(TGeoManager *geom)
Info(const std::string &iname)
TGeoManager * manager(void) const
static const int maxCorner_
virtual ~FWTGeoRecoGeometry(void)
TGeoManager * m_manager
std::map< unsigned int, FWTGeoRecoGeometry::Info > InfoMap
string end
Definition: dataset.py:937