Falaise  4.0.1
SuperNEMO Software Toolkit
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
snemo::geometry::xcalo_locator Class Reference

Fast locator class for SuperNEMO X calorimeter scintillator block volumes. More...

#include <falaise/snemo/geometry/xcalo_locator.h>

Inheritance diagram for snemo::geometry::xcalo_locator:
geomtools::base_locator datatools::i_tree_dumpable geomtools::i_base_locator

Public Types

enum  wall_type { WALL_INVALID = -1, WALL_LEFT = 0, WALL_RIGHT = 1 }
 Wall identifier constants (SuperNEMO module Y axis) More...
 
- Public Types inherited from datatools::i_tree_dumpable
enum  ostream_type
 

Public Member Functions

virtual bool is_initialized () const
 
 xcalo_locator ()
 Constructor. More...
 
 xcalo_locator (const ::geomtools::manager &gmgr_, uint32_t module_number_)
 Constructor: More...
 
virtual ~xcalo_locator ()
 Destructor. More...
 
virtual void initialize (const datatools::properties &config_)
 
virtual void reset ()
 
void initialize ()
 
bool has_submodule (uint32_t side_) const
 
bool id_is_valid (uint32_t side_, uint32_t wall_, uint32_t column_, uint32_t row_) const
 
virtual bool find_geom_id (const geomtools::vector_3d &world_position_, int type_, geomtools::geom_id &gid_, double tolerance_=GEOMTOOLS_PROPER_TOLERANCE) const
 
bool find_block_geom_id (const geomtools::vector_3d &world_position_, geomtools::geom_id &gid_, double tolerance_=GEOMTOOLS_PROPER_TOLERANCE) const
 
uint32_t get_module_number () const
 
void set_module_number (uint32_t module_number_)
 
bool is_block_partitioned () const
 
double get_block_width () const
 
double get_block_height () const
 
double get_block_thickness () const
 
size_t get_number_of_sides () const
 
size_t get_number_of_walls () const
 
size_t get_number_of_columns (uint32_t side_, uint32_t wall_) const
 
size_t get_number_of_rows (uint32_t side_, uint32_t wall_) const
 
double get_wall_y (uint32_t side_, uint32_t wall_) const
 
double get_wall_window_y (uint32_t side_, uint32_t wall_) const
 
double get_column_x (uint32_t side_, uint32_t wall_, uint32_t column_) const
 
double get_row_z (uint32_t side_, uint32_t wall_, uint32_t row_) const
 
void compute_block_position (uint32_t side_, uint32_t wall_, uint32_t column_, uint32_t row_, geomtools::vector_3d &module_position_) const
 
void compute_block_window_position (uint32_t side_, uint32_t wall_, uint32_t column_, uint32_t row_, geomtools::vector_3d &module_position_) const
 
geomtools::vector_3d get_block_position (uint32_t side_, uint32_t wall_, uint32_t column_, uint32_t row_) const
 
geomtools::vector_3d get_block_window_position (uint32_t side_, uint32_t wall_, uint32_t column_, uint32_t row_) const
 
void transform_world_to_module (const geomtools::vector_3d &world_position_, geomtools::vector_3d &module_position_) const
 
void transform_module_to_world (const geomtools::vector_3d &module_position_, geomtools::vector_3d &world_position_) const
 
bool is_world_position_in_module (const geomtools::vector_3d &world_position_, double tolerance_=GEOMTOOLS_PROPER_TOLERANCE) const
 
bool is_in_module (const geomtools::vector_3d &module_position_, double tolerance_=GEOMTOOLS_PROPER_TOLERANCE) const
 
bool is_in_block (const geomtools::vector_3d &module_position_, uint32_t side_, uint32_t wall_, uint32_t column_, uint32_t row_, double tolerance_=GEOMTOOLS_PROPER_TOLERANCE) const
 
bool is_world_position_in_block (const geomtools::vector_3d &world_position_, uint32_t side_, uint32_t wall_, uint32_t column_, uint32_t row_, double tolerance_=GEOMTOOLS_PROPER_TOLERANCE) const
 
size_t get_number_of_neighbours (uint32_t side_, uint32_t wall_, uint32_t column_, uint32_t row_, uint8_t mask_=utils::NEIGHBOUR_FIRST) const
 
size_t get_number_of_neighbours (const geomtools::geom_id &gid_, uint8_t mask_=utils::NEIGHBOUR_FIRST) const
 
void get_neighbours_ids (uint32_t side_, uint32_t wall_, uint32_t column_, uint32_t row_, std::vector< geomtools::geom_id > &ids_, uint8_t mask_=utils::NEIGHBOUR_FIRST) const
 
void get_neighbours_ids (const geomtools::geom_id &gid_, std::vector< geomtools::geom_id > &ids_, uint8_t mask_=utils::NEIGHBOUR_FIRST) const
 
void get_block_position (const geomtools::geom_id &gid_, geomtools::vector_3d &position_) const
 
void get_block_position (uint32_t side_, uint32_t wall_, uint32_t column_, uint32_t row_, geomtools::vector_3d &position_) const
 
int get_module_address_index () const
 
int get_side_address_index () const
 
int get_wall_address_index () const
 
int get_column_address_index () const
 
int get_row_address_index () const
 
int get_part_address_index () const
 
uint32_t extract_module (const geomtools::geom_id &gid_) const
 
uint32_t extract_side (const geomtools::geom_id &gid_) const
 
uint32_t extract_wall (const geomtools::geom_id &gid_) const
 
uint32_t extract_column (const geomtools::geom_id &gid_) const
 
uint32_t extract_row (const geomtools::geom_id &gid_) const
 
uint32_t extract_part (const geomtools::geom_id &gid_) const
 
bool is_calo_block (const geomtools::geom_id &gid_) const
 
bool is_calo_block_in_current_module (const geomtools::geom_id &gid_) const
 
virtual void tree_dump (std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
 Smart print. More...
 
void dump (std::ostream &out_) const
 Dump. More...
 
- Public Member Functions inherited from geomtools::base_locator
 base_locator ()
 
virtual ~base_locator ()
 
bool has_geo_manager () const
 
void set_geo_manager (const manager &mgr_)
 
const managerget_geo_manager () const
 
datatools::logger::priority get_logging_priority () const
 
void set_logging_priority (datatools::logger::priority)
 
- Public Member Functions inherited from datatools::i_tree_dumpable
 i_tree_dumpable ()
 
virtual ~i_tree_dumpable ()
 
virtual void print_tree (std::ostream &out_=std::clog, const boost::property_tree::ptree &options_=empty_options()) const
 
void print_tree_json (std::ostream &out_=std::clog, const std::string &json_options_="") const
 
void print_tree_json (std::ostream &out_=std::clog, const char *json_options_=nullptr) const
 
void tree_dump_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="", const std::string &indent_="", const bool inherit_=false) const
 
void tree_print_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="") const
 
void smart_print_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="", const std::string &indent_="") const
 

Static Public Attributes

static const unsigned int NWALLS_PER_SIDE = 2
 Number of X-calorimeter walls per side (on the Y-axis) More...
 

Protected Member Functions

bool find_block_geom_id_ (const geomtools::vector_3d &in_module_position_, geomtools::geom_id &gid_, double tolerance_=GEOMTOOLS_PROPER_TOLERANCE)
 
void _assert_initialized (const std::string &where_) const
 
void _set_defaults_ ()
 
void _construct ()
 
void _hack_trace ()
 Hack trace. More...
 
- Protected Member Functions inherited from geomtools::base_locator
void _basic_initialize (const datatools::properties &config_)
 

Additional Inherited Members

- Static Public Member Functions inherited from datatools::i_tree_dumpable
static const boost::property_tree::ptree & empty_options ()
 
static boost::property_tree::ptree make_base_print_options (const std::string &title_, const std::string &indent_="", const bool inherit_=false)
 
static std::ostream & last_skip_tag (std::ostream &out_)
 
static std::ostream & skip_tag (std::ostream &out_)
 
static std::ostream & last_tag (std::ostream &out_)
 
static std::ostream & tag (std::ostream &out_)
 
- Public Attributes inherited from datatools::i_tree_dumpable
 OSTREAM_COUT
 
 OSTREAM_CERR
 
 OSTREAM_CLOG
 
- Protected Attributes inherited from geomtools::base_locator
datatools::logger::priority _logging_priority
 

Detailed Description

Fast locator class for SuperNEMO X calorimeter scintillator block volumes.

Member Enumeration Documentation

◆ wall_type

Wall identifier constants (SuperNEMO module Y axis)

Enumerator
WALL_INVALID 

Invalid/undefined wall.

WALL_LEFT 

Left wall.

WALL_RIGHT 

Right wall.

Constructor & Destructor Documentation

◆ xcalo_locator() [1/2]

snemo::geometry::xcalo_locator::xcalo_locator ( )

Constructor.

◆ xcalo_locator() [2/2]

snemo::geometry::xcalo_locator::xcalo_locator ( const ::geomtools::manager gmgr_,
uint32_t  module_number_ 
)

Constructor:

◆ ~xcalo_locator()

virtual snemo::geometry::xcalo_locator::~xcalo_locator ( )
virtual

Destructor.

Member Function Documentation

◆ _assert_initialized()

void snemo::geometry::xcalo_locator::_assert_initialized ( const std::string &  where_) const
protected

Checks if the locator has been intialized or throw an exception.

◆ _construct()

void snemo::geometry::xcalo_locator::_construct ( )
protected

◆ _hack_trace()

void snemo::geometry::xcalo_locator::_hack_trace ( )
protected

Hack trace.

◆ _set_defaults_()

void snemo::geometry::xcalo_locator::_set_defaults_ ( )
protected

◆ compute_block_position()

void snemo::geometry::xcalo_locator::compute_block_position ( uint32_t  side_,
uint32_t  wall_,
uint32_t  column_,
uint32_t  row_,
geomtools::vector_3d module_position_ 
) const

! Compute the position of a block for specific side, wall, column and row (in module coordinate system).

◆ compute_block_window_position()

void snemo::geometry::xcalo_locator::compute_block_window_position ( uint32_t  side_,
uint32_t  wall_,
uint32_t  column_,
uint32_t  row_,
geomtools::vector_3d module_position_ 
) const

! Compute the position of the center of the entrance window of a block for specific side, column and row (in module coordinate system).

◆ dump()

void snemo::geometry::xcalo_locator::dump ( std::ostream &  out_) const

Dump.

◆ extract_column()

uint32_t snemo::geometry::xcalo_locator::extract_column ( const geomtools::geom_id gid_) const

◆ extract_module()

uint32_t snemo::geometry::xcalo_locator::extract_module ( const geomtools::geom_id gid_) const

◆ extract_part()

uint32_t snemo::geometry::xcalo_locator::extract_part ( const geomtools::geom_id gid_) const

◆ extract_row()

uint32_t snemo::geometry::xcalo_locator::extract_row ( const geomtools::geom_id gid_) const

◆ extract_side()

uint32_t snemo::geometry::xcalo_locator::extract_side ( const geomtools::geom_id gid_) const

◆ extract_wall()

uint32_t snemo::geometry::xcalo_locator::extract_wall ( const geomtools::geom_id gid_) const

◆ find_block_geom_id()

bool snemo::geometry::xcalo_locator::find_block_geom_id ( const geomtools::vector_3d world_position_,
geomtools::geom_id gid_,
double  tolerance_ = GEOMTOOLS_PROPER_TOLERANCE 
) const

◆ find_block_geom_id_()

bool snemo::geometry::xcalo_locator::find_block_geom_id_ ( const geomtools::vector_3d in_module_position_,
geomtools::geom_id gid_,
double  tolerance_ = GEOMTOOLS_PROPER_TOLERANCE 
)
protected

◆ find_geom_id()

virtual bool snemo::geometry::xcalo_locator::find_geom_id ( const geomtools::vector_3d world_position_,
int  type_,
geomtools::geom_id gid_,
double  tolerance_ = GEOMTOOLS_PROPER_TOLERANCE 
) const
virtual

◆ get_block_height()

double snemo::geometry::xcalo_locator::get_block_height ( ) const

!

Returns
the height of a calorimeter block.

◆ get_block_position() [1/3]

geomtools::vector_3d snemo::geometry::xcalo_locator::get_block_position ( uint32_t  side_,
uint32_t  wall_,
uint32_t  column_,
uint32_t  row_ 
) const

!

Returns
the position of a block for specific side, wall, column and row (in module coordinate system).

◆ get_block_position() [2/3]

void snemo::geometry::xcalo_locator::get_block_position ( const geomtools::geom_id gid_,
geomtools::vector_3d position_ 
) const

Given a block with a specific geometry IDs, compute its position in the module coordinate system.

◆ get_block_position() [3/3]

void snemo::geometry::xcalo_locator::get_block_position ( uint32_t  side_,
uint32_t  wall_,
uint32_t  column_,
uint32_t  row_,
geomtools::vector_3d position_ 
) const

Given a block with a specific side, wall, column and row, compute its position in the module coordinate system.

◆ get_block_thickness()

double snemo::geometry::xcalo_locator::get_block_thickness ( ) const

!

Returns
the thickness of a block.

◆ get_block_width()

double snemo::geometry::xcalo_locator::get_block_width ( ) const

!

Returns
the width of a calorimeter block.

◆ get_block_window_position()

geomtools::vector_3d snemo::geometry::xcalo_locator::get_block_window_position ( uint32_t  side_,
uint32_t  wall_,
uint32_t  column_,
uint32_t  row_ 
) const

!

Returns
the position of the center of the entrance window of a block for specific side, wall, column and row (in module coordinate system).

◆ get_column_address_index()

int snemo::geometry::xcalo_locator::get_column_address_index ( ) const

◆ get_column_x()

double snemo::geometry::xcalo_locator::get_column_x ( uint32_t  side_,
uint32_t  wall_,
uint32_t  column_ 
) const

!

Returns
the X-position of a block for specific side, wall and column (in module coordinate system).

◆ get_module_address_index()

int snemo::geometry::xcalo_locator::get_module_address_index ( ) const

◆ get_module_number()

uint32_t snemo::geometry::xcalo_locator::get_module_number ( ) const

!

Returns
the number of the module (>=0).

◆ get_neighbours_ids() [1/2]

void snemo::geometry::xcalo_locator::get_neighbours_ids ( uint32_t  side_,
uint32_t  wall_,
uint32_t  column_,
uint32_t  row_,
std::vector< geomtools::geom_id > &  ids_,
uint8_t  mask_ = utils::NEIGHBOUR_FIRST 
) const

Given a block at specific side, wall, column and row, compute the array of geometry IDs for associated neighbouring blocks.

◆ get_neighbours_ids() [2/2]

void snemo::geometry::xcalo_locator::get_neighbours_ids ( const geomtools::geom_id gid_,
std::vector< geomtools::geom_id > &  ids_,
uint8_t  mask_ = utils::NEIGHBOUR_FIRST 
) const

Given a block with a specific geometry IDs, compute the array of geometry IDs for associated neighbouring blocks.

◆ get_number_of_columns()

size_t snemo::geometry::xcalo_locator::get_number_of_columns ( uint32_t  side_,
uint32_t  wall_ 
) const

!

Returns
the number of columns in one side and one wall of the calorimeter.

◆ get_number_of_neighbours() [1/2]

size_t snemo::geometry::xcalo_locator::get_number_of_neighbours ( uint32_t  side_,
uint32_t  wall_,
uint32_t  column_,
uint32_t  row_,
uint8_t  mask_ = utils::NEIGHBOUR_FIRST 
) const

Given a block at specific side, wall, column and row, returns the number of neighbouring blocks.

◆ get_number_of_neighbours() [2/2]

size_t snemo::geometry::xcalo_locator::get_number_of_neighbours ( const geomtools::geom_id gid_,
uint8_t  mask_ = utils::NEIGHBOUR_FIRST 
) const

Given a block with a specific geometry ID, returns the number of neighbouring blocks.

◆ get_number_of_rows()

size_t snemo::geometry::xcalo_locator::get_number_of_rows ( uint32_t  side_,
uint32_t  wall_ 
) const

!

Returns
the number of rows in one side and one wall of the calorimeter.

◆ get_number_of_sides()

size_t snemo::geometry::xcalo_locator::get_number_of_sides ( ) const

!

Returns
the number of sides on the calorimeter.

◆ get_number_of_walls()

size_t snemo::geometry::xcalo_locator::get_number_of_walls ( ) const

!

Returns
the number of walls on the calorimeter.

◆ get_part_address_index()

int snemo::geometry::xcalo_locator::get_part_address_index ( ) const

◆ get_row_address_index()

int snemo::geometry::xcalo_locator::get_row_address_index ( ) const

◆ get_row_z()

double snemo::geometry::xcalo_locator::get_row_z ( uint32_t  side_,
uint32_t  wall_,
uint32_t  row_ 
) const

!

Returns
the Z-position of a block for specific side, wall and row (in module coordinate system).

◆ get_side_address_index()

int snemo::geometry::xcalo_locator::get_side_address_index ( ) const

◆ get_wall_address_index()

int snemo::geometry::xcalo_locator::get_wall_address_index ( ) const

◆ get_wall_window_y()

double snemo::geometry::xcalo_locator::get_wall_window_y ( uint32_t  side_,
uint32_t  wall_ 
) const

!

Returns
the Y-position of the entrance window of a wall for specific side and wall (in module coordinate system).

◆ get_wall_y()

double snemo::geometry::xcalo_locator::get_wall_y ( uint32_t  side_,
uint32_t  wall_ 
) const

!

Returns
the Y-position of a wall for specific side and wall (in module coordinate system).

◆ has_submodule()

bool snemo::geometry::xcalo_locator::has_submodule ( uint32_t  side_) const

◆ id_is_valid()

bool snemo::geometry::xcalo_locator::id_is_valid ( uint32_t  side_,
uint32_t  wall_,
uint32_t  column_,
uint32_t  row_ 
) const

◆ initialize() [1/2]

virtual void snemo::geometry::xcalo_locator::initialize ( const datatools::properties config_)
virtual

◆ initialize() [2/2]

void snemo::geometry::xcalo_locator::initialize ( )

◆ is_block_partitioned()

bool snemo::geometry::xcalo_locator::is_block_partitioned ( ) const

! check if block is partitioned in the current setup.

◆ is_calo_block()

bool snemo::geometry::xcalo_locator::is_calo_block ( const geomtools::geom_id gid_) const

◆ is_calo_block_in_current_module()

bool snemo::geometry::xcalo_locator::is_calo_block_in_current_module ( const geomtools::geom_id gid_) const

◆ is_in_block()

bool snemo::geometry::xcalo_locator::is_in_block ( const geomtools::vector_3d module_position_,
uint32_t  side_,
uint32_t  wall_,
uint32_t  column_,
uint32_t  row_,
double  tolerance_ = GEOMTOOLS_PROPER_TOLERANCE 
) const

Check if a module coordinate system position is in a specific block virtual volume (its bounding envelope).

◆ is_in_module()

bool snemo::geometry::xcalo_locator::is_in_module ( const geomtools::vector_3d module_position_,
double  tolerance_ = GEOMTOOLS_PROPER_TOLERANCE 
) const

Check if a module coordinate system position is in the module virtual volume (its bounding envelope).

◆ is_initialized()

virtual bool snemo::geometry::xcalo_locator::is_initialized ( ) const
virtual

◆ is_world_position_in_block()

bool snemo::geometry::xcalo_locator::is_world_position_in_block ( const geomtools::vector_3d world_position_,
uint32_t  side_,
uint32_t  wall_,
uint32_t  column_,
uint32_t  row_,
double  tolerance_ = GEOMTOOLS_PROPER_TOLERANCE 
) const

Check if a world coordinate system position is in a specific block virtual volume (its bounding envelope).

◆ is_world_position_in_module()

bool snemo::geometry::xcalo_locator::is_world_position_in_module ( const geomtools::vector_3d world_position_,
double  tolerance_ = GEOMTOOLS_PROPER_TOLERANCE 
) const

Check if a world coordinate system position is in the module virtual volume (its bounding envelope).

◆ reset()

virtual void snemo::geometry::xcalo_locator::reset ( )
virtual

◆ set_module_number()

void snemo::geometry::xcalo_locator::set_module_number ( uint32_t  module_number_)

! set the number of the module for this locator.

◆ transform_module_to_world()

void snemo::geometry::xcalo_locator::transform_module_to_world ( const geomtools::vector_3d module_position_,
geomtools::vector_3d world_position_ 
) const

Tranform a module coordinate system position to the corresponding world coordinate system position.

◆ transform_world_to_module()

void snemo::geometry::xcalo_locator::transform_world_to_module ( const geomtools::vector_3d world_position_,
geomtools::vector_3d module_position_ 
) const

Tranform a world coordinate system position to the corresponding module coordinate system position.

◆ tree_dump()

virtual void snemo::geometry::xcalo_locator::tree_dump ( std::ostream &  out_ = std::clog,
const std::string &  title_ = "",
const std::string &  indent_ = "",
bool  inherit_ = false 
) const
virtual

Smart print.

Reimplemented from datatools::i_tree_dumpable.

Member Data Documentation

◆ NWALLS_PER_SIDE

const unsigned int snemo::geometry::xcalo_locator::NWALLS_PER_SIDE = 2
static

Number of X-calorimeter walls per side (on the Y-axis)


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