CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Friends
DDDivision Class Reference

#include <DDDivision.h>

Inheritance diagram for DDDivision:
DDBase< DDName, DDI::Division * >

Public Member Functions

DDAxes axis () const
 
 DDDivision ()
 The default constructor provides an uninitialzed reference object. More...
 
 DDDivision (const DDName &name)
 Creates a refernce object referring to the appropriate XML specification. More...
 
 DDDivision (const DDName &name, const DDLogicalPart &parent, const DDAxes axis, const int nReplicas, const double width, const double offset)
 Registers (creates) a reference object representing a Division. More...
 
 DDDivision (const DDName &name, const DDLogicalPart &parent, const DDAxes axis, const int nReplicas, const double offset)
 Registers (creates) a reference object representing a Division. More...
 
 DDDivision (const DDName &name, const DDLogicalPart &parent, const DDAxes axis, const double width, const double offset)
 Registers (creates) a reference object representing a Division. More...
 
int nReplicas () const
 
double offset () const
 
const DDLogicalPartparent () const
 
double width () const
 
- Public Member Functions inherited from DDBase< DDName, DDI::Division * >
 DDBase ()
 
const DDNameddname () const
 
def_type isDefined () const
 
bool isValid () const
 true, if the wrapped pointer is valid More...
 
const DDNamename () const
 
 operator bool () const
 
bool operator< (const DDBase &b) const
 
bool operator== (const DDBase &b) const
 
bool operator> (const DDBase &b) const
 
const DDI::rep_traits< DDName,
DDI::Division * >::reference 
rep () const
 
DDI::rep_traits< DDName,
DDI::Division * >::reference 
rep ()
 
std::string toString () const
 
const DDI::rep_traits< DDName,
DDI::Division * >::reference 
val () const
 
const DDI::rep_traits< DDName,
DDI::Division * >::reference 
val ()
 
virtual ~DDBase ()
 

Friends

std::ostream & operator<< (std::ostream &, const DDDivision &)
 

Additional Inherited Members

- Public Types inherited from DDBase< DDName, DDI::Division * >
typedef std::pair< const
DDName *, bool > 
def_type
 
typedef DDI::Divisionpimpl_type
 
typedef DDI::rep_type< DDName,
pimpl_type > * 
prep_type
 
typedef DDI::Singleton
< DDI::Store< DDName,
DDI::Division * > > 
StoreT
 
- Static Public Member Functions inherited from DDBase< DDName, DDI::Division * >
static auto begin ()
 
static void clear ()
 
static auto end ()
 
static size_t size ()
 
- Protected Attributes inherited from DDBase< DDName, DDI::Division * >
prep_type prep_
 

Detailed Description

Definition at line 71 of file DDDivision.h.

Constructor & Destructor Documentation

DDDivision::DDDivision ( )

The default constructor provides an uninitialzed reference object.

Definition at line 27 of file DDDivision.cc.

DDDivision::DDDivision ( const DDName name)

Creates a refernce object referring to the appropriate XML specification.

Definition at line 30 of file DDDivision.cc.

References DDI::Singleton< I >::instance(), and DDBase< DDName, DDI::Division * >::prep_.

31 {
32  prep_ = StoreT::instance().create(name);
33 }
static value_type & instance()
DDDivision::DDDivision ( const DDName name,
const DDLogicalPart parent,
const DDAxes  axis,
const int  nReplicas,
const double  width,
const double  offset 
)

Registers (creates) a reference object representing a Division.

... Constructor with number of divisions and width

Definition at line 35 of file DDDivision.cc.

References DCOUT, DDI::Singleton< I >::instance(), DDAxesNames::name(), DDBase< N, C >::name(), offset(), and DDBase< DDName, DDI::Division * >::prep_.

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 }
const N & name() const
Definition: DDBase.h:78
int nReplicas() const
Definition: DDDivision.cc:71
double offset() const
Definition: DDDivision.cc:81
static value_type & instance()
static const std::string name(const DDAxes &s)
DDAxes axis() const
Definition: DDDivision.cc:66
double width() const
Definition: DDDivision.cc:76
#define DCOUT(M_v_Y, M_v_S)
Definition: DDdebug.h:53
DDDivision::DDDivision ( const DDName name,
const DDLogicalPart parent,
const DDAxes  axis,
const int  nReplicas,
const double  offset 
)

Registers (creates) a reference object representing a Division.

... Constructor with number of divisions

Definition at line 46 of file DDDivision.cc.

References DCOUT, DDI::Singleton< I >::instance(), DDAxesNames::name(), DDBase< N, C >::name(), offset(), and DDBase< DDName, DDI::Division * >::prep_.

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 }
const N & name() const
Definition: DDBase.h:78
int nReplicas() const
Definition: DDDivision.cc:71
double offset() const
Definition: DDDivision.cc:81
static value_type & instance()
static const std::string name(const DDAxes &s)
DDAxes axis() const
Definition: DDDivision.cc:66
#define DCOUT(M_v_Y, M_v_S)
Definition: DDdebug.h:53
DDDivision::DDDivision ( const DDName name,
const DDLogicalPart parent,
const DDAxes  axis,
const double  width,
const double  offset 
)

Registers (creates) a reference object representing a Division.

... Constructor with width

Definition at line 56 of file DDDivision.cc.

References DCOUT, DDI::Singleton< I >::instance(), DDAxesNames::name(), DDBase< N, C >::name(), offset(), and DDBase< DDName, DDI::Division * >::prep_.

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 }
const N & name() const
Definition: DDBase.h:78
double offset() const
Definition: DDDivision.cc:81
static value_type & instance()
static const std::string name(const DDAxes &s)
DDAxes axis() const
Definition: DDDivision.cc:66
double width() const
Definition: DDDivision.cc:76
#define DCOUT(M_v_Y, M_v_S)
Definition: DDdebug.h:53

Member Function Documentation

DDAxes DDDivision::axis ( ) const

Definition at line 66 of file DDDivision.cc.

References DDBase< DDName, DDI::Division * >::rep().

67 {
68  return rep().axis();
69 }
const DDI::rep_traits< DDName, DDI::Division * >::reference rep() const
Definition: DDBase.h:84
int DDDivision::nReplicas ( ) const

Definition at line 71 of file DDDivision.cc.

References DDBase< DDName, DDI::Division * >::rep().

Referenced by DDDividedGeometryObject::DDDividedGeometryObject().

72 {
73  return rep().nReplicas();
74 }
const DDI::rep_traits< DDName, DDI::Division * >::reference rep() const
Definition: DDBase.h:84
double DDDivision::offset ( ) const

Definition at line 81 of file DDDivision.cc.

References DDBase< DDName, DDI::Division * >::rep().

Referenced by DDDividedGeometryObject::checkNDivAndWidth(), DDDividedGeometryObject::checkOffset(), and DDDivision().

82 {
83  return rep().offset();
84 }
const DDI::rep_traits< DDName, DDI::Division * >::reference rep() const
Definition: DDBase.h:84
const DDLogicalPart & DDDivision::parent ( ) const
double DDDivision::width ( ) const

Definition at line 76 of file DDDivision.cc.

References DDBase< DDName, DDI::Division * >::rep().

Referenced by DDDividedGeometryObject::DDDividedGeometryObject().

77 {
78  return rep().width();
79 }
const DDI::rep_traits< DDName, DDI::Division * >::reference rep() const
Definition: DDBase.h:84

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const DDDivision div 
)
friend

Definition at line 9 of file DDDivision.cc.

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 }
const DDI::rep_traits< N, C >::reference rep() const
Definition: DDBase.h:84
def_type isDefined() const
Definition: DDBase.h:110
std::pair< const N *, bool > def_type
Definition: DDBase.h:73