CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
DetGeomDesc Class Reference

Geometrical description of a detector. More...

#include <DetGeomDesc.h>

Public Types

typedef std::vector< const DetGeomDesc * > ConstContainer
 
typedef std::vector< DetGeomDesc * > Container
 
typedef unsigned int GeometricEnumType
 a type (not used in the moment, left for the future) More...
 
typedef DDExpandedView::nav_type nav_type
 

Public Member Functions

void addComponent (DetGeomDesc *)
 
void addComponents (Container cont)
 
void ApplyAlignment (const RPAlignmentCorrectionData &)
 alignment More...
 
void clearComponents ()
 
virtual ConstContainer components () const
 access to the tree structure More...
 
virtual Container components ()
 
virtual int copyno () const
 
virtual ConstContainer deepComponents () const
 
void deepDeleteComponents ()
 deletes just the first daughters More...
 
void deleteComponents ()
 
virtual double density () const
 
 DetGeomDesc (nav_type navtype, GeometricEnumType dd=0)
 Constructors to be used when looping over DDD. More...
 
 DetGeomDesc (DDExpandedView *ev, GeometricEnumType dd=0)
 
 DetGeomDesc (DDFilteredView *fv, GeometricEnumType dd=0)
 
 DetGeomDesc (const DetGeomDesc &)
 copy constructor and assignment operator More...
 
virtual DetId geographicalID () const
 
bool isLeaf () const
 traverses the treee and deletes all nodes. More...
 
virtual std::string material () const
 
DDName name () const
 
nav_type navType () const
 
DetGeomDescoperator= (const DetGeomDesc &)
 
std::vector< double > params () const
 
virtual std::vector< DDExpandedNodeparents () const
 returns all the components below More...
 
DDRotationMatrix rotation () const
 geometry information More...
 
void setComponents (Container cont)
 components (children) management More...
 
void setGeographicalID (DetId id)
 ID stuff. More...
 
DDSolidShape shape () const
 
DDTranslation translation () const
 
GeometricEnumType type () const
 
virtual double volume () const
 
virtual double weight () const
 
virtual ~DetGeomDesc ()
 destructor More...
 

Private Attributes

Container _container
 
int _copy
 
nav_type _ddd
 
DDName _ddname
 
double _density
 
DetId _geographicalID
 
std::string _material
 
std::vector< double > _params
 
std::vector< DDExpandedNode_parents
 
DDRotationMatrix _rot
 
DDSolidShape _shape
 
DDTranslation _trans
 
GeometricEnumType _type
 
double _volume
 
double _weight
 

Detailed Description

Geometrical description of a detector.

See schema of TOTEM RP geometry classes

Class resembling GeometricDet class. Slight changes were made to suit needs of the TOTEM RP description. Each instance is a tree node, with geometrical information from DDD (shift, rotation, material, ...), ID and list of children nodes. It is intended to have two such a trees. One for ideal geometry (within IdealGeometryRecord) and second for real geometry (VeryForwardRealGeometryRecord). The transition from ideal to real geometry (i.e. loading alignments) is done by TotemRPRealGeometryModule.

The translation and rotation parameters are defined by local-to-global coordinate transform. That is, if r_l is a point in local coordinate system and x_g in global, then the transform reads:

   x_g = rotation * x_l + translation

Definition at line 40 of file DetGeomDesc.h.

Member Typedef Documentation

typedef std::vector< const DetGeomDesc*> DetGeomDesc::ConstContainer

Definition at line 43 of file DetGeomDesc.h.

typedef std::vector< DetGeomDesc*> DetGeomDesc::Container

Definition at line 44 of file DetGeomDesc.h.

typedef unsigned int DetGeomDesc::GeometricEnumType

a type (not used in the moment, left for the future)

Definition at line 48 of file DetGeomDesc.h.

Definition at line 45 of file DetGeomDesc.h.

Constructor & Destructor Documentation

DetGeomDesc::DetGeomDesc ( nav_type  navtype,
GeometricEnumType  dd = 0 
)

Constructors to be used when looping over DDD.

Definition at line 22 of file DetGeomDesc.cc.

References _copy, _ddd, _ddname, _density, _material, _params, _parents, _rot, _shape, _trans, _volume, _weight, DDExpandedView::copyno(), density(), ev, DDExpandedView::geoHistory(), DDExpandedView::goTo(), DDExpandedView::logicalPart(), material(), name(), metProducer_cfi::parameters, DDExpandedView::rotation(), shape(), DDExpandedView::translation(), and volume().

22  : _ddd(navtype), _type(type)
23 {
24  DDCompactView cpv;
25  DDExpandedView ev(cpv);
26  ev.goTo(_ddd);
27  _params = ((ev.logicalPart()).solid()).parameters();
28  _trans = ev.translation();
29  _rot = ev.rotation();
30  _shape = ((ev.logicalPart()).solid()).shape();
31  _ddname = ((ev.logicalPart()).ddname()).name();
32  _parents = ev.geoHistory();
33  _volume = ((ev.logicalPart()).solid()).volume();
34  _density = ((ev.logicalPart()).material()).density();
35  _weight = _density * ( _volume / 1000.); // volume mm3->cm3
36  _copy = ev.copyno();
37  _material = ((ev.logicalPart()).material()).name();
38 }
std::vector< DDExpandedNode > _parents
Definition: DetGeomDesc.h:112
type
Definition: HCALResponse.h:21
DDSolidShape _shape
Definition: DetGeomDesc.h:107
DDRotationMatrix _rot
Definition: DetGeomDesc.h:106
virtual double density() const
Definition: DetGeomDesc.h:95
bool ev
double _volume
Definition: DetGeomDesc.h:113
type of data representation of DDCompactView
Definition: DDCompactView.h:90
DDTranslation _trans
Definition: DetGeomDesc.h:105
DDName name() const
Definition: DetGeomDesc.h:90
virtual std::string material() const
Definition: DetGeomDesc.h:97
GeometricEnumType _type
Definition: DetGeomDesc.h:109
virtual double volume() const
Definition: DetGeomDesc.h:94
double _density
Definition: DetGeomDesc.h:114
double _weight
Definition: DetGeomDesc.h:115
std::vector< double > _params
Definition: DetGeomDesc.h:110
nav_type _ddd
Definition: DetGeomDesc.h:104
DDName _ddname
Definition: DetGeomDesc.h:108
std::string _material
Definition: DetGeomDesc.h:117
Provides an exploded view of the detector (tree-view)
DDSolidShape shape() const
Definition: DetGeomDesc.h:88
DetGeomDesc::DetGeomDesc ( DDExpandedView ev,
GeometricEnumType  dd = 0 
)

Definition at line 42 of file DetGeomDesc.cc.

References _copy, _ddd, _ddname, _density, _material, _params, _parents, _rot, _shape, _trans, _volume, _weight, DDExpandedView::copyno(), density(), DDExpandedView::geoHistory(), DDExpandedView::logicalPart(), material(), name(), DDExpandedView::navPos(), metProducer_cfi::parameters, DDExpandedView::rotation(), shape(), DDExpandedView::translation(), and volume().

42  : _type(type)
43 {
44  _ddd = fv->navPos();
45  _params = ((fv->logicalPart()).solid()).parameters();
46  _trans = fv->translation();
47  _rot = fv->rotation();
48  _shape = ((fv->logicalPart()).solid()).shape();
49  _ddname = ((fv->logicalPart()).ddname()).name();
50  _parents = fv->geoHistory();
51  _volume = ((fv->logicalPart()).solid()).volume();
52  _density = ((fv->logicalPart()).material()).density();
53  _weight = _density * ( _volume / 1000.); // volume mm3->cm3
54  _copy = fv->copyno();
55  _material = ((fv->logicalPart()).material()).name();
56 }
std::vector< DDExpandedNode > _parents
Definition: DetGeomDesc.h:112
type
Definition: HCALResponse.h:21
DDSolidShape _shape
Definition: DetGeomDesc.h:107
DDRotationMatrix _rot
Definition: DetGeomDesc.h:106
virtual double density() const
Definition: DetGeomDesc.h:95
double _volume
Definition: DetGeomDesc.h:113
DDTranslation _trans
Definition: DetGeomDesc.h:105
DDName name() const
Definition: DetGeomDesc.h:90
virtual std::string material() const
Definition: DetGeomDesc.h:97
GeometricEnumType _type
Definition: DetGeomDesc.h:109
virtual double volume() const
Definition: DetGeomDesc.h:94
double _density
Definition: DetGeomDesc.h:114
double _weight
Definition: DetGeomDesc.h:115
std::vector< double > _params
Definition: DetGeomDesc.h:110
nav_type _ddd
Definition: DetGeomDesc.h:104
DDName _ddname
Definition: DetGeomDesc.h:108
std::string _material
Definition: DetGeomDesc.h:117
DDSolidShape shape() const
Definition: DetGeomDesc.h:88
DetGeomDesc::DetGeomDesc ( DDFilteredView fv,
GeometricEnumType  dd = 0 
)

Definition at line 60 of file DetGeomDesc.cc.

References _copy, _ddd, _ddname, _density, _material, _params, _parents, _rot, _shape, _trans, _volume, _weight, DDFilteredView::copyno(), density(), DDFilteredView::geoHistory(), DDFilteredView::logicalPart(), material(), name(), DDFilteredView::navPos(), metProducer_cfi::parameters, DDFilteredView::rotation(), shape(), DDFilteredView::translation(), and volume().

60  : _type(type)
61 {
62  _ddd = fv->navPos();
63  _params = ((fv->logicalPart()).solid()).parameters();
64  _trans = fv->translation();
65  _rot = fv->rotation();
66  _shape = ((fv->logicalPart()).solid()).shape();
67  _ddname = ((fv->logicalPart()).ddname()).name();
68  _parents = fv->geoHistory();
69  _volume = ((fv->logicalPart()).solid()).volume();
70  _density = ((fv->logicalPart()).material()).density();
71  _weight = _density * ( _volume / 1000.); // volume mm3->cm3
72  _copy = fv->copyno();
73  _material = ((fv->logicalPart()).material()).name();
74 }
std::vector< DDExpandedNode > _parents
Definition: DetGeomDesc.h:112
type
Definition: HCALResponse.h:21
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
DDSolidShape _shape
Definition: DetGeomDesc.h:107
const DDRotationMatrix & rotation() const
The absolute rotation of the current node.
DDRotationMatrix _rot
Definition: DetGeomDesc.h:106
virtual double density() const
Definition: DetGeomDesc.h:95
nav_type navPos() const
return the stack of sibling numbers
double _volume
Definition: DetGeomDesc.h:113
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
int copyno() const
Copy number associated with the current node.
DDTranslation _trans
Definition: DetGeomDesc.h:105
DDName name() const
Definition: DetGeomDesc.h:90
virtual std::string material() const
Definition: DetGeomDesc.h:97
GeometricEnumType _type
Definition: DetGeomDesc.h:109
virtual double volume() const
Definition: DetGeomDesc.h:94
double _density
Definition: DetGeomDesc.h:114
double _weight
Definition: DetGeomDesc.h:115
std::vector< double > _params
Definition: DetGeomDesc.h:110
nav_type _ddd
Definition: DetGeomDesc.h:104
DDName _ddname
Definition: DetGeomDesc.h:108
const DDTranslation & translation() const
The absolute translation of the current node.
std::string _material
Definition: DetGeomDesc.h:117
DDSolidShape shape() const
Definition: DetGeomDesc.h:88
DetGeomDesc::DetGeomDesc ( const DetGeomDesc ref)

copy constructor and assignment operator

Definition at line 78 of file DetGeomDesc.cc.

79 {
80  (*this) = ref;
81 }
DetGeomDesc::~DetGeomDesc ( )
virtual

destructor

Definition at line 107 of file DetGeomDesc.cc.

References deepDeleteComponents().

108 {
110 }
void deepDeleteComponents()
deletes just the first daughters
Definition: DetGeomDesc.cc:173

Member Function Documentation

void DetGeomDesc::addComponent ( DetGeomDesc det)

Definition at line 159 of file DetGeomDesc.cc.

References _container.

Referenced by TotemRPGeometryESModule::ApplyAlignments(), DDDTotemRPContruction::buildDetGeomDesc(), and setComponents().

160 {
161  _container.push_back(det);
162 }
Container _container
Definition: DetGeomDesc.h:103
void DetGeomDesc::addComponents ( Container  cont)

Definition at line 150 of file DetGeomDesc.cc.

References _container.

Referenced by setComponents().

151 {
152  for( Container::iterator ig = cont.begin(); ig != cont.end();ig++) {
153  _container.push_back(*ig);
154  }
155 }
Container _container
Definition: DetGeomDesc.h:103
void DetGeomDesc::ApplyAlignment ( const RPAlignmentCorrectionData t)

alignment

Definition at line 184 of file DetGeomDesc.cc.

References _rot, _trans, RPAlignmentCorrectionData::getRotationMatrix(), and RPAlignmentCorrectionData::getTranslation().

Referenced by TotemRPGeometryESModule::ApplyAlignments(), and material().

185 {
186  //cout << " DetGeomDesc::ApplyAlignment > before: " << _trans << ", " << _rot << endl;
187  _rot = t.getRotationMatrix() * _rot;
188  _trans = t.getTranslation() + _trans;
189  //cout << " DetGeomDesc::ApplyAlignment > after: " << _trans << ", " << _rot << endl;
190 }
RotationMatrix getRotationMatrix() const
DDRotationMatrix _rot
Definition: DetGeomDesc.h:106
const math::XYZVectorD & getTranslation() const
DDTranslation _trans
Definition: DetGeomDesc.h:105
void DetGeomDesc::clearComponents ( )
inline

Definition at line 78 of file DetGeomDesc.h.

References _container, deepDeleteComponents(), and deleteComponents().

Referenced by deepDeleteComponents().

79  { _container.resize(0);}
Container _container
Definition: DetGeomDesc.h:103
DetGeomDesc::ConstContainer DetGeomDesc::components ( ) const
virtual

access to the tree structure

Definition at line 121 of file DetGeomDesc.cc.

References _container.

Referenced by TotemRPGeometryESModule::ApplyAlignments(), TotemRPGeometry::Build(), and geographicalID().

122 {
123  ConstContainer _temp;
124  for (Container::const_iterator it = _container.begin(); it != _container.end(); it++) {
125  _temp.push_back(*it);
126  }
127  return _temp;
128 }
std::vector< const DetGeomDesc * > ConstContainer
Definition: DetGeomDesc.h:43
Container _container
Definition: DetGeomDesc.h:103
DetGeomDesc::Container DetGeomDesc::components ( )
virtual

Definition at line 114 of file DetGeomDesc.cc.

References _container.

115 {
116  return _container;
117 }
Container _container
Definition: DetGeomDesc.h:103
virtual int DetGeomDesc::copyno ( ) const
inlinevirtual

Definition at line 93 of file DetGeomDesc.h.

References _copy.

93 {return _copy;}
DetGeomDesc::ConstContainer DetGeomDesc::deepComponents ( ) const
virtual

Definition at line 132 of file DetGeomDesc.cc.

References _container, popcon2dropbox::copy(), and isLeaf().

Referenced by geographicalID().

133 {
134  ConstContainer _temp;
135  if (isLeaf())
136  _temp.push_back(const_cast<DetGeomDesc*>(this));
137  else {
138  for (Container::const_iterator it = _container.begin();
139  it != _container.end(); it++){
140  ConstContainer _temp2 = (**it).deepComponents();
141  copy(_temp2.begin(), _temp2.end(), back_inserter(_temp));
142  }
143  }
144  return _temp;
145 }
std::vector< const DetGeomDesc * > ConstContainer
Definition: DetGeomDesc.h:43
Container _container
Definition: DetGeomDesc.h:103
bool isLeaf() const
traverses the treee and deletes all nodes.
Definition: DetGeomDesc.h:82
void DetGeomDesc::deepDeleteComponents ( )

deletes just the first daughters

Definition at line 173 of file DetGeomDesc.cc.

References _container, and clearComponents().

Referenced by clearComponents(), and ~DetGeomDesc().

174 {
175  for (Container::iterator it = _container.begin(); it != _container.end(); it++) {
176  ( const_cast<DetGeomDesc*>(*it) )->deepDeleteComponents();
177  delete (*it);
178  }
179  clearComponents();
180 }
void clearComponents()
Definition: DetGeomDesc.h:78
void deepDeleteComponents()
deletes just the first daughters
Definition: DetGeomDesc.cc:173
Geometrical description of a detector.
Definition: DetGeomDesc.h:40
Container _container
Definition: DetGeomDesc.h:103
void DetGeomDesc::deleteComponents ( )

Definition at line 166 of file DetGeomDesc.cc.

References _container.

Referenced by clearComponents().

167 {
168  _container.erase(_container.begin(), _container.end());
169 }
Container _container
Definition: DetGeomDesc.h:103
virtual double DetGeomDesc::density ( ) const
inlinevirtual

Definition at line 95 of file DetGeomDesc.h.

References _density.

Referenced by DetGeomDesc().

95 {return _density;}
double _density
Definition: DetGeomDesc.h:114
virtual DetId DetGeomDesc::geographicalID ( ) const
inlinevirtual

Definition at line 64 of file DetGeomDesc.h.

References _geographicalID, components(), and deepComponents().

Referenced by TotemRPGeometryESModule::ApplyAlignments(), and TotemRPGeometry::Build().

64 { return _geographicalID; }
DetId _geographicalID
Definition: DetGeomDesc.h:111
bool DetGeomDesc::isLeaf ( ) const
inline

traverses the treee and deletes all nodes.

Definition at line 82 of file DetGeomDesc.h.

References _container.

Referenced by deepComponents().

83  { return (_container.size() == 0); }
Container _container
Definition: DetGeomDesc.h:103
virtual std::string DetGeomDesc::material ( void  ) const
inlinevirtual

Definition at line 97 of file DetGeomDesc.h.

References _material, and ApplyAlignment().

Referenced by DetGeomDesc().

97 {return _material;}
std::string _material
Definition: DetGeomDesc.h:117
DDName DetGeomDesc::name ( void  ) const
inline
nav_type DetGeomDesc::navType ( ) const
inline

Definition at line 91 of file DetGeomDesc.h.

References _ddd.

91 {return _ddd;}
nav_type _ddd
Definition: DetGeomDesc.h:104
DetGeomDesc & DetGeomDesc::operator= ( const DetGeomDesc ref)

Definition at line 85 of file DetGeomDesc.cc.

References _copy, _ddd, _ddname, _density, _geographicalID, _material, _params, _parents, _rot, _shape, _trans, _type, _volume, and _weight.

86 {
87  _ddd = ref._ddd;
88  _params = ref._params;
89  _trans = ref._trans;
90  _rot = ref._rot;
91  _shape = ref._shape;
92  _ddname = ref._ddname;
93  _parents = ref._parents;
94  _volume = ref._volume;
95  _density = ref._density;
96  _weight = ref._weight;
97  _copy = ref._copy;
98  _material = ref._material;
100  _type = ref._type;
101 
102  return (*this);
103 }
std::vector< DDExpandedNode > _parents
Definition: DetGeomDesc.h:112
DDSolidShape _shape
Definition: DetGeomDesc.h:107
DetId _geographicalID
Definition: DetGeomDesc.h:111
DDRotationMatrix _rot
Definition: DetGeomDesc.h:106
double _volume
Definition: DetGeomDesc.h:113
DDTranslation _trans
Definition: DetGeomDesc.h:105
GeometricEnumType _type
Definition: DetGeomDesc.h:109
double _density
Definition: DetGeomDesc.h:114
double _weight
Definition: DetGeomDesc.h:115
std::vector< double > _params
Definition: DetGeomDesc.h:110
nav_type _ddd
Definition: DetGeomDesc.h:104
DDName _ddname
Definition: DetGeomDesc.h:108
std::string _material
Definition: DetGeomDesc.h:117
std::vector<double> DetGeomDesc::params ( ) const
inline

Definition at line 92 of file DetGeomDesc.h.

References _params.

Referenced by CTPPSDiamondRecHitProducerAlgorithm::build().

92 {return _params;}
std::vector< double > _params
Definition: DetGeomDesc.h:110
virtual std::vector< DDExpandedNode > DetGeomDesc::parents ( ) const
inlinevirtual

returns all the components below

retuns the geometrical history

Definition at line 70 of file DetGeomDesc.h.

References _parents.

71  { return _parents; }
std::vector< DDExpandedNode > _parents
Definition: DetGeomDesc.h:112
DDRotationMatrix DetGeomDesc::rotation ( void  ) const
inline

geometry information

Definition at line 86 of file DetGeomDesc.h.

References _rot.

Referenced by TotemRPGeometry::GlobalToLocal(), and TotemRPGeometry::LocalToGlobal().

86 {return _rot;}
DDRotationMatrix _rot
Definition: DetGeomDesc.h:106
void DetGeomDesc::setComponents ( Container  cont)
inline

components (children) management

Definition at line 74 of file DetGeomDesc.h.

References _container, addComponent(), and addComponents().

75  { _container = cont; }
Container _container
Definition: DetGeomDesc.h:103
void DetGeomDesc::setGeographicalID ( DetId  id)
inline

ID stuff.

Definition at line 63 of file DetGeomDesc.h.

References _geographicalID, and hcalTTPDigis_cfi::id.

Referenced by DDDTotemRPContruction::buildDetGeomDesc().

DDSolidShape DetGeomDesc::shape ( void  ) const
inline

Definition at line 88 of file DetGeomDesc.h.

References _shape.

Referenced by DetGeomDesc().

88 {return _shape;}
DDSolidShape _shape
Definition: DetGeomDesc.h:107
DDTranslation DetGeomDesc::translation ( void  ) const
inline
GeometricEnumType DetGeomDesc::type ( ) const
inline

Definition at line 89 of file DetGeomDesc.h.

References _type.

89 {return _type;}
GeometricEnumType _type
Definition: DetGeomDesc.h:109
virtual double DetGeomDesc::volume ( void  ) const
inlinevirtual

Definition at line 94 of file DetGeomDesc.h.

References _volume.

Referenced by DetGeomDesc().

94 {return _volume;}
double _volume
Definition: DetGeomDesc.h:113
virtual double DetGeomDesc::weight ( void  ) const
inlinevirtual

Definition at line 96 of file DetGeomDesc.h.

References _weight.

96 {return _weight;}
double _weight
Definition: DetGeomDesc.h:115

Member Data Documentation

Container DetGeomDesc::_container
private
int DetGeomDesc::_copy
private

Definition at line 116 of file DetGeomDesc.h.

Referenced by copyno(), DetGeomDesc(), and operator=().

nav_type DetGeomDesc::_ddd
private

Definition at line 104 of file DetGeomDesc.h.

Referenced by DetGeomDesc(), navType(), and operator=().

DDName DetGeomDesc::_ddname
private

Definition at line 108 of file DetGeomDesc.h.

Referenced by DetGeomDesc(), name(), and operator=().

double DetGeomDesc::_density
private

Definition at line 114 of file DetGeomDesc.h.

Referenced by density(), DetGeomDesc(), and operator=().

DetId DetGeomDesc::_geographicalID
private

Definition at line 111 of file DetGeomDesc.h.

Referenced by geographicalID(), operator=(), and setGeographicalID().

std::string DetGeomDesc::_material
private

Definition at line 117 of file DetGeomDesc.h.

Referenced by DetGeomDesc(), material(), and operator=().

std::vector<double> DetGeomDesc::_params
private

Definition at line 110 of file DetGeomDesc.h.

Referenced by DetGeomDesc(), operator=(), and params().

std::vector< DDExpandedNode > DetGeomDesc::_parents
private

Definition at line 112 of file DetGeomDesc.h.

Referenced by DetGeomDesc(), operator=(), and parents().

DDRotationMatrix DetGeomDesc::_rot
private

Definition at line 106 of file DetGeomDesc.h.

Referenced by ApplyAlignment(), DetGeomDesc(), operator=(), and rotation().

DDSolidShape DetGeomDesc::_shape
private

Definition at line 107 of file DetGeomDesc.h.

Referenced by DetGeomDesc(), operator=(), and shape().

DDTranslation DetGeomDesc::_trans
private

Definition at line 105 of file DetGeomDesc.h.

Referenced by ApplyAlignment(), DetGeomDesc(), operator=(), and translation().

GeometricEnumType DetGeomDesc::_type
private

Definition at line 109 of file DetGeomDesc.h.

Referenced by operator=(), and type().

double DetGeomDesc::_volume
private

Definition at line 113 of file DetGeomDesc.h.

Referenced by DetGeomDesc(), operator=(), and volume().

double DetGeomDesc::_weight
private

Definition at line 115 of file DetGeomDesc.h.

Referenced by DetGeomDesc(), operator=(), and weight().