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

Biasing algorithm used at primary event generation. More...

#include <bayeux/mctools/biasing/primary_event_bias.h>

Inheritance diagram for mctools::biasing::primary_event_bias:
datatools::i_tree_dumpable

Classes

struct  biasing_info
 Biasing information associated to a biased primary event. More...
 
struct  poi_entry_type
 Dictionary of points of interest. More...
 
struct  stat_record
 Record counters. More...
 

Public Types

enum  bias_mode_type {
  BIAS_UNDEFINED = 0, BIAS_NONE = 1, BIAS_ONLY_MASTER_PARTICLE = 2, BIAS_ALL_PARTICLES = 3,
  BIAS_DEFAULT = BIAS_ONLY_MASTER_PARTICLE
}
 Biasing modes. More...
 
enum  biased_event_status { BES_UNDEFINED = 0, BES_NORMAL = 1, BES_TRUNCATED = 2, BES_KILLED = 3 }
 Status of a biased primary event. More...
 
typedef std::map< std::string, poi_entry_typepoi_dict_type
 Dictionary of points of interest. 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

const stat_recordget_stats () const
 Return the embedded statistics record. More...
 
void reset_stats ()
 Reset the embedded statistics record. More...
 
bool has_stats_store () const
 Check if a store file is used to record statistics record. More...
 
void set_stats_store (const std::string &)
 Set the filename of a file used to record statistics record. More...
 
 primary_event_bias ()
 Default constructor. More...
 
virtual ~primary_event_bias ()
 Destructor. More...
 
void set_geometry_manager (const geomtools::manager &)
 Set the geometry manager. More...
 
bool is_initialized () const
 Check initialization flag. More...
 
void initialize_simple ()
 Initialization. More...
 
void initialize (const datatools::properties &config_)
 Initialization. More...
 
void reset ()
 Reset. More...
 
void set_bias_mode (bias_mode_type)
 Set the bias mode. More...
 
bias_mode_type get_bias_mode () const
 Return the bias mode. More...
 
bool is_using_no_bias () const
 Check no bias mode. More...
 
bool is_using_master_particle () const
 Check mode for using a master particle. More...
 
bool is_using_all_particles () const
 Check mode for using all particles. More...
 
void add_particle_by_label (const std::string &)
 Add the identifier of the master particle. More...
 
void add_particle_by_type (int id_)
 Add the identifier of the master particle. More...
 
void set_particle_minimum_energy (double kemin_)
 Set the minimum kinetic energy of the master particle. More...
 
void set_particle_maximum_energy (double kemax_)
 Set the maximum kinetic energy of the master particle. More...
 
void set_master_particle_rank (int rank_)
 Set the rank of the master particle. More...
 
void set_track_only_master_particle (bool)
 Set the track only flag of the master particle. More...
 
void set_total_minimum_energy (double)
 Set the total minimum kinetic energy. More...
 
void set_total_maximum_energy (double)
 Set the total maximum kinetic energy. More...
 
void set_mapping_name (const std::string &)
 Set the mapping name. More...
 
const std::string & get_mapping_name () const
 Return the mapping name. More...
 
void set_logging (datatools::logger::priority)
 Set the logging priority threshold. More...
 
datatools::logger::priority get_logging () const
 Return the logging priority threshold. More...
 
void add_point_of_interest (const std::string &poi_name_, const point_of_interest &poi_)
 Add a point of interest. More...
 
bool has_point_of_interest (const std::string &poi_name_) const
 Check point of interest. More...
 
const poi_entry_typeget_point_of_interest (const std::string &poi_name_) const
 Return a non mutable reference to a point of interest. More...
 
poi_entry_typegrab_point_of_interest (const std::string &poi_name_)
 Return a mutable reference to a point of interest. More...
 
void process (const geomtools::vector_3d &vertex_, genbb::primary_event &event_, biasing_info &info_)
 Bias the primary event. More...
 
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 draw (const geomtools::vector_3d &vertex_, genbb::primary_event &event_) const
 Draw. More...
 
void store_stats ()
 Saev the statistics record. More...
 
- Public Member Functions inherited from datatools::i_tree_dumpable
 i_tree_dumpable ()
 Constructor. More...
 
virtual ~i_tree_dumpable ()
 Destructor. More...
 
virtual void print_tree (std::ostream &out_=std::clog, const boost::property_tree::ptree &options_=empty_options()) const
 Main new interface method for printing. 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
 

Static Public Member Functions

static const std::string & killed_event_label ()
 Return the label for a killed event (not tracked at all) More...
 
static const std::string & truncated_event_label ()
 Return the label for a truncated event (some particles are not tracked) More...
 
static const std::string & normal_event_label ()
 Return the label for a normal event (all particles are tracked) More...
 
static const std::string & biased_event_status_key ()
 Return the property key for a normal event. More...
 
static const std::string & master_particle_flag ()
 Return the property flag to tag the master particle. More...
 
static const std::string & dont_track_this_particle_flag ()
 Return the property flag to skip the tracking of a particle. More...
 
- 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_)
 

Static Public Attributes

static const int DEFAULT_PARTICLE_RANK = 0
 
static const int INVALID_PARTICLE_RANK = -1
 
static const int ANY_PARTICLE_RANK = 0x7FFFFFFF
 

Protected Member Functions

void _set_default ()
 Set default attribute values. More...
 
void _make_candidate_particles (genbb::primary_event &, std::vector< genbb::primary_particle * > &) const
 Build the list of candidate primary particles. More...
 
bool _validate_particle_direction (const genbb::primary_particle &, const geomtools::vector_3d &) const
 Validate a particle with respect to its direction and the list of PoIs. More...
 

Detailed Description

Biasing algorithm used at primary event generation.

Member Typedef Documentation

◆ poi_dict_type

Dictionary of points of interest.

Member Enumeration Documentation

◆ bias_mode_type

Biasing modes.

Enumerator
BIAS_UNDEFINED 

Undefined bias.

BIAS_NONE 

No bias.

BIAS_ONLY_MASTER_PARTICLE 

Bias based on some criteria applied only to the master particle in the event.

BIAS_ALL_PARTICLES 

Bias based on some criteria applied to all candidate particles in the event.

BIAS_DEFAULT 

Default bias mode.

◆ biased_event_status

Status of a biased primary event.

Enumerator
BES_UNDEFINED 

Undefined status.

BES_NORMAL 

Normal status (event is preserved as is and tracked)

BES_TRUNCATED 

Normal status (event is preserved but some particles are not tracked)

BES_KILLED 

Event should be killed (not tracked at all)

Constructor & Destructor Documentation

◆ primary_event_bias()

mctools::biasing::primary_event_bias::primary_event_bias ( )

Default constructor.

◆ ~primary_event_bias()

virtual mctools::biasing::primary_event_bias::~primary_event_bias ( )
virtual

Destructor.

Member Function Documentation

◆ _make_candidate_particles()

void mctools::biasing::primary_event_bias::_make_candidate_particles ( genbb::primary_event ,
std::vector< genbb::primary_particle * > &   
) const
protected

Build the list of candidate primary particles.

◆ _set_default()

void mctools::biasing::primary_event_bias::_set_default ( )
protected

Set default attribute values.

◆ _validate_particle_direction()

bool mctools::biasing::primary_event_bias::_validate_particle_direction ( const genbb::primary_particle ,
const geomtools::vector_3d  
) const
protected

Validate a particle with respect to its direction and the list of PoIs.

◆ add_particle_by_label()

void mctools::biasing::primary_event_bias::add_particle_by_label ( const std::string &  )

Add the identifier of the master particle.

◆ add_particle_by_type()

void mctools::biasing::primary_event_bias::add_particle_by_type ( int  id_)

Add the identifier of the master particle.

◆ add_point_of_interest()

void mctools::biasing::primary_event_bias::add_point_of_interest ( const std::string &  poi_name_,
const point_of_interest poi_ 
)

Add a point of interest.

◆ biased_event_status_key()

static const std::string& mctools::biasing::primary_event_bias::biased_event_status_key ( )
static

Return the property key for a normal event.

◆ dont_track_this_particle_flag()

static const std::string& mctools::biasing::primary_event_bias::dont_track_this_particle_flag ( )
static

Return the property flag to skip the tracking of a particle.

◆ draw()

void mctools::biasing::primary_event_bias::draw ( const geomtools::vector_3d vertex_,
genbb::primary_event event_ 
) const

Draw.

◆ get_bias_mode()

bias_mode_type mctools::biasing::primary_event_bias::get_bias_mode ( ) const

Return the bias mode.

◆ get_logging()

datatools::logger::priority mctools::biasing::primary_event_bias::get_logging ( ) const

Return the logging priority threshold.

◆ get_mapping_name()

const std::string& mctools::biasing::primary_event_bias::get_mapping_name ( ) const

Return the mapping name.

◆ get_point_of_interest()

const poi_entry_type& mctools::biasing::primary_event_bias::get_point_of_interest ( const std::string &  poi_name_) const

Return a non mutable reference to a point of interest.

◆ get_stats()

const stat_record& mctools::biasing::primary_event_bias::get_stats ( ) const

Return the embedded statistics record.

◆ grab_point_of_interest()

poi_entry_type& mctools::biasing::primary_event_bias::grab_point_of_interest ( const std::string &  poi_name_)

Return a mutable reference to a point of interest.

◆ has_point_of_interest()

bool mctools::biasing::primary_event_bias::has_point_of_interest ( const std::string &  poi_name_) const

Check point of interest.

◆ has_stats_store()

bool mctools::biasing::primary_event_bias::has_stats_store ( ) const

Check if a store file is used to record statistics record.

◆ initialize()

void mctools::biasing::primary_event_bias::initialize ( const datatools::properties config_)

Initialization.

◆ initialize_simple()

void mctools::biasing::primary_event_bias::initialize_simple ( )

Initialization.

◆ is_initialized()

bool mctools::biasing::primary_event_bias::is_initialized ( ) const

Check initialization flag.

◆ is_using_all_particles()

bool mctools::biasing::primary_event_bias::is_using_all_particles ( ) const

Check mode for using all particles.

◆ is_using_master_particle()

bool mctools::biasing::primary_event_bias::is_using_master_particle ( ) const

Check mode for using a master particle.

◆ is_using_no_bias()

bool mctools::biasing::primary_event_bias::is_using_no_bias ( ) const

Check no bias mode.

◆ killed_event_label()

static const std::string& mctools::biasing::primary_event_bias::killed_event_label ( )
static

Return the label for a killed event (not tracked at all)

◆ master_particle_flag()

static const std::string& mctools::biasing::primary_event_bias::master_particle_flag ( )
static

Return the property flag to tag the master particle.

◆ normal_event_label()

static const std::string& mctools::biasing::primary_event_bias::normal_event_label ( )
static

Return the label for a normal event (all particles are tracked)

◆ process()

void mctools::biasing::primary_event_bias::process ( const geomtools::vector_3d vertex_,
genbb::primary_event event_,
biasing_info info_ 
)

Bias the primary event.

◆ reset()

void mctools::biasing::primary_event_bias::reset ( )

Reset.

◆ reset_stats()

void mctools::biasing::primary_event_bias::reset_stats ( )

Reset the embedded statistics record.

◆ set_bias_mode()

void mctools::biasing::primary_event_bias::set_bias_mode ( bias_mode_type  )

Set the bias mode.

◆ set_geometry_manager()

void mctools::biasing::primary_event_bias::set_geometry_manager ( const geomtools::manager )

Set the geometry manager.

◆ set_logging()

void mctools::biasing::primary_event_bias::set_logging ( datatools::logger::priority  )

Set the logging priority threshold.

◆ set_mapping_name()

void mctools::biasing::primary_event_bias::set_mapping_name ( const std::string &  )

Set the mapping name.

◆ set_master_particle_rank()

void mctools::biasing::primary_event_bias::set_master_particle_rank ( int  rank_)

Set the rank of the master particle.

◆ set_particle_maximum_energy()

void mctools::biasing::primary_event_bias::set_particle_maximum_energy ( double  kemax_)

Set the maximum kinetic energy of the master particle.

◆ set_particle_minimum_energy()

void mctools::biasing::primary_event_bias::set_particle_minimum_energy ( double  kemin_)

Set the minimum kinetic energy of the master particle.

◆ set_stats_store()

void mctools::biasing::primary_event_bias::set_stats_store ( const std::string &  )

Set the filename of a file used to record statistics record.

◆ set_total_maximum_energy()

void mctools::biasing::primary_event_bias::set_total_maximum_energy ( double  )

Set the total maximum kinetic energy.

◆ set_total_minimum_energy()

void mctools::biasing::primary_event_bias::set_total_minimum_energy ( double  )

Set the total minimum kinetic energy.

◆ set_track_only_master_particle()

void mctools::biasing::primary_event_bias::set_track_only_master_particle ( bool  )

Set the track only flag of the master particle.

◆ store_stats()

void mctools::biasing::primary_event_bias::store_stats ( )

Saev the statistics record.

◆ tree_dump()

virtual void mctools::biasing::primary_event_bias::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.

◆ truncated_event_label()

static const std::string& mctools::biasing::primary_event_bias::truncated_event_label ( )
static

Return the label for a truncated event (some particles are not tracked)

Member Data Documentation

◆ ANY_PARTICLE_RANK

const int mctools::biasing::primary_event_bias::ANY_PARTICLE_RANK = 0x7FFFFFFF
static

◆ DEFAULT_PARTICLE_RANK

const int mctools::biasing::primary_event_bias::DEFAULT_PARTICLE_RANK = 0
static

◆ INVALID_PARTICLE_RANK

const int mctools::biasing::primary_event_bias::INVALID_PARTICLE_RANK = -1
static

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