lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
Loading...
Searching...
No Matches
geometry::GeometryObject Class Reference

Class supports elementary building block for hierarchial geometry description. More...

#include <GeometryObject.hh>

Public Types

typedef geometry::SegGeometry SG
 Alias for geometry::SegGeometry.
 
typedef GeometryObject * pGO
 Pointer to a GeometryObject.
 

Public Member Functions

 GeometryObject (std::string pname=std::string(), segindex_t pindex=0, std::string oname=std::string(), segindex_t oindex=0, pixel_coord_t x0=0, pixel_coord_t y0=0, pixel_coord_t z0=0, angle_t rot_z=0, angle_t rot_y=0, angle_t rot_x=0, angle_t tilt_z=0, angle_t tilt_y=0, angle_t tilt_x=0)
 Class constructor accepts path to the calibration "geometry" file and verbosity control bit-word.
 
virtual ~GeometryObject ()
 Delete the segment geometry that the constructor got from SegGeometryStore::Create() (this can be a shared singleton instance) and free the pixel coordinate, area and mask arrays.
 
std::string string_geo ()
 Return a one-line string with the parent name and index, the object name and index, the position x0, y0, z0, the rotation angles and the tilt angles.
 
std::string string_geo_children ()
 Return a one-line string with the parent and object names and indexes, the number of children, and each child's name and index.
 
std::string str_data ()
 Returns string of data for output file.
 
void print_geo ()
 Prints info about self object.
 
void print_geo_children ()
 Prints info about children objects.
 
void set_parent (pGO parent)
 Sets shared pointer to the parent object.
 
void add_child (pGO child)
 Adds shared pointer of the children geometry object to the vector.
 
pGO get_parent ()
 Returns shared pointer to the parent geometry object.
 
std::vector< pGO > & get_list_of_children ()
 Returns vector of shared pointers to children geometry objects.
 
std::string get_geo_name ()
 Returns self object name.
 
segindex_t get_geo_index ()
 Returns self object index.
 
std::string get_parent_name ()
 Returns parent object name.
 
segindex_t get_parent_index ()
 Returns parent object index.
 
void evaluate_pixel_coords (const bool do_tilt=true, const bool do_eval=false)
 Re-evaluate pixel coordinates (useful if geo is changed)
 
void get_pixel_coords (const pixel_coord_t *&X, const pixel_coord_t *&Y, const pixel_coord_t *&Z, gsize_t &size, const bool do_tilt=true, const bool do_eval=false)
 Returns pointers to pixel coordinate arrays.
 
void get_pixel_areas (const pixel_area_t *&areas, gsize_t &size)
 Returns pointers to pixel areas array.
 
void get_pixel_mask (const pixel_mask_t *&mask, gsize_t &size, const bitword_t &mbits=0377)
 Returns pointers to pixel mask array.
 
gsize_t get_size_geo_array ()
 Returns size of geometry object array - number of pixels.
 
pixel_coord_t get_pixel_scale_size ()
 Returns pixel scale size of geometry object.
 
void get_geo_pars (pixel_coord_t &x0, pixel_coord_t &y0, pixel_coord_t &z0, angle_t &rot_z, angle_t &rot_y, angle_t &rot_x, angle_t &tilt_z, angle_t &tilt_y, angle_t &tilt_x)
 Gets self object geometry parameters.
 
void set_geo_pars (const pixel_coord_t &x0=0, const pixel_coord_t &y0=0, const pixel_coord_t &z0=0, const angle_t &rot_z=0, const angle_t &rot_y=0, const angle_t &rot_x=0, const angle_t &tilt_z=0, const angle_t &tilt_y=0, const angle_t &tilt_x=0)
 Sets self object geometry parameters.
 
void move_geo (const pixel_coord_t &dx=0, const pixel_coord_t &dy=0, const pixel_coord_t &dz=0)
 Adds offset for origin of the self object w.r.t. current position.
 
void tilt_geo (const pixel_coord_t &dt_x=0, const pixel_coord_t &dt_y=0, const pixel_coord_t &dt_z=0)
 Adds tilts to the self object w.r.t. current orientation.
 

Static Public Member Functions

static const std::string name ()
 Returns class name for MsgLogger.
 

Detailed Description

Class supports elementary building block for hierarchial geometry description.

Note
This software was developed for the LCLS project. If you use all or part of it, please give an appropriate acknowledgment.
Author
Mikhail S. Dubrovin

Interface Description
  • Modification methods
    geo->set_geo_pars( 10, 11, 12, 90, 0, 0, 0, 0, 0)
    geo->move_geo(10, 11, 12);
    geo->tilt_geo(0, 0, 0.15);
    void set_geo_pars(const pixel_coord_t &x0=0, const pixel_coord_t &y0=0, const pixel_coord_t &z0=0, const angle_t &rot_z=0, const angle_t &rot_y=0, const angle_t &rot_x=0, const angle_t &tilt_z=0, const angle_t &tilt_y=0, const angle_t &tilt_x=0)
    Sets self object geometry parameters.
    void tilt_geo(const pixel_coord_t &dt_x=0, const pixel_coord_t &dt_y=0, const pixel_coord_t &dt_z=0)
    Adds tilts to the self object w.r.t. current orientation.
    void move_geo(const pixel_coord_t &dx=0, const pixel_coord_t &dy=0, const pixel_coord_t &dz=0)
    Adds offset for origin of the self object w.r.t. current position.

Member Typedef Documentation

◆ pGO

◆ SG

Constructor & Destructor Documentation

◆ GeometryObject()

geometry::GeometryObject::GeometryObject ( std::string  pname = std::string(),
segindex_t  pindex = 0,
std::string  oname = std::string(),
segindex_t  oindex = 0,
pixel_coord_t  x0 = 0,
pixel_coord_t  y0 = 0,
pixel_coord_t  z0 = 0,
angle_t  rot_z = 0,
angle_t  rot_y = 0,
angle_t  rot_x = 0,
angle_t  tilt_z = 0,
angle_t  tilt_y = 0,
angle_t  tilt_x = 0 
)

Class constructor accepts path to the calibration "geometry" file and verbosity control bit-word.

Parameters
[in]pname- parent name
[in]pindex- parent index
[in]oname- this object name
[in]oindex- this object index
[in]x0- object origin coordinate x[um] in parent frame
[in]y0- object origin coordinate y[um] in parent frame
[in]z0- object origin coordinate z[um] in parent frame
[in]rot_z- object rotation/design angle [deg] around axis z of the parent frame
[in]rot_y- object rotation/design angle [deg] around axis y of the parent frame
[in]rot_x- object rotation/design angle [deg] around axis x of the parent frame
[in]tilt_z- object tilt/deviation angle [deg] around axis z of the parent frame
[in]tilt_y- object tilt/deviation angle [deg] around axis y of the parent frame
[in]tilt_x- object tilt/deviation angle [deg] around axis x of the parent frame

◆ ~GeometryObject()

virtual geometry::GeometryObject::~GeometryObject ( )
virtual

Delete the segment geometry that the constructor got from SegGeometryStore::Create() (this can be a shared singleton instance) and free the pixel coordinate, area and mask arrays.

Member Function Documentation

◆ add_child()

void geometry::GeometryObject::add_child ( pGO  child)
inline

Adds shared pointer of the children geometry object to the vector.

◆ evaluate_pixel_coords()

void geometry::GeometryObject::evaluate_pixel_coords ( const bool  do_tilt = true,
const bool  do_eval = false 
)

Re-evaluate pixel coordinates (useful if geo is changed)

Parameters
[in]do_tilt- on/off tilt angle correction
[in]do_eval- enforce (re-)evaluation of pixel coordinates

◆ get_geo_index()

segindex_t geometry::GeometryObject::get_geo_index ( )
inline

Returns self object index.

◆ get_geo_name()

std::string geometry::GeometryObject::get_geo_name ( )
inline

Returns self object name.

◆ get_geo_pars()

void geometry::GeometryObject::get_geo_pars ( pixel_coord_t &  x0,
pixel_coord_t &  y0,
pixel_coord_t &  z0,
angle_t &  rot_z,
angle_t &  rot_y,
angle_t &  rot_x,
angle_t &  tilt_z,
angle_t &  tilt_y,
angle_t &  tilt_x 
)

Gets self object geometry parameters.

◆ get_list_of_children()

std::vector< pGO > & geometry::GeometryObject::get_list_of_children ( )
inline

Returns vector of shared pointers to children geometry objects.

◆ get_parent()

pGO geometry::GeometryObject::get_parent ( )
inline

Returns shared pointer to the parent geometry object.

◆ get_parent_index()

segindex_t geometry::GeometryObject::get_parent_index ( )
inline

Returns parent object index.

◆ get_parent_name()

std::string geometry::GeometryObject::get_parent_name ( )
inline

Returns parent object name.

◆ get_pixel_areas()

void geometry::GeometryObject::get_pixel_areas ( const pixel_area_t *&  areas,
gsize_t &  size 
)

Returns pointers to pixel areas array.

Parameters
[out]areas- pointer to pixel areas array
[out]size- size of the pixel areas array (number of pixels)

◆ get_pixel_coords()

void geometry::GeometryObject::get_pixel_coords ( const pixel_coord_t *&  X,
const pixel_coord_t *&  Y,
const pixel_coord_t *&  Z,
gsize_t &  size,
const bool  do_tilt = true,
const bool  do_eval = false 
)

Returns pointers to pixel coordinate arrays.

Parameters
[out]X- pointer to x pixel coordinate array
[out]Y- pointer to y pixel coordinate array
[out]Z- pointer to z pixel coordinate array
[out]size- size of the pixel coordinate array (number of pixels)
[in]do_tilt- on/off tilt angle correction
[in]do_eval- enforce (re-)evaluation of pixel coordinates

◆ get_pixel_mask()

void geometry::GeometryObject::get_pixel_mask ( const pixel_mask_t *&  mask,
gsize_t &  size,
const bitword_t &  mbits = 0377 
)

Returns pointers to pixel mask array.

Parameters
[out]mask- pointer to pixel mask array
[out]size- size of the pixel mask array (number of pixels)
[in]mbits- mask control bits;
  • 1 - mask edges,
  • 2 - mask two central columns,
  • 4 - mask non-bounded pixels,
  • 8 - mask nearest neighbours of nonbonded pixels.

◆ get_pixel_scale_size()

pixel_coord_t geometry::GeometryObject::get_pixel_scale_size ( )

Returns pixel scale size of geometry object.

◆ get_size_geo_array()

gsize_t geometry::GeometryObject::get_size_geo_array ( )

Returns size of geometry object array - number of pixels.

◆ move_geo()

void geometry::GeometryObject::move_geo ( const pixel_coord_t &  dx = 0,
const pixel_coord_t &  dy = 0,
const pixel_coord_t &  dz = 0 
)

Adds offset for origin of the self object w.r.t. current position.

◆ name()

static const std::string geometry::GeometryObject::name ( )
inlinestatic

Returns class name for MsgLogger.

◆ print_geo()

void geometry::GeometryObject::print_geo ( )

Prints info about self object.

◆ print_geo_children()

void geometry::GeometryObject::print_geo_children ( )

Prints info about children objects.

◆ set_geo_pars()

void geometry::GeometryObject::set_geo_pars ( const pixel_coord_t &  x0 = 0,
const pixel_coord_t &  y0 = 0,
const pixel_coord_t &  z0 = 0,
const angle_t &  rot_z = 0,
const angle_t &  rot_y = 0,
const angle_t &  rot_x = 0,
const angle_t &  tilt_z = 0,
const angle_t &  tilt_y = 0,
const angle_t &  tilt_x = 0 
)

Sets self object geometry parameters.

◆ set_parent()

void geometry::GeometryObject::set_parent ( pGO  parent)
inline

Sets shared pointer to the parent object.

◆ str_data()

std::string geometry::GeometryObject::str_data ( )

Returns string of data for output file.

◆ string_geo()

std::string geometry::GeometryObject::string_geo ( )

Return a one-line string with the parent name and index, the object name and index, the position x0, y0, z0, the rotation angles and the tilt angles.

◆ string_geo_children()

std::string geometry::GeometryObject::string_geo_children ( )

Return a one-line string with the parent and object names and indexes, the number of children, and each child's name and index.

◆ tilt_geo()

void geometry::GeometryObject::tilt_geo ( const pixel_coord_t &  dt_x = 0,
const pixel_coord_t &  dt_y = 0,
const pixel_coord_t &  dt_z = 0 
)

Adds tilts to the self object w.r.t. current orientation.


The documentation for this class was generated from the following file: