CMS 3D CMS Logo

DDDivision.cc
Go to the documentation of this file.
2 
3 #include <ostream>
4 
6 #include "Division.h"
8 
9 using DDI::Division;
10 
11 std::ostream &
12 operator<<(std::ostream & os, const DDDivision & div)
13 {
15  if (defined.first) {
16  os << *(defined.first) << " ";
17  if (defined.second) {
18  div.rep().stream(os);
19  }
20  else {
21  os << "* division not defined * ";
22  }
23  }
24  else {
25  os << "* division not declared * ";
26  }
27  return os;
28 }
29 
31 { }
32 
34 {
35  prep_ = StoreT::instance().create(name);
36 }
37 
39  const DDLogicalPart & parent,
40  const DDAxes axis,
41  const int nReplicas,
42  const double width,
43  const double offset ) : DDBase<DDName,DDI::Division*>()
44 {
45  prep_ = StoreT::instance().create(name, new Division(parent, axis, nReplicas, width, offset));
46 }
47 
49  const DDLogicalPart & parent,
50  const DDAxes axis,
51  const int nReplicas,
52  const double offset )
53 {
54  prep_ = StoreT::instance().create(name, new Division(parent, axis, nReplicas, offset));
55 }
56 
58  const DDLogicalPart & parent,
59  const DDAxes axis,
60  const double width,
61  const double offset )
62 {
63  prep_ = StoreT::instance().create(name, new Division(parent, axis, width, offset));
64 }
65 
67 {
68  return rep().axis();
69 }
70 
72 {
73  return rep().nReplicas();
74 }
75 
76 double DDDivision::width() const
77 {
78  return rep().width();
79 }
80 
81 double DDDivision::offset() const
82 {
83  return rep().offset();
84 }
85 
87 {
88  return rep().parent();
89 }
90 
Definition: DDBase.h:10
const DDI::rep_traits< N, C >::reference rep() const
Definition: DDBase.h:84
def_type isDefined() const
Definition: DDBase.h:110
const DDName & name() const
Definition: DDBase.h:78
int nReplicas() const
Definition: DDDivision.cc:71
std::pair< const N *, bool > def_type
Definition: DDBase.h:73
double offset() const
Definition: DDDivision.cc:81
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
static value_type & instance()
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:92
DDDivision()
The default constructor provides an uninitialzed reference object.
Definition: DDDivision.cc:30
std::ostream & operator<<(std::ostream &os, const DDDivision &div)
Definition: DDDivision.cc:12
DDAxes axis() const
Definition: DDDivision.cc:66
double width() const
Definition: DDDivision.cc:76
DDAxes
analagous to geant4/source/global/HEPGeometry/include/geomdefs.hh
Definition: DDAxes.h:11
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86