Bayeux  3.4.1
Core Foundation library for SuperNEMO
Classes | Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
geomtools::base_hit Class Reference

The base class for hit objects that locate events in a geometry model. More...

#include <bayeux/geomtools/base_hit.h>

Inheritance diagram for geomtools::base_hit:
datatools::i_serializable datatools::i_tree_dumpable datatools::i_clear geomtools::blur_spot mctools::base_step_hit mctools::digitization::sampled_signal mctools::signal::base_signal

Classes

class  has_flag_predicate
 Predicate that checks if the auxiliaries container stores some specific flag. More...
 
class  has_geom_id_predicate
 Predicate that checks if the hit has some specific geometry ID. More...
 
class  has_hit_id_predicate
 Predicate that checks if the hit has some specific ID. More...
 
class  has_key_predicate
 Predicate that checks if the auxiliaries container stores some property with a specific key. More...
 
class  has_string_property_predicate
 Predicate that checks if the auxiliaries container stores some property with a specific key. More...
 
class  i_measurement
 Generic abstract interface for a measurement on a hit. More...
 
class  negates_predicate
 Predicate that negates another predicate. More...
 

Public Types

enum  store_mask_type {
  STORE_NOTHING = 0, STORE_HIT_ID = datatools::bit_mask::bit00, STORE_GEOM_ID = datatools::bit_mask::bit01, STORE_AUXILIARIES = datatools::bit_mask::bit02,
  STORE_RESERVED30 = datatools::bit_mask::bit30, STORE_RESERVED31 = datatools::bit_mask::bit31
}
 Masks to automatically tag the attributes to be stored. More...
 
- Public Types inherited from datatools::i_tree_dumpable
enum  ostream_type { OSTREAM_COUT = 1, OSTREAM_CERR = 2, OSTREAM_CLOG = 3 }
 Enumeration for standard output streams. More...
 

Public Member Functions

bool has_hit_id () const
 
int32_t get_hit_id () const
 
void set_hit_id (int32_t)
 Set the hit ID integer value. More...
 
void invalidate_hit_id ()
 
bool has_geom_id () const
 Check if the geometry ID is valid. More...
 
const geomtools::geom_idget_geom_id () const
 Get a reference on the non-mutable geometry ID. More...
 
geomtools::geom_idgrab_geom_id ()
 Get a reference on the mutable geometry ID. More...
 
void set_geom_id (const geomtools::geom_id &)
 Set the geometry ID. More...
 
void invalidate_geom_id ()
 Reset the geometry ID. More...
 
bool has_auxiliaries () const
 Check if there are stored auxiliary properties. More...
 
const datatools::propertiesget_auxiliaries () const
 Get a non-mutable reference on the auxiliaries container. More...
 
datatools::propertiesgrab_auxiliaries ()
 Get a mutable reference on the auxiliaries container. More...
 
void set_auxiliaries (const datatools::properties &)
 Set the auxiliaries container. More...
 
void invalidate_auxiliaries ()
 Reset the mutable auxiliaries container. More...
 
 base_hit ()
 Default constructor. More...
 
virtual ~base_hit ()
 Destructor. More...
 
virtual bool is_valid () const
 Check if the hit is valid. More...
 
virtual void invalidate ()
 Reset the internals of the hit, making it invalid. More...
 
void reset ()
 Reset the internals of the hit, making it invalid. More...
 
virtual void clear ()
 Reset the internals of the hit, making it invalid. More...
 
base_hitmeasure (i_measurement &)
 Apply a measurement on the current hit. More...
 
virtual void tree_dump (std::ostream &a_out=std::clog, const std::string &a_title="", const std::string &a_indent="", bool a_inherit=false) const
 
void print_tree (std::ostream &out_=std::clog, const boost::property_tree::ptree &options_=datatools::i_tree_dumpable::empty_options()) const override
 
void dump () const
 Smart print (default behaviour) More...
 
- Public Member Functions inherited from datatools::i_serializable
 i_serializable ()
 Default constructor. More...
 
virtual ~i_serializable ()
 Destructor. More...
 
virtual const std::string & get_serial_tag () const =0
 Return the serialization string identifier of the class. More...
 
- Public Member Functions inherited from datatools::i_tree_dumpable
 i_tree_dumpable ()
 Constructor. More...
 
virtual ~i_tree_dumpable ()
 Destructor. More...
 
void print_tree_json (std::ostream &out_=std::clog, const std::string &json_options_="") const
 Printing with jsonized options. More...
 
void print_tree_json (std::ostream &out_=std::clog, const char *json_options_=nullptr) const
 Printing with jsonized options. More...
 
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
 
- Public Member Functions inherited from datatools::i_clear
virtual ~i_clear ()
 Destructor. More...
 

Static Public Attributes

static const int32_t INVALID_HIT_ID = -1
 

Protected Member Functions

void _store_set (uint32_t bit_mask_)
 Set the bits from a mask. More...
 
void _store_unset (uint32_t bit_mask_)
 Unset the bits from a mask. More...
 
bool _store_check (uint32_t bit_mask_) const
 Check the bits from a mask. More...
 

Protected Attributes

uint32_t _store
 

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_)
 

Detailed Description

The base class for hit objects that locate events in a geometry model.

Member Enumeration Documentation

◆ store_mask_type

Masks to automatically tag the attributes to be stored.

Enumerator
STORE_NOTHING 
STORE_HIT_ID 

Serialization mask for the hit ID attribute.

STORE_GEOM_ID 

Serialization mask for the geometry ID attribute.

STORE_AUXILIARIES 

Serialization mask for the auxiliary properties attribute.

STORE_RESERVED30 

Reserved bit (lock)

STORE_RESERVED31 

Reserved bit (chained)

Constructor & Destructor Documentation

◆ base_hit()

geomtools::base_hit::base_hit ( )

Default constructor.

◆ ~base_hit()

virtual geomtools::base_hit::~base_hit ( )
virtual

Destructor.

Member Function Documentation

◆ _store_check()

bool geomtools::base_hit::_store_check ( uint32_t  bit_mask_) const
protected

Check the bits from a mask.

◆ _store_set()

void geomtools::base_hit::_store_set ( uint32_t  bit_mask_)
protected

Set the bits from a mask.

◆ _store_unset()

void geomtools::base_hit::_store_unset ( uint32_t  bit_mask_)
protected

Unset the bits from a mask.

◆ clear()

virtual void geomtools::base_hit::clear ( )
virtual

Reset the internals of the hit, making it invalid.

Implements datatools::i_clear.

Reimplemented in mctools::base_step_hit.

◆ dump()

void geomtools::base_hit::dump ( ) const

Smart print (default behaviour)

◆ get_auxiliaries()

const datatools::properties& geomtools::base_hit::get_auxiliaries ( ) const

Get a non-mutable reference on the auxiliaries container.

◆ get_geom_id()

const geomtools::geom_id& geomtools::base_hit::get_geom_id ( ) const

Get a reference on the non-mutable geometry ID.

◆ get_hit_id()

int32_t geomtools::base_hit::get_hit_id ( ) const

Get the hit ID integer value

hit0.set_hit_id(34);
std::clog << hit0.get_hit_id() << '\n';

◆ grab_auxiliaries()

datatools::properties& geomtools::base_hit::grab_auxiliaries ( )

Get a mutable reference on the auxiliaries container.

◆ grab_geom_id()

geomtools::geom_id& geomtools::base_hit::grab_geom_id ( )

Get a reference on the mutable geometry ID.

◆ has_auxiliaries()

bool geomtools::base_hit::has_auxiliaries ( ) const

Check if there are stored auxiliary properties.

◆ has_geom_id()

bool geomtools::base_hit::has_geom_id ( ) const

Check if the geometry ID is valid.

◆ has_hit_id()

bool geomtools::base_hit::has_hit_id ( ) const

Check if the hit ID is valid

hit0.set_hit_id(34);
if (hit0.has_hit_id()) {
...
}

◆ invalidate()

virtual void geomtools::base_hit::invalidate ( )
virtual

Reset the internals of the hit, making it invalid.

Reimplemented in mctools::base_step_hit, and geomtools::blur_spot.

◆ invalidate_auxiliaries()

void geomtools::base_hit::invalidate_auxiliaries ( )

Reset the mutable auxiliaries container.

◆ invalidate_geom_id()

void geomtools::base_hit::invalidate_geom_id ( )

Reset the geometry ID.

◆ invalidate_hit_id()

void geomtools::base_hit::invalidate_hit_id ( )

Reset the hit ID integer value

hit0.set_hit_id(34);
if (hit0.has_hit_id()) {
...
}

◆ is_valid()

virtual bool geomtools::base_hit::is_valid ( ) const
virtual

Check if the hit is valid.

We consider a base hit valid if:

  • a valid hit ID is set
  • a valid geometry ID is set

Reimplemented in mctools::base_step_hit, geomtools::blur_spot, mctools::digitization::sampled_signal, and mctools::signal::base_signal.

◆ measure()

base_hit& geomtools::base_hit::measure ( i_measurement )

Apply a measurement on the current hit.

◆ print_tree()

void geomtools::base_hit::print_tree ( std::ostream &  out_ = std::clog,
const boost::property_tree::ptree &  options_ = datatools::i_tree_dumpable::empty_options() 
) const
overridevirtual

Supported options:

{
"title" : "My title: ",
"indent" : "[debug] ",
"inherit" : false,
"no_list_auxiliaries" : false
}

Reimplemented from datatools::i_tree_dumpable.

Reimplemented in mctools::base_step_hit.

◆ reset()

void geomtools::base_hit::reset ( )

Reset the internals of the hit, making it invalid.

◆ set_auxiliaries()

void geomtools::base_hit::set_auxiliaries ( const datatools::properties )

Set the auxiliaries container.

◆ set_geom_id()

void geomtools::base_hit::set_geom_id ( const geomtools::geom_id )

Set the geometry ID.

◆ set_hit_id()

void geomtools::base_hit::set_hit_id ( int32_t  )

Set the hit ID integer value.

◆ tree_dump()

virtual void geomtools::base_hit::tree_dump ( std::ostream &  a_out = std::clog,
const std::string &  a_title = "",
const std::string &  a_indent = "",
bool  a_inherit = false 
) const
virtual

Member Data Documentation

◆ _store

uint32_t geomtools::base_hit::_store
protected

The store field records the usage status of the each data field members. One bit is affected to each field: 0 : field member is not used 1 : field member is used This enables to serialize only the useful part of the hit. It is made protected in order to allow daughter classes to use it (32 bits are available)

◆ INVALID_HIT_ID

const int32_t geomtools::base_hit::INVALID_HIT_ID = -1
static

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