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& operator<<(std::ostream& os, const DDDivision& div) {
12  if (defined.first) {
13  os << *(defined.first) << " ";
14  if (defined.second) {
15  div.rep().stream(os);
16  } else {
17  os << "* division not defined * ";
18  }
19  } else {
20  os << "* division not declared * ";
21  }
22  return os;
23 }
24 
26 
28 
30  const DDLogicalPart& parent,
31  const DDAxes axis,
32  const int nReplicas,
33  const double width,
34  const double offset)
36  create(name, std::make_unique<Division>(parent, axis, nReplicas, width, offset));
37 }
38 
40  const DDName& name, const DDLogicalPart& parent, const DDAxes axis, const int nReplicas, const double offset) {
41  create(name, std::make_unique<Division>(parent, axis, nReplicas, offset));
42 }
43 
45  const DDName& name, const DDLogicalPart& parent, const DDAxes axis, const double width, const double offset) {
46  create(name, std::make_unique<Division>(parent, axis, width, offset));
47 }
48 
49 DDAxes DDDivision::axis() const { return rep().axis(); }
50 
51 int DDDivision::nReplicas() const { return rep().nReplicas(); }
52 
53 double DDDivision::width() const { return rep().width(); }
54 
55 double DDDivision::offset() const { return rep().offset(); }
56 
57 const DDLogicalPart& DDDivision::parent() const { return rep().parent(); }
Definition: DDBase.h:10
int nReplicas() const
Definition: DDDivision.cc:51
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
double offset() const
Definition: DDDivision.cc:55
const DDI::rep_traits< N, C >::reference rep() const
Definition: DDBase.h:64
std::unique_ptr< T, impl::DeviceDeleter > unique_ptr
DDAxes axis() const
Definition: DDDivision.cc:49
const DDLogicalPart & parent() const
Definition: DDDivision.cc:57
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:25
std::ostream & operator<<(std::ostream &os, const DDDivision &div)
Definition: DDDivision.cc:10
Definition: Assembly.h:7
double width() const
Definition: DDDivision.cc:53
std::pair< const N *, bool > def_type
Definition: DDBase.h:51
DDAxes
analagous to geant4/source/global/HEPGeometry/include/geomdefs.hh
Definition: DDAxes.h:11
def_type isDefined() const
Definition: DDBase.h:89
void create(const DDName &name, std::unique_ptr< DDI::Division > vals)
Definition: DDBase.h:95