Skip to content
Snippets Groups Projects
Commit e98fbae8 authored by Markus Frank's avatar Markus Frank
Browse files

Add more segmentation handle implementations

parent 4422166e
No related branches found
No related tags found
No related merge requests found
// AIDA Detector description implementation for LCD
//--------------------------------------------------------------------------
// 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.
//
// \author Markus Frank
// \date 2016-10-18
// \version 1.0
//
//==========================================================================
#ifndef DD4HEP_DDCORE_CARTESIANGRIDXYZ_H
#define DD4HEP_DDCORE_CARTESIANGRIDXYZ_H 1
// Framework include files
#include "DD4hep/Objects.h"
/// Namespace for the AIDA detector description toolkit
namespace DD4hep {
/// Namespace for base segmentations
namespace DDSegmentation { class CartesianGridXYZ; }
/// Namespace for the geometry part of the AIDA detector description toolkit
namespace Geometry {
// Forward declarations
class Segmentation;
/// Implementation class for the grid XYZ segmentation.
/**
* \author M.Frank
* \version 1.0
* \ingroup DD4HEP_GEOMETRY
*/
class CartesianGridXYZ : public Handle<DDSegmentation::CartesianGridXYZ> {
public:
/// Defintiion of the basic handled object
typedef DDSegmentation::CartesianGridXYZ Object;
public:
/// Default constructor
CartesianGridXYZ() : Handle<Object>() {}
/// Copy constructor from handle
CartesianGridXYZ(const Handle<Object>& e) : Handle<Object>(e) {}
/// Copy constructor
CartesianGridXYZ(const CartesianGridXYZ& e) = default;
/// Copy Constructor from segmentation base object
CartesianGridXYZ(const Segmentation& e);
/// Assignment operator
CartesianGridXYZ& operator=(const CartesianGridXYZ& seg) = default;
/// Equality operator
bool operator==(const CartesianGridXYZ& seg) const {
return m_element == seg.m_element;
}
/// determine the position based on the cell ID
Position position(const CellID& cellID) const;
/// determine the cell ID based on the position
CellID cellID(const Position& local, const Position& global, const VolumeID& volID) const;
/// access the grid size in X
double gridSizeX() const;
/// access the grid size in Y
double gridSizeY() const;
/// access the grid size in Z
double gridSizeZ() const;
/// access the coordinate offset in X
double offsetX() const;
/// access the coordinate offset in Y
double offsetY() const;
/// access the coordinate offset in Z
double offsetZ() const;
/// access the field name used for X
const std::string& fieldNameX() const;
/// access the field name used for Y
const std::string& fieldNameY() const;
/// access the field name used for Z
const std::string& fieldNameZ() const;
/** \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
-# size in z
*/
std::vector<double> cellDimensions(const CellID& cellID) const;
};
} /* End namespace Geometry */
} /* End namespace DD4hep */
#endif // DD4HEP_DDCORE_CARTESIANGRIDXYZ_H
// AIDA Detector description implementation for LCD
//--------------------------------------------------------------------------
// 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.
//
// \author Markus Frank
// \date 2016-10-18
// \version 1.0
//
//==========================================================================
#ifndef DD4HEP_DDCORE_CARTESIANGRIDXZ_H
#define DD4HEP_DDCORE_CARTESIANGRIDXZ_H 1
// Framework include files
#include "DD4hep/Objects.h"
/// Namespace for the AIDA detector description toolkit
namespace DD4hep {
/// Namespace for base segmentations
namespace DDSegmentation { class CartesianGridXZ; }
/// Namespace for the geometry part of the AIDA detector description toolkit
namespace Geometry {
// Forward declarations
class Segmentation;
/// Implementation class for the grid XZ segmentation.
/**
* \author M.Frank
* \version 1.0
* \ingroup DD4HEP_GEOMETRY
*/
class CartesianGridXZ : public Handle<DDSegmentation::CartesianGridXZ> {
public:
/// Defintiion of the basic handled object
typedef DDSegmentation::CartesianGridXZ Object;
public:
/// Default constructor
CartesianGridXZ() : Handle<Object>() {}
/// Copy constructor from handle
CartesianGridXZ(const Handle<Object>& e) : Handle<Object>(e) {}
/// Copy constructor
CartesianGridXZ(const CartesianGridXZ& e) = default;
/// Copy Constructor from segmentation base object
CartesianGridXZ(const Segmentation& e);
/// Assignment operator
CartesianGridXZ& operator=(const CartesianGridXZ& seg) = default;
/// Equality operator
bool operator==(const CartesianGridXZ& seg) const {
return m_element == seg.m_element;
}
/// determine the position based on the cell ID
Position position(const CellID& cellID) const;
/// determine the cell ID based on the position
CellID cellID(const Position& local, const Position& global, const VolumeID& volID) const;
/// access the grid size in X
double gridSizeX() const;
/// access the grid size in Z
double gridSizeZ() const;
/// access the coordinate offset in X
double offsetX() const;
/// access the coordinate offset in Z
double offsetZ() const;
/// access the field name used for X
const std::string& fieldNameX() const;
/// access the field name used for Z
const std::string& fieldNameZ() const;
/** \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
*/
std::vector<double> cellDimensions(const CellID& cellID) const;
};
} /* End namespace Geometry */
} /* End namespace DD4hep */
#endif // DD4HEP_DDCORE_CARTESIANGRIDXZ_H
// AIDA Detector description implementation for LCD
//--------------------------------------------------------------------------
// 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.
//
// \author Markus Frank
// \date 2016-10-18
// \version 1.0
//
//==========================================================================
#ifndef DD4HEP_DDCORE_CARTESIANGRIDYZ_H
#define DD4HEP_DDCORE_CARTESIANGRIDYZ_H 1
// Framework include files
#include "DD4hep/Objects.h"
/// Namespace for the AIDA detector description toolkit
namespace DD4hep {
/// Namespace for base segmentations
namespace DDSegmentation { class CartesianGridYZ; }
/// Namespace for the geometry part of the AIDA detector description toolkit
namespace Geometry {
// Forward declarations
class Segmentation;
/// Implementation class for the grid YZ segmentation.
/**
* \author M.Frank
* \version 1.0
* \ingroup DD4HEP_GEOMETRY
*/
class CartesianGridYZ : public Handle<DDSegmentation::CartesianGridYZ> {
public:
/// Defintiion of the basic handled object
typedef DDSegmentation::CartesianGridYZ Object;
public:
/// Default constructor
CartesianGridYZ() : Handle<Object>() {}
/// Copy constructor from handle
CartesianGridYZ(const Handle<Object>& e) : Handle<Object>(e) {}
/// Copy constructor
CartesianGridYZ(const CartesianGridYZ& e) = default;
/// Copy Constructor from segmentation base object
CartesianGridYZ(const Segmentation& e);
/// Assignment operator
CartesianGridYZ& operator=(const CartesianGridYZ& seg) = default;
/// Equality operator
bool operator==(const CartesianGridYZ& seg) const {
return m_element == seg.m_element;
}
/// determine the position based on the cell ID
Position position(const CellID& cellID) const;
/// determine the cell ID based on the position
CellID cellID(const Position& local, const Position& global, const VolumeID& volID) const;
/// access the grid size in X
double gridSizeX() const;
/// access the grid size in Y
double gridSizeY() const;
/// access the grid size in Z
double gridSizeZ() const;
/// access the coordinate offset in X
double offsetX() const;
/// access the coordinate offset in Y
double offsetY() const;
/// access the coordinate offset in Z
double offsetZ() const;
/// access the field name used for X
const std::string& fieldNameX() const;
/// access the field name used for Y
const std::string& fieldNameY() const;
/// access the field name used for Z
const std::string& fieldNameZ() const;
/** \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
*/
std::vector<double> cellDimensions(const CellID& cellID) const;
};
} /* End namespace Geometry */
} /* End namespace DD4hep */
#endif // DD4HEP_DDCORE_CARTESIANGRIDYZ_H
// AIDA Detector description implementation for LCD
//--------------------------------------------------------------------------
// 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.
//
// \author Markus Frank
// \date 2016-10-18
// \version 1.0
//
//==========================================================================
#ifndef DD4HEP_DDCORE_POLARGRIDRPHI_H
#define DD4HEP_DDCORE_POLARGRIDRPHI_H 1
// Framework include files
#include "DD4hep/Objects.h"
/// Namespace for the AIDA detector description toolkit
namespace DD4hep {
/// Namespace for base segmentations
namespace DDSegmentation { class PolarGridRPhi; }
/// Namespace for the geometry part of the AIDA detector description toolkit
namespace Geometry {
// Forward declarations
class Segmentation;
/// Implementation class for the grid XZ segmentation.
/**
* \author M.Frank
* \version 1.0
* \ingroup DD4HEP_GEOMETRY
*/
class PolarGridRPhi : public Handle<DDSegmentation::PolarGridRPhi> {
public:
/// Defintiion of the basic handled object
typedef DDSegmentation::PolarGridRPhi Object;
public:
/// Default constructor
PolarGridRPhi() : Handle<Object>() {}
/// Copy constructor from handle
PolarGridRPhi(const Handle<Object>& e) : Handle<Object>(e) {}
/// Copy Constructor from segmentation base object
PolarGridRPhi(const Segmentation& e);
/// Copy constructor
PolarGridRPhi(const PolarGridRPhi& e) = default;
/// Assignment operator
PolarGridRPhi& operator=(const PolarGridRPhi& seg) = default;
/// Equality operator
bool operator==(const PolarGridRPhi& seg) const {
return m_element == seg.m_element;
}
/// determine the position based on the cell ID
Position position(const CellID& cellID) const;
/// determine the cell ID based on the position
CellID cellID(const Position& local, const Position& global, const VolumeID& volID) const;
/// access the grid size in R
double gridSizeR() const;
/// access the grid size in Phi
double gridSizePhi() const;
/// access the coordinate offset in R
double offsetR() const;
/// access the coordinate offset in Phi
double offsetPhi() const;
/// access the field name used for R
const std::string& fieldNameR() const;
/// access the field name used for Phi
const std::string& fieldNamePhi() const;
/** \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
*/
std::vector<double> cellDimensions(const CellID& cellID) const;
};
} /* End namespace Geometry */
} /* End namespace DD4hep */
#endif // DD4HEP_DDCORE_POLARGRIDRPHI_H
//==========================================================================
// AIDA Detector description implementation for LCD
//--------------------------------------------------------------------------
// 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.
//
// Author : M.Frank
//
//==========================================================================
// Framework include files
#include "DD4hep/Segmentations.h"
#include "DD4hep/CartesianGridXYZ.h"
#include "DDSegmentation/CartesianGridXYZ.h"
// C/C++ include files
using namespace std;
using namespace DD4hep::Geometry;
/// Copy Constructor from segmentation base object
CartesianGridXYZ::CartesianGridXYZ(const Segmentation& e) : Handle<Object>()
{
m_element = Segmentation::get<Object>(e.ptr());
}
/// determine the position based on the cell ID
Position CartesianGridXYZ::position(const CellID& id) const {
return Position(access()->position(id));
}
/// determine the cell ID based on the position
DD4hep::CellID CartesianGridXYZ::cellID(const Position& local,
const Position& global,
const VolumeID& volID) const
{
return access()->cellID(local, global, volID);
}
/// access the grid size in X
double CartesianGridXYZ::gridSizeX() const {
return access()->gridSizeX();
}
/// access the grid size in Y
double CartesianGridXYZ::gridSizeY() const {
return access()->gridSizeY();
}
/// access the grid size in Z
double CartesianGridXYZ::gridSizeZ() const {
return access()->gridSizeZ();
}
/// access the coordinate offset in X
double CartesianGridXYZ::offsetX() const {
return access()->offsetX();
}
/// access the coordinate offset in Y
double CartesianGridXYZ::offsetY() const {
return access()->offsetY();
}
/// access the coordinate offset in Z
double CartesianGridXYZ::offsetZ() const {
return access()->offsetZ();
}
/// access the field name used for X
const string& CartesianGridXYZ::fieldNameX() const {
return access()->fieldNameX();
}
/// access the field name used for Y
const string& CartesianGridXYZ::fieldNameY() const {
return access()->fieldNameY();
}
/// access the field name used for Z
const string& CartesianGridXYZ::fieldNameZ() const {
return access()->fieldNameZ();
}
/** \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 vector<double> size 2:
-# size in x
-# size in y
-# size in z
*/
vector<double> CartesianGridXYZ::cellDimensions(const CellID& id) const {
return access()->cellDimensions(id);
}
//==========================================================================
// AIDA Detector description implementation for LCD
//--------------------------------------------------------------------------
// 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.
//
// Author : M.Frank
//
//==========================================================================
// Framework include files
#include "DD4hep/Segmentations.h"
#include "DD4hep/CartesianGridXZ.h"
#include "DDSegmentation/CartesianGridXZ.h"
// C/C++ include files
using namespace std;
using namespace DD4hep::Geometry;
/// Copy Constructor from segmentation base object
CartesianGridXZ::CartesianGridXZ(const Segmentation& e) : Handle<Object>()
{
m_element = Segmentation::get<Object>(e.ptr());
}
/// determine the position based on the cell ID
Position CartesianGridXZ::position(const CellID& id) const {
return Position(access()->position(id));
}
/// determine the cell ID based on the position
DD4hep::CellID CartesianGridXZ::cellID(const Position& local,
const Position& global,
const VolumeID& volID) const
{
return access()->cellID(local, global, volID);
}
/// access the grid size in X
double CartesianGridXZ::gridSizeX() const {
return access()->gridSizeX();
}
/// access the grid size in Z
double CartesianGridXZ::gridSizeZ() const {
return access()->gridSizeZ();
}
/// access the coordinate offset in X
double CartesianGridXZ::offsetX() const {
return access()->offsetX();
}
/// access the coordinate offset in Z
double CartesianGridXZ::offsetZ() const {
return access()->offsetZ();
}
/// access the field name used for X
const string& CartesianGridXZ::fieldNameX() const {
return access()->fieldNameX();
}
/// access the field name used for Z
const string& CartesianGridXZ::fieldNameZ() const {
return access()->fieldNameZ();
}
/** \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 vector<double> size 2:
-# size in x
-# size in z
*/
vector<double> CartesianGridXZ::cellDimensions(const CellID& id) const {
return access()->cellDimensions(id);
}
//==========================================================================
// AIDA Detector description implementation for LCD
//--------------------------------------------------------------------------
// 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.
//
// Author : M.Frank
//
//==========================================================================
// Framework include files
#include "DD4hep/Segmentations.h"
#include "DD4hep/CartesianGridYZ.h"
#include "DDSegmentation/CartesianGridYZ.h"
// C/C++ include files
using namespace std;
using namespace DD4hep::Geometry;
/// Copy Constructor from segmentation base object
CartesianGridYZ::CartesianGridYZ(const Segmentation& e) : Handle<Object>()
{
m_element = Segmentation::get<Object>(e.ptr());
}
/// determine the position based on the cell ID
Position CartesianGridYZ::position(const CellID& id) const {
return Position(access()->position(id));
}
/// determine the cell ID based on the position
DD4hep::CellID CartesianGridYZ::cellID(const Position& local,
const Position& global,
const VolumeID& volID) const
{
return access()->cellID(local, global, volID);
}
/// access the grid size in Y
double CartesianGridYZ::gridSizeY() const {
return access()->gridSizeY();
}
/// access the grid size in Z
double CartesianGridYZ::gridSizeZ() const {
return access()->gridSizeZ();
}
/// access the coordinate offset in Y
double CartesianGridYZ::offsetY() const {
return access()->offsetY();
}
/// access the coordinate offset in Z
double CartesianGridYZ::offsetZ() const {
return access()->offsetZ();
}
/// access the field name used for Y
const string& CartesianGridYZ::fieldNameY() const {
return access()->fieldNameY();
}
/// access the field name used for Z
const string& CartesianGridYZ::fieldNameZ() const {
return access()->fieldNameZ();
}
/** \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 vector<double> size 2:
-# size in y
-# size in z
*/
vector<double> CartesianGridYZ::cellDimensions(const CellID& id) const {
return access()->cellDimensions(id);
}
//==========================================================================
// AIDA Detector description implementation for LCD
//--------------------------------------------------------------------------
// 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.
//
// Author : M.Frank
//
//==========================================================================
// Framework include files
#include "DD4hep/Segmentations.h"
#include "DD4hep/PolarGridRPhi.h"
#include "DDSegmentation/PolarGridRPhi.h"
// C/C++ include files
using namespace std;
using namespace DD4hep::Geometry;
/// Copy Constructor from segmentation base object
PolarGridRPhi::PolarGridRPhi(const Segmentation& e) : Handle<Object>()
{
m_element = Segmentation::get<Object>(e.ptr());
}
/// determine the position based on the cell ID
Position PolarGridRPhi::position(const CellID& id) const {
return Position(access()->position(id));
}
/// determine the cell ID based on the position
DD4hep::CellID PolarGridRPhi::cellID(const Position& local,
const Position& global,
const VolumeID& volID) const
{
return access()->cellID(local, global, volID);
}
/// access the grid size in R
double PolarGridRPhi::gridSizeR() const {
return access()->gridSizeR();
}
/// access the grid size in Phi
double PolarGridRPhi::gridSizePhi() const {
return access()->gridSizePhi();
}
/// access the coordinate offset in R
double PolarGridRPhi::offsetR() const {
return access()->offsetR();
}
/// access the coordinate offset in Phi
double PolarGridRPhi::offsetPhi() const {
return access()->offsetPhi();
}
/// access the field name used for R
const string& PolarGridRPhi::fieldNameR() const {
return access()->fieldNameR();
}
/// access the field name used for Phi
const string& PolarGridRPhi::fieldNamePhi() const {
return access()->fieldNamePhi();
}
/** \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 vector<double> size 2:
-# size in x
-# size in z
*/
vector<double> PolarGridRPhi::cellDimensions(const CellID& id) const {
return access()->cellDimensions(id);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment