# Example B2 History

See `CONTRIBUTING.rst` for details of **required** info/format for each entry,
which **must** added in reverse chronological order (newest at the top).
It must **not** be used as a substitute for writing good git commit messages!

-------------------------------------------------------------------------------

## 2024-01-22 Gabriele Cosmo (exampleB2-V11-02-00)
- Updated PrimaryGeneratorAction::GeneratePrimaries() in all B2 examples to
  avoid nonsense placing of the initial position on the world boundary.

## 2023-11-07 I. Hrivnacova (exampleB2-V11-01-03)
- Fixed and improved setting of G4VisAttribute
  - Do not create vis attributes with new (causing memory leak)
  - Use Geant4 predefined colours (for clarity)

## 2023-11-07 I. Hrivnacova (exampleB2-V11-01-02)
- Removed unsused and unimplemented method declaration
  PrimaryGeneratorAction::SetRandomFlag

## 2023-11-03 I. Hrivnacova (exampleB2-V11-01-01)
- Applied auto in main where suitable and not done by clang-tidy
- Minor formatting changes

## 2023-09-06 John Allison (exampleB2-V11-01-00)
- For the new flexible run-time graphics system options:
- B2a and B2b:
  - main programs:
    - Use constructor with arguments: new G4VisExecutive(argc, argv).
  - EventAction.cc, TrackerSD.cc:
    - Change G4int to std::size_t to eliminate precision loss warnings.
- vis.mac in B2a/, B2b/ and macros/:
    - Change "/vis/open OGL 600x600-0+0" to "/vis/open" to allow run-time choices.

## 2022-05-20 I. Hrivnacova (exampleB2-V11-00-01)
- Restore the top UI commands directory name ("B2") in B2a::DetectorMessenger
  removed by mistake in exampleB2-V10-07-02
  (https://github.com/Geant4/geant4/pull/46)

## 2021-12-10 Ben Morgan (exampleB2-V11-00-00)
- Change to new Markdown History format

---

# History entries prior to 11.0

13-07-21 I. Hrivnacova (exampleB2-V10-07-02)
- Introduced namespace instead of a class names prefix
- Declare overriding functions 'override' (and removed 'virtual' keyword)

31-05-21 I. Hrivnacova (exampleB2-V10-07-01)
- Use nullptr instead of 0, NULL
- Clean trailing whitespaces from all files

30-05-21 M.Maire (exampleB2-V10-07-00)
- exampleB2a,b.cc: use G4SteppingVerboseWithUnits

02/11/20 B.Morgan (exampleB2-V10-06-02)
- Support same CMake version range as core Geant4

30/06/20 G. Cosmo (exampleB2-V10-06-01)
- Migrated examples to use G4RunManagerFactory, therefore implicitly enabling
  tasking by default in MT builds.

13/02/20 I. Hrivnacova  (exampleB2-V10-06-00)
- Updated READMEs and added a comment in B2PrimaryGeneratorAction
  that starting a primary particle on the world boundary
  requires shooting in a direction towards inside the world

21/11/19 G. Cosmo (exampleB2-V10-05-00)
- Use default MixMax random engine.

13/03/18 I. Hrivnacova  (exampleB2-V10-04-00)
- Modified exampleB2.in test to reduce the output

19/11/16 A. Dotti   (exampleB2-V10-02-01)
- explitic set of SD to manager

01/11/16 L. Garnier (exampleB2-V10-02-00)
- Remove icons.mac. Automatically include since interfaces-V10-02-07

29/11/14 I. Hrivnacova
- Use G4endl instead of \n in G4cout;
  this makes each new line in the output on threads preceded with
  G4WTN >

06/11/14 I. Hrivnacova
- Finalized modifications in previous tags (02, 03):
  - Removed G4UI_USE/G4VIS_USE tests and init.mac macro (not needed)
  - Moved G4UIExecutive at the beginning of main() in all examples
  - Perform run initialization in macros instead of main()

31/10/14 L. Garnier (exampleB2-V10-00-02 - exampleB2-V10-00-03)
 exampleB2b :
  - Fix a warning (perhaps a crash)
  - Fix a warning "'ui' may be used uninitialized in this function"

31/10/14 L. Garnier (exampleB2-V10-00-01)
 exampleB2a/exampleB2b :
  - Remove old G4UI_USE/G4VIS_USE
  - Move G4UIExecutive at the beginning of main()

02 December 2013 Ivana Hrivnacova
- Fixed gui.mac:
  corrected wireframe parameter, removed run2.mac from gui

30/11/13 I. Hrivnacova
- Fixed B2a/gui.mac

28/11/13 I. Hrivnacova (exampleB2-V09-06-12)
- Clean-up macros (fixed B2a/gui.mac, removed obsolete comments)

26/11/13 I. Hrivnacova (exampleB2-V09-06-11)
- Fixed deleting fMagFieldMessenger with use of G4AutoDelete utility

12/11/13 I. Hrivnacova (exampleB2-V09-06-10)
- Avoid long lines

29/10/13 I. Hrivnacova (exampleB2-V09-06-09)
- Using G4RunManager::SetPrintProgress()
- Removed SetNumberOfThreads(4) from main (use Geant4 default)
- Fixed deleting fMagFieldMessenger in DetectorConstruction
- Updated README

10/09/13 I. Hrivnacova (exampleB2-V09-06-08)
- Removed "tcsh" selection from G4UIExecutive in exampleB2b.cc
  (unwantedly introduced with previous update)

04/09/13 I. Hrivnacova (exampleB2-V09-06-07)
- Magnetic field classes (B2MagneticField, B2FieldMessenger) replaced
  with use of new G4GlobalMagFieldMessenger class.

27/08/13 G.Cosmo (exampleB2-V09-06-06)
- Added G4Ellipsoid among solids enabled for parameterisation in B2b.

14/08/13 P. Gumplinger (exampleB2-V09-06-05)
- Removed static comment in B2MagneticField.hh for GetGlobalFieldManager.

26/06/13 G. Cosmo (exampleB2-V09-06-04)
- Fixed use of G4Random instead of HepRandom in B2b.

04/06/13 I. Hrivnacova (exampleB2-V09-06-03)
- Fixed reference to B2ActionInitialization in README and .README

04/06/13 P. Gumplinger (exampleB2-V09-06-02)
- add section about ACTION INITALIZATION to README and .README

10/05/13 I. Hrivnacova (exampleB2-V09-06-01)
- Minor fixes in documentation
- Added initialization of base class in constructors where missing

09/05/13 M. Asai
- Migration to multi-threading

28/02/13 I. Hrivnacova
- When building materials with NistManager
  do not set fromIsotopes argument (which was set to false),
  as since 9.6 all materials have to be built from isotopes.
  Thanks to V. Ivantchenko for pointing at this.

02/02/13 V.Ivanchenko (exampleB2-V09-06-00)
- Renamed G4StepLimiterBuilder by G4StepLimiterPhysics
- minor fix of GNUmakefile

18/09/12 I. Hrivnacova
- Updated vis.mac (on suggestions by John Al.):
  - Activating drawing hits in vis.mac macros
  - Increased hit screen size (from 2 to 4)
  - In TrackerSD: removing obsolete line with
  //newHit->Draw();
- General changes (see basic/History)

15/11/11 I. Hrivnacova
- Migration to new G4Exception in B2aDetectorConstruction.cc
  and B2bChamberParameterisation.cc.

14/11/11 I. Hrivnacova
- The first tagged version of the new B2 example created from N02
  example by P. Gumplinger (tagged in basic).
  Started from novice/N03.

05-07-11 gum
migrate to new novice example code guidelines

03-06-11 mma (exampleN02-V09-04-02)
PhysicsList migrated to new scheme G4PhysListHelper

10-02-11 mma (exampleN02-V09-04-01)
- update SteppingVerbose

01-02-11 mma (exampleN02-V09-04-00)
- /vis/modeling/trajectories/drawByCharge-0/default/setStepPtsSize 1

04-06-10 J.Perl (exampleN02-V09-03-01)
- Updated vis usage

22-01-10 mma (exampleN02-V09-03-00)
- DetectorConstruction::SetMagField() : fpMagField->SetMagFieldValue()

15-11-09 mma (exampleN02-V09-02-01)
- Use G4MuMultipleScattering for muons
- Separate alpha from GenericIon

30 October 2009 John Allison (exampleN02-V09-02-00)
- Introduced G4UIExecutive.

17-12-08 mma
- vis.mac : /vis/scene/add/trajectories smooth

31-10-08 mma (exampleN02-V09-01-04)
- Use G4hMultipleScattering for muons and protons

26-10-08 mma (exampleN02-V09-01-03)
- Update PhysicsList for proton and ions

22-09-08 mma (exampleN02-V09-01-02)
- PhysicsList : AddStepMax() for G4StepLimiter
- DetectorConstruction : SetMaxStep(value)
- DetectorMessenger : /N02/det/stepMax

07-05-08 J.Allison (exampleN02-V09-01-01)
- Protected "/control/execute vis.mac" with G4VIS_USE flag.

03-05-08 mma (exampleN02-V09-01-00)
- PhysicsList : replace G4MultipleScattering by G4eMultipleScattering

17-10-07 G.Cosmo (exampleN02-V09-00-02)
- Explicitely delete allocated parameterisation and step-limit objects
  in ExN02DetectorConstruction class.

22-08-07 G.Cosmo (exampleN02-V09-00-01)
- Fixed implementation of ExN02MagneticField class in way field is set...

25-06-07 M.Maire (exampleN02-V08-03-01, exampleN02-V09-00-00)
- Cosmetics in main().

11-05-07 G.Cosmo (exampleN02-V08-03-00)
- Show usage of G4GeometryTolerance tuned for the geometry topology.

12-12-06 G.Cosmo (exampleN02-V08-01-01)
- Commented out drawing of hits in vis.mac.

06-11-06 J.Allison (exampleN02-V08-01-00)
- Improved vis.mac to vis best practice.

16-06-06 G.Cosmo (exampleN02-V08-00-03)
- Use coherent allocation scheme for user-classes and
  initialisation in main().

15-06-06 G.Cosmo (exampleN02-V08-00-02)
- Separate instantiation of the user-stepping-verbose class from
  initialisation of the G4VSteppingVerbose singleton.

02-06-06 mma (exampleN02-V08-00-01)
- ExN02TrackerSD.cc: replace Touchable by TouchableHandle

31-03-06 mma (exampleN02-V08-00-00)
- Add a sentence in README for G4UserLimits and G4StepLimiter.

01-06-05 J.Allison  (exampleN02-V07-00-03)
- ExN02TrackerHit.cc: Changed screen size to 2 pixels.

31-05-05 mma (exampleN02-V07-00-02)
- G4UserLimits + G4StepLimiter become uncommented

30-05-05  J.Allison  (exampleN02-V07-00-01)
- Completed replacement of vis manager with G4VisExecutive.

3rd May 2005 J.Allison  (examples-V07-00-03)
- Replaced vis manager with G4VisExecutive.

28-01-05 mma (exampleN02-V07-00-00)
- PhysicsList: add G4StepLimiter (in a commented line)

16-09-04 mma (exampleN02-V06-02-01)
- DetectorConstruction: modify a comment in PVPlacement. // copy number

08-09-04 J.Allison (exampleN02-V06-02-00)
- Removed trajectory printing from ExN02EventAction - now available
  with /vis/scene/add/trajectories, which is now included in vis.mac.

05-04-04 mma (exampleN02-V06-01-00)
- ExN02DetectorConstruction: correct definition of XenonGas

19-03-04 mma (exampleN02-V06-00-01)
- ExN02PhysicsList: cleanup of include

08-03-04 mma (exampleN02-V06-00-00)
- ExN02RunAction: removed ApplyCommand("/vis/...") statements.

10-11-03 G.Cosmo (exampleN02-V05-02-03)
- Removed OPACS driver from vis-manager.
- Cleared warnings for parameterised detectors.

30-10-03 G.Cosmo (exampleN02-V05-02-02)
- Cleared compilation warnings due to new class G4Orb.

24-10-03 mma (exampleN02-V05-02-01)
- PhysicsList: AddProcess(Bremsstrahlung,-1,3,3) ..etc..

06-10-03 mma (exampleN02-V05-02-00)
- cosmetic cleanup in material definitions

28-05-03 G.Cosmo (exampleN02-V05-01-00)
- Get rid of pedantic warnings...

25-03-03 mma (exampleN02-V05-00-02)
- Use G4PVPlacement and G4PVParametrised constructors in logical mother.

11-02-03 mma (exampleN02-V05-00-00)
- a blank in SteppingVerbose

27-11-01 mma (exampleN02-V03-02-04)
- vis.mac: /vis/viewer/set/viewpointThetaPhi

19-11-01 J.Allison (exampleN02-V03-02-03)
- Updated ExN02VisManager.cc for new graphics systems and defaults.

07-11-01 S.Tanaka (exampleN02-V03-02-02)
- vis.mac: /vis/viewer/refresh + /vis/viewer/update is replaced
  with their equivalent command /vis/viewer/flush.

24-10-01 mma (exampleN02-V03-02-01)
- initInter.mac renamed vis.mac

19-10-01 S.O'Neale (examples-V03-02-00)
- Update reference output

11-10-01 mma (exampleN02-V03-02-00)
- adapted to new visualisation commands (initInter and EventAction)
- 80 columns max everywhere

12-07-01 mma
- DetectorMessenger: setField, help: magnetic field in X dirction

20-02-01 S.O'Neale (exampleN02-V03-00-03) update reference outputs following
   materials-V03-00-04 (tagset 268)

09-02-01 M.Asai (exampleN02-V03-00-02)
- Migration to STL vector classes
 affected file : ExN02SteppingVerbose.cc

31-02-05 S.O'Neale (exampleN02-V03-00-01)
- update reference output for Batch Mode system testing for
  exampleN02-V03-00-00 and recent EM Physics tags.

31-01-01 G.Cosmo (exampleN02-V03-00-00)
- fix to ExN02ChamberParameterisation and ExN02DetectorConstruction
  to cope with bug report #186. Parameterisation of chambers was not
  taking into account that copyNo starts from 0, therefore dimensions
  of the first chamber (parametrised G4Box) were set to negative values (!).
  This was causing the side-effect of visualising a "ghost" chamber (the
  first one close to the target), which was correctly not seen by tracking.
  Therefore, number of chambers is now reduced to 5 but global positioning
  and parameters have been preserved.

06-12-00 S.O'Neale (exampleN02-V02-00-03)
- update reference output for Batch Mode system testing
  in this context 0 trajectories stored is normal.

03-12-00 M.Maire (exampleN02-V02-00-02)
- README updated
- prerun.g4mac updated for new vis commands, and renamed initInter.mac
- new examples of macro: run1.mac, ruN2.mac
- G4UItcsh in the main, under the control of G4UI_USE_TCSH (for Linux)
- visualisation on interactive mode
- DetectorConstruction: tracker region in the centre of the world.
  default target material: Pb, chamber material: Xenon
- interactive commands to change the materials and to setup a magnetic field
- the magnetic field is transverse to the beam (i.e. along x)
- PhysicsList: copy of N03. defaultCut = 1 cm
- PrimaryGenerator: default momentum direction corrected: along z.
  Suppress the possibility of random impact and the associated messenger.
- RunAction and EventAction updated for vis commands
- SteppingAction: cleanup because no specific actions
- SteppingVerbose: see README
- TrackerHit: a Hit = 4 informations: trackID, chamberNb, edep, position.
  Draw and Print
- TrackerSD: ProcessHits.
  Print HitsCollection at end of event

25th November 2000 Steve O'Neale (tagset210)
- Update test outputs for min.delta energy cut
- Update test outputs for emlowen-V02-00-22 and stand,muon,xray,utils.

Nov 09, 2000  V.Grichine     (exampleN02-V02-00-00)
- Fix in ExN02MagneticField constructors: added call to SetDetectorField()
  to activate user-defined magnetic-field.
- Updated exampleN02.out.

June 24, 2000  John Allison  (exampleN02-V01-01-03)
- Updated exampleN02.out for stand-V01-01-05 and utils-V01-01-03.

June 17, 2000  John Allison  (exampleN02-V01-01-02)
- Updated exampleN02.out for exampleN02-V01-01-01.

June 19, 2000  G.Cosmo  (exampleN02-V01-01-01)
- Fixed length of detector box to include tracker in ExN02DetectorConstruction.
- Cosmetic changes to comments.

June 17, 2000  John Allison  (exampleN02-V01-01-00)
- Updated exampleN02.out for geant4-01-01-ref-06.

25-02-00 H.Kurashige
- removed RhoZeroDefinition from PhysicsList

15-11-99 M.Maire
- example of user SteppingVerbose class: verbose with units

16th April 1999 H.Kurashige
- modify ExN02SteppingAction::UserSteppingAction
- modify ExN02PhysicsList::SetCuts

 4th December 1998 John Apostolakis

- corrected the Magnetic Field  SetField methods
- cosmetic change to the name of a volume (chamber), as it was too long.

12th Sptember 1998 Michel Maire
- removed the function SetEmProcess() ( contained cin)
  and the class ExN02PhysicsListMessenger

    Interchanged N02 and N03.

9th August 1998  John Allison
- Removed trackerChamber_logVisAtt->SetForceWireframe(true);
- Removed G4_SOLVE_TEMPLATES macros (now done in architecture.gmk).
- Change G4UIterminal to G4UIGAG.

16th July 1998  John Allison
- Changed /vis~/Draw... to /vis~/draw.

9th July 1998  John Allison
- Added G4VIS_USE_DAWNFILE and G4VIS_USE_OPENGLWIN32 to ExN03VisManager.cc.

8th July 1998  G.Cosmo
- Protected visualization code with G4VIS_USE.

6th July 1998  John Allison
- Simplified ExN03VisManager.

June 29 , 98 H.Kurashige
- Modified ExN03PhysicsList.

May   15, 98 G. Cosmo

- Added #ifdef protection to ExN03MagneticField.hh. Header now
  included explicitly in ExN03DetectorConstruction.hh. Example now
  links.

May   07, 98 J. Apostolakis

- Created Physical Volume Parameterisation for Tracker Chambers.
- Copied from example6:
       MyTrackerHit into ExN03TrackerHit

May   05, 98 J. Apostolakis

- Changed the geometry in DetectorConstruction.
- Created the Magnetic Field

May   01, 98 J. Apostolakis

- Files created by copying from exampleEmPhys2, renaming the files
    and the classes within them, changing the string "My" into

- Major changes made:
  * Event action: deleted energy counting.


April 09, 98 G. Cosmo

- Created.
