11 #define _USE_MATH_DEFINES
15 namespace DDSegmentation {
24 _type =
"ProjectiveCylinder";
25 _description =
"Projective segmentation in the global coordinates";
40 _type =
"ProjectiveCylinder";
41 _description =
"Projective segmentation in the global coordinates";
81 return 2. *
M_PI * ((double) phiIndex + 0.5) / (double)
_phiBins;
94 return 2. *
M_PI * ((double) phiIndex + 0.5) / (double)
_phiBins;
long long int CellID
Useful typedefs to differentiate cell IDs and volume IDs.
void registerIdentifier(const std::string &nam, const std::string &desc, std::string &ident, const std::string &defaultVal)
Add a cell identifier to this segmentation. Used by derived classes to define their required identifi...
std::string _phiID
the field name used for phi
virtual CellID cellID(const Vector3D &localPosition, const Vector3D &globalPosition, const VolumeID &volumeID) const
determine the cell ID based on the position
BitField64 * _decoder
The cell ID encoder and decoder.
#define REGISTER_SEGMENTATION(classname)
Macro to instantiate a new SegmentationCreator by its type name.
int _phiBins
the number of bins in phi
virtual Vector3D position(const CellID &cellID) const
determine the position based on the cell ID
double thetaFromXYZ(const Vector3D &position)
calculates the polar angle theta from Cartesian coordinates
int _thetaBins
the number of bins in theta
double phiFromXYZ(const Vector3D &position)
calculates the azimuthal angle phi from Cartesian coordinates
Simple container for a physics vector.
std::string _thetaID
the field name used for theta
std::string _description
The description of the segmentation.
static int positionToBin(double position, double cellSize, double offset=0.)
Helper method to convert a 1D position to a cell ID.
double theta() const
determine the polar angle theta based on the current cell ID
double phi() const
determine the azimuthal angle phi based on the current cell ID
void registerParameter(const std::string &nam, const std::string &desc, TYPE ¶m, const TYPE &defaultVal, UnitType unitTyp=SegmentationParameter::NoUnit, bool isOpt=false)
Add a parameter to this segmentation. Used by derived classes to define their parameters.
std::string _type
The segmentation type.
ProjectiveCylinder(const std::string &cellEncoding)
default constructor using an arbitrary type
void setValue(long64 value)
double _offsetTheta
the coordinate offset in theta
virtual ~ProjectiveCylinder()
destructor
Vector3D positionFromRThetaPhi(double r, double theta, double phi)
Conversions from spherical to Cartesian coordinates ///.
double _offsetPhi
the coordinate offset in phi