13 #ifndef DD4HEP_GEOMETRY_OBJECTS_H
14 #define DD4HEP_GEOMETRY_OBJECTS_H
27 class TGeoTranslation;
28 class TGeoPhysicalNode;
32 #pragma GCC diagnostic push
33 #pragma GCC diagnostic ignored "-Wdeprecated" // Code that causes warning goes here
36 #include "TGeoPhysicalNode.h"
37 #include "Math/Vector3D.h"
38 #include "Math/Transform3D.h"
39 #include "Math/Translation3D.h"
40 #include "Math/RotationX.h"
41 #include "Math/RotationY.h"
42 #include "Math/RotationZ.h"
43 #include "Math/Rotation3D.h"
44 #include "Math/RotationZYX.h"
45 #include "Math/EulerAngles.h"
46 #include "Math/VectorUtil.h"
48 #pragma GCC diagnostic pop
57 #define _USE_MATH_DEFINES
59 #define M_PI 3.14159265358979323846
77 typedef ROOT::Math::XYZVector
Position;
78 template <
class V> V
RotateX(
const V&
v,
double a) {
81 template <
class V> V
RotateY(
const V&
v,
double a) {
84 template <
class V> V
RotateZ(
const V&
v,
double a) {
137 template <
typename Q>
146 m_element = e.m_element;
193 const std::string
name()
const;
195 void setName(
const std::string& new_name);
197 const std::string
title()
const;
199 void setTitle(
const std::string& new_title);
201 const std::string&
author()
const;
203 void setAuthor(
const std::string& new_author);
205 const std::string&
url()
const;
207 void setUrl(
const std::string& new_url);
209 const std::string&
status()
const;
211 void setStatus(
const std::string& new_status);
213 const std::string&
version()
const;
215 void setVersion(
const std::string& new_version);
217 const std::string&
comment()
const;
219 void setComment(
const std::string& new_comment);
244 template <
typename Q>
251 Constant(
const std::string&
name,
const std::string& val,
const std::string& typ=
"number");
281 template <
typename Q>
287 Atom(
const std::string&
name,
const std::string& formula,
int Z,
int N,
double density);
315 template <
typename Q>
361 template <
typename Q>
404 void setColor(
float red,
float green,
float blue);
407 bool rgb(
float& red,
float& green,
float& blue)
const;
424 template <
typename Q>
431 int align(
const Position& pos,
bool check =
false,
double overlap = 0.001);
433 int align(
const RotationZYX& rot,
bool check =
false,
double overlap = 0.001);
492 template <
typename Q>
507 const std::set<DD4hep::Geometry::Limit>&
limits()
const;
534 template <
typename Q>
551 std::vector<std::string>&
limits()
const;
564 #include "Math/Vector4D.h"
565 #include "Math/Point3D.h"
572 return std::sqrt(l.X() * r.X() + l.Y() * r.Y() + l.Z() * r.Z());
576 return 0.5 * (p1.R() + p2.R()) / 2.0;
580 return 0.5 * (p1 + p2);
588 bool operator<(
const XYZPoint& a,
const XYZPoint& b);
590 bool operator<(
const XYZVector& a,
const XYZVector& b);
592 bool operator<(
const PxPyPzEVector& a,
const PxPyPzEVector& b);
Handle< TGeoPhysicalNode > Base
Constant(const Constant &e)
Constructorto be used for assignment from a handle.
std::string toString() const
Conversion to a string representation.
Atom()
Default constructor.
Limit & operator=(const Limit &c)
Assignment operator.
double operator*(const Position &l, const Position &r)
Dot product of 3-vectors.
Constant()
Default constructor.
void setShowDaughters(bool value)
Set Flag to show/hide daughter elements.
const char * name() const
Access the object name (or "" if not supported by the object)
Handle class describing a material.
bool storeSecondaries() const
Access secondaries flag.
Handle class describing an element in the periodic table.
Region & operator=(const Region &c)
Assignment operator.
LimitSet(const Handle< Q > &e)
Constructor to be used when reading the already parsed DOM tree.
const std::set< DD4hep::Geometry::Limit > & limits() const
Accessor to limits container.
Author(const Handle< Q > &e)
Constructor to be used when assigning already valid handle.
double cut() const
Access cut value.
Constant(const Handle< Q > &e)
Constructor to be used when reading the already parsed DOM tree.
Concrete object implementation of the Region Handle.
NamedObject Object
Definition of the implementation type.
double intLength() const
Access the interaction length of the underlying material.
VisAttr()
Default constructor.
Region(const Region &e)
Copy Constructor.
std::string authorName() const
Access the auhor's name.
RegionObject Object
Implemeting class.
LimitSet(const LimitSet &e)
Copy constructor for handle.
LimitSet()
Constructor to be used when reading the already parsed DOM tree.
ROOT::Math::RotationY RotationY
Concrete object implementation for the Constant handle.
void setColor(float red, float green, float blue)
Set object color.
Region & setThreshold(double value)
double mean_length(const Position &p1, const Position &p2)
Calculate the mean length of two vectors.
bool rgb(float &red, float &green, float &blue) const
Get RGB values of the color (if valid)
Region & setStoreSecondaries(bool value)
Implementation of a named object.
std::vector< std::string > & limits() const
Access references to user limits.
ROOT::Math::RotationZYX RotationZYX
bool operator<(const XYZPoint &a, const XYZPoint &b)
Allow point insertion of a point in maps.
DD4hep::Geometry::Position Position
bool visible() const
Get visibility flag.
std::string toString() const
String representation of this object.
Deprecated: Handle class describing an alignment entry.
TGeoIdentity * identityTransform()
Access the TGeo identity transformation
V RotateZ(const V &v, double a)
std::string toString() const
String representation of this object.
Position mean_direction(const Position &p1, const Position &p2)
Calculate the mean direction of two vectors.
ROOT::Math::Rotation3D Rotation3D
double threshold() const
Access production threshold.
void setAuthorEmail(const std::string &addr)
Set the author's email address.
Limit()
Default constructor.
Limit(const Limit &c)
Copy constructor.
Region(const Handle< Q > &e)
Constructor to be used when assigning handle.
void setAuthorName(const std::string &nam)
Set the author's name.
double radLength() const
Access the radiation length of the underlying material.
double A() const
atomic number of the underlying material
VisAttr(const VisAttr &e)
Copy constructor for handle.
int lineStyle() const
Get line style.
ROOT::Math::XYZVector Position
Author(const Author &e)
Constructorto be used for assignment from a handle.
Material()
Default constructor.
TGeoMedium Object
Definition of the implementation type.
ROOT::Math::RotationZ RotationZ
Author()
Default constructor.
Atom(const Handle< Q > &e)
Constructor to be used when creating from a object handle.
Handle< NamedObject > Ref_t
Default Ref_t definition describing named objects.
Region & setCut(double value)
Handle class describing an author entity.
Small object describing a limit structure acting on a particle type.
double Z() const
proton number of the underlying material
std::string dataType() const
Access the constant.
Handle class describing visualization attributes.
std::string authorEmail() const
Access the auhor's email address.
LimitSet & operator=(const LimitSet &c)
Assignment operator.
TGeoElement Object
Definition of the implementation type.
Handle: a templated class like a shared pointer, which allows specialized access to tgeometry objects...
ROOT::Math::Translation3D Translation3D
AlignmentEntry(const Handle< Q > &h)
Constructor to be used when reading the already parsed DOM tree.
int drawingStyle() const
Get drawing style.
Material(const Handle< Q > &e)
Constructorto be used for assignment from object handle.
V RotateY(const V &v, double a)
Handle class describing a set of limits as they are used for simulation.
bool operator==(const Limit &c) const
Equality operator.
Handle class describing a region as used in simulation.
V RotateX(const V &v, double a)
double density() const
density of the underlying material
bool operator<(const Limit &c) const
operator less
The main interface to the DD4hep detector description package.
void setDrawingStyle(int style)
Set drawing style.
ROOT::Math::EulerAngles EulerAngles
ConstantObject Object
Definition of the implementation type.
int color() const
Get object color.
Concrete object implementation of the LimitSet Handle.
Region()
Default constructor.
float alpha() const
Get alpha value.
T * m_element
Single and only data member: Reference to the actual element.
VisAttr & operator=(const VisAttr &attr)
Assignment operator.
std::string toString() const
String representation of this object.
VisAttr(const Handle< Q > &e)
Constructor to be used for assignment from object handle.
int align(const Position &pos, bool check=false, double overlap=0.001)
Align the PhysicalNode (translation only)
void setAlpha(float value)
Set alpha value.
ROOT::Math::Transform3D Transform3D
ROOT::Math::RotationX RotationX
void setVisible(bool value)
Set visibility flag.
Author & operator=(const Author &e)
Assignment operator.
bool addLimit(const DD4hep::Geometry::Limit &limit)
Add new limit. Returns true if the new limit was added, false if it already existed.
Handle class describing a constant (define) object in lcdd.
Geometry::IDDescriptor IDDescriptor
Concrete object implementation of the VisAttr Handle.
bool showDaughters() const
Get Flag to show/hide daughter elements.
void setLineStyle(int style)
Set line style.