test
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 // void DD_NDC(const DDName & n) {
9 // std::vector<DDName> & ns = DIVNAMES::instance()[n.name()];
10 // typedef std::vector<DDName>::iterator IT;
11 // bool alreadyIn(false);
12 // for(IT p = ns.begin(); p != ns.end() ; ++p) {
13 // if ( p->ns() == n.ns()) {
14 // alreadyIn = true;
15 // break;
16 // }
17 // }
18 // if (!alreadyIn) {
19 // ns.push_back(n);
20 // }
21 // }
22 
23 std::ostream &
24 operator<<(std::ostream & os, const DDDivision & div)
25 {
27  if (defined.first) {
28  os << *(defined.first) << " ";
29  if (defined.second) {
30  div.rep().stream(os);
31  }
32  else {
33  os << "* division not defined * ";
34  }
35  }
36  else {
37  os << "* division not declared * ";
38  }
39  return os;
40 }
41 
43 { }
44 
46 {
47  prep_ = StoreT::instance().create(name);
48  // DD_NDC(name);
49 }
50 
52  const DDLogicalPart & parent,
53  const DDAxes axis,
54  const int nReplicas,
55  const double width,
56  const double offset ) : DDBase<DDName,DDI::Division*>()
57 {
58  DCOUT('C', "create Division name=" << name << " parent=" << parent.name() << " axis=" << DDAxesNames::name(axis) << " nReplicas=" << nReplicas << " width=" << width << " offset=" << offset);
59  prep_ = StoreT::instance().create(name, new Division(parent, axis, nReplicas, width, offset));
60  // DD_NDC(name);
61 }
62 
64  const DDLogicalPart & parent,
65  const DDAxes axis,
66  const int nReplicas,
67  const double offset )
68 {
69  DCOUT('C', "create Division name=" << name << " parent=" << parent.name() << " axis=" << DDAxesNames::name(axis) << " nReplicas=" << nReplicas << " offset=" << offset);
70  prep_ = StoreT::instance().create(name, new Division(parent, axis, nReplicas, offset));
71  // DD_NDC(name);
72 }
73 
75  const DDLogicalPart & parent,
76  const DDAxes axis,
77  const double width,
78  const double offset )
79 {
80  DCOUT('C', "create Division name=" << name << " parent=" << parent.name() << " axis=" << DDAxesNames::name(axis) << " width=" << width << " offset=" << offset);
81  prep_ = StoreT::instance().create(name, new Division(parent, axis, width, offset));
82  // DD_NDC(name);
83 }
84 
86 {
87  return rep().axis();
88 }
89 
91 {
92  return rep().nReplicas();
93 }
94 
95 double DDDivision::width() const
96 {
97  return rep().width();
98 }
99 
100 double DDDivision::offset() const
101 {
102  return rep().offset();
103 }
104 
106 {
107  return rep().parent();
108 }
109 
Definition: DDBase.h:14
const DDI::rep_traits< N, C >::reference rep() const
Definition: DDBase.h:89
def_type isDefined() const
Definition: DDBase.h:115
const N & name() const
Definition: DDBase.h:82
list parent
Definition: dbtoconf.py:74
int nReplicas() const
Definition: DDDivision.cc:90
std::pair< const N *, bool > def_type
Definition: DDBase.h:77
double offset() const
Definition: DDDivision.cc:100
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
DDDivision()
The default constructor provides an uninitialzed reference object.
Definition: DDDivision.cc:42
unsigned int offset(bool)
DDAxes axis() const
Definition: DDDivision.cc:85
double width() const
Definition: DDDivision.cc:95
DDAxes
analagous to geant4/source/global/HEPGeometry/include/geomdefs.hh
Definition: DDAxes.h:10
const DDLogicalPart & parent() const
Definition: DDDivision.cc:105
static const std::string name(const DDAxes &s)
Definition: DDAxes.cc:37
#define DCOUT(M_v_Y, M_v_S)
Definition: DDdebug.h:53