diff --git a/archived_notes/index.rst b/archived_notes/index.rst index d6d771b6f..3165b17b3 100644 --- a/archived_notes/index.rst +++ b/archived_notes/index.rst @@ -16,6 +16,7 @@ Version Release Date 3.4.2_ 2020-07-15 3.4.3_ 2020-07-23 3.4.4_ 2021-01-10 +3.5.0_ 2021-05-17 ======================= ============ .. _3.1.2: release_notes-3.1.2.rst @@ -26,3 +27,4 @@ Version Release Date .. _3.4.2: release_notes-3.4.2.rst .. _3.4.3: release_notes-3.4.3.rst .. _3.4.4: release_notes-3.4.4.rst +.. _3.5.0: release_notes-3.5.0.rst diff --git a/archived_notes/release_notes-3.5.0.rst b/archived_notes/release_notes-3.5.0.rst new file mode 100644 index 000000000..f6656045f --- /dev/null +++ b/archived_notes/release_notes-3.5.0.rst @@ -0,0 +1,107 @@ +============================= +Bayeux 3.5.0 Release Notes +============================= + +Bayeux 3.5.0 adds some new features as well as fixes for reported issues. + +For information on changes made in previous versions, please see +the `release notes archive`_. + +.. _`release notes archive` : archived_notes/index.rst + +.. contents: + +Requirements +============ + +Bayeux 3.5.0 requires Linux (recommended Ubuntu >=18.04 (preferred +20.04), CentOS >=7.5), or macOS 10. + + +Additions +========= + +* Add ``geomtools::plain_model`` class. +* Add ``geomtools::i_model::destroy`` and + ``geomtools::i_model::_at_destroy`` methods for possible cleaning + from within a specific model. +* Add load/store methods in ``geomtools::tessellated_solid`` class + (using a simple ASCII format, alternative to the STL import + features). +* Add + ``geomtools::model_with_internal_items_tools::init_internal_items`` + method to enable automatic setup of internal physical volumes + without using initialization through a ``datatools::properties`` + object (like in + ``geomtools::model_with_internal_items_tools::plug_internal_models``). +* Add ranking features in the datatools variant system. Some dedicated + auxiliary data are parsed from any CSV file used for large enumeration of + string values for an enumerated string variant parameter. A few levels of UI + ranking directives are available + (``rank=highlight|first|second|third|last``). The variant GUI now + provides a check box per variant registry panel to inhibit the + display of values of *secondary* interest in combo boxes (for string + parameters only). +* Add support for ``GNUPLOT_DRAWER_DEBUG`` environment variable for + debug print from the ``geomtools::gnuplot_drawer``. + + +Removals +========= + + +Changes +======= + +* Better support for model cleaning in ``geomtools::model_factory``. +* The interface of the ``geomtools::i_model`` abstract class has been + changed. + + - the ``geomtools::i_model::_at_construct`` protected method has a + simpler signature. It does not use the model name parameter anymore, + because it was unused and confusing. All model classes have been + updated to take into account this interface change. + - the ``geomtools::i_model::_at_destroy`` and + ``geomtools::i_model::destroy`` methods have been added to fullfil + some possible needs at destruction stage in some geometry models. +* The ``geomtools::simple_shaped_model`` class has been refactored for + a better management of some internals for the tube, polycone and + polyhedra shapes when using the *filled_by_envelope* mode. It is + now possible to define some envelope geometrical tolerance and + automatically generate an envelope with some margins along the main + axis of the shape (X, Y, Z, radial...), typically at submicrometer + scale in the geometry setup, to avoid rounding issues during + tracking of particle (Geant4). The envelope can be defined by + inflation (default) of the contained shape, or by deflation of the + contained shape. This experimental feature is rather tricky to use + so it will need to be checked in real situations in Geant4 + (Falaise). Not all shapes can be addressed safely through this mechanism due + to the simplicity of topological approach used to build the envelope + by inflation or deflation of the contained shape. + + New properties are thus available from the model configuration. By + default, none of these properties are defined and the envelope is + build with zero margin with respect to the contained shape (tube, + polycone or polyhedra) : + + .. code:: + + filled_mode : string = "by_envelope" + envelope.tolerance.r : real as length = 0.1 um # Radial distance + envelope.tolerance.x : real as length = 0.1 um # X-axis distance + envelope.tolerance.y : real as length = 0.1 um # Y-axis distance + envelope.tolerance.z : real as length = 0.1 um # Z-axis distance + envelope.tolerance.phi : real as angle = 0.1 degree # Longitude angular tolerance + envelope.tolerance.theta : real as angle = 0.1 degree # Colatitude angular tolerance + envelope.deflated : boolean = false # Envelope defined by an inflated version + # of the contained shape outer bounds (default) + .. + +Fixes +===== + +Bugs +==== + + +.. end diff --git a/cmake/BayeuxDependencies.cmake b/cmake/BayeuxDependencies.cmake index 283af4f2e..9a3886b1b 100644 --- a/cmake/BayeuxDependencies.cmake +++ b/cmake/BayeuxDependencies.cmake @@ -2,7 +2,7 @@ message( STATUS "[info] Define Bayeux dependencies") if(Bayeux_WITH_GENBB) - set(BAYEUX_BXDECAY0_MIN_VERSION "1.0.9") + set(BAYEUX_BXDECAY0_MIN_VERSION "1.1.0") find_package(BxDecay0 ${BAYEUX_BXDECAY0_MIN_VERSION} REQUIRED CONFIG) message(STATUS "Found BxDecay0 ${BxDecay0_VERSION}") message(STATUS " - BxDecay0 include dirs : '${BxDecay0_INCLUDE_DIRS}'") diff --git a/release_notes.rst b/release_notes.rst index f6656045f..eadfa2d6a 100644 --- a/release_notes.rst +++ b/release_notes.rst @@ -1,8 +1,8 @@ ============================= -Bayeux 3.5.0 Release Notes +Bayeux 3.5.1 Release Notes ============================= -Bayeux 3.5.0 adds some new features as well as fixes for reported issues. +Bayeux 3.5.1 adds some new features as well as fixes for reported issues. For information on changes made in previous versions, please see the `release notes archive`_. @@ -14,37 +14,13 @@ the `release notes archive`_. Requirements ============ -Bayeux 3.5.0 requires Linux (recommended Ubuntu >=18.04 (preferred -20.04), CentOS >=7.5), or macOS 10. - +* Bayeux 3.5.1 requires Linux (recommended Ubuntu >=18.04 (preferred + 20.04), CentOS >=7.5), or macOS 10. +* Bayeux 3.5.1 depends on BxDecay >=1.1.0. Additions ========= -* Add ``geomtools::plain_model`` class. -* Add ``geomtools::i_model::destroy`` and - ``geomtools::i_model::_at_destroy`` methods for possible cleaning - from within a specific model. -* Add load/store methods in ``geomtools::tessellated_solid`` class - (using a simple ASCII format, alternative to the STL import - features). -* Add - ``geomtools::model_with_internal_items_tools::init_internal_items`` - method to enable automatic setup of internal physical volumes - without using initialization through a ``datatools::properties`` - object (like in - ``geomtools::model_with_internal_items_tools::plug_internal_models``). -* Add ranking features in the datatools variant system. Some dedicated - auxiliary data are parsed from any CSV file used for large enumeration of - string values for an enumerated string variant parameter. A few levels of UI - ranking directives are available - (``rank=highlight|first|second|third|last``). The variant GUI now - provides a check box per variant registry panel to inhibit the - display of values of *secondary* interest in combo boxes (for string - parameters only). -* Add support for ``GNUPLOT_DRAWER_DEBUG`` environment variable for - debug print from the ``geomtools::gnuplot_drawer``. - Removals ========= @@ -52,53 +28,12 @@ Removals Changes ======= - -* Better support for model cleaning in ``geomtools::model_factory``. -* The interface of the ``geomtools::i_model`` abstract class has been - changed. - - - the ``geomtools::i_model::_at_construct`` protected method has a - simpler signature. It does not use the model name parameter anymore, - because it was unused and confusing. All model classes have been - updated to take into account this interface change. - - the ``geomtools::i_model::_at_destroy`` and - ``geomtools::i_model::destroy`` methods have been added to fullfil - some possible needs at destruction stage in some geometry models. -* The ``geomtools::simple_shaped_model`` class has been refactored for - a better management of some internals for the tube, polycone and - polyhedra shapes when using the *filled_by_envelope* mode. It is - now possible to define some envelope geometrical tolerance and - automatically generate an envelope with some margins along the main - axis of the shape (X, Y, Z, radial...), typically at submicrometer - scale in the geometry setup, to avoid rounding issues during - tracking of particle (Geant4). The envelope can be defined by - inflation (default) of the contained shape, or by deflation of the - contained shape. This experimental feature is rather tricky to use - so it will need to be checked in real situations in Geant4 - (Falaise). Not all shapes can be addressed safely through this mechanism due - to the simplicity of topological approach used to build the envelope - by inflation or deflation of the contained shape. - - New properties are thus available from the model configuration. By - default, none of these properties are defined and the envelope is - build with zero margin with respect to the contained shape (tube, - polycone or polyhedra) : - - .. code:: - - filled_mode : string = "by_envelope" - envelope.tolerance.r : real as length = 0.1 um # Radial distance - envelope.tolerance.x : real as length = 0.1 um # X-axis distance - envelope.tolerance.y : real as length = 0.1 um # Y-axis distance - envelope.tolerance.z : real as length = 0.1 um # Z-axis distance - envelope.tolerance.phi : real as angle = 0.1 degree # Longitude angular tolerance - envelope.tolerance.theta : real as angle = 0.1 degree # Colatitude angular tolerance - envelope.deflated : boolean = false # Envelope defined by an inflated version - # of the contained shape outer bounds (default) - .. Fixes ===== + +* Fix the ``genbb::time_slicer_generator`` class with respect to the + determination of particles' time (issue #58). Bugs ==== diff --git a/source/bxgenbb_help/include/genbb_help/time_slicer_generator.h b/source/bxgenbb_help/include/genbb_help/time_slicer_generator.h index 802acb133..c21085eff 100644 --- a/source/bxgenbb_help/include/genbb_help/time_slicer_generator.h +++ b/source/bxgenbb_help/include/genbb_help/time_slicer_generator.h @@ -23,7 +23,7 @@ * * Description: * - * A generator of GENBB-like event that use another generator and + * A generator of GENBB-like event that uses another generator and * clusterize primary particles in special time slices. * * History: @@ -51,9 +51,11 @@ namespace genbb { /// /// This generator uses the output primary event from another particle generator and classifies /// its primary particles in two sets of particles falling in subsequent time slices. + /// /// \code + /// Event #0 Event #1 /// primary event with many particles along time - /// ----[o--o-oo---o--o---------o-o----o-----------o-o--o--------o]----------------------> time + /// ----[o--o-oo---o--o---------o-o----o-----------o-o--o--------o]--------[-o-oo------o-/ /---> time /// \endcode /// /// The result consists in several primary event instances: @@ -62,10 +64,12 @@ namespace genbb { /// - particles with time in [time_cut,+infinity[ are dropped. /// /// \code - /// prompt particles delayed particles ignored particles - /// ----[o--o-oo---o--o---][----o-o----o------][---o-o--o--------o]----------------------> time + /// Event #0.0 Event #0.1 Event #1.0 + /// prompt particles delayed particles ignored particles prompt particles... + /// ----[o--o-oo---o--o---][----o-o----o------][---o-o--o--------o]--------[-o-oo------o-/ /---> time /// time_threshold time_cut /// \endcode + /// class time_slicer_generator : public i_genbb { @@ -155,7 +159,7 @@ namespace genbb { double _time_cut_; //!< Time cut above whom particles are ignored slice_mode_type _mode_ = SM_UNDEF; //!< Slicing mode bool _record_original_event_id_ = true; //!< Flag to record the original event ID in the auxiliaries - + // Working data: primary_event _buffer_event_; std::size_t _original_event_counter_ = 0; diff --git a/source/bxgenbb_help/src/time_slicer_generator.cc b/source/bxgenbb_help/src/time_slicer_generator.cc index bc09c22c0..59a9a601c 100644 --- a/source/bxgenbb_help/src/time_slicer_generator.cc +++ b/source/bxgenbb_help/src/time_slicer_generator.cc @@ -317,11 +317,16 @@ namespace genbb { } } } // end of particle loop - + + double ref_time = 0.0; + // We ignore event time information: + // if (working_event.has_time()) { + // ref_time = working_event.get_time(); + // } + + // Specific processing of the extracted prompt event: if (prompt_event.get_number_of_particles() > 0) { - if (working_event.has_time()) { - prompt_event.set_time(working_event.get_time()); - } + prompt_event.set_time(ref_time); // Force prompt event's time to zero if (working_event.has_vertex()) { prompt_event.set_vertex(working_event.get_vertex()); } @@ -333,11 +338,10 @@ namespace genbb { } } + // Specific processing of the extracted delayed event: if (delayed_event.get_number_of_particles() > 0) { - if (working_event.has_time()) { - delayed_event.set_time(working_event.get_time() - first_delayed_time); - } - delayed_event.shift_particles_time(-first_delayed_time); + delayed_event.set_time(ref_time); // Force delayed event's time to zero + delayed_event.shift_particles_time(-first_delayed_time); // Shift delayed particles if (working_event.has_vertex()) { delayed_event.set_vertex(working_event.get_vertex()); } @@ -348,13 +352,17 @@ namespace genbb { delayed_event.set_genbb_weight(working_event.get_genbb_weight()); } } + if (prompt_event.get_number_of_particles() > 0) { + // Deliver the prompt event: event_ = prompt_event; if (delayed_event.get_number_of_particles() > 0) { + // Save the delayed event in the buffered event: _buffer_event_ = delayed_event; } need_new_event = false; } else if (delayed_event.get_number_of_particles() > 0) { + // Deliver the delayed event: event_ = delayed_event; need_new_event = false; } diff --git a/source/bxmctools/src/g4/primary_generator.cc b/source/bxmctools/src/g4/primary_generator.cc index f4d475182..a505fd002 100644 --- a/source/bxmctools/src/g4/primary_generator.cc +++ b/source/bxmctools/src/g4/primary_generator.cc @@ -298,8 +298,6 @@ namespace mctools { // THIS IS NOW INVALIDATED: 2011-04-19 FM: moved these bits to 'event_action::BeginOfEventAction' : // Clear event data: // FIX BUG: 2011-05-10 FM+XG : DO CLEAR THE EVENT DATA MODEL HERE ! - // clog << "DEVEL: primary_generator::GeneratePrimaries: " - // << "Clear event data..." << endl; _event_action_->grab_event_data().clear(); _event_action_->set_aborted_event(false); _event_action_->set_killed_event(false); @@ -380,7 +378,6 @@ namespace mctools { if (mgr.using_time_stat()) { mgr.grab_CT_map()["EG"].stop(); } - // current_generated_event.set_time(0.0 * CLHEP::ns); // Default event reference time: double event_time = 0.0; @@ -417,7 +414,6 @@ namespace mctools { } // Should we check the validity of the primary event here ? - if (_event_action_->is_aborted_event()) { return; } @@ -692,7 +688,7 @@ namespace mctools { std::clog << tag2 << tag << "Geant4 name = " << g4_particle_name << std::endl; - std::clog << tag2 << tag << "Time = " + std::clog << tag2 << tag << "Time = " << _particle_gun_->GetParticleTime() / CLHEP::ns << " ns" << std::endl; std::clog << tag2 << tag << "Position = " << _current_vertex_ / CLHEP::mm << " mm" << std::endl; @@ -783,8 +779,7 @@ DOCD_CLASS_IMPLEMENT_LOAD_BEGIN(mctools::g4::primary_generator,ocd_) ocd_.set_class_library("mctools_g4"); // The class detailed documentation : - ocd_.set_class_documentation("This is Geant4 simulation engine embedded primary generator action. \n" - ); + ocd_.set_class_documentation("This is Geant4 simulation engine embedded primary generator action.\n"); { // Description of the 'logging.priority' configuration property :