diff --git a/DDCond/include/DDCond/ConditionsDependencyHandler.h b/DDCond/include/DDCond/ConditionsDependencyHandler.h index 163769e507ab878d08fa524c510756a5b206fb20..c452225a5a16a9e1e52598b0f3f3bf34d159fe11 100644 --- a/DDCond/include/DDCond/ConditionsDependencyHandler.h +++ b/DDCond/include/DDCond/ConditionsDependencyHandler.h @@ -38,7 +38,9 @@ namespace dd4hep { */ class ConditionsDependencyHandler : public ConditionResolver { public: + /// Obect state definitions enum State { INVALID, CREATED, RESOLVED }; + /// Helper structure to define the current update item struct Work { IOV iov; ConditionUpdateContext context; @@ -68,10 +70,11 @@ namespace dd4hep { /// User defined optional processing parameter ConditionUpdateUserContext* m_userParam; /// The objects created during processing - WorkConditions m_created, m_todo; + WorkConditions m_created, m_todo; /// Handler's state State m_state = CREATED; - Work* m_block; + /// Current blocking work item + Work* m_block; public: /// Number of callbacks to the handler for monitoring diff --git a/DDCond/src/plugins/ConditionsParser.cpp b/DDCond/src/plugins/ConditionsParser.cpp index ad606128dfeb7da16e7efa15373cba40d8815a5d..4cfd46ad113dc7550d0e16ff1d895664cce9470c 100644 --- a/DDCond/src/plugins/ConditionsParser.cpp +++ b/DDCond/src/plugins/ConditionsParser.cpp @@ -61,8 +61,10 @@ using std::string; using namespace dd4hep; using namespace dd4hep::cond; +/// Namespace for the AIDA detector description toolkit namespace dd4hep { + /// Helper structure for data conversion struct ConversionArg { DetElement detector; ConditionsStack* stack; diff --git a/DDCore/include/DDSegmentation/BitField64.h b/DDCore/include/DDSegmentation/BitField64.h index 1ff9067441959f5d31ac2e55b910c56488d7b14b..1e02050c5abfbf0d1dd3440508ca7ef4a178e1bd 100644 --- a/DDCore/include/DDSegmentation/BitField64.h +++ b/DDCore/include/DDSegmentation/BitField64.h @@ -1,3 +1,14 @@ +//========================================================================== +// AIDA Detector description implementation +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN) +// All rights reserved. +// +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. +// +//========================================================================== + #ifndef DDSegmentation_BitField64_H #define DDSegmentation_BitField64_H 1 @@ -17,13 +28,12 @@ namespace dd4hep { namespace DDSegmentation { - /** Lightweight helper class for BitField64 that corresponds to one field value. - * (Not thread safe - only use directly through BitField64). + /// Lightweight helper class for BitField64 that corresponds to one field value. + /** (Not thread safe - only use directly through BitField64). * * @author F.Gaede, DESY * @date 2017-09 */ - class BitFieldValue{ long64& _value ; @@ -79,8 +89,8 @@ namespace dd4hep { } ; - /** A bit field of 64bits that allows convenient declaration and - * manipulation of sub fields of various widths.<br> + /// A bit field of 64bits that allows convenient declaration + /** and manipulation of sub fields of various widths.<br> * Example:<br> * BitField64 b("layer:7,system:-3,barrel:3,theta:32:11,phi:11" ) ; <br> * b[ "layer" ] = 123 ; <br> diff --git a/DDCore/include/DDSegmentation/BitFieldCoder.h b/DDCore/include/DDSegmentation/BitFieldCoder.h index 0a14acc1c101804877cfacf53506c22d4733fc7b..6428191a833b7344eec460c8d4338425bef1ceec 100644 --- a/DDCore/include/DDSegmentation/BitFieldCoder.h +++ b/DDCore/include/DDSegmentation/BitFieldCoder.h @@ -1,3 +1,14 @@ +//========================================================================== +// AIDA Detector description implementation +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN) +// All rights reserved. +// +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. +// +//========================================================================== + #ifndef DDSegmentation_BitFieldCoder_H #define DDSegmentation_BitFieldCoder_H 1 @@ -17,10 +28,8 @@ namespace DDSegmentation { class StringTokenizer ; - /** Helper class for BitFieldCoder that corresponds to one field value. - */ - - class BitFieldElement{ + /// Helper class for BitFieldCoder that corresponds to one field value. + class BitFieldElement{ public : @@ -86,8 +95,8 @@ namespace DDSegmentation { - /** Helper class for decoding and encoding a bit field of 64bits for convenient declaration and - * manipulation of sub fields of various widths.<br> + /// Helper class for decoding and encoding a bit field of 64bits for convenient declaration + /** and manipulation of sub fields of various widths.<br> * This is a thread safe re-implementation of the functionality in the deprected BitField64. * * Example:<br> @@ -253,7 +262,8 @@ namespace DDSegmentation { }; - /** Helper class for string tokenization. Usage:<br> + /// Helper class for string tokenization. + /** Usage:<br> * std::vector<std::string> tokens ; <br> * StringTokenizer t( tokens ,',') ; <br> * std::for_each( aString.begin(), aString.end(), t ) ; <br> diff --git a/DDCore/include/DDSegmentation/CartesianGrid.h b/DDCore/include/DDSegmentation/CartesianGrid.h index 4f57c10807dd3f2f8e032b5253f224daaf79ab4d..4c669ee9503d5ccaf847ae0816c3aaa1ca5f441a 100644 --- a/DDCore/include/DDSegmentation/CartesianGrid.h +++ b/DDCore/include/DDSegmentation/CartesianGrid.h @@ -1,3 +1,14 @@ +//========================================================================== +// AIDA Detector description implementation +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN) +// All rights reserved. +// +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. +// +//========================================================================== + /* * CartesianGrid.h * @@ -11,19 +22,20 @@ #include "DDSegmentation/Segmentation.h" namespace dd4hep { -namespace DDSegmentation { + namespace DDSegmentation { -class CartesianGrid: public Segmentation { -public: - /// Destructor - virtual ~CartesianGrid(); -protected: - /// Default constructor used by derived classes passing the encoding string - CartesianGrid(const std::string& cellEncoding = ""); - /// Default constructor used by derived classes passing an existing decoder - CartesianGrid(const BitFieldCoder* decoder); -}; + /// Segmentation base class describing cartesian grid segmentation + class CartesianGrid: public Segmentation { + public: + /// Destructor + virtual ~CartesianGrid(); + protected: + /// Default constructor used by derived classes passing the encoding string + CartesianGrid(const std::string& cellEncoding = ""); + /// Default constructor used by derived classes passing an existing decoder + CartesianGrid(const BitFieldCoder* decoder); + }; -} /* namespace DDSegmentation */ + } /* namespace DDSegmentation */ } /* namespace dd4hep */ #endif /* DDSegmentation_CARTESIANGRID_H_ */ diff --git a/DDCore/include/DDSegmentation/CartesianGridXY.h b/DDCore/include/DDSegmentation/CartesianGridXY.h index 337af434593e344cb91211e405ea32e9882194f5..7ea2400f7ef1b846eafeed16f0d2462bd685c0e5 100644 --- a/DDCore/include/DDSegmentation/CartesianGridXY.h +++ b/DDCore/include/DDSegmentation/CartesianGridXY.h @@ -1,3 +1,17 @@ +//========================================================================== +// AIDA Detector description implementation +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN) +// All rights reserved. +// +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. +// +//========================================================================== + + + + /* * CartesianGridXY.h * @@ -11,95 +25,96 @@ #include "DDSegmentation/CartesianGrid.h" namespace dd4hep { -namespace DDSegmentation { + namespace DDSegmentation { -class CartesianGridXY: public CartesianGrid { -public: - /// Default constructor passing the encoding string - CartesianGridXY(const std::string& cellEncoding = ""); - /// Default constructor used by derived classes passing an existing decoder - CartesianGridXY(const BitFieldCoder* decoder); - /// destructor - virtual ~CartesianGridXY(); + /// Segmentation base class describing cartesian grid segmentation in the X-Y plane + class CartesianGridXY: public CartesianGrid { + public: + /// Default constructor passing the encoding string + CartesianGridXY(const std::string& cellEncoding = ""); + /// Default constructor used by derived classes passing an existing decoder + CartesianGridXY(const BitFieldCoder* decoder); + /// destructor + virtual ~CartesianGridXY(); - /// determine the position based on the cell ID - virtual Vector3D position(const CellID& cellID) const; - /// determine the cell ID based on the position - virtual CellID cellID(const Vector3D& localPosition, const Vector3D& globalPosition, const VolumeID& volumeID) const; - /// access the grid size in X - double gridSizeX() const { - return _gridSizeX; - } - /// access the grid size in Y - double gridSizeY() const { - return _gridSizeY; - } - /// access the coordinate offset in X - double offsetX() const { - return _offsetX; - } - /// access the coordinate offset in Y - double offsetY() const { - return _offsetY; - } - /// access the field name used for X - const std::string& fieldNameX() const { - return _xId; - } - /// access the field name used for Y - const std::string& fieldNameY() const { - return _yId; - } - /// set the grid size in X - void setGridSizeX(double cellSize) { - _gridSizeX = cellSize; - } - /// set the grid size in Y - void setGridSizeY(double cellSize) { - _gridSizeY = cellSize; - } - /// set the coordinate offset in X - void setOffsetX(double offset) { - _offsetX = offset; - } - /// set the coordinate offset in Y - void setOffsetY(double offset) { - _offsetY = offset; - } - /// set the field name used for X - void setFieldNameX(const std::string& fieldName) { - _xId = fieldName; - } - /// set the field name used for Y - void setFieldNameY(const std::string& fieldName) { - _yId = fieldName; - } - /** \brief Returns a vector<double> of the cellDimensions of the given cell ID - in natural order of dimensions, e.g., dx/dy/dz, or dr/r*dPhi + /// determine the position based on the cell ID + virtual Vector3D position(const CellID& cellID) const; + /// determine the cell ID based on the position + virtual CellID cellID(const Vector3D& localPosition, const Vector3D& globalPosition, const VolumeID& volumeID) const; + /// access the grid size in X + double gridSizeX() const { + return _gridSizeX; + } + /// access the grid size in Y + double gridSizeY() const { + return _gridSizeY; + } + /// access the coordinate offset in X + double offsetX() const { + return _offsetX; + } + /// access the coordinate offset in Y + double offsetY() const { + return _offsetY; + } + /// access the field name used for X + const std::string& fieldNameX() const { + return _xId; + } + /// access the field name used for Y + const std::string& fieldNameY() const { + return _yId; + } + /// set the grid size in X + void setGridSizeX(double cellSize) { + _gridSizeX = cellSize; + } + /// set the grid size in Y + void setGridSizeY(double cellSize) { + _gridSizeY = cellSize; + } + /// set the coordinate offset in X + void setOffsetX(double offset) { + _offsetX = offset; + } + /// set the coordinate offset in Y + void setOffsetY(double offset) { + _offsetY = offset; + } + /// set the field name used for X + void setFieldNameX(const std::string& fieldName) { + _xId = fieldName; + } + /// set the field name used for Y + void setFieldNameY(const std::string& fieldName) { + _yId = fieldName; + } + /** \brief Returns a vector<double> of the cellDimensions of the given cell ID + in natural order of dimensions, e.g., dx/dy/dz, or dr/r*dPhi - Returns a vector of the cellDimensions of the given cell ID - \param cellID is ignored as all cells have the same dimension - \return std::vector<double> size 2: - -# size in x - -# size in y - */ - virtual std::vector<double> cellDimensions(const CellID& cellID) const; + Returns a vector of the cellDimensions of the given cell ID + \param cellID is ignored as all cells have the same dimension + \return std::vector<double> size 2: + -# size in x + -# size in y + */ + virtual std::vector<double> cellDimensions(const CellID& cellID) const; -protected: - /// the grid size in X - double _gridSizeX; - /// the coordinate offset in X - double _offsetX; - /// the grid size in Y - double _gridSizeY; - /// the coordinate offset in Y - double _offsetY; - /// the field name used for X - std::string _xId; - /// the field name used for Y - std::string _yId; -}; + protected: + /// the grid size in X + double _gridSizeX; + /// the coordinate offset in X + double _offsetX; + /// the grid size in Y + double _gridSizeY; + /// the coordinate offset in Y + double _offsetY; + /// the field name used for X + std::string _xId; + /// the field name used for Y + std::string _yId; + }; -} /* namespace DDSegmentation */ + } /* namespace DDSegmentation */ } /* namespace dd4hep */ #endif /* DDSegmentation_CARTESIANGRIDXY_H_ */ diff --git a/DDCore/include/DDSegmentation/CartesianGridXYZ.h b/DDCore/include/DDSegmentation/CartesianGridXYZ.h index 0ee1b1c214914be9a7ea307510fec9c94043de0d..9c1d3046e22a3a76a2dd92bf713178004247c668 100644 --- a/DDCore/include/DDSegmentation/CartesianGridXYZ.h +++ b/DDCore/include/DDSegmentation/CartesianGridXYZ.h @@ -1,3 +1,14 @@ +//========================================================================== +// AIDA Detector description implementation +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN) +// All rights reserved. +// +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. +// +//========================================================================== + /* * CartesianGridXYZ.h * @@ -11,66 +22,67 @@ #include "DDSegmentation/CartesianGridXY.h" namespace dd4hep { -namespace DDSegmentation { + namespace DDSegmentation { -class CartesianGridXYZ: public CartesianGridXY { -public: - /// default constructor using an arbitrary type - CartesianGridXYZ(const std::string& cellEncoding); - /// Default constructor used by derived classes passing an existing decoder - CartesianGridXYZ(const BitFieldCoder* decoder); - /// destructor - virtual ~CartesianGridXYZ(); + /// Segmentation base class describing cartesian grid segmentation in space + class CartesianGridXYZ: public CartesianGridXY { + public: + /// default constructor using an arbitrary type + CartesianGridXYZ(const std::string& cellEncoding); + /// Default constructor used by derived classes passing an existing decoder + CartesianGridXYZ(const BitFieldCoder* decoder); + /// destructor + virtual ~CartesianGridXYZ(); - /// determine the position based on the cell ID - virtual Vector3D position(const CellID& cellID) const; - /// determine the cell ID based on the position - virtual CellID cellID(const Vector3D& localPosition, const Vector3D& globalPosition, const VolumeID& volumeID) const; - /// access the grid size in Z - double gridSizeZ() const { - return _gridSizeZ; - } - /// access the coordinate offset in Z - double offsetZ() const { - return _offsetZ; - } - /// access the field name used for Z - const std::string& fieldNameZ() const { - return _zId; - } - /// set the grid size in Z - void setGridSizeZ(double cellSize) { - _gridSizeZ = cellSize; - } - /// set the coordinate offset in Z - void setOffsetZ(double offset) { - _offsetZ = offset; - } - /// set the field name used for Z - void setFieldNameZ(const std::string& fieldName) { - _zId = fieldName; - } - /** \brief Returns a vector<double> of the cellDimensions of the given cell ID - in natural order of dimensions, e.g., dx/dy/dz, or dr/r*dPhi + /// determine the position based on the cell ID + virtual Vector3D position(const CellID& cellID) const; + /// determine the cell ID based on the position + virtual CellID cellID(const Vector3D& localPosition, const Vector3D& globalPosition, const VolumeID& volumeID) const; + /// access the grid size in Z + double gridSizeZ() const { + return _gridSizeZ; + } + /// access the coordinate offset in Z + double offsetZ() const { + return _offsetZ; + } + /// access the field name used for Z + const std::string& fieldNameZ() const { + return _zId; + } + /// set the grid size in Z + void setGridSizeZ(double cellSize) { + _gridSizeZ = cellSize; + } + /// set the coordinate offset in Z + void setOffsetZ(double offset) { + _offsetZ = offset; + } + /// set the field name used for Z + void setFieldNameZ(const std::string& fieldName) { + _zId = fieldName; + } + /** \brief Returns a vector<double> of the cellDimensions of the given cell ID + in natural order of dimensions, e.g., dx/dy/dz, or dr/r*dPhi - Returns a vector of the cellDimensions of the given cell ID - \param cellID is ignored as all cells have the same dimension - \return std::vector<double> size 3: - -# size in x - -# size in y - -# size in z - */ - virtual std::vector<double> cellDimensions(const CellID& cellID) const; + Returns a vector of the cellDimensions of the given cell ID + \param cellID is ignored as all cells have the same dimension + \return std::vector<double> size 3: + -# size in x + -# size in y + -# size in z + */ + virtual std::vector<double> cellDimensions(const CellID& cellID) const; -protected: - /// the grid size in Z - double _gridSizeZ; - /// the coordinate offset in Z - double _offsetZ; - /// the field name used for Z - std::string _zId; -}; + protected: + /// the grid size in Z + double _gridSizeZ; + /// the coordinate offset in Z + double _offsetZ; + /// the field name used for Z + std::string _zId; + }; -} /* namespace DDSegmentation */ + } /* namespace DDSegmentation */ } /* namespace dd4hep */ #endif /* DDSegmentation_CARTESIANGRIDXYZ_H_ */ diff --git a/DDCore/include/DDSegmentation/CartesianGridXZ.h b/DDCore/include/DDSegmentation/CartesianGridXZ.h index c0ed76b592f50bf869262f63c5314aa006db12a4..c5d265a9c5a57c5ca53101e3cf714b80b402d2d7 100644 --- a/DDCore/include/DDSegmentation/CartesianGridXZ.h +++ b/DDCore/include/DDSegmentation/CartesianGridXZ.h @@ -1,3 +1,14 @@ +//========================================================================== +// AIDA Detector description implementation +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN) +// All rights reserved. +// +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. +// +//========================================================================== + /* * CartesianGridXY.h * @@ -11,95 +22,96 @@ #include "DDSegmentation/CartesianGrid.h" namespace dd4hep { -namespace DDSegmentation { + namespace DDSegmentation { -class CartesianGridXZ: public CartesianGrid { -public: - /// default constructor using an arbitrary type - CartesianGridXZ(const std::string& cellEncoding); - /// Default constructor used by derived classes passing an existing decoder - CartesianGridXZ(const BitFieldCoder* decoder); - /// destructor - virtual ~CartesianGridXZ(); + /// Segmentation base class describing cartesian grid segmentation in the X-Z plane + class CartesianGridXZ: public CartesianGrid { + public: + /// default constructor using an arbitrary type + CartesianGridXZ(const std::string& cellEncoding); + /// Default constructor used by derived classes passing an existing decoder + CartesianGridXZ(const BitFieldCoder* decoder); + /// destructor + virtual ~CartesianGridXZ(); - /// determine the local based on the cell ID - virtual Vector3D position(const CellID& cellID) const; - /// determine the cell ID based on the position - virtual CellID cellID(const Vector3D& localPosition, const Vector3D& globalPosition, const VolumeID& volumeID) const; - /// access the grid size in X - double gridSizeX() const { - return _gridSizeX; - } - /// access the grid size in Z - double gridSizeZ() const { - return _gridSizeZ; - } - /// access the coordinate offset in X - double offsetX() const { - return _offsetX; - } - /// access the coordinate offset in Z - double offsetZ() const { - return _offsetZ; - } - /// access the field name used for X - const std::string& fieldNameX() const { - return _xId; - } - /// access the field name used for Z - const std::string& fieldNameZ() const { - return _zId; - } - /// set the grid size in X - void setGridSizeX(double cellSize) { - _gridSizeX = cellSize; - } - /// set the grid size in Z - void setGridSizeZ(double cellSize) { - _gridSizeZ = cellSize; - } - /// set the coordinate offset in X - void setOffsetX(double offset) { - _offsetX = offset; - } - /// set the coordinate offset in Z - void setOffsetZ(double offset) { - _offsetZ = offset; - } - /// set the field name used for X - void setFieldNameX(const std::string& fieldName) { - _xId = fieldName; - } - /// set the field name used for Y - void setFieldNameZ(const std::string& fieldName) { - _zId = fieldName; - } - /** \brief Returns a vector<double> of the cellDimensions of the given cell ID - in natural order of dimensions, e.g., dx/dy/dz, or dr/r*dPhi + /// determine the local based on the cell ID + virtual Vector3D position(const CellID& cellID) const; + /// determine the cell ID based on the position + virtual CellID cellID(const Vector3D& localPosition, const Vector3D& globalPosition, const VolumeID& volumeID) const; + /// access the grid size in X + double gridSizeX() const { + return _gridSizeX; + } + /// access the grid size in Z + double gridSizeZ() const { + return _gridSizeZ; + } + /// access the coordinate offset in X + double offsetX() const { + return _offsetX; + } + /// access the coordinate offset in Z + double offsetZ() const { + return _offsetZ; + } + /// access the field name used for X + const std::string& fieldNameX() const { + return _xId; + } + /// access the field name used for Z + const std::string& fieldNameZ() const { + return _zId; + } + /// set the grid size in X + void setGridSizeX(double cellSize) { + _gridSizeX = cellSize; + } + /// set the grid size in Z + void setGridSizeZ(double cellSize) { + _gridSizeZ = cellSize; + } + /// set the coordinate offset in X + void setOffsetX(double offset) { + _offsetX = offset; + } + /// set the coordinate offset in Z + void setOffsetZ(double offset) { + _offsetZ = offset; + } + /// set the field name used for X + void setFieldNameX(const std::string& fieldName) { + _xId = fieldName; + } + /// set the field name used for Y + void setFieldNameZ(const std::string& fieldName) { + _zId = fieldName; + } + /** \brief Returns a vector<double> of the cellDimensions of the given cell ID + in natural order of dimensions, e.g., dx/dy/dz, or dr/r*dPhi - Returns a vector of the cellDimensions of the given cell ID - \param cellID is ignored as all cells have the same dimension - \return std::vector<double> size 2: - -# size in x - -# size in z - */ - virtual std::vector<double> cellDimensions(const CellID& cellID) const; + Returns a vector of the cellDimensions of the given cell ID + \param cellID is ignored as all cells have the same dimension + \return std::vector<double> size 2: + -# size in x + -# size in z + */ + virtual std::vector<double> cellDimensions(const CellID& cellID) const; -protected: - /// the grid size in X - double _gridSizeX; - /// the coordinate offset in X - double _offsetX; - /// the grid size in Z - double _gridSizeZ; - /// the coordinate offset in Z - double _offsetZ; - /// the field name used for X - std::string _xId; - /// the field name used for Z - std::string _zId; -}; + protected: + /// the grid size in X + double _gridSizeX; + /// the coordinate offset in X + double _offsetX; + /// the grid size in Z + double _gridSizeZ; + /// the coordinate offset in Z + double _offsetZ; + /// the field name used for X + std::string _xId; + /// the field name used for Z + std::string _zId; + }; -} /* namespace DDSegmentation */ + } /* namespace DDSegmentation */ } /* namespace dd4hep */ #endif /* DDSegmentation_CARTESIANGRIDXZ_H_ */ diff --git a/DDCore/include/DDSegmentation/CartesianGridYZ.h b/DDCore/include/DDSegmentation/CartesianGridYZ.h index 9c7bb534c5c4b1c60cb21edd69ed79e711489437..de4f29c5d0993abc0952bd905ccf390d0cd25cb5 100644 --- a/DDCore/include/DDSegmentation/CartesianGridYZ.h +++ b/DDCore/include/DDSegmentation/CartesianGridYZ.h @@ -1,107 +1,118 @@ +//========================================================================== +// AIDA Detector description implementation +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN) +// All rights reserved. +// +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. +// +//========================================================================== #ifndef DDSegmentation_CARTESIANGRIDYZ_H_ #define DDSegmentation_CARTESIANGRIDYZ_H_ #include "DDSegmentation/CartesianGrid.h" namespace dd4hep { -namespace DDSegmentation { + namespace DDSegmentation { -/** - * CartesianGridYZ.h - * - * @date: Sep 03, 2014 - * @author: F.Gaede CERN/Desy - * @version: $Id: $ - * direkt copy of CartesianGridXY - * by Christian Grefe, CERN - */ -class CartesianGridYZ: public CartesianGrid { -public: - /// Default constructor passing the encoding string - CartesianGridYZ(const std::string& cellEncoding = ""); - /// Default constructor used by derived classes passing an existing decoder - CartesianGridYZ(const BitFieldCoder* decoder); - /// destructor - virtual ~CartesianGridYZ(); + /// Segmentation base class describing cartesian grid segmentation in the Y-Z plane + /** + * CartesianGridYZ.h + * + * @date: Sep 03, 2014 + * @author: F.Gaede CERN/Desy + * @version: $Id: $ + * direkt copy of CartesianGridXY + * by Christian Grefe, CERN + */ + class CartesianGridYZ: public CartesianGrid { + public: + /// Default constructor passing the encoding string + CartesianGridYZ(const std::string& cellEncoding = ""); + /// Default constructor used by derived classes passing an existing decoder + CartesianGridYZ(const BitFieldCoder* decoder); + /// destructor + virtual ~CartesianGridYZ(); - /// determine the position based on the cell ID - virtual Vector3D position(const CellID& cellID) const; - /// determine the cell ID based on the position - virtual CellID cellID(const Vector3D& localPosition, const Vector3D& globalPosition, const VolumeID& volumeID) const; - /// access the grid size in Y - double gridSizeY() const { - return _gridSizeY; - } - /// access the grid size in Z - double gridSizeZ() const { - return _gridSizeZ; - } - /// access the coordinate offset in Y - double offsetY() const { - return _offsetY; - } - /// access the coordinate offset in Z - double offsetZ() const { - return _offsetZ; - } - /// access the field name used for Y - const std::string& fieldNameY() const { - return _yId; - } - /// access the field name used for Z - const std::string& fieldNameZ() const { - return _zId; - } - /// set the grid size in Y - void setGridSizeY(double cellSize) { - _gridSizeY = cellSize; - } - /// set the grid size in Z - void setGridSizeZ(double cellSize) { - _gridSizeZ = cellSize; - } - /// set the coordinate offset in Y - void setOffsetY(double offset) { - _offsetY = offset; - } - /// set the coordinate offset in Z - void setOffsetZ(double offset) { - _offsetZ = offset; - } - /// set the field name used for Y - void setFieldNameY(const std::string& fieldName) { - _yId = fieldName; - } - /// set the field name used for Z - void setFieldNameZ(const std::string& fieldName) { - _zId = fieldName; - } - /** \brief Returns a vector<double> of the cellDimensions of the given cell ID - in natural order of dimensions, e.g., dx/dy/dz, or dr/r*dPhi + /// determine the position based on the cell ID + virtual Vector3D position(const CellID& cellID) const; + /// determine the cell ID based on the position + virtual CellID cellID(const Vector3D& localPosition, const Vector3D& globalPosition, const VolumeID& volumeID) const; + /// access the grid size in Y + double gridSizeY() const { + return _gridSizeY; + } + /// access the grid size in Z + double gridSizeZ() const { + return _gridSizeZ; + } + /// access the coordinate offset in Y + double offsetY() const { + return _offsetY; + } + /// access the coordinate offset in Z + double offsetZ() const { + return _offsetZ; + } + /// access the field name used for Y + const std::string& fieldNameY() const { + return _yId; + } + /// access the field name used for Z + const std::string& fieldNameZ() const { + return _zId; + } + /// set the grid size in Y + void setGridSizeY(double cellSize) { + _gridSizeY = cellSize; + } + /// set the grid size in Z + void setGridSizeZ(double cellSize) { + _gridSizeZ = cellSize; + } + /// set the coordinate offset in Y + void setOffsetY(double offset) { + _offsetY = offset; + } + /// set the coordinate offset in Z + void setOffsetZ(double offset) { + _offsetZ = offset; + } + /// set the field name used for Y + void setFieldNameY(const std::string& fieldName) { + _yId = fieldName; + } + /// set the field name used for Z + void setFieldNameZ(const std::string& fieldName) { + _zId = fieldName; + } + /** \brief Returns a vector<double> of the cellDimensions of the given cell ID + in natural order of dimensions, e.g., dx/dy/dz, or dr/r*dPhi - Returns a vector of the cellDimensions of the given cell ID - \param cellID is ignored as all cells have the same dimension - \return std::vector<double> size 2: - -# size in y - -# size in z - */ - virtual std::vector<double> cellDimensions(const CellID& cellID) const; + Returns a vector of the cellDimensions of the given cell ID + \param cellID is ignored as all cells have the same dimension + \return std::vector<double> size 2: + -# size in y + -# size in z + */ + virtual std::vector<double> cellDimensions(const CellID& cellID) const; -protected: - /// the grid size in Y - double _gridSizeY; - /// the coordinate offset in Y - double _offsetY; - /// the grid size in Z - double _gridSizeZ; - /// the coordinate offset in Z - double _offsetZ; - /// the field name used for Y - std::string _yId; - /// the field name used for Z - std::string _zId; -}; + protected: + /// the grid size in Y + double _gridSizeY; + /// the coordinate offset in Y + double _offsetY; + /// the grid size in Z + double _gridSizeZ; + /// the coordinate offset in Z + double _offsetZ; + /// the field name used for Y + std::string _yId; + /// the field name used for Z + std::string _zId; + }; -} /* namespace DDSegmentation */ + } /* namespace DDSegmentation */ } /* namespace dd4hep */ #endif /* DDSegmentation_CARTESIANGRIDXY_H_ */ diff --git a/DDCore/include/DDSegmentation/CartesianStrip.h b/DDCore/include/DDSegmentation/CartesianStrip.h index 62f8255adba44200f0477ffbec82765e27876942..e92014b61b0e854a137101c87f63a63ebb34d639 100644 --- a/DDCore/include/DDSegmentation/CartesianStrip.h +++ b/DDCore/include/DDSegmentation/CartesianStrip.h @@ -1,3 +1,14 @@ +//========================================================================== +// AIDA Detector description implementation +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN) +// All rights reserved. +// +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. +// +//========================================================================== + /* * CartesianStrip.h * @@ -12,18 +23,20 @@ #include "DDSegmentation/Segmentation.h" namespace dd4hep { -namespace DDSegmentation { -class CartesianStrip : public Segmentation { - public: - /// Destructor - virtual ~CartesianStrip(); + namespace DDSegmentation { + + /// Segmentation base class describing cartesian strip segmentation + class CartesianStrip : public Segmentation { + public: + /// Destructor + virtual ~CartesianStrip(); - protected: - /// Default constructor used by derived classes passing the encoding string - CartesianStrip(const std::string& cellEncoding = ""); - /// Default constructor used by derived classes passing an existing decoder - CartesianStrip(const BitFieldCoder* decoder); -}; -} /* namespace DDSegmentation */ + protected: + /// Default constructor used by derived classes passing the encoding string + CartesianStrip(const std::string& cellEncoding = ""); + /// Default constructor used by derived classes passing an existing decoder + CartesianStrip(const BitFieldCoder* decoder); + }; + } /* namespace DDSegmentation */ } /* namespace dd4hep */ #endif // DDSegmentation_CARTESIANSTRIP_H_ diff --git a/DDCore/include/DDSegmentation/CartesianStripX.h b/DDCore/include/DDSegmentation/CartesianStripX.h index a4e006ceb99e04521dd14427f989235d837731ff..78444fe5a11347f2e0cf9411524493dcf4026236 100644 --- a/DDCore/include/DDSegmentation/CartesianStripX.h +++ b/DDCore/include/DDSegmentation/CartesianStripX.h @@ -1,3 +1,14 @@ +//========================================================================== +// AIDA Detector description implementation +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN) +// All rights reserved. +// +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. +// +//========================================================================== + /* * CartesianStripX.h * @@ -13,6 +24,8 @@ namespace dd4hep { namespace DDSegmentation { + + /// Segmentation base class describing cartesian strip segmentation in X class CartesianStripX : public DDSegmentation::CartesianStrip { public: /// Default constructor passing the encoding string diff --git a/DDCore/include/DDSegmentation/CartesianStripY.h b/DDCore/include/DDSegmentation/CartesianStripY.h index da7b5fddfd044138ef7965ff1bc049c8adcb7659..db94e3029b5976634b405d63d295c343f0f20ff9 100644 --- a/DDCore/include/DDSegmentation/CartesianStripY.h +++ b/DDCore/include/DDSegmentation/CartesianStripY.h @@ -1,3 +1,14 @@ +//========================================================================== +// AIDA Detector description implementation +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN) +// All rights reserved. +// +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. +// +//========================================================================== + /* * CartesianStripY.h * @@ -12,51 +23,53 @@ #include "DDSegmentation/CartesianStrip.h" namespace dd4hep { -namespace DDSegmentation { -class CartesianStripY : public DDSegmentation::CartesianStrip { - public: - /// Default constructor passing the encoding string - CartesianStripY(const std::string& cellEncoding = ""); - /// Default constructor used by derived classes passing an existing decoder - CartesianStripY(const BitFieldCoder* decoder); - /// destructor - virtual ~CartesianStripY(); - - /// determine the position based on the cell ID - virtual Vector3D position(const CellID& cellID) const; - /// determine the cell ID based on the position - virtual CellID cellID(const Vector3D& localPosition, const Vector3D& globalPosition, - const VolumeID& volumeID) const; - /// access the strip size in Y - double stripSizeY() const { return _stripSizeY; } - /// access the coordinate offset in Y - double offsetY() const { return _offsetY; } - /// access the field name used for Y - const std::string& fieldNameY() const { return _xId; } - /// set the strip size in Y - void setStripSizeY(double cellSize) { _stripSizeY = cellSize; } - /// set the coordinate offset in Y - void setOffsetY(double offset) { _offsetY = offset; } - /// set the field name used for Y - void setFieldNameY(const std::string& fieldName) { _xId = fieldName; } - /** \brief Returns a vector<double> of the cellDimensions of the given cell ID - in natural order of dimensions, e.g., dx/dy/dz, or dr/r*dPhi - - Returns a vector of the cellDimensions of the given cell ID - \param cellID is ignored as all cells have the same dimension - \return std::vector<double> size 1: - -# size in x - */ - virtual std::vector<double> cellDimensions(const CellID& cellID) const; - - protected: - /// the strip size in Y - double _stripSizeY; - /// the coordinate offset in Y - double _offsetY; - /// the field name used for Y - std::string _xId; -}; -} // namespace DDSegmentation + namespace DDSegmentation { + + /// Segmentation base class describing cartesian strip segmentation in Y + class CartesianStripY : public DDSegmentation::CartesianStrip { + public: + /// Default constructor passing the encoding string + CartesianStripY(const std::string& cellEncoding = ""); + /// Default constructor used by derived classes passing an existing decoder + CartesianStripY(const BitFieldCoder* decoder); + /// destructor + virtual ~CartesianStripY(); + + /// determine the position based on the cell ID + virtual Vector3D position(const CellID& cellID) const; + /// determine the cell ID based on the position + virtual CellID cellID(const Vector3D& localPosition, const Vector3D& globalPosition, + const VolumeID& volumeID) const; + /// access the strip size in Y + double stripSizeY() const { return _stripSizeY; } + /// access the coordinate offset in Y + double offsetY() const { return _offsetY; } + /// access the field name used for Y + const std::string& fieldNameY() const { return _xId; } + /// set the strip size in Y + void setStripSizeY(double cellSize) { _stripSizeY = cellSize; } + /// set the coordinate offset in Y + void setOffsetY(double offset) { _offsetY = offset; } + /// set the field name used for Y + void setFieldNameY(const std::string& fieldName) { _xId = fieldName; } + /** \brief Returns a vector<double> of the cellDimensions of the given cell ID + in natural order of dimensions, e.g., dx/dy/dz, or dr/r*dPhi + + Returns a vector of the cellDimensions of the given cell ID + \param cellID is ignored as all cells have the same dimension + \return std::vector<double> size 1: + -# size in x + */ + virtual std::vector<double> cellDimensions(const CellID& cellID) const; + + protected: + /// the strip size in Y + double _stripSizeY; + /// the coordinate offset in Y + double _offsetY; + /// the field name used for Y + std::string _xId; + }; + } // namespace DDSegmentation } /* namespace dd4hep */ #endif // DDSegmentation_CARTESIANSTRIPY_H_ diff --git a/DDCore/include/DDSegmentation/CartesianStripZ.h b/DDCore/include/DDSegmentation/CartesianStripZ.h index 67e9440506e4bd9faa1e503e4e2aa736324ce814..b385b66308f104f6f18d72995e1a4d54be354f12 100644 --- a/DDCore/include/DDSegmentation/CartesianStripZ.h +++ b/DDCore/include/DDSegmentation/CartesianStripZ.h @@ -1,3 +1,14 @@ +//========================================================================== +// AIDA Detector description implementation +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN) +// All rights reserved. +// +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. +// +//========================================================================== + /* * CartesianStripZ.h * @@ -12,51 +23,53 @@ #include "DDSegmentation/CartesianStrip.h" namespace dd4hep { -namespace DDSegmentation { -class CartesianStripZ : public DDSegmentation::CartesianStrip { - public: - /// Default constructor passing the encoding string - CartesianStripZ(const std::string& cellEncoding = ""); - /// Default constructor used by derived classes passing an existing decoder - CartesianStripZ(const BitFieldCoder* decoder); - /// destructor - virtual ~CartesianStripZ(); - - /// determine the position based on the cell ID - virtual Vector3D position(const CellID& cellID) const; - /// determine the cell ID based on the position - virtual CellID cellID(const Vector3D& localPosition, const Vector3D& globalPosition, - const VolumeID& volumeID) const; - /// access the strip size in Z - double stripSizeZ() const { return _stripSizeZ; } - /// access the coordinate offset in Z - double offsetZ() const { return _offsetZ; } - /// access the field name used for Z - const std::string& fieldNameZ() const { return _xId; } - /// set the strip size in Z - void setStripSizeZ(double cellSize) { _stripSizeZ = cellSize; } - /// set the coordinate offset in Z - void setOffsetZ(double offset) { _offsetZ = offset; } - /// set the field name used for Z - void setFieldNameZ(const std::string& fieldName) { _xId = fieldName; } - /** \brief Returns a vector<double> of the cellDimensions of the given cell ID - in natural order of dimensions, e.g., dx/dy/dz, or dr/r*dPhi - - Returns a vector of the cellDimensions of the given cell ID - \param cellID is ignored as all cells have the same dimension - \return std::vector<double> size 1: - -# size in x - */ - virtual std::vector<double> cellDimensions(const CellID& cellID) const; - - protected: - /// the strip size in Z - double _stripSizeZ; - /// the coordinate offset in Z - double _offsetZ; - /// the field name used for Z - std::string _xId; -}; -} // namespace DDSegmentation + namespace DDSegmentation { + + /// Segmentation base class describing cartesian strip segmentation in Z + class CartesianStripZ : public DDSegmentation::CartesianStrip { + public: + /// Default constructor passing the encoding string + CartesianStripZ(const std::string& cellEncoding = ""); + /// Default constructor used by derived classes passing an existing decoder + CartesianStripZ(const BitFieldCoder* decoder); + /// destructor + virtual ~CartesianStripZ(); + + /// determine the position based on the cell ID + virtual Vector3D position(const CellID& cellID) const; + /// determine the cell ID based on the position + virtual CellID cellID(const Vector3D& localPosition, const Vector3D& globalPosition, + const VolumeID& volumeID) const; + /// access the strip size in Z + double stripSizeZ() const { return _stripSizeZ; } + /// access the coordinate offset in Z + double offsetZ() const { return _offsetZ; } + /// access the field name used for Z + const std::string& fieldNameZ() const { return _xId; } + /// set the strip size in Z + void setStripSizeZ(double cellSize) { _stripSizeZ = cellSize; } + /// set the coordinate offset in Z + void setOffsetZ(double offset) { _offsetZ = offset; } + /// set the field name used for Z + void setFieldNameZ(const std::string& fieldName) { _xId = fieldName; } + /** \brief Returns a vector<double> of the cellDimensions of the given cell ID + in natural order of dimensions, e.g., dx/dy/dz, or dr/r*dPhi + + Returns a vector of the cellDimensions of the given cell ID + \param cellID is ignored as all cells have the same dimension + \return std::vector<double> size 1: + -# size in x + */ + virtual std::vector<double> cellDimensions(const CellID& cellID) const; + + protected: + /// the strip size in Z + double _stripSizeZ; + /// the coordinate offset in Z + double _offsetZ; + /// the field name used for Z + std::string _xId; + }; + } // namespace DDSegmentation } /* namespace dd4hep */ #endif // DDSegmentation_CARTESIANSTRIPZ_H_ diff --git a/DDCore/include/DDSegmentation/CylindricalSegmentation.h b/DDCore/include/DDSegmentation/CylindricalSegmentation.h index c06ec0b2cde761f22277b390abb7e0d2be2b4fc0..fad91cc53d84d7fa222d19c33f3c8a3ed85bb8d6 100644 --- a/DDCore/include/DDSegmentation/CylindricalSegmentation.h +++ b/DDCore/include/DDSegmentation/CylindricalSegmentation.h @@ -1,3 +1,14 @@ +//========================================================================== +// AIDA Detector description implementation +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN) +// All rights reserved. +// +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. +// +//========================================================================== + /* * CylindricalSegmentation.h * @@ -13,21 +24,22 @@ #include <map> namespace dd4hep { -namespace DDSegmentation { + namespace DDSegmentation { -class CylindricalSegmentation: public Segmentation { -public: - /// destructor - virtual ~CylindricalSegmentation(); + /// Segmentation base class describing a cyliondrical segmentation + class CylindricalSegmentation: public Segmentation { + public: + /// destructor + virtual ~CylindricalSegmentation(); -protected: - /// default constructor using an arbitrary type - CylindricalSegmentation(const std::string& cellEncoding); - /// Default constructor used by derived classes passing an existing decoder - CylindricalSegmentation(const BitFieldCoder* decoder); -}; + protected: + /// default constructor using an arbitrary type + CylindricalSegmentation(const std::string& cellEncoding); + /// Default constructor used by derived classes passing an existing decoder + CylindricalSegmentation(const BitFieldCoder* decoder); + }; -} /* namespace DDSegmentation */ + } /* namespace DDSegmentation */ } /* namespace dd4hep */ #endif /* DDSegmentation_CYLINDRICALSEGMENTATION_H_ */ diff --git a/DDCore/include/DDSegmentation/GridPhiEta.h b/DDCore/include/DDSegmentation/GridPhiEta.h index b7d2f9476175884d42add886b486af4812b34fe2..5c65af1c222b293b721c7df6979d357a952dfcc2 100644 --- a/DDCore/include/DDSegmentation/GridPhiEta.h +++ b/DDCore/include/DDSegmentation/GridPhiEta.h @@ -1,3 +1,14 @@ +//========================================================================== +// AIDA Detector description implementation +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN) +// All rights reserved. +// +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. +// +//========================================================================== + #ifndef DETSEGMENTATION_GRIDPHIETA_H #define DETSEGMENTATION_GRIDPHIETA_H @@ -14,134 +25,136 @@ */ namespace dd4hep { -namespace DDSegmentation { -class GridPhiEta : public Segmentation { -public: - /// default constructor using an arbitrary type - GridPhiEta(const std::string& aCellEncoding); - /// Default constructor used by derived classes passing an existing decoder - GridPhiEta(const BitFieldCoder* decoder); + namespace DDSegmentation { - /// destructor - virtual ~GridPhiEta() = default; + /// Segmentation class describing segmentation in Phi-Eta + class GridPhiEta : public Segmentation { + public: + /// default constructor using an arbitrary type + GridPhiEta(const std::string& aCellEncoding); + /// Default constructor used by derived classes passing an existing decoder + GridPhiEta(const BitFieldCoder* decoder); - /** Determine the global position based on the cell ID. - * @warning This segmentation has no knowledge of radius, so radius = 1 is taken into calculations. - * @param[in] aCellId ID of a cell. - * return Position (radius = 1). - */ - virtual Vector3D position(const CellID& aCellID) const; - /** Determine the cell ID based on the position. - * @param[in] aLocalPosition (not used). - * @param[in] aGlobalPosition position in the global coordinates. - * @param[in] aVolumeId ID of a volume. - * return Cell ID. - */ - virtual CellID cellID(const Vector3D& aLocalPosition, const Vector3D& aGlobalPosition, const VolumeID& aVolumeID) const; - /** Determine the pseudorapidity based on the cell ID. - * @param[in] aCellId ID of a cell. - * return Pseudorapidity. - */ - double eta(const CellID& aCellID) const; - /** Determine the azimuthal angle based on the cell ID. - * @param[in] aCellId ID of a cell. - * return Phi. - */ - double phi(const CellID& aCellID) const; - /** Get the grid size in pseudorapidity. - * return Grid size in eta. - */ - inline double gridSizeEta() const { - return m_gridSizeEta; - } - /** Get the grid size in phi. - * return Grid size in phi. - */ - inline double gridSizePhi() const { - return 2 * M_PI / static_cast<double>(m_phiBins); - } - /** Get the number of bins in azimuthal angle. - * return Number of bins in phi. - */ - inline int phiBins() const { - return m_phiBins; - } - /** Get the coordinate offset in pseudorapidity. - * return The offset in eta. - */ - inline double offsetEta() const { - return m_offsetEta; - } - /** Get the coordinate offset in azimuthal angle. - * return The offset in phi. - */ - inline double offsetPhi() const { - return m_offsetPhi; - } - /** Get the field name used for pseudorapidity - * return The field name for eta. - */ - inline const std::string& fieldNameEta() const { - return m_etaID; - } - /** Get the field name for azimuthal angle. - * return The field name for phi. - */ - inline const std::string& fieldNamePhi() const { - return m_phiID; - } - /** Set the grid size in pseudorapidity. - * @param[in] aCellSize Cell size in eta. - */ - void setGridSizeEta(double aCellSize) { - m_gridSizeEta = aCellSize; - } - /** Set the number of bins in azimuthal angle. - * @param[in] aNumberBins Number of bins in phi. - */ - inline void setPhiBins(int bins) { - m_phiBins = bins; - } - /** Set the coordinate offset in pseudorapidity. - * @param[in] aOffset Offset in eta. - */ - inline void setOffsetEta(double offset) { - m_offsetEta = offset; - } - /** Set the coordinate offset in azimuthal angle. - * @param[in] aOffset Offset in phi. - */ - inline void setOffsetPhi(double offset) { - m_offsetPhi = offset; - } - /** Set the field name used for pseudorapidity. - * @param[in] aFieldName Field name for eta. - */ - inline void setFieldNameEta(const std::string& fieldName) { - m_etaID = fieldName; - } - /** Set the field name used for azimuthal angle. - * @param[in] aFieldName Field name for phi. - */ - inline void setFieldNamePhi(const std::string& fieldName) { - m_phiID = fieldName; - } + /// destructor + virtual ~GridPhiEta() = default; -protected: + /** Determine the global position based on the cell ID. + * @warning This segmentation has no knowledge of radius, so radius = 1 is taken into calculations. + * @param[in] aCellId ID of a cell. + * return Position (radius = 1). + */ + virtual Vector3D position(const CellID& aCellID) const; + /** Determine the cell ID based on the position. + * @param[in] aLocalPosition (not used). + * @param[in] aGlobalPosition position in the global coordinates. + * @param[in] aVolumeId ID of a volume. + * return Cell ID. + */ + virtual CellID cellID(const Vector3D& aLocalPosition, const Vector3D& aGlobalPosition, const VolumeID& aVolumeID) const; + /** Determine the pseudorapidity based on the cell ID. + * @param[in] aCellId ID of a cell. + * return Pseudorapidity. + */ + double eta(const CellID& aCellID) const; + /** Determine the azimuthal angle based on the cell ID. + * @param[in] aCellId ID of a cell. + * return Phi. + */ + double phi(const CellID& aCellID) const; + /** Get the grid size in pseudorapidity. + * return Grid size in eta. + */ + inline double gridSizeEta() const { + return m_gridSizeEta; + } + /** Get the grid size in phi. + * return Grid size in phi. + */ + inline double gridSizePhi() const { + return 2 * M_PI / static_cast<double>(m_phiBins); + } + /** Get the number of bins in azimuthal angle. + * return Number of bins in phi. + */ + inline int phiBins() const { + return m_phiBins; + } + /** Get the coordinate offset in pseudorapidity. + * return The offset in eta. + */ + inline double offsetEta() const { + return m_offsetEta; + } + /** Get the coordinate offset in azimuthal angle. + * return The offset in phi. + */ + inline double offsetPhi() const { + return m_offsetPhi; + } + /** Get the field name used for pseudorapidity + * return The field name for eta. + */ + inline const std::string& fieldNameEta() const { + return m_etaID; + } + /** Get the field name for azimuthal angle. + * return The field name for phi. + */ + inline const std::string& fieldNamePhi() const { + return m_phiID; + } + /** Set the grid size in pseudorapidity. + * @param[in] aCellSize Cell size in eta. + */ + void setGridSizeEta(double aCellSize) { + m_gridSizeEta = aCellSize; + } + /** Set the number of bins in azimuthal angle. + * @param[in] aNumberBins Number of bins in phi. + */ + inline void setPhiBins(int bins) { + m_phiBins = bins; + } + /** Set the coordinate offset in pseudorapidity. + * @param[in] aOffset Offset in eta. + */ + inline void setOffsetEta(double offset) { + m_offsetEta = offset; + } + /** Set the coordinate offset in azimuthal angle. + * @param[in] aOffset Offset in phi. + */ + inline void setOffsetPhi(double offset) { + m_offsetPhi = offset; + } + /** Set the field name used for pseudorapidity. + * @param[in] aFieldName Field name for eta. + */ + inline void setFieldNameEta(const std::string& fieldName) { + m_etaID = fieldName; + } + /** Set the field name used for azimuthal angle. + * @param[in] aFieldName Field name for phi. + */ + inline void setFieldNamePhi(const std::string& fieldName) { + m_phiID = fieldName; + } - /// the grid size in eta - double m_gridSizeEta; - /// the number of bins in phi - int m_phiBins; - /// the coordinate offset in eta - double m_offsetEta; - /// the coordinate offset in phi - double m_offsetPhi; - /// the field name used for eta - std::string m_etaID; - /// the field name used for phi - std::string m_phiID; -}; -} + protected: + + /// the grid size in eta + double m_gridSizeEta; + /// the number of bins in phi + int m_phiBins; + /// the coordinate offset in eta + double m_offsetEta; + /// the coordinate offset in phi + double m_offsetPhi; + /// the field name used for eta + std::string m_etaID; + /// the field name used for phi + std::string m_phiID; + }; + } } #endif /* DETSEGMENTATION_GRIDPHIETA_H */ diff --git a/DDCore/include/DDSegmentation/GridRPhiEta.h b/DDCore/include/DDSegmentation/GridRPhiEta.h index ef3188e5e35b434f1f1d5f417c9caab9248f4e66..1b8ed1a6b8913e896613b0e01351bff5078d4b53 100644 --- a/DDCore/include/DDSegmentation/GridRPhiEta.h +++ b/DDCore/include/DDSegmentation/GridRPhiEta.h @@ -1,3 +1,14 @@ +//========================================================================== +// AIDA Detector description implementation +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN) +// All rights reserved. +// +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. +// +//========================================================================== + #ifndef DETSEGMENTATION_GRIDRPHIETA_H #define DETSEGMENTATION_GRIDRPHIETA_H @@ -14,82 +25,84 @@ */ namespace dd4hep { -namespace DDSegmentation { -class GridRPhiEta: public GridPhiEta { -public: - /// default constructor using an arbitrary type - GridRPhiEta(const std::string& aCellEncoding); + namespace DDSegmentation { - /// Default constructor used by derived classes passing an existing decoder - GridRPhiEta(const BitFieldCoder* decoder); + /// Segmentation class describing segmentation in R-Phi-Eta + class GridRPhiEta: public GridPhiEta { + public: + /// default constructor using an arbitrary type + GridRPhiEta(const std::string& aCellEncoding); - /// destructor - virtual ~GridRPhiEta() = default; + /// Default constructor used by derived classes passing an existing decoder + GridRPhiEta(const BitFieldCoder* decoder); - /** Determine the global position based on the cell ID. - * @param[in] aCellId ID of a cell. - * return Position. - */ - virtual Vector3D position(const CellID& aCellID) const; - /** Determine the cell ID based on the position. - * @param[in] aLocalPosition (not used). - * @param[in] aGlobalPosition position in the global coordinates. - * @param[in] aVolumeId ID of a volume. - * return Cell ID. - */ - virtual CellID cellID(const Vector3D& aLocalPosition, const Vector3D& aGlobalPosition, const VolumeID& aVolumeID) const; - /** Determine the radius based on the cell ID. - * @param[in] aCellId ID of a cell. - * return Radius. - */ - double r(const CellID& aCellID) const; - /** Get the grid size in radial distance from the detector centre. - * return Grid size in radial distance. - */ - inline double gridSizeR() const { - return m_gridSizeR; - } - /** Get the coordinate offset in radial distance. - * return The offset in R. - */ - inline double offsetR() const { - return m_offsetR; - } - /** Get the field name for radial distance. - * return The field name for radial distance. - */ - inline const std::string& fieldNameR() const { - return m_rID; - } - /** Set the grid size in radial distance. - * @param[in] aCellSize Cell size in radial distance. - */ - void setGridSizeR(double aCellSize) { - m_gridSizeR = aCellSize; - } - /** Set the coordinate offset in radial distance. - * @param[in] aOffset Offset in radial distance. - */ - inline void setOffsetR(double offset) { - m_offsetR = offset; - } - /** Set the field name used for radial distance. - * @param[in] aFieldName Field name for R. - */ - inline void setFieldNameR(const std::string& fieldName) { - m_rID = fieldName; - } + /// destructor + virtual ~GridRPhiEta() = default; -private: + /** Determine the global position based on the cell ID. + * @param[in] aCellId ID of a cell. + * return Position. + */ + virtual Vector3D position(const CellID& aCellID) const; + /** Determine the cell ID based on the position. + * @param[in] aLocalPosition (not used). + * @param[in] aGlobalPosition position in the global coordinates. + * @param[in] aVolumeId ID of a volume. + * return Cell ID. + */ + virtual CellID cellID(const Vector3D& aLocalPosition, const Vector3D& aGlobalPosition, const VolumeID& aVolumeID) const; + /** Determine the radius based on the cell ID. + * @param[in] aCellId ID of a cell. + * return Radius. + */ + double r(const CellID& aCellID) const; + /** Get the grid size in radial distance from the detector centre. + * return Grid size in radial distance. + */ + inline double gridSizeR() const { + return m_gridSizeR; + } + /** Get the coordinate offset in radial distance. + * return The offset in R. + */ + inline double offsetR() const { + return m_offsetR; + } + /** Get the field name for radial distance. + * return The field name for radial distance. + */ + inline const std::string& fieldNameR() const { + return m_rID; + } + /** Set the grid size in radial distance. + * @param[in] aCellSize Cell size in radial distance. + */ + void setGridSizeR(double aCellSize) { + m_gridSizeR = aCellSize; + } + /** Set the coordinate offset in radial distance. + * @param[in] aOffset Offset in radial distance. + */ + inline void setOffsetR(double offset) { + m_offsetR = offset; + } + /** Set the field name used for radial distance. + * @param[in] aFieldName Field name for R. + */ + inline void setFieldNameR(const std::string& fieldName) { + m_rID = fieldName; + } - /// the grid size in r - double m_gridSizeR; - /// the coordinate offset in r - double m_offsetR; - /// the field name used for r - std::string m_rID; + private: -}; -} + /// the grid size in r + double m_gridSizeR; + /// the coordinate offset in r + double m_offsetR; + /// the field name used for r + std::string m_rID; + + }; + } } #endif /* DETSEGMENTATION_GRIDRPHIETA_H */ diff --git a/DDCore/include/DDSegmentation/MegatileLayerGridXY.h b/DDCore/include/DDSegmentation/MegatileLayerGridXY.h index 2e8f03c624e9ee64fecf72d6d6a3f2daaf9343c1..226d2bc53c664b5ca025188fcaa49674fea329a4 100644 --- a/DDCore/include/DDSegmentation/MegatileLayerGridXY.h +++ b/DDCore/include/DDSegmentation/MegatileLayerGridXY.h @@ -1,3 +1,14 @@ +//========================================================================== +// AIDA Detector description implementation +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN) +// All rights reserved. +// +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. +// +//========================================================================== + /* * MegatileLayerGridXY.h * @@ -12,31 +23,28 @@ #include <cassert> -/* - - a megatile is a rectangule in x-y, split into a grid along x and y, with an exactly integer number of cells in x and y. - - this class assumes a mostly-common megatile size, with possibility for a number of "special" megatiles of non-standard size / segmentation - - the segmentation of standard megatiles is defined layer-by-layer. - - some changes wrt previous version from Kotera et al. - - significantly simplified. - - complications due to end-of-slab moved to higher level detector drivers. - - D. Jeans - Nov 2016 - - July 2017 - DJeans - some changes for easier use of multi-layer segmentations - - for uniform segmentation, allow setting of ncellsx/y via parameter - - use std::vector, rather than fixed array to store ncells values - -*/ - namespace dd4hep { namespace DDSegmentation { + /// a megatile is a rectangule in x-y, split into a grid along x and y, with an exactly integer number of cells in x and y. + /** + * this class assumes a mostly-common megatile size, with possibility for a number of "special" megatiles of non-standard size / segmentation + * + * the segmentation of standard megatiles is defined layer-by-layer. + * + * some changes wrt previous version from Kotera et al. + * - significantly simplified. + * - complications due to end-of-slab moved to higher level detector drivers. + * + * D. Jeans - Nov 2016 + * + * July 2017 - DJeans + * some changes for easier use of multi-layer segmentations + * - for uniform segmentation, allow setting of ncellsx/y via parameter + * - use std::vector, rather than fixed array to store ncells values + * + */ class MegatileLayerGridXY: public CartesianGrid { public: /// Default constructor passing the encoding string @@ -106,7 +114,7 @@ namespace dd4hep { int getUnifNCellsX() {return _unif_nCellsX;} int getUnifNCellsY() {return _unif_nCellsY;} - + /// Helper structure struct segInfo { double megaTileSizeX = 0; double megaTileSizeY = 0; diff --git a/DDCore/include/DDSegmentation/MultiSegmentation.h b/DDCore/include/DDSegmentation/MultiSegmentation.h index b8d8616bcaa316201025d20a15aa7d6bdeb8eab6..cee4ca699361d255a2ba66136037d4334bfc4fb4 100644 --- a/DDCore/include/DDSegmentation/MultiSegmentation.h +++ b/DDCore/include/DDSegmentation/MultiSegmentation.h @@ -29,7 +29,7 @@ namespace dd4hep { */ class MultiSegmentation : public Segmentation { public: - + /// Heler structure to describe a sub-segmentation entry struct Entry { long key_min, key_max; Segmentation* segmentation; diff --git a/DDCore/include/DDSegmentation/NoSegmentation.h b/DDCore/include/DDSegmentation/NoSegmentation.h index 6de5b699755d5625b747e4caada23bbdb2dc046e..a64ff5fc2585b03693046323dc78a20a61511d4e 100644 --- a/DDCore/include/DDSegmentation/NoSegmentation.h +++ b/DDCore/include/DDSegmentation/NoSegmentation.h @@ -1,3 +1,14 @@ +//========================================================================== +// AIDA Detector description implementation +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN) +// All rights reserved. +// +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. +// +//========================================================================== + /* * NoSegmentation.h * @@ -13,7 +24,7 @@ namespace dd4hep { namespace DDSegmentation { - /** This class exists to provide a segmenation when it is need but doesn't exist. */ + /// This class exists to provide a segmenation when it is need but doesn't exist. class NoSegmentation: public Segmentation { public: diff --git a/DDCore/include/DDSegmentation/PolarGrid.h b/DDCore/include/DDSegmentation/PolarGrid.h index f1d033d8b43c6143ccb1084b89200329c8b9797b..31219ed86510b10734c511afd4a93b5d51a119da 100644 --- a/DDCore/include/DDSegmentation/PolarGrid.h +++ b/DDCore/include/DDSegmentation/PolarGrid.h @@ -1,3 +1,14 @@ +//========================================================================== +// AIDA Detector description implementation +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN) +// All rights reserved. +// +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. +// +//========================================================================== + /* * PolarGrid.h * @@ -11,19 +22,20 @@ #include "DDSegmentation/Segmentation.h" namespace dd4hep { -namespace DDSegmentation { + namespace DDSegmentation { -class PolarGrid: public Segmentation { -public: - /// Destructor - virtual ~PolarGrid(); -protected: - /// Default constructor used by derived classes passing the encoding string - PolarGrid(const std::string& cellEncoding = ""); - /// Default constructor used by derived classes passing an existing decoder - PolarGrid(const BitFieldCoder* decoder); -}; + /// Segmentation base class for polar grids + class PolarGrid: public Segmentation { + public: + /// Destructor + virtual ~PolarGrid(); + protected: + /// Default constructor used by derived classes passing the encoding string + PolarGrid(const std::string& cellEncoding = ""); + /// Default constructor used by derived classes passing an existing decoder + PolarGrid(const BitFieldCoder* decoder); + }; -} /* namespace DDSegmentation */ + } /* namespace DDSegmentation */ } /* namespace dd4hep */ #endif /* DDSegmentation_POLARGRID_H_ */ diff --git a/DDCore/include/DDSegmentation/PolarGridRPhi.h b/DDCore/include/DDSegmentation/PolarGridRPhi.h index cc21a093000d3a465ba2cdc7ce7b3403cf61772e..4418794046b9012da5267ca2d5298ab83371a926 100644 --- a/DDCore/include/DDSegmentation/PolarGridRPhi.h +++ b/DDCore/include/DDSegmentation/PolarGridRPhi.h @@ -1,3 +1,14 @@ +//========================================================================== +// AIDA Detector description implementation +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN) +// All rights reserved. +// +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. +// +//========================================================================== + /* * PolarGridRPhi.h * @@ -12,95 +23,96 @@ #include <math.h> namespace dd4hep { -namespace DDSegmentation { + namespace DDSegmentation { -class PolarGridRPhi: public PolarGrid { -public: - /// Default constructor passing the encoding string - PolarGridRPhi(const std::string& cellEncoding = ""); - /// Default constructor used by derived classes passing an existing decoder - PolarGridRPhi(const BitFieldCoder* decoder); - /// destructor - virtual ~PolarGridRPhi(); + /// A segmentation for arbitrary sizes in R and R-dependent sizes in Phi + class PolarGridRPhi: public PolarGrid { + public: + /// Default constructor passing the encoding string + PolarGridRPhi(const std::string& cellEncoding = ""); + /// Default constructor used by derived classes passing an existing decoder + PolarGridRPhi(const BitFieldCoder* decoder); + /// destructor + virtual ~PolarGridRPhi(); - /// determine the position based on the cell ID - virtual Vector3D position(const CellID& cellID) const; - /// determine the cell ID based on the position - virtual CellID cellID(const Vector3D& localPosition, const Vector3D& globalPosition, const VolumeID& volumeID) const; - /// access the grid size in R - double gridSizeR() const { - return _gridSizeR; - } - /// access the grid size in Phi - double gridSizePhi() const { - return _gridSizePhi; - } - /// access the coordinate offset in R - double offsetR() const { - return _offsetR; - } - /// access the coordinate offset in Phi - double offsetPhi() const { - return _offsetPhi; - } - /// access the field name used for R - const std::string& fieldNameR() const { - return _rId; - } - /// access the field name used for Phi - const std::string& fieldNamePhi() const { - return _phiId; - } - /// set the grid size in R - void setGridSizeR(double cellSize) { - _gridSizeR = cellSize; - } - /// set the grid size in Phi - void setGridSizePhi(double cellSize) { - _gridSizePhi = cellSize; - } - /// set the coordinate offset in R - void setOffsetR(double offset) { - _offsetR = offset; - } - /// set the coordinate offset in Phi - void setOffsetPhi(double offset) { - _offsetPhi = offset; - } - /// set the field name used for X - void setFieldNameR(const std::string& fieldName) { - _rId = fieldName; - } - /// set the field name used for Y - void setFieldNamePhi(const std::string& fieldName) { - _phiId = fieldName; - } - /** \brief Returns a vector<double> of the cellDimensions of the given cell ID - in natural order of dimensions: dr, r*dPhi + /// determine the position based on the cell ID + virtual Vector3D position(const CellID& cellID) const; + /// determine the cell ID based on the position + virtual CellID cellID(const Vector3D& localPosition, const Vector3D& globalPosition, const VolumeID& volumeID) const; + /// access the grid size in R + double gridSizeR() const { + return _gridSizeR; + } + /// access the grid size in Phi + double gridSizePhi() const { + return _gridSizePhi; + } + /// access the coordinate offset in R + double offsetR() const { + return _offsetR; + } + /// access the coordinate offset in Phi + double offsetPhi() const { + return _offsetPhi; + } + /// access the field name used for R + const std::string& fieldNameR() const { + return _rId; + } + /// access the field name used for Phi + const std::string& fieldNamePhi() const { + return _phiId; + } + /// set the grid size in R + void setGridSizeR(double cellSize) { + _gridSizeR = cellSize; + } + /// set the grid size in Phi + void setGridSizePhi(double cellSize) { + _gridSizePhi = cellSize; + } + /// set the coordinate offset in R + void setOffsetR(double offset) { + _offsetR = offset; + } + /// set the coordinate offset in Phi + void setOffsetPhi(double offset) { + _offsetPhi = offset; + } + /// set the field name used for X + void setFieldNameR(const std::string& fieldName) { + _rId = fieldName; + } + /// set the field name used for Y + void setFieldNamePhi(const std::string& fieldName) { + _phiId = fieldName; + } + /** \brief Returns a vector<double> of the cellDimensions of the given cell ID + in natural order of dimensions: dr, r*dPhi - Returns a vector of the cellDimensions of the given cell ID - \param cID cellID - \return std::vector<double> size 2: - -# size in r - -# size of r*dPhi at the radial centre of the pad - */ - virtual std::vector<double> cellDimensions(const CellID& cID) const; + Returns a vector of the cellDimensions of the given cell ID + \param cID cellID + \return std::vector<double> size 2: + -# size in r + -# size of r*dPhi at the radial centre of the pad + */ + virtual std::vector<double> cellDimensions(const CellID& cID) const; -protected: - /// the grid size in R - double _gridSizeR; - /// the coordinate offset in R - double _offsetR; - /// the grid size in Phi - double _gridSizePhi; - /// the coordinate offset in Phi - double _offsetPhi; - /// the field name used for R - std::string _rId; - /// the field name used for Phi - std::string _phiId; -}; + protected: + /// the grid size in R + double _gridSizeR; + /// the coordinate offset in R + double _offsetR; + /// the grid size in Phi + double _gridSizePhi; + /// the coordinate offset in Phi + double _offsetPhi; + /// the field name used for R + std::string _rId; + /// the field name used for Phi + std::string _phiId; + }; -} /* namespace DDSegmentation */ + } /* namespace DDSegmentation */ } /* namespace dd4hep */ #endif /* DDSegmentation_POLARGRIDRPHI_H_ */ diff --git a/DDCore/include/DDSegmentation/PolarGridRPhi2.h b/DDCore/include/DDSegmentation/PolarGridRPhi2.h index 663133862266564a90d732e1304b5c705cefecc0..d1b01570ccd79bafadd5b521b4b2fdc3b241c9ce 100644 --- a/DDCore/include/DDSegmentation/PolarGridRPhi2.h +++ b/DDCore/include/DDSegmentation/PolarGridRPhi2.h @@ -1,3 +1,14 @@ +//========================================================================== +// AIDA Detector description implementation +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN) +// All rights reserved. +// +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. +// +//========================================================================== + /* * PolarGridRPhi2.h * @@ -13,136 +24,137 @@ #include <vector> namespace dd4hep { -namespace DDSegmentation { + namespace DDSegmentation { - /** A segmentation for arbitrary sizes in R and R-dependent sizes in Phi<br> - * Note: Counting of phi-ids starts at the offset. There are no negative phi-IDs<br> - * The grid_r_values give the boundaries of the bin, the grid_phi_values give the size of the bin for each radial bin - * see also PolarGridRPhi2::setGridRValues and PolarGridRPhi2::setGridPhiValues<br> - * Example:<br> - @verbatim - <segmentation type="PolarGridRPhi2" - grid_r_values="3.2*cm 3.7*cm 4.9*cm 5.5*cm<br/> - 6.*cm 7.*cm 7.5*cm 8.7*cm<br/> - 9.5*cm 10.*cm 11.*cm 11.8*cm<br/> - 12.*cm 13.*cm 14.*cm 15.0*cm" - grid_phi_values="360/(4*8)*degree 360/(5*8)*degree - 360/(6*8)*degree 360/(6*8)*degree - 360/(7*8)*degree 360/(8*8)*degree - 360/(9*8)*degree 360/(9*8)*degree - 360/(10*8)*degree 360/(11*8)*degree - 360/(12*8)*degree 360/(12*8)*degree - 360/(13*8)*degree 360/(14*8)*degree - 360/(15*8)*degree" - offset_phi="-180.0*degree" - /> - <id>system:8,barrel:3,layer:8,slice:5,r:32:16,phi:16</id> - @endverbatim - * @version $Id$ - * @date 2015-03 - */ -class PolarGridRPhi2: public PolarGrid { -public: - /// Default constructor passing the encoding string - PolarGridRPhi2(const std::string& cellEncoding = ""); - /// Default constructor used by derived classes passing an existing decoder - PolarGridRPhi2(const BitFieldCoder* decoder); - /// destructor - virtual ~PolarGridRPhi2(); + /// A segmentation for arbitrary sizes in R and R-dependent sizes in Phi + /** + * Note: Counting of phi-ids starts at the offset. There are no negative phi-IDs<br> + * The grid_r_values give the boundaries of the bin, the grid_phi_values give the size of the bin for each radial bin + * see also PolarGridRPhi2::setGridRValues and PolarGridRPhi2::setGridPhiValues<br> + * Example:<br> + @verbatim + <segmentation type="PolarGridRPhi2" + grid_r_values="3.2*cm 3.7*cm 4.9*cm 5.5*cm<br/> + 6.*cm 7.*cm 7.5*cm 8.7*cm<br/> + 9.5*cm 10.*cm 11.*cm 11.8*cm<br/> + 12.*cm 13.*cm 14.*cm 15.0*cm" + grid_phi_values="360/(4*8)*degree 360/(5*8)*degree + 360/(6*8)*degree 360/(6*8)*degree + 360/(7*8)*degree 360/(8*8)*degree + 360/(9*8)*degree 360/(9*8)*degree + 360/(10*8)*degree 360/(11*8)*degree + 360/(12*8)*degree 360/(12*8)*degree + 360/(13*8)*degree 360/(14*8)*degree + 360/(15*8)*degree" + offset_phi="-180.0*degree" + /> + <id>system:8,barrel:3,layer:8,slice:5,r:32:16,phi:16</id> + @endverbatim + * @version $Id$ + * @date 2015-03 + */ + class PolarGridRPhi2: public PolarGrid { + public: + /// Default constructor passing the encoding string + PolarGridRPhi2(const std::string& cellEncoding = ""); + /// Default constructor used by derived classes passing an existing decoder + PolarGridRPhi2(const BitFieldCoder* decoder); + /// destructor + virtual ~PolarGridRPhi2(); - /// determine the position based on the cell ID - virtual Vector3D position(const CellID& cellID) const; - /// determine the cell ID based on the position - virtual CellID cellID(const Vector3D& localPosition, const Vector3D& globalPosition, const VolumeID& volumeID) const; - /// access the grid size in R - std::vector<double> gridRValues() const { - return _gridRValues; - } - /// access the grid size in Phi - std::vector<double> gridPhiValues() const { - return _gridPhiValues; - } - /// access the coordinate offset in R - double offsetR() const { - return _offsetR; - } - /// access the coordinate offset in Phi - double offsetPhi() const { - return _offsetPhi; - } - /// access the field name used for R - const std::string& fieldNameR() const { - return _rId; - } - /// access the field name used for Phi - const std::string& fieldNamePhi() const { - return _phiId; - } - /// set the grid Boundaries in R - void setGridRValues(double cellSize, int rID) { - _gridRValues[rID] = cellSize; - } - /// set the grid size in Phi - void setGridSizePhi(double cellSize, int phiID) { - _gridPhiValues[phiID] = cellSize; - } + /// determine the position based on the cell ID + virtual Vector3D position(const CellID& cellID) const; + /// determine the cell ID based on the position + virtual CellID cellID(const Vector3D& localPosition, const Vector3D& globalPosition, const VolumeID& volumeID) const; + /// access the grid size in R + std::vector<double> gridRValues() const { + return _gridRValues; + } + /// access the grid size in Phi + std::vector<double> gridPhiValues() const { + return _gridPhiValues; + } + /// access the coordinate offset in R + double offsetR() const { + return _offsetR; + } + /// access the coordinate offset in Phi + double offsetPhi() const { + return _offsetPhi; + } + /// access the field name used for R + const std::string& fieldNameR() const { + return _rId; + } + /// access the field name used for Phi + const std::string& fieldNamePhi() const { + return _phiId; + } + /// set the grid Boundaries in R + void setGridRValues(double cellSize, int rID) { + _gridRValues[rID] = cellSize; + } + /// set the grid size in Phi + void setGridSizePhi(double cellSize, int phiID) { + _gridPhiValues[phiID] = cellSize; + } - /// set the grid boundaries for R - /// @param rValues The boundaries of the segments in radius, the first value is the lower boundary of the first bin, the highest value is the upper boundary of the last bin - void setGridRValues(std::vector<double> const& rValues) { - _gridRValues = std::vector<double>(rValues); - } + /// set the grid boundaries for R + /// @param rValues The boundaries of the segments in radius, the first value is the lower boundary of the first bin, the highest value is the upper boundary of the last bin + void setGridRValues(std::vector<double> const& rValues) { + _gridRValues = std::vector<double>(rValues); + } - /// set the grid size in Phi for each bin in R - /// @param phiValues The size in phi for each bin in R, this vector is one smaller than the vector for PolarGridRPhi2::setGridRValues - void setGridPhiValues(std::vector<double> const& phiValues) { - _gridPhiValues = std::vector<double>(phiValues); - } + /// set the grid size in Phi for each bin in R + /// @param phiValues The size in phi for each bin in R, this vector is one smaller than the vector for PolarGridRPhi2::setGridRValues + void setGridPhiValues(std::vector<double> const& phiValues) { + _gridPhiValues = std::vector<double>(phiValues); + } - /// set the coordinate offset in R - void setOffsetR(double offset) { - _offsetR = offset; - } - /// set the coordinate offset in Phi - void setOffsetPhi(double offset) { - _offsetPhi = offset; - } - /// set the field name used for X - void setFieldNameR(const std::string& fieldName) { - _rId = fieldName; - } - /// set the field name used for Y - void setFieldNamePhi(const std::string& fieldName) { - _phiId = fieldName; - } - /** \brief Returns a vector<double> of the cellDimensions of the given cell ID - in natural order of dimensions: dr, r*dPhi + /// set the coordinate offset in R + void setOffsetR(double offset) { + _offsetR = offset; + } + /// set the coordinate offset in Phi + void setOffsetPhi(double offset) { + _offsetPhi = offset; + } + /// set the field name used for X + void setFieldNameR(const std::string& fieldName) { + _rId = fieldName; + } + /// set the field name used for Y + void setFieldNamePhi(const std::string& fieldName) { + _phiId = fieldName; + } + /** \brief Returns a vector<double> of the cellDimensions of the given cell ID + in natural order of dimensions: dr, r*dPhi - Returns a vector of the cellDimensions of the given cell ID - \param cellID is ignored as all cells have the same dimension - \return std::vector<double> size 2: - -# size in r - -# size of r*dPhi at the radial centre of the pad - */ - virtual std::vector<double> cellDimensions(const CellID& cellID) const; + Returns a vector of the cellDimensions of the given cell ID + \param cellID is ignored as all cells have the same dimension + \return std::vector<double> size 2: + -# size in r + -# size of r*dPhi at the radial centre of the pad + */ + virtual std::vector<double> cellDimensions(const CellID& cellID) const; -protected: - /// the grid boundaries in R - std::vector<double> _gridRValues; - /// the coordinate offset in R - double _offsetR; - /// the grid sizes in Phi - std::vector<double> _gridPhiValues; - /// the coordinate offset in Phi - double _offsetPhi; - /// the field name used for R - std::string _rId; - /// the field name used for Phi - std::string _phiId; -}; + protected: + /// the grid boundaries in R + std::vector<double> _gridRValues; + /// the coordinate offset in R + double _offsetR; + /// the grid sizes in Phi + std::vector<double> _gridPhiValues; + /// the coordinate offset in Phi + double _offsetPhi; + /// the field name used for R + std::string _rId; + /// the field name used for Phi + std::string _phiId; + }; -} /* namespace DDSegmentation */ + } /* namespace DDSegmentation */ } /* namespace dd4hep */ #endif /* DDSegmentation_PolarGridRPhi2_H_ */ diff --git a/DDCore/include/DDSegmentation/ProjectiveCylinder.h b/DDCore/include/DDSegmentation/ProjectiveCylinder.h index 94c63ca688a0e4900995018442f9703064039a15..67082f7de61c4c8b27e4c1e54061146935ef3fe3 100644 --- a/DDCore/include/DDSegmentation/ProjectiveCylinder.h +++ b/DDCore/include/DDSegmentation/ProjectiveCylinder.h @@ -1,3 +1,14 @@ +//========================================================================== +// AIDA Detector description implementation +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN) +// All rights reserved. +// +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. +// +//========================================================================== + /* * ProjectiveCylinder.h * @@ -11,90 +22,91 @@ #include "CylindricalSegmentation.h" namespace dd4hep { -namespace DDSegmentation { + namespace DDSegmentation { -class ProjectiveCylinder: public CylindricalSegmentation { -public: - /// default constructor using an arbitrary type - ProjectiveCylinder(const std::string& cellEncoding); - /// Default constructor used by derived classes passing an existing decoder - ProjectiveCylinder(const BitFieldCoder* decoder); - /// destructor - virtual ~ProjectiveCylinder(); + /// A segmentation class to describe projective cylinders + class ProjectiveCylinder: public CylindricalSegmentation { + public: + /// default constructor using an arbitrary type + ProjectiveCylinder(const std::string& cellEncoding); + /// Default constructor used by derived classes passing an existing decoder + ProjectiveCylinder(const BitFieldCoder* decoder); + /// destructor + virtual ~ProjectiveCylinder(); - /// determine the position based on the cell ID - virtual Vector3D position(const CellID& cellID) const; - /// determine the cell ID based on the position - virtual CellID cellID(const Vector3D& localPosition, const Vector3D& globalPosition, const VolumeID& volumeID) const; - /// determine the polar angle theta based on the cell ID - double theta(const CellID& cellID) const; - /// determine the azimuthal angle phi based on the cell ID - double phi(const CellID& cellID) const; - /// access the number of bins in theta - int thetaBins() const { - return _thetaBins; - } - /// access the number of bins in theta - int phiBins() const { - return _phiBins; - } - /// access the coordinate offset in theta - double offsetTheta() const { - return _offsetTheta; - } - /// access the coordinate offset in phi - double offsetPhi() const { - return _offsetPhi; - } - /// access the field name used for theta - std::string fieldNameTheta() const { - return _thetaID; - } - /// access the field name used for phi - std::string fieldNamePhi() const { - return _phiID; - } - /// set the number of bins in theta - void setThetaBins(int bins) { - _thetaBins = bins; - } - /// set the number of bins in phi - void setPhiBins(int bins) { - _phiBins = bins; - } - /// set the coordinate offset in theta - void setOffsetTheta(double offset) { - _offsetTheta = offset; - } - /// set the coordinate offset in phi - void setOffsetPhi(double offset) { - _offsetPhi = offset; - } - /// set the field name used for theta - void setFieldNameTheta(const std::string& fieldName) { - _thetaID = fieldName; - } - /// set the field name used for phi - void setFieldNamePhi(const std::string& fieldName) { - _phiID = fieldName; - } + /// determine the position based on the cell ID + virtual Vector3D position(const CellID& cellID) const; + /// determine the cell ID based on the position + virtual CellID cellID(const Vector3D& localPosition, const Vector3D& globalPosition, const VolumeID& volumeID) const; + /// determine the polar angle theta based on the cell ID + double theta(const CellID& cellID) const; + /// determine the azimuthal angle phi based on the cell ID + double phi(const CellID& cellID) const; + /// access the number of bins in theta + int thetaBins() const { + return _thetaBins; + } + /// access the number of bins in theta + int phiBins() const { + return _phiBins; + } + /// access the coordinate offset in theta + double offsetTheta() const { + return _offsetTheta; + } + /// access the coordinate offset in phi + double offsetPhi() const { + return _offsetPhi; + } + /// access the field name used for theta + std::string fieldNameTheta() const { + return _thetaID; + } + /// access the field name used for phi + std::string fieldNamePhi() const { + return _phiID; + } + /// set the number of bins in theta + void setThetaBins(int bins) { + _thetaBins = bins; + } + /// set the number of bins in phi + void setPhiBins(int bins) { + _phiBins = bins; + } + /// set the coordinate offset in theta + void setOffsetTheta(double offset) { + _offsetTheta = offset; + } + /// set the coordinate offset in phi + void setOffsetPhi(double offset) { + _offsetPhi = offset; + } + /// set the field name used for theta + void setFieldNameTheta(const std::string& fieldName) { + _thetaID = fieldName; + } + /// set the field name used for phi + void setFieldNamePhi(const std::string& fieldName) { + _phiID = fieldName; + } -protected: - /// the number of bins in theta - int _thetaBins; - /// the number of bins in phi - int _phiBins; - /// the coordinate offset in theta - double _offsetTheta; - /// the coordinate offset in phi - double _offsetPhi; - /// the field name used for theta - std::string _thetaID; - /// the field name used for phi - std::string _phiID; + protected: + /// the number of bins in theta + int _thetaBins; + /// the number of bins in phi + int _phiBins; + /// the coordinate offset in theta + double _offsetTheta; + /// the coordinate offset in phi + double _offsetPhi; + /// the field name used for theta + std::string _thetaID; + /// the field name used for phi + std::string _phiID; -}; + }; -} /* namespace DDSegmentation */ + } /* namespace DDSegmentation */ } /* namespace dd4hep */ #endif /* PROJECTIVECYLINDER_H_ */ diff --git a/DDCore/include/DDSegmentation/Segmentation.h b/DDCore/include/DDSegmentation/Segmentation.h index 475379b936ef3d9b2f7332d75c29b6dee4205655..914a343a0ca7d64543c1d12833ba18cdb3734b75 100644 --- a/DDCore/include/DDSegmentation/Segmentation.h +++ b/DDCore/include/DDSegmentation/Segmentation.h @@ -1,3 +1,14 @@ +//========================================================================== +// AIDA Detector description implementation +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN) +// All rights reserved. +// +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. +// +//========================================================================== + /* * Segmentation.h * @@ -19,157 +30,157 @@ #include <vector> namespace dd4hep { -namespace DDSegmentation { - -typedef SegmentationParameter* Parameter; -typedef std::vector<Parameter> Parameters; -typedef TypedSegmentationParameter<int>* IntParameter; -typedef TypedSegmentationParameter<float>* FloatParameter; -typedef TypedSegmentationParameter<double>* DoubleParameter; -typedef TypedSegmentationParameter<std::string>* StringParameter; -typedef TypedSegmentationParameter<std::vector<int> >* IntVecParameter; -typedef TypedSegmentationParameter<std::vector<float> >* FloatVecParameter; -typedef TypedSegmentationParameter<std::vector<double> >* DoubleVecParameter; -typedef TypedSegmentationParameter<std::vector<std::string> >* StringVecParameter; -typedef SegmentationParameter::UnitType UnitType; - -/// Useful typedefs to differentiate cell IDs and volume IDs -typedef long long int CellID; -typedef long long int VolumeID; - -/// Simple container for a physics vector -struct Vector3D { - /// Default constructor - Vector3D(double x_val = 0., double y_val = 0., double z_val = 0.) : - X(x_val), Y(y_val), Z(z_val) { - } - /// Constructor using a foreign vector class. Requires methods x(), y() and z() - template<typename T> Vector3D(const T& v) { - X = v.x(); - Y = v.y(); - Z = v.Z(); - } - /// Access to x value (required for use with ROOT GenVector) - double x() const { - return X; - } - /// Access to y value (required for use with ROOT GenVector) - double y() const { - return Y; - } - /// Access to z value (required for use with ROOT GenVector) - double z() const { - return Z; - } - double X, Y, Z; -}; - -/// Base class for all segmentations -class Segmentation { -public: - /// Destructor - virtual ~Segmentation(); - - /// Add subsegmentation. Call only valid for Multi-segmentations. Default implementation throws an exception - virtual void addSubsegmentation(long key_min, long key_max, Segmentation* entry); - /// Determine the local position based on the cell ID - virtual Vector3D position(const CellID& cellID) const = 0; - /// Determine the cell ID based on the position - virtual CellID cellID(const Vector3D& localPosition, const Vector3D& globalPosition, - const VolumeID& volumeID) const = 0; - /// Determine the volume ID from the full cell ID by removing all local fields - virtual VolumeID volumeID(const CellID& cellID) const; - /// Calculates the neighbours of the given cell ID and adds them to the list of neighbours - virtual void neighbours(const CellID& cellID, std::set<CellID>& neighbours) const; - /// Access the encoding string - virtual std::string fieldDescription() const { - return _decoder->fieldDescription(); - } - /// Access the segmentation name - virtual const std::string& name() const { - return _name; - } - /// Set the segmentation name - virtual void setName(const std::string& value) { - _name = value; - } - /// Access the segmentation type - virtual const std::string& type() const { - return _type; - } - /// Access the description of the segmentation - virtual const std::string& description() const { - return _description; - } - /// Access the underlying decoder - virtual const BitFieldCoder* decoder() const { - return _decoder; - } - /// Set the underlying decoder - virtual void setDecoder(const BitFieldCoder* decoder); - /// Access to parameter by name - virtual Parameter parameter(const std::string& parameterName) const; - /// Access to all parameters - virtual Parameters parameters() const; - /// Set all parameters from an existing set of parameters - virtual void setParameters(const Parameters& parameters); - /** \brief Returns a vector<double> of the cellDimensions of the given cell ID - in natural order of dimensions, e.g., dx/dy/dz, or dr/r*dPhi - - \param cellID cellID of the cell for which parameters are returned - \return vector<double> in natural order of dimensions, e.g., dx/dy/dz, or dr/r*dPhi - */ - virtual std::vector<double> cellDimensions(const CellID& cellID) const; - -protected: - /// Default constructor used by derived classes passing the encoding string - Segmentation(const std::string& cellEncoding = ""); - /// Default constructor used by derived classes passing an existing decoder - Segmentation(const BitFieldCoder* decoder); - - /// Add a parameter to this segmentation. Used by derived classes to define their parameters - template<typename TYPE> void registerParameter(const std::string& nam, const std::string& desc, - TYPE& param, const TYPE& defaultVal, UnitType unitTyp = SegmentationParameter::NoUnit, - bool isOpt = false) { - _parameters[nam] = new TypedSegmentationParameter<TYPE>(nam,desc,param,defaultVal,unitTyp,isOpt); - } - /// Add a cell identifier to this segmentation. Used by derived classes to define their required identifiers - void registerIdentifier(const std::string& nam, const std::string& desc, std::string& ident, - const std::string& defaultVal); - - /// Helper method to convert a bin number to a 1D position - static double binToPosition(CellID bin, double cellSize, double offset = 0.); - /// Helper method to convert a 1D position to a cell ID - static int positionToBin(double position, double cellSize, double offset = 0.); - - /// Helper method to convert a bin number to a 1D position given a vector of binBoundaries - static double binToPosition(CellID bin, std::vector<double> const& cellBoundaries, double offset = 0.); - /// Helper method to convert a 1D position to a cell ID given a vector of binBoundaries - static int positionToBin(double position, std::vector<double> const& cellBoundaries, double offset = 0.); - - /// The segmentation name - std::string _name; - /// The segmentation type - std::string _type; - /// The description of the segmentation - std::string _description; - /// The parameters for this segmentation - std::map<std::string, Parameter> _parameters; //! No ROOT persistency - /// The indices used for the encoding - std::map<std::string, StringParameter> _indexIdentifiers; //! No ROOT persistency - /// The cell ID encoder and decoder - const BitFieldCoder* _decoder = 0; - /// Keeps track of the decoder ownership - bool _ownsDecoder = false; -private: - /// No copy constructor allowed - Segmentation(const Segmentation&); -}; - -/// Macro to instantiate a new SegmentationCreator by its type name -#define REGISTER_SEGMENTATION(classname) \ - static const SegmentationCreator<classname> classname##_creator(#classname); - -} /* namespace DDSegmentation */ + namespace DDSegmentation { + + typedef SegmentationParameter* Parameter; + typedef std::vector<Parameter> Parameters; + typedef TypedSegmentationParameter<int>* IntParameter; + typedef TypedSegmentationParameter<float>* FloatParameter; + typedef TypedSegmentationParameter<double>* DoubleParameter; + typedef TypedSegmentationParameter<std::string>* StringParameter; + typedef TypedSegmentationParameter<std::vector<int> >* IntVecParameter; + typedef TypedSegmentationParameter<std::vector<float> >* FloatVecParameter; + typedef TypedSegmentationParameter<std::vector<double> >* DoubleVecParameter; + typedef TypedSegmentationParameter<std::vector<std::string> >* StringVecParameter; + typedef SegmentationParameter::UnitType UnitType; + + /// Useful typedefs to differentiate cell IDs and volume IDs + typedef long long int CellID; + typedef long long int VolumeID; + + /// Simple container for a physics vector + struct Vector3D { + /// Default constructor + Vector3D(double x_val = 0., double y_val = 0., double z_val = 0.) : + X(x_val), Y(y_val), Z(z_val) { + } + /// Constructor using a foreign vector class. Requires methods x(), y() and z() + template<typename T> Vector3D(const T& v) { + X = v.x(); + Y = v.y(); + Z = v.Z(); + } + /// Access to x value (required for use with ROOT GenVector) + double x() const { + return X; + } + /// Access to y value (required for use with ROOT GenVector) + double y() const { + return Y; + } + /// Access to z value (required for use with ROOT GenVector) + double z() const { + return Z; + } + double X, Y, Z; + }; + + /// Base class for all segmentations + class Segmentation { + public: + /// Destructor + virtual ~Segmentation(); + + /// Add subsegmentation. Call only valid for Multi-segmentations. Default implementation throws an exception + virtual void addSubsegmentation(long key_min, long key_max, Segmentation* entry); + /// Determine the local position based on the cell ID + virtual Vector3D position(const CellID& cellID) const = 0; + /// Determine the cell ID based on the position + virtual CellID cellID(const Vector3D& localPosition, const Vector3D& globalPosition, + const VolumeID& volumeID) const = 0; + /// Determine the volume ID from the full cell ID by removing all local fields + virtual VolumeID volumeID(const CellID& cellID) const; + /// Calculates the neighbours of the given cell ID and adds them to the list of neighbours + virtual void neighbours(const CellID& cellID, std::set<CellID>& neighbours) const; + /// Access the encoding string + virtual std::string fieldDescription() const { + return _decoder->fieldDescription(); + } + /// Access the segmentation name + virtual const std::string& name() const { + return _name; + } + /// Set the segmentation name + virtual void setName(const std::string& value) { + _name = value; + } + /// Access the segmentation type + virtual const std::string& type() const { + return _type; + } + /// Access the description of the segmentation + virtual const std::string& description() const { + return _description; + } + /// Access the underlying decoder + virtual const BitFieldCoder* decoder() const { + return _decoder; + } + /// Set the underlying decoder + virtual void setDecoder(const BitFieldCoder* decoder); + /// Access to parameter by name + virtual Parameter parameter(const std::string& parameterName) const; + /// Access to all parameters + virtual Parameters parameters() const; + /// Set all parameters from an existing set of parameters + virtual void setParameters(const Parameters& parameters); + /** \brief Returns a vector<double> of the cellDimensions of the given cell ID + in natural order of dimensions, e.g., dx/dy/dz, or dr/r*dPhi + + \param cellID cellID of the cell for which parameters are returned + \return vector<double> in natural order of dimensions, e.g., dx/dy/dz, or dr/r*dPhi + */ + virtual std::vector<double> cellDimensions(const CellID& cellID) const; + + protected: + /// Default constructor used by derived classes passing the encoding string + Segmentation(const std::string& cellEncoding = ""); + /// Default constructor used by derived classes passing an existing decoder + Segmentation(const BitFieldCoder* decoder); + + /// Add a parameter to this segmentation. Used by derived classes to define their parameters + template<typename TYPE> void registerParameter(const std::string& nam, const std::string& desc, + TYPE& param, const TYPE& defaultVal, UnitType unitTyp = SegmentationParameter::NoUnit, + bool isOpt = false) { + _parameters[nam] = new TypedSegmentationParameter<TYPE>(nam,desc,param,defaultVal,unitTyp,isOpt); + } + /// Add a cell identifier to this segmentation. Used by derived classes to define their required identifiers + void registerIdentifier(const std::string& nam, const std::string& desc, std::string& ident, + const std::string& defaultVal); + + /// Helper method to convert a bin number to a 1D position + static double binToPosition(CellID bin, double cellSize, double offset = 0.); + /// Helper method to convert a 1D position to a cell ID + static int positionToBin(double position, double cellSize, double offset = 0.); + + /// Helper method to convert a bin number to a 1D position given a vector of binBoundaries + static double binToPosition(CellID bin, std::vector<double> const& cellBoundaries, double offset = 0.); + /// Helper method to convert a 1D position to a cell ID given a vector of binBoundaries + static int positionToBin(double position, std::vector<double> const& cellBoundaries, double offset = 0.); + + /// The segmentation name + std::string _name; + /// The segmentation type + std::string _type; + /// The description of the segmentation + std::string _description; + /// The parameters for this segmentation + std::map<std::string, Parameter> _parameters; //! No ROOT persistency + /// The indices used for the encoding + std::map<std::string, StringParameter> _indexIdentifiers; //! No ROOT persistency + /// The cell ID encoder and decoder + const BitFieldCoder* _decoder = 0; + /// Keeps track of the decoder ownership + bool _ownsDecoder = false; + private: + /// No copy constructor allowed + Segmentation(const Segmentation&); + }; + + /// Macro to instantiate a new SegmentationCreator by its type name +#define REGISTER_SEGMENTATION(classname) \ + static const SegmentationCreator<classname> classname##_creator(#classname); + + } /* namespace DDSegmentation */ } /* namespace dd4hep */ #endif /* DDSegmentation_SEGMENTATION_H_ */ diff --git a/DDCore/include/DDSegmentation/SegmentationFactory.h b/DDCore/include/DDSegmentation/SegmentationFactory.h index 36100860a801d7eeee1dddbab8f4fce1ff051de3..96605e65e8fcfa383ef1092ce6e52e1d17410749 100644 --- a/DDCore/include/DDSegmentation/SegmentationFactory.h +++ b/DDCore/include/DDSegmentation/SegmentationFactory.h @@ -1,3 +1,14 @@ +//========================================================================== +// AIDA Detector description implementation +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN) +// All rights reserved. +// +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. +// +//========================================================================== + /* * SegmentationFactory.h * @@ -17,61 +28,61 @@ #include <string> namespace dd4hep { -namespace DDSegmentation { + namespace DDSegmentation { -/// Forward declaration required because of circular dependency -class Segmentation; -class SegmentationCreatorBase; + /// Forward declaration required because of circular dependency + class Segmentation; + class SegmentationCreatorBase; -/// Base class for the SegmentationCreator objects. Allows to use the factory without template. -class SegmentationCreatorBase { -public: - /// Default constructor. Takes the class name as argument and takes care of registration with the factory - SegmentationCreatorBase(const std::string& name); - /// Destructor - virtual ~SegmentationCreatorBase() {}; - /// Create a new object - virtual Segmentation* create(const std::string& identifier) const = 0; -}; + /// Base class for the SegmentationCreator objects. Allows to use the factory without template. + class SegmentationCreatorBase { + public: + /// Default constructor. Takes the class name as argument and takes care of registration with the factory + SegmentationCreatorBase(const std::string& name); + /// Destructor + virtual ~SegmentationCreatorBase() {}; + /// Create a new object + virtual Segmentation* create(const std::string& identifier) const = 0; + }; -/// Concrete class to create segmentation objects. Every segmentation needs to instantiate a static instance of this. -template<class TYPE> class SegmentationCreator : public SegmentationCreatorBase { -public: - /// Default constructor. Takes the class name as argument which should match the class type - SegmentationCreator<TYPE>(const std::string& name) : SegmentationCreatorBase(name) {}; - /// Destructor - virtual ~SegmentationCreator() {}; - /// Create a new object of the given type. - Segmentation* create(const std::string& identifier) const {return new TYPE(identifier);}; -}; + /// Concrete class to create segmentation objects. Every segmentation needs to instantiate a static instance of this. + template<class TYPE> class SegmentationCreator : public SegmentationCreatorBase { + public: + /// Default constructor. Takes the class name as argument which should match the class type + SegmentationCreator<TYPE>(const std::string& name) : SegmentationCreatorBase(name) {}; + /// Destructor + virtual ~SegmentationCreator() {}; + /// Create a new object of the given type. + Segmentation* create(const std::string& identifier) const {return new TYPE(identifier);}; + }; -/// Factory for creating segmentation objects by type name -class SegmentationFactory { - /// Allow SegmentationCreators to register themselves with the factory - friend class SegmentationCreatorBase; -public: - /// Access to the global factory instance - static SegmentationFactory* instance(); - /// Create a new segmentation object with the given type name. Returns NULL if type name is unknown. - Segmentation* create(const std::string& name, const std::string& identifier = "") const; - /// Access to the list of registered segmentations - std::vector<std::string> registeredSegmentations() const; -protected: - /// Default constructor - SegmentationFactory() {}; - /// Copy constructor - SegmentationFactory(const SegmentationFactory&) {}; - /// Destructor - virtual ~SegmentationFactory() {}; - /// Registers a new SegmentationCreator with the factory - void registerSegmentation(const std::string& name, SegmentationCreatorBase* creator); - /// Map to store SegmentationCreators by name - std::map<std::string, SegmentationCreatorBase*> _segmentations; -private: - /// The global factory instance - static SegmentationFactory* _instance; -}; + /// Factory for creating segmentation objects by type name + class SegmentationFactory { + /// Allow SegmentationCreators to register themselves with the factory + friend class SegmentationCreatorBase; + public: + /// Access to the global factory instance + static SegmentationFactory* instance(); + /// Create a new segmentation object with the given type name. Returns NULL if type name is unknown. + Segmentation* create(const std::string& name, const std::string& identifier = "") const; + /// Access to the list of registered segmentations + std::vector<std::string> registeredSegmentations() const; + protected: + /// Default constructor + SegmentationFactory() {}; + /// Copy constructor + SegmentationFactory(const SegmentationFactory&) {}; + /// Destructor + virtual ~SegmentationFactory() {}; + /// Registers a new SegmentationCreator with the factory + void registerSegmentation(const std::string& name, SegmentationCreatorBase* creator); + /// Map to store SegmentationCreators by name + std::map<std::string, SegmentationCreatorBase*> _segmentations; + private: + /// The global factory instance + static SegmentationFactory* _instance; + }; -} /* namespace DDSegmentation */ + } /* namespace DDSegmentation */ } /* namespace dd4hep */ #endif /* DDSegmentation_SEGMENTATIONFACTORY_H_ */ diff --git a/DDCore/include/DDSegmentation/SegmentationParameter.h b/DDCore/include/DDSegmentation/SegmentationParameter.h index bcde988522fbe513df49802adc37d96bf44c9c7b..ffe737863f2f0e00184fcec0b5edf4482eb0019a 100644 --- a/DDCore/include/DDSegmentation/SegmentationParameter.h +++ b/DDCore/include/DDSegmentation/SegmentationParameter.h @@ -1,3 +1,14 @@ +//========================================================================== +// AIDA Detector description implementation +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN) +// All rights reserved. +// +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. +// +//========================================================================== + /* * SegmentationParameter.h * @@ -16,286 +27,288 @@ #include <vector> namespace dd4hep { -namespace DDSegmentation { - - -/// Helper method to split string into tokens -inline std::vector<std::string> splitString(const std::string& s, char delimiter = ' ') { - std::vector<std::string> elements; - std::stringstream ss(s); - std::string item; - while (std::getline(ss, item, delimiter)) { - elements.push_back(item); - } - return elements; -} - -/// Helper class to extract type names -template<typename TYPE> struct TypeName { - static const char* name() { - return typeid(TYPE).name(); - } -}; - -/// Specialization for int type -template<> struct TypeName<int> { - static const char* name() { - return "int"; - } -}; - -/// Specialization for float type -template<> struct TypeName<float> { - static const char* name() { - return "float"; - } -}; - -/// Specialization for double type -template<> struct TypeName<double> { - static const char* name() { - return "double"; - } -}; - -/// Specialization for string type -template<> struct TypeName<std::string> { - static const char* name() { - return "string"; - } -}; - -/// Specialization for int vector type -template<> struct TypeName<std::vector<int> > { - static const char* name() { - return "intvec"; - } -}; - -/// Specialization for float vector type -template<> struct TypeName<std::vector<float> > { - static const char* name() { - return "floatvec"; - } -}; - -/// Specialization for double vector type -template<> struct TypeName<std::vector<double> > { - static const char* name() { - return "doublevec"; - } -}; - -/// Specialization for string vector type -template<> struct TypeName<std::vector<std::string> > { - static const char* name() { - return "stringvec"; - } -}; - -/// Class to hold a segmentation parameter with its description -class SegmentationParameter { -public: - /// Defines the parameter unit type (useful to convert to default set of units) - enum UnitType { - NoUnit, LengthUnit, AngleUnit - }; - /// Default destructor - virtual ~SegmentationParameter() { - } - /// Access to the parameter name - const std::string& name() const { - return _name; - } - /// Access to the parameter description - const std::string& description() const { - return _description; - } - /// Access to the unit type - UnitType unitType() const { - return _unitType; - } - /// Access to the parameter type - virtual std::string type() const = 0; - /// Access to the parameter value in string representation - virtual std::string value() const = 0; - /// Set the parameter value in string representation - virtual void setValue(const std::string& value) = 0; - /// Access to the parameter default value in string representation - virtual std::string defaultValue() const = 0; - /// Check if this parameter is optional - bool isOptional() const { - return _isOptional; - } - /// Printable version - std::string toString() const { - std::stringstream s; - s << _name << " = " << value(); - if (not _description.empty()) { - s << " (" << _description << ")"; - } - return s.str(); - } -protected: - /// Default constructor used by derived classes - SegmentationParameter(const std::string& nam, const std::string& desc, UnitType unitTyp = NoUnit, - bool isOpt = false) : - _name(nam), _description(desc), _unitType(unitTyp), _isOptional(isOpt) { - } - /// The parameter name - std::string _name; - /// The parameter description - std::string _description; - /// The unit type - UnitType _unitType; - /// Store if parameter is optional - bool _isOptional; -}; - -template<typename TYPE> class TypedSegmentationParameter: public SegmentationParameter { -public: + namespace DDSegmentation { + + + /// Helper method to split string into tokens + inline std::vector<std::string> splitString(const std::string& s, char delimiter = ' ') { + std::vector<std::string> elements; + std::stringstream ss(s); + std::string item; + while (std::getline(ss, item, delimiter)) { + elements.push_back(item); + } + return elements; + } + + /// Helper class to extract type names + template<typename TYPE> struct TypeName { + static const char* name() { + return typeid(TYPE).name(); + } + }; + + /// Specialization for int type + template<> struct TypeName<int> { + static const char* name() { + return "int"; + } + }; + + /// Specialization for float type + template<> struct TypeName<float> { + static const char* name() { + return "float"; + } + }; + + /// Specialization for double type + template<> struct TypeName<double> { + static const char* name() { + return "double"; + } + }; + + /// Specialization for string type + template<> struct TypeName<std::string> { + static const char* name() { + return "string"; + } + }; + + /// Specialization for int vector type + template<> struct TypeName<std::vector<int> > { + static const char* name() { + return "intvec"; + } + }; + + /// Specialization for float vector type + template<> struct TypeName<std::vector<float> > { + static const char* name() { + return "floatvec"; + } + }; + + /// Specialization for double vector type + template<> struct TypeName<std::vector<double> > { + static const char* name() { + return "doublevec"; + } + }; + + /// Specialization for string vector type + template<> struct TypeName<std::vector<std::string> > { + static const char* name() { + return "stringvec"; + } + }; + + /// Class to hold a segmentation parameter with its description + class SegmentationParameter { + public: + /// Defines the parameter unit type (useful to convert to default set of units) + enum UnitType { + NoUnit, LengthUnit, AngleUnit + }; + /// Default destructor + virtual ~SegmentationParameter() { + } + /// Access to the parameter name + const std::string& name() const { + return _name; + } + /// Access to the parameter description + const std::string& description() const { + return _description; + } + /// Access to the unit type + UnitType unitType() const { + return _unitType; + } + /// Access to the parameter type + virtual std::string type() const = 0; + /// Access to the parameter value in string representation + virtual std::string value() const = 0; + /// Set the parameter value in string representation + virtual void setValue(const std::string& value) = 0; + /// Access to the parameter default value in string representation + virtual std::string defaultValue() const = 0; + /// Check if this parameter is optional + bool isOptional() const { + return _isOptional; + } + /// Printable version + std::string toString() const { + std::stringstream s; + s << _name << " = " << value(); + if (not _description.empty()) { + s << " (" << _description << ")"; + } + return s.str(); + } + protected: + /// Default constructor used by derived classes + SegmentationParameter(const std::string& nam, const std::string& desc, UnitType unitTyp = NoUnit, + bool isOpt = false) : + _name(nam), _description(desc), _unitType(unitTyp), _isOptional(isOpt) { + } + /// The parameter name + std::string _name; + /// The parameter description + std::string _description; + /// The unit type + UnitType _unitType; + /// Store if parameter is optional + bool _isOptional; + }; + + /// Concrete class to hold a segmentation parameter of a given type with its description + template<typename TYPE> class TypedSegmentationParameter: public SegmentationParameter { + public: #if defined(G__ROOT) || defined(__CLANG__) || defined(__ROOTCLING__) - /// Empty constructor for ROOT persistency - TypedSegmentationParameter() - : SegmentationParameter("","",SegmentationParameter::NoUnit,false), _value(0), _defaultValue() {} + /// Empty constructor for ROOT persistency + TypedSegmentationParameter() + : SegmentationParameter("","",SegmentationParameter::NoUnit,false), _value(0), _defaultValue() {} #endif - /// Default constructor - TypedSegmentationParameter(const std::string& nam, const std::string& desc, TYPE& val, - const TYPE& default_Value, SegmentationParameter::UnitType unitTyp = SegmentationParameter::NoUnit, - bool isOpt = false) : - SegmentationParameter(nam, desc, unitTyp, isOpt), _value(&val), _defaultValue(default_Value) { - *_value = default_Value; - } - /// Default destructor - virtual ~TypedSegmentationParameter() { } - - /// Access to the parameter value - const TYPE& typedValue() const { - return *_value; - } - - /// Set the parameter value - void setTypedValue(const TYPE& val) { - *_value = val; - } - - /// Access to the parameter default value - const TYPE& typedDefaultValue() const { - return _defaultValue; - } - - /// Access to the parameter type - std::string type() const { - return TypeName<TYPE>::name(); - } - - /// Access to the parameter value in string representation - std::string value() const { - std::stringstream s; - s << *_value; - return s.str(); - } - - /// Set the parameter value in string representation - void setValue(const std::string& val) { - std::stringstream s; - s << val; - s >> *_value; - } - - /// Access to the parameter default value in string representation - std::string defaultValue() const { - std::stringstream s; - s << _defaultValue; - return s.str(); - } - -protected: - TYPE* _value = 0; //! - TYPE _defaultValue; -}; - -template<typename TYPE> class TypedSegmentationParameter<std::vector<TYPE> > : public SegmentationParameter { -public: + /// Default constructor + TypedSegmentationParameter(const std::string& nam, const std::string& desc, TYPE& val, + const TYPE& default_Value, SegmentationParameter::UnitType unitTyp = SegmentationParameter::NoUnit, + bool isOpt = false) : + SegmentationParameter(nam, desc, unitTyp, isOpt), _value(&val), _defaultValue(default_Value) { + *_value = default_Value; + } + /// Default destructor + virtual ~TypedSegmentationParameter() { } + + /// Access to the parameter value + const TYPE& typedValue() const { + return *_value; + } + + /// Set the parameter value + void setTypedValue(const TYPE& val) { + *_value = val; + } + + /// Access to the parameter default value + const TYPE& typedDefaultValue() const { + return _defaultValue; + } + + /// Access to the parameter type + std::string type() const { + return TypeName<TYPE>::name(); + } + + /// Access to the parameter value in string representation + std::string value() const { + std::stringstream s; + s << *_value; + return s.str(); + } + + /// Set the parameter value in string representation + void setValue(const std::string& val) { + std::stringstream s; + s << val; + s >> *_value; + } + + /// Access to the parameter default value in string representation + std::string defaultValue() const { + std::stringstream s; + s << _defaultValue; + return s.str(); + } + + protected: + TYPE* _value = 0; //! + TYPE _defaultValue; + }; + + /// Concrete class to hold a segmentation parameter of a vector of items of a given type with its description + template<typename TYPE> class TypedSegmentationParameter<std::vector<TYPE> > : public SegmentationParameter { + public: #if defined(G__ROOT) || defined(__CLANG__) || defined(__ROOTCLING__) - /// Empty constructor for ROOT persistency - TypedSegmentationParameter() - : SegmentationParameter("","",SegmentationParameter::NoUnit,false), _value(0), _defaultValue() {} + /// Empty constructor for ROOT persistency + TypedSegmentationParameter() + : SegmentationParameter("","",SegmentationParameter::NoUnit,false), _value(0), _defaultValue() {} #endif - /// Default constructor - TypedSegmentationParameter(const std::string& nam, const std::string& desc, std::vector<TYPE>& val, - const std::vector<TYPE>& defaultVal, SegmentationParameter::UnitType unitTyp = - SegmentationParameter::NoUnit, bool isOpt = false) : - SegmentationParameter(nam, desc, unitTyp, isOpt), _value(&val), _defaultValue(defaultVal) { - *_value = defaultVal; - } - /// Default destructor - virtual ~TypedSegmentationParameter() { } - - /// Access to the parameter value - const std::vector<TYPE>& typedValue() const { - return *_value; - } - - /// Set the parameter value - void setTypedValue(const std::vector<TYPE>& val) { - *_value = val; - } - - /// Access to the parameter default value - const std::vector<TYPE>& typedDefaultValue() const { - return _defaultValue; - } - - /// Access to the parameter type - std::string type() const { - std::stringstream s; - s << TypeName<TYPE>::name() << "vec"; - return s.str() ; - } - - /// Access to the parameter value in string representation - std::string value() const { - std::stringstream s; - for (const auto& it : *_value ) { - s << it; - s << " "; - } - return s.str(); - } - - /// Set the parameter value in string representation - void setValue(const std::string& val) { - std::vector<std::string> elements = splitString(val); - _value->clear(); - for (std::vector<std::string>::const_iterator it = elements.begin(); it != elements.end(); ++it) { - if (not it->empty()) { - TYPE entry; - std::stringstream s; - s << *it; - s >> entry; - _value->push_back(entry); - } - } - } - - /// Access to the parameter default value in string representation - std::string defaultValue() const { - std::stringstream s; - typename std::vector<TYPE>::const_iterator it = _defaultValue.begin(); - for (; it != _defaultValue.end(); ++it) { - s << *it; - s << " "; - } - return s.str(); - } - -protected: - std::vector<TYPE>* _value = 0; //! - std::vector<TYPE> _defaultValue; - -}; - -} /* namespace DDSegmentation */ + /// Default constructor + TypedSegmentationParameter(const std::string& nam, const std::string& desc, std::vector<TYPE>& val, + const std::vector<TYPE>& defaultVal, SegmentationParameter::UnitType unitTyp = + SegmentationParameter::NoUnit, bool isOpt = false) : + SegmentationParameter(nam, desc, unitTyp, isOpt), _value(&val), _defaultValue(defaultVal) { + *_value = defaultVal; + } + /// Default destructor + virtual ~TypedSegmentationParameter() { } + + /// Access to the parameter value + const std::vector<TYPE>& typedValue() const { + return *_value; + } + + /// Set the parameter value + void setTypedValue(const std::vector<TYPE>& val) { + *_value = val; + } + + /// Access to the parameter default value + const std::vector<TYPE>& typedDefaultValue() const { + return _defaultValue; + } + + /// Access to the parameter type + std::string type() const { + std::stringstream s; + s << TypeName<TYPE>::name() << "vec"; + return s.str() ; + } + + /// Access to the parameter value in string representation + std::string value() const { + std::stringstream s; + for (const auto& it : *_value ) { + s << it; + s << " "; + } + return s.str(); + } + + /// Set the parameter value in string representation + void setValue(const std::string& val) { + std::vector<std::string> elements = splitString(val); + _value->clear(); + for (std::vector<std::string>::const_iterator it = elements.begin(); it != elements.end(); ++it) { + if (not it->empty()) { + TYPE entry; + std::stringstream s; + s << *it; + s >> entry; + _value->push_back(entry); + } + } + } + + /// Access to the parameter default value in string representation + std::string defaultValue() const { + std::stringstream s; + typename std::vector<TYPE>::const_iterator it = _defaultValue.begin(); + for (; it != _defaultValue.end(); ++it) { + s << *it; + s << " "; + } + return s.str(); + } + + protected: + std::vector<TYPE>* _value = 0; //! + std::vector<TYPE> _defaultValue; + + }; + + } /* namespace DDSegmentation */ } /* namespace dd4hep */ #endif /* DDSegmentation_SEGMENTATIONPARAMETER_H_ */ diff --git a/DDCore/include/DDSegmentation/TiledLayerGridXY.h b/DDCore/include/DDSegmentation/TiledLayerGridXY.h index 4379ef1a63f0e85d2751d7e4228c52bc495597f8..51be74245c683a608741716d65106d6c3a88ea6e 100644 --- a/DDCore/include/DDSegmentation/TiledLayerGridXY.h +++ b/DDCore/include/DDSegmentation/TiledLayerGridXY.h @@ -1,3 +1,14 @@ +//========================================================================== +// AIDA Detector description implementation +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN) +// All rights reserved. +// +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. +// +//========================================================================== + /* * TiledLayerGridXY.h * @@ -15,147 +26,148 @@ #include <vector> namespace dd4hep { -namespace DDSegmentation { + namespace DDSegmentation { -class TiledLayerGridXY: public CartesianGrid { -public: - /// Default constructor passing the encoding string - TiledLayerGridXY(const std::string& cellEncoding = ""); - /// Default constructor used by derived classes passing an existing decoder - TiledLayerGridXY(const BitFieldCoder* decoder); - /// destructor - virtual ~TiledLayerGridXY(); + /// A segmentation class to describe tiled layers + class TiledLayerGridXY: public CartesianGrid { + public: + /// Default constructor passing the encoding string + TiledLayerGridXY(const std::string& cellEncoding = ""); + /// Default constructor used by derived classes passing an existing decoder + TiledLayerGridXY(const BitFieldCoder* decoder); + /// destructor + virtual ~TiledLayerGridXY(); - /// determine the position based on the cell ID - virtual Vector3D position(const CellID& cellID) const; - /// determine the cell ID based on the position - virtual CellID cellID(const Vector3D& localPosition, const Vector3D& globalPosition, const VolumeID& volumeID) const; - /// access the grid size in X - double gridSizeX() const { - return _gridSizeX; - } - /// access the grid size in Y - double gridSizeY() const { - return _gridSizeY; - } - /// access the coordinate offset in X - double offsetX() const { - return _offsetX; - } - /// access the coordinate offset in Y - double offsetY() const { - return _offsetY; - } - /// access the coordinate layerOffset in X - std::vector<double> layerOffsetX() const { - return _layerOffsetX; - } - /// access the coordinate layerOffset in Y - std::vector<double> layerOffsetY() const { - return _layerOffsetY; - } - /// access the boundary dimension in X - std::vector<double> boundaryLayerX() const { - return _layerDimX; - } - /// access the fraction cell size in X - std::vector<double> FractCellSizeXPerLayer() const { - return _fractCellSizeXPerLayer; - } - /// access the field name used for X - const std::string& fieldNameX() const { - return _xId; - } - /// access the field name used for Y - const std::string& fieldNameY() const { - return _yId; - } - /// access the field name used for Layer - const std::string& fieldNameLayer() const { - return _identifierLayer; - } - /// set the grid size in X - void setGridSizeX(double cellSize) { - _gridSizeX = cellSize; - } - /// set the grid size in Y - void setGridSizeY(double cellSize) { - _gridSizeY = cellSize; - } - /// set the coordinate offset in X - void setOffsetX(double offset) { - _offsetX = offset; - } - /// set the coordinate offset in Y - void setOffsetY(double offset) { - _offsetY = offset; - } - /// set the coordinate layerOffset in X - void setLayerOffsetX(double offset) { - _layerOffsetX.push_back(offset); - } - /// set the coordinate layerOffset in Y - void setLayerOffsetY(double offset) { - _layerOffsetY.push_back(offset); - } - /// set the field name used for X - void setFieldNameX(const std::string& fieldName) { - _xId = fieldName; - } - /// set the field name used for Y - void setFieldNameY(const std::string& fieldName) { - _yId = fieldName; - } - /// set the field name used for Y - void setFieldNameLayer(const std::string& fieldName) { - _identifierLayer= fieldName; - } - /// set the layer boundary dimension for X - void setBoundaryLayerX(double halfX) - { - _layerDimX.push_back(halfX); - }; - /// set the layer fraction cell size for X - void setFractCellSizeXPerLayer(double newFractCellSizeX) - { - _fractCellSizeXPerLayer.push_back(newFractCellSizeX); - } - /** \brief Returns a vector<double> of the cellDimensions of the given cell ID - in natural order of dimensions, e.g., dx/dy/dz, or dr/r*dPhi + /// determine the position based on the cell ID + virtual Vector3D position(const CellID& cellID) const; + /// determine the cell ID based on the position + virtual CellID cellID(const Vector3D& localPosition, const Vector3D& globalPosition, const VolumeID& volumeID) const; + /// access the grid size in X + double gridSizeX() const { + return _gridSizeX; + } + /// access the grid size in Y + double gridSizeY() const { + return _gridSizeY; + } + /// access the coordinate offset in X + double offsetX() const { + return _offsetX; + } + /// access the coordinate offset in Y + double offsetY() const { + return _offsetY; + } + /// access the coordinate layerOffset in X + std::vector<double> layerOffsetX() const { + return _layerOffsetX; + } + /// access the coordinate layerOffset in Y + std::vector<double> layerOffsetY() const { + return _layerOffsetY; + } + /// access the boundary dimension in X + std::vector<double> boundaryLayerX() const { + return _layerDimX; + } + /// access the fraction cell size in X + std::vector<double> FractCellSizeXPerLayer() const { + return _fractCellSizeXPerLayer; + } + /// access the field name used for X + const std::string& fieldNameX() const { + return _xId; + } + /// access the field name used for Y + const std::string& fieldNameY() const { + return _yId; + } + /// access the field name used for Layer + const std::string& fieldNameLayer() const { + return _identifierLayer; + } + /// set the grid size in X + void setGridSizeX(double cellSize) { + _gridSizeX = cellSize; + } + /// set the grid size in Y + void setGridSizeY(double cellSize) { + _gridSizeY = cellSize; + } + /// set the coordinate offset in X + void setOffsetX(double offset) { + _offsetX = offset; + } + /// set the coordinate offset in Y + void setOffsetY(double offset) { + _offsetY = offset; + } + /// set the coordinate layerOffset in X + void setLayerOffsetX(double offset) { + _layerOffsetX.push_back(offset); + } + /// set the coordinate layerOffset in Y + void setLayerOffsetY(double offset) { + _layerOffsetY.push_back(offset); + } + /// set the field name used for X + void setFieldNameX(const std::string& fieldName) { + _xId = fieldName; + } + /// set the field name used for Y + void setFieldNameY(const std::string& fieldName) { + _yId = fieldName; + } + /// set the field name used for Y + void setFieldNameLayer(const std::string& fieldName) { + _identifierLayer= fieldName; + } + /// set the layer boundary dimension for X + void setBoundaryLayerX(double halfX) + { + _layerDimX.push_back(halfX); + }; + /// set the layer fraction cell size for X + void setFractCellSizeXPerLayer(double newFractCellSizeX) + { + _fractCellSizeXPerLayer.push_back(newFractCellSizeX); + } + /** \brief Returns a vector<double> of the cellDimensions of the given cell ID + in natural order of dimensions, e.g., dx/dy/dz, or dr/r*dPhi - Returns a vector of the cellDimensions of the given cell ID - \param cellID is ignored as all cells have the same dimension - \return std::vector<double> size 2: - -# size in x - -# size in y - */ - virtual std::vector<double> cellDimensions(const CellID& cellID) const; + Returns a vector of the cellDimensions of the given cell ID + \param cellID is ignored as all cells have the same dimension + \return std::vector<double> size 2: + -# size in x + -# size in y + */ + virtual std::vector<double> cellDimensions(const CellID& cellID) const; -protected: - /// the grid size in X - double _gridSizeX; - /// the coordinate offset in X - double _offsetX; - /// the grid size in Y - double _gridSizeY; - /// the coordinate offset in Y - double _offsetY; - /// the field name used for X - std::string _xId; - /// the field name used for Y - std::string _yId; - /// encoding field used for the layer - std::string _identifierLayer; - /// list of layer x offset - std::vector<double> _layerOffsetX; - /// list of layer y offset - std::vector<double> _layerOffsetY; - /// list of layer boundary dimension for X - std::vector<double> _layerDimX; - /// list of the layer fraction cell size for X - std::vector<double> _fractCellSizeXPerLayer; -}; + protected: + /// the grid size in X + double _gridSizeX; + /// the coordinate offset in X + double _offsetX; + /// the grid size in Y + double _gridSizeY; + /// the coordinate offset in Y + double _offsetY; + /// the field name used for X + std::string _xId; + /// the field name used for Y + std::string _yId; + /// encoding field used for the layer + std::string _identifierLayer; + /// list of layer x offset + std::vector<double> _layerOffsetX; + /// list of layer y offset + std::vector<double> _layerOffsetY; + /// list of layer boundary dimension for X + std::vector<double> _layerDimX; + /// list of the layer fraction cell size for X + std::vector<double> _fractCellSizeXPerLayer; + }; -} /* namespace DDSegmentation */ + } /* namespace DDSegmentation */ } /* namespace dd4hep */ #endif /* DDSegmentation_TILEDLAYERGRIDXY_H_ */ diff --git a/DDCore/include/DDSegmentation/TiledLayerSegmentation.h b/DDCore/include/DDSegmentation/TiledLayerSegmentation.h index 801b61763a6addfb0625085e7b53d57ddbfd4b87..355750841bfd121dba52aab2fdf6b0c189c8604d 100644 --- a/DDCore/include/DDSegmentation/TiledLayerSegmentation.h +++ b/DDCore/include/DDSegmentation/TiledLayerSegmentation.h @@ -1,3 +1,14 @@ +//========================================================================== +// AIDA Detector description implementation +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN) +// All rights reserved. +// +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. +// +//========================================================================== + /* * TiledLayerSegmentation.h * @@ -15,104 +26,105 @@ #include <vector> namespace dd4hep { -namespace DDSegmentation { - -class TiledLayerSegmentation: public Segmentation { -public: - /// Helper class to store x and y dimensions of a layer - struct LayerDimensions { - LayerDimensions(double _x = 1., double _y = 1.) : - x(_x), y(_y) {} - double x, y; - }; - - /// Default constructor passing the encoding string - TiledLayerSegmentation(const std::string& cellEncoding = ""); - /// Default constructor used by derived classes passing an existing decoder - TiledLayerSegmentation(const BitFieldCoder* decoder); - /// destructor - virtual ~TiledLayerSegmentation(); - - /// determine the position based on the cell ID - virtual Vector3D position(const CellID& cellID) const; - /// determine the cell ID based on the position - virtual CellID cellID(const Vector3D& localPosition, const Vector3D& globalPosition, - const VolumeID& volumeID) const; - - /// access the default grid size in X - double gridSizeX() const { - return _gridSizeX; - } - /// access the default grid size in Y - double gridSizeY() const { - return _gridSizeY; - } - - /// access the actual grid size in X for a given layer - double layerGridSizeX(int layerIndex) const; - /// access the actual grid size in Y for a given layer - double layerGridSizeY(int layerIndex) const; - - /// access the encoding field name used for X - const std::string& identifierX() const { - return _identifierX; - } - /// access the encoding field name used for Y - const std::string& identifierY() const { - return _identifierY; - } - /// access the encoding field name used for Y - const std::string& identifierLayer() const { - return _identifierLayer; - } - - /// access to the dimensions of the given layer - LayerDimensions layerDimensions(int layerIndex) const; - - /// set the default grid size in X - void setGridSizeX(double cellSize) { - _gridSizeX = cellSize; - } - /// set the default grid size in Y - void setGridSizeY(double cellSize) { - _gridSizeY = cellSize; - } - - /// set the encoding field name used for X - void setIdentifierX(const std::string& fieldName) { - _identifierX = fieldName; - } - /// set the encoding field name used for Y - void setIdentifierY(const std::string& fieldName) { - _identifierY = fieldName; - } - /// set the encoding field name used for layer - void setIdentifierLayer(const std::string& fieldName) { - _identifierLayer = fieldName; - } - - /// set the dimensions of the given layer - void setLayerDimensions(int layerIndex, double x, double y); - - - -protected: - double _gridSizeX; /// default grid size in X - double _gridSizeY; /// default grid size in Y - std::string _identifierX; /// encoding field used for X - std::string _identifierY; /// encoding field used for Y - std::string _identifierLayer; /// encoding field used for the layer - std::vector<int> _layerIndices; /// list of valid layer identifiers - std::vector<double> _layerDimensionsX; /// list of layer x dimensions - std::vector<double> _layerDimensionsY; /// list of layer y dimensions - - /// helper method to calculate optimal cell size based on total size - static double calculateOptimalCellSize(double nominalCellSize, double totalSize); - /// helper method to calculate offset of bin 0 based on the total size - static double calculateOffset(double cellSize, double totalSize); -}; - -} /* namespace DDSegmentation */ + namespace DDSegmentation { + + /// A segmentation class to describe tiled layers + class TiledLayerSegmentation: public Segmentation { + public: + /// Helper class to store x and y dimensions of a layer + struct LayerDimensions { + LayerDimensions(double _x = 1., double _y = 1.) : + x(_x), y(_y) {} + double x, y; + }; + + /// Default constructor passing the encoding string + TiledLayerSegmentation(const std::string& cellEncoding = ""); + /// Default constructor used by derived classes passing an existing decoder + TiledLayerSegmentation(const BitFieldCoder* decoder); + /// destructor + virtual ~TiledLayerSegmentation(); + + /// determine the position based on the cell ID + virtual Vector3D position(const CellID& cellID) const; + /// determine the cell ID based on the position + virtual CellID cellID(const Vector3D& localPosition, const Vector3D& globalPosition, + const VolumeID& volumeID) const; + + /// access the default grid size in X + double gridSizeX() const { + return _gridSizeX; + } + /// access the default grid size in Y + double gridSizeY() const { + return _gridSizeY; + } + + /// access the actual grid size in X for a given layer + double layerGridSizeX(int layerIndex) const; + /// access the actual grid size in Y for a given layer + double layerGridSizeY(int layerIndex) const; + + /// access the encoding field name used for X + const std::string& identifierX() const { + return _identifierX; + } + /// access the encoding field name used for Y + const std::string& identifierY() const { + return _identifierY; + } + /// access the encoding field name used for Y + const std::string& identifierLayer() const { + return _identifierLayer; + } + + /// access to the dimensions of the given layer + LayerDimensions layerDimensions(int layerIndex) const; + + /// set the default grid size in X + void setGridSizeX(double cellSize) { + _gridSizeX = cellSize; + } + /// set the default grid size in Y + void setGridSizeY(double cellSize) { + _gridSizeY = cellSize; + } + + /// set the encoding field name used for X + void setIdentifierX(const std::string& fieldName) { + _identifierX = fieldName; + } + /// set the encoding field name used for Y + void setIdentifierY(const std::string& fieldName) { + _identifierY = fieldName; + } + /// set the encoding field name used for layer + void setIdentifierLayer(const std::string& fieldName) { + _identifierLayer = fieldName; + } + + /// set the dimensions of the given layer + void setLayerDimensions(int layerIndex, double x, double y); + + + + protected: + double _gridSizeX; /// default grid size in X + double _gridSizeY; /// default grid size in Y + std::string _identifierX; /// encoding field used for X + std::string _identifierY; /// encoding field used for Y + std::string _identifierLayer; /// encoding field used for the layer + std::vector<int> _layerIndices; /// list of valid layer identifiers + std::vector<double> _layerDimensionsX; /// list of layer x dimensions + std::vector<double> _layerDimensionsY; /// list of layer y dimensions + + /// helper method to calculate optimal cell size based on total size + static double calculateOptimalCellSize(double nominalCellSize, double totalSize); + /// helper method to calculate offset of bin 0 based on the total size + static double calculateOffset(double cellSize, double totalSize); + }; + + } /* namespace DDSegmentation */ } /* namespace dd4hep */ #endif /* TILEDLAYERSEGMENTATION_H_ */ diff --git a/DDCore/include/DDSegmentation/WaferGridXY.h b/DDCore/include/DDSegmentation/WaferGridXY.h index 63975a57b512972b99cbb7766aecfbeec83a7cb6..61b2019828b186eab23be35e5d9e7795b2fcdcff 100644 --- a/DDCore/include/DDSegmentation/WaferGridXY.h +++ b/DDCore/include/DDSegmentation/WaferGridXY.h @@ -1,3 +1,14 @@ +//========================================================================== +// AIDA Detector description implementation +//-------------------------------------------------------------------------- +// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN) +// All rights reserved. +// +// For the licensing terms see $DD4hepINSTALL/LICENSE. +// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. +// +//========================================================================== + /* * WaferGridXY.h * @@ -16,6 +27,7 @@ namespace dd4hep { namespace DDSegmentation { + /// A segmentation class to describe wafer grids in X-Y class WaferGridXY: public CartesianGrid { public: /// Default constructor passing the encoding string diff --git a/DDCore/src/plugins/PandoraConverter.cpp b/DDCore/src/plugins/PandoraConverter.cpp index c55ef85eee43d7e489cdf74f3581f8f0b7ad8d73..b615701f615f73cb8cc53f5879f86afbb6487204 100644 --- a/DDCore/src/plugins/PandoraConverter.cpp +++ b/DDCore/src/plugins/PandoraConverter.cpp @@ -28,6 +28,7 @@ namespace dd4hep { */ namespace detail { + /// Converter to create Pandora structures from dd4hep (NOT IMPLEMENTED) /** @class PandoraConverter PandoraConverter.h XML/PandoraConverter.h * * Geometry converter from dd4hep to Geant 4. @@ -37,6 +38,7 @@ namespace dd4hep { */ struct PandoraConverter: public GeoHandler { protected: + /// Helper class struct GeometryInfo: public GeoHandler::GeometryInfo { xml_doc_t doc; xml_elt_t doc_root, doc_calorimeters, doc_detector, doc_coil, doc_tracking; diff --git a/DDG4/legacy/Geant4CalorimeterSD.cpp b/DDG4/legacy/Geant4CalorimeterSD.cpp index e4fef905428a59735050320243287452c6084e51..a6928b68a1c9ca4f20a9362228dedb77fa7e4259 100644 --- a/DDG4/legacy/Geant4CalorimeterSD.cpp +++ b/DDG4/legacy/Geant4CalorimeterSD.cpp @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation //-------------------------------------------------------------------------- @@ -31,6 +30,13 @@ namespace dd4hep { namespace sim { /// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ /// Geant4GenericSD<Calorimeter> /// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + + /// Legacy class. Deprecated. Not supported! Not supported by the DDG4 kernel. + /** \deprecated + * + * @author M.Frank + * @version 1.0 + */ struct Calorimeter {}; /// Method for generating hit(s) using the information of G4Step object. template <> bool Geant4GenericSD<Calorimeter>::buildHits(G4Step* step,G4TouchableHistory*) { @@ -64,7 +70,21 @@ namespace dd4hep { namespace sim { /// Geant4GenericSD<OpticalCalorimeter> /// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ enum { Edep_type=0, Cerenkov_type=1 }; + + /// Legacy class. Deprecated. Not supported! Not supported by the DDG4 kernel. + /** \deprecated + * + * @author M.Frank + * @version 1.0 + */ struct OpticalCalorimeter {}; + + /// Legacy class. Deprecated. Not supported! Not supported by the DDG4 kernel. + /** \deprecated + * + * @author M.Frank + * @version 1.0 + */ template <> class Geant4GenericSD<OpticalCalorimeter> : public Geant4GenericSD<Calorimeter> { public: /// Constructor. The sensitive detector element is identified by the detector name diff --git a/DDG4/legacy/Geant4TrackerCombineSD.cpp b/DDG4/legacy/Geant4TrackerCombineSD.cpp index 706af1fc7842d6b9d90616d01704a669200a4eb1..815099a6a43cd1a6c760c2247eb54ad8db622e39 100644 --- a/DDG4/legacy/Geant4TrackerCombineSD.cpp +++ b/DDG4/legacy/Geant4TrackerCombineSD.cpp @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation //-------------------------------------------------------------------------- @@ -24,6 +23,13 @@ namespace dd4hep { namespace sim { /// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ /// Geant4GenericSD<TrackerCombine> /// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + + /// Legacy class. Deprecated. Not supported! Not supported by the DDG4 kernel. + /** \deprecated + * + * @author M.Frank + * @version 1.0 + */ struct TrackerCombine { Geant4TrackerHit pre; Geant4TrackerHit post; diff --git a/DDG4/legacy/Geant4TrackerSD.cpp b/DDG4/legacy/Geant4TrackerSD.cpp index bb527608719163845ed31821734049f321436b77..578ff482f4ae9272b9a1c15e88c7f2abf16847c3 100644 --- a/DDG4/legacy/Geant4TrackerSD.cpp +++ b/DDG4/legacy/Geant4TrackerSD.cpp @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation //-------------------------------------------------------------------------- @@ -29,7 +28,15 @@ namespace dd4hep { namespace sim { /// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ /// Geant4GenericSD<Tracker> /// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + + /// Legacy class. Deprecated. Not supported! Not supported by the DDG4 kernel. + /** \deprecated + * + * @author M.Frank + * @version 1.0 + */ struct Tracker {}; + /// Method for generating hit(s) using the information of G4Step object. template <> bool Geant4GenericSD<Tracker>::buildHits(G4Step* step,G4TouchableHistory* /*hist*/ ) { diff --git a/DDParsers/include/Evaluator/Evaluator.h b/DDParsers/include/Evaluator/Evaluator.h index c1f155a6ba9e721ea33f0fb52534de2ac2feb227..d4dfae0d53b5a79f0c3ab802e57d30aa4963bceb 100644 --- a/DDParsers/include/Evaluator/Evaluator.h +++ b/DDParsers/include/Evaluator/Evaluator.h @@ -52,18 +52,18 @@ namespace dd4hep { * @see print_error */ enum { - OK, /**< Everything OK */ - WARNING_EXISTING_VARIABLE, /**< Redefinition of existing variable */ - WARNING_EXISTING_FUNCTION, /**< Redefinition of existing function */ - WARNING_BLANK_STRING, /**< Empty input string */ - ERROR_NOT_A_NAME, /**< Not allowed sysmbol in the name of variable or function */ - ERROR_SYNTAX_ERROR, /**< Systax error */ - ERROR_UNPAIRED_PARENTHESIS, /**< Unpaired parenthesis */ - ERROR_UNEXPECTED_SYMBOL, /**< Unexpected sysbol */ - ERROR_UNKNOWN_VARIABLE, /**< Non-existing variable */ - ERROR_UNKNOWN_FUNCTION, /**< Non-existing function */ - ERROR_EMPTY_PARAMETER, /**< Function call has empty parameter */ - ERROR_CALCULATION_ERROR /**< Error during calculation */ + OK, /**< Everything OK */ + WARNING_EXISTING_VARIABLE, /**< Redefinition of existing variable */ + WARNING_EXISTING_FUNCTION, /**< Redefinition of existing function */ + WARNING_BLANK_STRING, /**< Empty input string */ + ERROR_NOT_A_NAME, /**< Not allowed sysmbol in the name of variable or function */ + ERROR_SYNTAX_ERROR, /**< Systax error */ + ERROR_UNPAIRED_PARENTHESIS, /**< Unpaired parenthesis */ + ERROR_UNEXPECTED_SYMBOL, /**< Unexpected sysbol */ + ERROR_UNKNOWN_VARIABLE, /**< Non-existing variable */ + ERROR_UNKNOWN_FUNCTION, /**< Non-existing function */ + ERROR_EMPTY_PARAMETER, /**< Function call has empty parameter */ + ERROR_CALCULATION_ERROR /**< Error during calculation */ }; /** @@ -273,7 +273,7 @@ namespace dd4hep { * @endcode */ void setSystemOfUnits(double meter = 1.0, double kilogram = 1.0, double second = 1.0, double ampere = 1.0, double kelvin = - 1.0, double mole = 1.0, double candela = 1.0, double radians = 1.0 ); + 1.0, double mole = 1.0, double candela = 1.0, double radians = 1.0 ); private: void * p; // private data diff --git a/DDParsers/src/Evaluator/Evaluator.cpp b/DDParsers/src/Evaluator/Evaluator.cpp index d43a01d9f5b39ae3019f8c99d3e258b05faa113e..3e00155d1954f3b99c31b679b7761703a048ab6b 100644 --- a/DDParsers/src/Evaluator/Evaluator.cpp +++ b/DDParsers/src/Evaluator/Evaluator.cpp @@ -1,3 +1,4 @@ + // -*- C++ -*- // --------------------------------------------------------------------------- @@ -26,6 +27,8 @@ #endif //--------------------------------------------------------------------------- + +/// Internal expression evaluator helper class struct Item { enum { UNKNOWN, VARIABLE, EXPRESSION, FUNCTION, STRING } what; double variable; @@ -42,6 +45,8 @@ typedef char * pchar; typedef hash_map<string,Item> dic_type; namespace { + + /// Internal expression evaluator helper class struct Struct { dic_type theDictionary; pchar theExpression; @@ -50,6 +55,7 @@ namespace { double theResult; }; + /// Internal expression evaluator helper union union FCN { void* ptr; double (*f0)(); diff --git a/DDParsers/src/Evaluator/hash_map.src b/DDParsers/src/Evaluator/hash_map.src index ddb1376d45543d726154234aaed9e73af80cbba2..662254ec9f8c4ef21c327e79da24a241d2398659 100644 --- a/DDParsers/src/Evaluator/hash_map.src +++ b/DDParsers/src/Evaluator/hash_map.src @@ -12,6 +12,8 @@ #include <utility> #include "string.src" + +/// Internal expression evaluato class /* * Simplified hash_map class. * It provides only basic functions of the standard <hash_map> and diff --git a/DDParsers/src/Evaluator/stack.src b/DDParsers/src/Evaluator/stack.src index 8079c56d50c2caab495e10bf4cd7056b1ca8fb9f..83125887aab26433e481cac90f251d37af3cce5f 100644 --- a/DDParsers/src/Evaluator/stack.src +++ b/DDParsers/src/Evaluator/stack.src @@ -4,6 +4,7 @@ #ifndef HEP_STACK_SRC #define HEP_STACK_SRC +/// Internal expression evaluato class /* * Simplified stack class. * It is intended to be used as a replacement of the standard class where diff --git a/DDParsers/src/Evaluator/string.src b/DDParsers/src/Evaluator/string.src index c118dd93947274add6fde4b186c9f867649280fc..7e8cde0a05c2e2404c26155f93f108e4a1cf3603 100644 --- a/DDParsers/src/Evaluator/string.src +++ b/DDParsers/src/Evaluator/string.src @@ -7,6 +7,7 @@ #include <iostream> #include <string.h> +/// Internal expression evaluato class /* * Simplified string class. * It provides only few basic functions of the standard <string> and diff --git a/DDTest/include/DD4hep/DDTest.h b/DDTest/include/DD4hep/DDTest.h index c30711b905b1758fa9e378bdfa649b11af29d973..9c91a727bd870d0c8230a7f50787142c8db695f9 100644 --- a/DDTest/include/DD4hep/DDTest.h +++ b/DDTest/include/DD4hep/DDTest.h @@ -4,8 +4,8 @@ namespace dd4hep{ - /** Simple class for defining unit tests. - * Use in main program that is added as a test to ctest: + /// Simple class for defining unit tests. + /** Use in main program that is added as a test to ctest: * * DDTest test = DDTest( "example" ) ; * test.log( "example test" ); diff --git a/examples/DDDB/include/DDDB/DDDBConversion.h b/examples/DDDB/include/DDDB/DDDBConversion.h index 86381531e5618e28f25013754d057f49f03720c3..84af3a7a10268755c19e4d7f42d6e0a35454b712 100644 --- a/examples/DDDB/include/DDDB/DDDBConversion.h +++ b/examples/DDDB/include/DDDB/DDDBConversion.h @@ -608,7 +608,9 @@ namespace dd4hep { /// Detector element hierarchy DDDBCatalog *top, *structure, *geometry; }; - class dddb_conditions {}; + + /// Declaration of a not implemented tag-class to handle conditions + class dddb_conditions; template <typename T> class Increment { public: