Bayeux  3.4.1
Core Foundation library for SuperNEMO
Public Types | Public Member Functions | Protected Member Functions | List of all members
mctools::simulated_data Class Reference

The container of collections of MC hits. More...

#include <bayeux/mctools/simulated_data.h>

Inheritance diagram for mctools::simulated_data:
datatools::i_serializable datatools::i_tree_dumpable datatools::i_clear

Public Types

enum  collection_type { INVALID_HIT_COLLECTION_TYPE = -1, PLAIN_HIT_COLLECTION_TYPE = 0, HANDLE_HIT_COLLECTION_TYPE = 1 }
 Type of the memory layout of the collection of MC hits. More...
 
enum  hit_category_type { HIT_CATEGORY_TYPE_PUBLIC = datatools::bit_mask::bit00, HIT_CATEGORY_TYPE_PRIVATE = datatools::bit_mask::bit01, HIT_CATEGORY_TYPE_PREFIX = datatools::bit_mask::bit02, HIT_CATEGORY_TYPE_ALL = HIT_CATEGORY_TYPE_PUBLIC | HIT_CATEGORY_TYPE_PRIVATE }
 Categories of MC hits. More...
 
typedef datatools::handle< base_step_hithit_handle_type
 Alias for the MC base step hit handle type. More...
 
typedef std::vector< hit_handle_typehit_handle_collection_type
 Alias for the collection of MC base step hit handles. More...
 
typedef std::vector< base_step_hithit_collection_type
 Alias for the collection of MC base step hits. More...
 
typedef std::map< std::string, hit_handle_collection_typestep_hits_dict_type
 
typedef std::map< std::string, hit_collection_typeplain_step_hits_dict_type
 
typedef ::genbb::primary_event primary_event_type
 Alias for the primary generated event type. 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

void reset_collection_type ()
 Reset the memory layout for hit storage. More...
 
void set_collection_type (const int collection_type_)
 Set the memory layout for hit storage (collection of plain MC hits/collections of MC hits handles) More...
 
bool use_plain_hit_collection () const
 Check if the memory layout for hit storage uses collection of plain MC hits. More...
 
bool use_handle_hit_collection () const
 Check if the memory layout for hit storage uses collection of MC hits handles. More...
 
bool has_data () const
 Check if some collections of MC hits exist. More...
 
bool has_vertex () const
 Check if a vertex is defined. More...
 
const geomtools::vector_3dget_vertex () const
 Get a reference to the non mutable vertex. More...
 
geomtools::vector_3dgrab_vertex ()
 Get a reference to the mutable vertex. More...
 
void set_vertex (const geomtools::vector_3d &)
 Set the vertex. More...
 
bool has_time () const
 Check if a time is defined. More...
 
double get_time () const
 Get the reference time. More...
 
void set_time (const double)
 Set the reference time. More...
 
const primary_event_typeget_primary_event () const
 Get a reference to the non mutable primary event. More...
 
primary_event_typegrab_primary_event ()
 Get a reference to the mutable primary event. More...
 
void set_primary_event (const primary_event_type &)
 Set the primary event. More...
 
const datatools::propertiesget_properties () const
 Get a reference to the non mutable collection of auxiliary properties. More...
 
datatools::propertiesgrab_properties ()
 Get a reference to the mutable collection of auxiliary properties. More...
 
void set_properties (const datatools::properties &)
 
step_hits_dict_typegrab_step_hits_dict ()
 Get a reference to the mutable collection of MC hits handles. More...
 
const step_hits_dict_typeget_step_hits_dict () const
 Get a reference to the non mutable collection of MC hits handles. More...
 
plain_step_hits_dict_typegrab_plain_step_hits_dict ()
 Get a reference to the mutable collection of plain MC hits. More...
 
const plain_step_hits_dict_typeget_plain_step_hits_dict () const
 Get a reference to the non mutable collection of plain MC hits. More...
 
void get_step_hits_categories (std::vector< std::string > &categories_, unsigned int mode_=HIT_CATEGORY_TYPE_ALL, const std::string &prefix_="") const
 Get a list of categories associated to existing collections of MC hits. More...
 
simulated_dataadd_step_hits (const std::string &category_, size_t capacity_=0)
 Add a new collection of MC hits with some given category and a default capacity for memory allocation. More...
 
simulated_dataremove_step_hits (const std::string &category_)
 Remove a collection of MC hits with some given category. More...
 
base_step_hitadd_step_hit (const std::string &category_)
 Add/append a new MC hit in a collection of MC hits with some given category. More...
 
bool has_step_hits (const std::string &category_) const
 Check is some MC hits exists in some given category. More...
 
size_t get_number_of_step_hits (const std::string &category_) const
 Get the number of MC hits within a given category. More...
 
const base_step_hitget_step_hit (const std::string &category_, int hit_index_) const
 Get a reference to the non mutable MC hit within a given category and index. More...
 
base_step_hitgrab_step_hit (const std::string &category_, int hit_index_)
 Get a reference to the mutable MC hit within a given category and index. More...
 
template<class Hit >
Hit & add_hit (const std::string &category_)
 Add/append a new MC hit in a collection of MC hits with some given category. More...
 
bool has_hit (const std::string &category_, const int index_) const
 
template<class Hit >
bool is_hit (const std::string &category_, const int index_) const
 
template<class Hit >
const Hit & get_hit (const std::string &category_, const int index_) const
 
hit_handle_collection_typegrab_step_hits (const std::string &category_)
 Get a reference to the mutable collection of MC hits handles with a given category. More...
 
const hit_handle_collection_typeget_step_hits (const std::string &category_) const
 Get a reference to the non mutable collection of MC hits handles with a given category. More...
 
hit_collection_typegrab_plain_step_hits (const std::string &category_)
 
const hit_collection_typeget_plain_step_hits (const std::string &category_) const
 
simulated_datareset (bool reset_collection_type_)
 
void reset ()
 Reset data. More...
 
 simulated_data ()
 Default constructor. More...
 
 simulated_data (int collection_type_)
 Constructor. More...
 
virtual ~simulated_data ()
 Destructor. More...
 
virtual void clear ()
 Reset the internal data. More...
 
virtual void tree_dump (std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool 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
 
- 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...
 

Protected Member Functions

void _set_defaults ()
 Set default values to attributes. More...
 

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 container of collections of MC hits.

Member Typedef Documentation

◆ hit_collection_type

Alias for the collection of MC base step hits.

◆ hit_handle_collection_type

Alias for the collection of MC base step hit handles.

◆ hit_handle_type

Alias for the MC base step hit handle type.

◆ plain_step_hits_dict_type

Dictionary of lists of base step hits. Each list has its own string key which represents the 'category' of simulated hits.

◆ primary_event_type

Alias for the primary generated event type.

◆ step_hits_dict_type

Dictionary of lists of handles to base step hits. Each list has its own string key which represents the 'category' of simulated hits.

Member Enumeration Documentation

◆ collection_type

Type of the memory layout of the collection of MC hits.

Enumerator
INVALID_HIT_COLLECTION_TYPE 

Invalid type of hit collection.

PLAIN_HIT_COLLECTION_TYPE 
Deprecated:
Collection of plain hits
HANDLE_HIT_COLLECTION_TYPE 

Collection of hit handles.

◆ hit_category_type

Categories of MC hits.

Enumerator
HIT_CATEGORY_TYPE_PUBLIC 
HIT_CATEGORY_TYPE_PRIVATE 
HIT_CATEGORY_TYPE_PREFIX 
HIT_CATEGORY_TYPE_ALL 

Constructor & Destructor Documentation

◆ simulated_data() [1/2]

mctools::simulated_data::simulated_data ( )

Default constructor.

◆ simulated_data() [2/2]

mctools::simulated_data::simulated_data ( int  collection_type_)
explicit

Constructor.

◆ ~simulated_data()

virtual mctools::simulated_data::~simulated_data ( )
virtual

Destructor.

Member Function Documentation

◆ _set_defaults()

void mctools::simulated_data::_set_defaults ( )
protected

Set default values to attributes.

◆ add_hit()

template<class Hit >
Hit& mctools::simulated_data::add_hit ( const std::string &  category_)
inline

Add/append a new MC hit in a collection of MC hits with some given category.

◆ add_step_hit()

base_step_hit& mctools::simulated_data::add_step_hit ( const std::string &  category_)

Add/append a new MC hit in a collection of MC hits with some given category.

◆ add_step_hits()

simulated_data& mctools::simulated_data::add_step_hits ( const std::string &  category_,
size_t  capacity_ = 0 
)

Add a new collection of MC hits with some given category and a default capacity for memory allocation.

◆ clear()

virtual void mctools::simulated_data::clear ( )
virtual

Reset the internal data.

Implements datatools::i_clear.

◆ get_hit()

template<class Hit >
const Hit& mctools::simulated_data::get_hit ( const std::string &  category_,
const int  index_ 
) const
inline

◆ get_number_of_step_hits()

size_t mctools::simulated_data::get_number_of_step_hits ( const std::string &  category_) const

Get the number of MC hits within a given category.

◆ get_plain_step_hits()

const hit_collection_type& mctools::simulated_data::get_plain_step_hits ( const std::string &  category_) const
Deprecated:
Get a reference to the non mutable collection of plain MC hits with a given category

◆ get_plain_step_hits_dict()

const plain_step_hits_dict_type& mctools::simulated_data::get_plain_step_hits_dict ( ) const

Get a reference to the non mutable collection of plain MC hits.

◆ get_primary_event()

const primary_event_type& mctools::simulated_data::get_primary_event ( ) const

Get a reference to the non mutable primary event.

◆ get_properties()

const datatools::properties& mctools::simulated_data::get_properties ( ) const

Get a reference to the non mutable collection of auxiliary properties.

◆ get_step_hit()

const base_step_hit& mctools::simulated_data::get_step_hit ( const std::string &  category_,
int  hit_index_ 
) const

Get a reference to the non mutable MC hit within a given category and index.

◆ get_step_hits()

const hit_handle_collection_type& mctools::simulated_data::get_step_hits ( const std::string &  category_) const

Get a reference to the non mutable collection of MC hits handles with a given category.

◆ get_step_hits_categories()

void mctools::simulated_data::get_step_hits_categories ( std::vector< std::string > &  categories_,
unsigned int  mode_ = HIT_CATEGORY_TYPE_ALL,
const std::string &  prefix_ = "" 
) const

Get a list of categories associated to existing collections of MC hits.

◆ get_step_hits_dict()

const step_hits_dict_type& mctools::simulated_data::get_step_hits_dict ( ) const

Get a reference to the non mutable collection of MC hits handles.

◆ get_time()

double mctools::simulated_data::get_time ( ) const

Get the reference time.

◆ get_vertex()

const geomtools::vector_3d& mctools::simulated_data::get_vertex ( ) const

Get a reference to the non mutable vertex.

◆ grab_plain_step_hits()

hit_collection_type& mctools::simulated_data::grab_plain_step_hits ( const std::string &  category_)
Deprecated:
Get a reference to the mutable collection of plain MC hits with a given category

◆ grab_plain_step_hits_dict()

plain_step_hits_dict_type& mctools::simulated_data::grab_plain_step_hits_dict ( )

Get a reference to the mutable collection of plain MC hits.

◆ grab_primary_event()

primary_event_type& mctools::simulated_data::grab_primary_event ( )

Get a reference to the mutable primary event.

◆ grab_properties()

datatools::properties& mctools::simulated_data::grab_properties ( )

Get a reference to the mutable collection of auxiliary properties.

◆ grab_step_hit()

base_step_hit& mctools::simulated_data::grab_step_hit ( const std::string &  category_,
int  hit_index_ 
)

Get a reference to the mutable MC hit within a given category and index.

◆ grab_step_hits()

hit_handle_collection_type& mctools::simulated_data::grab_step_hits ( const std::string &  category_)

Get a reference to the mutable collection of MC hits handles with a given category.

◆ grab_step_hits_dict()

step_hits_dict_type& mctools::simulated_data::grab_step_hits_dict ( )

Get a reference to the mutable collection of MC hits handles.

◆ grab_vertex()

geomtools::vector_3d& mctools::simulated_data::grab_vertex ( )

Get a reference to the mutable vertex.

◆ has_data()

bool mctools::simulated_data::has_data ( ) const

Check if some collections of MC hits exist.

◆ has_hit()

bool mctools::simulated_data::has_hit ( const std::string &  category_,
const int  index_ 
) const

◆ has_step_hits()

bool mctools::simulated_data::has_step_hits ( const std::string &  category_) const

Check is some MC hits exists in some given category.

◆ has_time()

bool mctools::simulated_data::has_time ( ) const

Check if a time is defined.

◆ has_vertex()

bool mctools::simulated_data::has_vertex ( ) const

Check if a vertex is defined.

◆ is_hit()

template<class Hit >
bool mctools::simulated_data::is_hit ( const std::string &  category_,
const int  index_ 
) const
inline

◆ print_tree()

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

Smart print

Supported options:

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

Reimplemented from datatools::i_tree_dumpable.

◆ remove_step_hits()

simulated_data& mctools::simulated_data::remove_step_hits ( const std::string &  category_)

Remove a collection of MC hits with some given category.

◆ reset() [1/2]

simulated_data& mctools::simulated_data::reset ( bool  reset_collection_type_)
Deprecated:
Reset the internal data

◆ reset() [2/2]

void mctools::simulated_data::reset ( )

Reset data.

◆ reset_collection_type()

void mctools::simulated_data::reset_collection_type ( )

Reset the memory layout for hit storage.

◆ set_collection_type()

void mctools::simulated_data::set_collection_type ( const int  collection_type_)

Set the memory layout for hit storage (collection of plain MC hits/collections of MC hits handles)

◆ set_primary_event()

void mctools::simulated_data::set_primary_event ( const primary_event_type )

Set the primary event.

◆ set_properties()

void mctools::simulated_data::set_properties ( const datatools::properties )

◆ set_time()

void mctools::simulated_data::set_time ( const double  )

Set the reference time.

◆ set_vertex()

void mctools::simulated_data::set_vertex ( const geomtools::vector_3d )

Set the vertex.

◆ tree_dump()

virtual void mctools::simulated_data::tree_dump ( std::ostream &  out_ = std::clog,
const std::string &  title_ = "",
const std::string &  indent_ = "",
bool  inherit_ = false 
) const
virtual
Deprecated:
Smart print

Reimplemented from datatools::i_tree_dumpable.

◆ use_handle_hit_collection()

bool mctools::simulated_data::use_handle_hit_collection ( ) const

Check if the memory layout for hit storage uses collection of MC hits handles.

◆ use_plain_hit_collection()

bool mctools::simulated_data::use_plain_hit_collection ( ) const

Check if the memory layout for hit storage uses collection of plain MC hits.


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