CMS 3D CMS Logo

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