Bayeux
3.4.1
Core Foundation library for SuperNEMO
|
The container of collections of MC hits. More...
#include <bayeux/mctools/simulated_data.h>
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_hit > | hit_handle_type |
Alias for the MC base step hit handle type. More... | |
typedef std::vector< hit_handle_type > | hit_handle_collection_type |
Alias for the collection of MC base step hit handles. More... | |
typedef std::vector< base_step_hit > | hit_collection_type |
Alias for the collection of MC base step hits. More... | |
typedef std::map< std::string, hit_handle_collection_type > | step_hits_dict_type |
typedef std::map< std::string, hit_collection_type > | plain_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_3d & | get_vertex () const |
Get a reference to the non mutable vertex. More... | |
geomtools::vector_3d & | grab_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_type & | get_primary_event () const |
Get a reference to the non mutable primary event. More... | |
primary_event_type & | grab_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::properties & | get_properties () const |
Get a reference to the non mutable collection of auxiliary properties. More... | |
datatools::properties & | grab_properties () |
Get a reference to the mutable collection of auxiliary properties. More... | |
void | set_properties (const datatools::properties &) |
step_hits_dict_type & | grab_step_hits_dict () |
Get a reference to the mutable collection of MC hits handles. More... | |
const step_hits_dict_type & | get_step_hits_dict () const |
Get a reference to the non mutable collection of MC hits handles. More... | |
plain_step_hits_dict_type & | grab_plain_step_hits_dict () |
Get a reference to the mutable collection of plain MC hits. More... | |
const plain_step_hits_dict_type & | get_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_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. More... | |
simulated_data & | remove_step_hits (const std::string &category_) |
Remove a collection of MC hits with some given category. More... | |
base_step_hit & | add_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_hit & | 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. More... | |
base_step_hit & | grab_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_type & | grab_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_type & | get_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_type & | grab_plain_step_hits (const std::string &category_) |
const hit_collection_type & | get_plain_step_hits (const std::string &category_) const |
simulated_data & | reset (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_) |
The container of collections of MC hits.
typedef std::vector<base_step_hit> mctools::simulated_data::hit_collection_type |
Alias for the collection of MC base step hits.
typedef std::vector<hit_handle_type> mctools::simulated_data::hit_handle_collection_type |
Alias for the collection of MC base step hit handles.
Alias for the MC base step hit handle type.
typedef std::map<std::string, hit_collection_type> mctools::simulated_data::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.
Alias for the primary generated event type.
typedef std::map<std::string, hit_handle_collection_type> mctools::simulated_data::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.
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 |
|
HANDLE_HIT_COLLECTION_TYPE | Collection of hit handles. |
mctools::simulated_data::simulated_data | ( | ) |
Default constructor.
|
explicit |
Constructor.
|
virtual |
Destructor.
|
protected |
Set default values to attributes.
|
inline |
Add/append a new MC hit in a collection of MC hits with some given category.
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.
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.
|
virtual |
Reset the internal data.
Implements datatools::i_clear.
|
inline |
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.
const hit_collection_type& mctools::simulated_data::get_plain_step_hits | ( | const std::string & | category_ | ) | const |
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.
const primary_event_type& mctools::simulated_data::get_primary_event | ( | ) | const |
Get a reference to the non mutable primary event.
const datatools::properties& mctools::simulated_data::get_properties | ( | ) | const |
Get a reference to the non mutable collection of auxiliary properties.
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.
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.
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.
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.
double mctools::simulated_data::get_time | ( | ) | const |
Get the reference time.
const geomtools::vector_3d& mctools::simulated_data::get_vertex | ( | ) | const |
Get a reference to the non mutable vertex.
hit_collection_type& mctools::simulated_data::grab_plain_step_hits | ( | const std::string & | category_ | ) |
plain_step_hits_dict_type& mctools::simulated_data::grab_plain_step_hits_dict | ( | ) |
Get a reference to the mutable collection of plain MC hits.
primary_event_type& mctools::simulated_data::grab_primary_event | ( | ) |
Get a reference to the mutable primary event.
datatools::properties& mctools::simulated_data::grab_properties | ( | ) |
Get a reference to the mutable collection of auxiliary properties.
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.
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.
step_hits_dict_type& mctools::simulated_data::grab_step_hits_dict | ( | ) |
Get a reference to the mutable collection of MC hits handles.
geomtools::vector_3d& mctools::simulated_data::grab_vertex | ( | ) |
Get a reference to the mutable vertex.
bool mctools::simulated_data::has_data | ( | ) | const |
Check if some collections of MC hits exist.
bool mctools::simulated_data::has_hit | ( | const std::string & | category_, |
const int | index_ | ||
) | const |
bool mctools::simulated_data::has_step_hits | ( | const std::string & | category_ | ) | const |
Check is some MC hits exists in some given category.
bool mctools::simulated_data::has_time | ( | ) | const |
Check if a time is defined.
bool mctools::simulated_data::has_vertex | ( | ) | const |
Check if a vertex is defined.
|
inline |
|
overridevirtual |
Smart print
Supported options:
Reimplemented from datatools::i_tree_dumpable.
simulated_data& mctools::simulated_data::remove_step_hits | ( | const std::string & | category_ | ) |
Remove a collection of MC hits with some given category.
simulated_data& mctools::simulated_data::reset | ( | bool | reset_collection_type_ | ) |
void mctools::simulated_data::reset | ( | ) |
Reset data.
void mctools::simulated_data::reset_collection_type | ( | ) |
Reset the memory layout for hit storage.
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)
void mctools::simulated_data::set_primary_event | ( | const primary_event_type & | ) |
Set the primary event.
void mctools::simulated_data::set_properties | ( | const datatools::properties & | ) |
void mctools::simulated_data::set_time | ( | const double | ) |
Set the reference time.
void mctools::simulated_data::set_vertex | ( | const geomtools::vector_3d & | ) |
Set the vertex.
|
virtual |
Reimplemented from datatools::i_tree_dumpable.
bool mctools::simulated_data::use_handle_hit_collection | ( | ) | const |
Check if the memory layout for hit storage uses collection of MC hits handles.
bool mctools::simulated_data::use_plain_hit_collection | ( | ) | const |
Check if the memory layout for hit storage uses collection of plain MC hits.