CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DDDivision.cc
Go to the documentation of this file.
2 #include "Division.h"
3 
5 
6 using DDI::Division;
7 
8 std::ostream &
9 operator<<(std::ostream & os, const DDDivision & div)
10 {
12  if (defined.first) {
13  os << *(defined.first) << " ";
14  if (defined.second) {
15  div.rep().stream(os);
16  }
17  else {
18  os << "* division not defined * ";
19  }
20  }
21  else {
22  os << "* division not declared * ";
23  }
24  return os;
25 }
26 
28 { }
29 
31 {
32  prep_ = StoreT::instance().create(name);
33 }
34 
36  const DDLogicalPart & parent,
37  const DDAxes axis,
38  const int nReplicas,
39  const double width,
40  const double offset ) : DDBase<DDName,DDI::Division*>()
41 {
42  DCOUT('C', "create Division name=" << name << " parent=" << parent.name() << " axis=" << DDAxesNames::name(axis) << " nReplicas=" << nReplicas << " width=" << width << " offset=" << offset);
43  prep_ = StoreT::instance().create(name, new Division(parent, axis, nReplicas, width, offset));
44 }
45 
47  const DDLogicalPart & parent,
48  const DDAxes axis,
49  const int nReplicas,
50  const double offset )
51 {
52  DCOUT('C', "create Division name=" << name << " parent=" << parent.name() << " axis=" << DDAxesNames::name(axis) << " nReplicas=" << nReplicas << " offset=" << offset);
53  prep_ = StoreT::instance().create(name, new Division(parent, axis, nReplicas, offset));
54 }
55 
57  const DDLogicalPart & parent,
58  const DDAxes axis,
59  const double width,
60  const double offset )
61 {
62  DCOUT('C', "create Division name=" << name << " parent=" << parent.name() << " axis=" << DDAxesNames::name(axis) << " width=" << width << " offset=" << offset);
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 N & name() const
Definition: DDBase.h:78
list parent
Definition: dbtoconf.py:74
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:18
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
static value_type & instance()
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:88
static const std::string name(const DDAxes &s)
DDDivision()
The default constructor provides an uninitialzed reference object.
Definition: DDDivision.cc:27
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
#define DCOUT(M_v_Y, M_v_S)
Definition: DDdebug.h:53