******************************************************************************
****** CHANGE LOG ****** CHANGE LOG ****** CHANGE LOG ****** CHANGE LOG ******
******************************************************************************






Version 3.01/3.02
=================

General:
+ setup: HEASoft can now be compiled as optional package
+ setup: New script configure_macport to setup macport before compiling 
         ROOT/Geant4/MEGAlib on macOS Catalina
+ dmegalib: New dmegalib-setup, which needs to be run before the distributed
            analysis can be used

Fretalon:
+ Changes to the API to run Melinator in a python script 
            
Mimrec:
+ New option in the event selector to choose the detector of the 2nd interaction
+ New tool to convert the tra file into a COSI Level 3 fits file and back

Examples:
+ AllSky: How to simulate all-sky images
+ Cross-section plotter

Long-term bugs fixed:
+ Sivan: There was a uncommon programatic path using clusters and discretization, 
         which could have lead to double noising 
 



Version 2.99/3.00
=================

*** IMPORTANT - PLEASE READ:

+ Switch to GPL v3 license
+ Big update to revan and mimrec to allow triple-compton PET reconstruction 
  requiring significant internal changes (v2.99.10)
+ Default ROOT version is now 6.18, default Geant4 version is 10.2
 

*** KNOWN ISSUES
+ The performance of activation simulations is still not the best...
  
  
*** Significant new features & improvements:

General:
+ Python bindings! Check out resource/examples/python for a few examples on how
  to use MEGAlib in Python (v2.99.09)
+ Setup script now has an option to keep MEGAlib un-updated
+ Fixed many multi-threading bugs
+ Added old and new neural network interface
+ Official MEGAlib docker container 
+ Removed old Visual Studio projects since MEGAlib can now be run in a
  container and on Linux on Windows
+ Dropped svn & cvs support in the setup script
+ Added benchmark in resource/examples/Benchmark

Cosima:
+ Support for Geant4 10.2
+ Option to simulate event list (including advanced example)
+ Lightcurve simulations
+ Orientations
+ Istropic emission as short cut for FarFieldAreaSource from 4 pi (v.2.99.12)
+ StoreMinimumEnergy: Store only events which deposited at least this
  amount of energy
+ Improved dcosima distributed simulation
+ Replaced "StoreOnlyTriggeredEvents" with "PreTriggerMode" using 3 modes:
  Full, EveryEventWithHits & Everything
+ Updated all examples
+ In the documentation, the break energy of the Band function was 
  accidentially called peak energy (formula was correct)


Sivan:
+ Enabled comments (and their passing through) in the sim file ("CC" tag)

Fretalon:
+ Many smaller enhancements triggered by COSI analysis
+ Detection enhancements in Melinator

Geomega:
+ New option to show the surrounding sphere (ShowSurroundingsphere true)
  This will only be displayed in geomega, but does not show up in any
  other program
+ Fixed the PEEK elemental composition to 19C12H3O from 5C8H2O
+ Dropped support for Geant3/MGeant
+ Internal rewrite of the guard ring interface: 
  - Guard rings are now their own detector type
  - You need to give 2 energy resolution data point as in all other detectors
  - Updated all examples accordingly
+ New trigger mode: TriggerMap. This mode allows much more complex trigger,
  e.g. tracks in the tracker, non-vetoable triggers for long tracks, etc.
  
Reponse:
+ New base class for all responses
+ Many improvements for COSI analysis
+ TMVA data set creation and training of machine learning codes
+ Distributed response simulation with dresponsecreator
+ TMVA mode for identifying multiple gamma-ray from single event (v2.99.10)
  
Revan:
+ Enabled comments (and their passing through) in the tra file ("CC" tag)
+ Added TMVA Compton sequence reconstruction (e.g. boosted decision trees, neural networks)
+ Event clustering allows identifying multiple gamma-ray events
+ Significant internal changes to reconstruct multiple gamma rays from one event (v2.99.10)

Mimrec:
+ Enabled comments (and their passing through) in the tra file ("CC" tag)
+ Parallelization of image deconvolution
+ New imaging response modes
+ Support for binned imaging
+ Support for PET and multi-gamma-ray events (v2.99.10)


Realta:

Spectralizer:

Addons:
+ SensitivityOptimizer: The power law index input has now the same sign as
  in cosima, it's the Gamma, i.e. the positive one (e.g. Crab has +2.19)

Examples:
+ The EventList example demonstrates the use of event list during simulation
  basically allowing any arbitrary beam/spectrum/polarization input
+ GRB sampling based on BATSE catalog

  
... plus many, many smaller things I already forgot about :)


Long-term bugs fixed:
+ Cosima: AngerCamera in XYZ mode: Z axis was discretized as in XY mode 
+ Cosima: Voxel3D: The Y offset was used as Z offset during simulations
+ Cosima: In DecayMode buildup (the one used for hadron therapy, 
  not astrophysics) the DetectorDecayConstant was ignored
+ Geomega: Sphere: The random position generation wasn't really random
+ Revan: Reported by Alexey: Some events were incorrectly rejected in the classic
  event reconstruction approach

Important regressions fixed:
+ Between 4/26/2018 & 5/15/2018 the sim file reader skipped each second event...
  

******************************************************************************




Version 2.29/2.30
=================

*** IMPORTANT - PLEASE READ:

+ El Capitan / Xcode 7.x users: Run the setup script with the additional option
  --patch=yes to apply a set of necessary patches to ROOT and Geant4
+ Exchanged the (slow) ROOT rotations (TMatrix*) in Geomega with new
  MRotation class
  --> If something seems wrong with your rotations email me
+ Partial rewrite of the MEGAlib file I/O classes to enable transparent 
  handling of gzip'ed files
  --> Since I had to modify the whole I/O chain (including the interfaces), 
      email me if there are any problems reading or writing files
+ First beta version of calibration framework Fretalon with Melinator line 
  calibrator
+ Exchange of the ROOT geometry backend (switch to the TGeo* classes)
  --> Since this switch required significant changes in Geomega, please verify
      your geometries
+ The MEGAlib default materials have been changed to the new format
  ("XYZ.ComponentByAtoms Si 1") which is based on natural isotope distributions
  in Geant4. Thus the cross sections changed slightly.
+ A compiler with C++11 support is now required - all current Mac and Linux
  compiler should do, e.g. g++ 4.8 and higher and Apple compiler 6.0
  and higher. 
+ ROOT is now built using cmake instead of its older, error prone configure
  script
 

*** KNOWN ISSUES
+ The performance of activation simulations is currently not the best...
  
  
*** Significant new features & improvements:

General:
+ Added automatic patch system to the build system
+ A compiler with C++11 support is now required - all current Mac and Linux
  compiler should do, e.g. g++ 4.8 and higher and Apple compiler 6.0
  and higher. The setup script will test for the compiler.
+ Capability to change font size for Retina displays
+ Capability to read and write gzip'ed files via zlib library
+ MTimer is now thread reentrant
+ Gnuzillion antique memory leaks fixed
+ New mvalgrind frontend for simplified memory issue debugging
+ ROOT is now built using cmake instead of its older, error prone configure
  script

Cosima:
+ Support for Geant4 10.0 (enables meta-stable states, but multi-threading 
  is not yet supported)
+ Support for Geant4 10.1 --- however, you have to add "101" manually to the 
  file config/AllowedGeant4Versions.txt since it has worse performance than 
  10.0
+ For improved activation simulations (and only those!) there are patches
  for Geant4 10.00.p04 and 10.01.p01 in resource/patches
+ New hadron physics list FTFP_BERT_HP
+ Restricted line source
+ dcosima - distributed simulations on multiple machines (see cosima manual for
  instructions)

Sivan:
+ Show start locations

Fretalon:
+ First alpha version of calibration framework
+ First alpha version of Melinator - the MEGAlib line calibrator

Geomega:
+ Switch to ROOT's newer TGeo* geometry front end
+ Addition of boolean shapes generated via intersection, union, and subtraction
+ Exchanged the (slow) ROOT rotations (TMatrix*) in Geomega with new MRotation 
  class
+ The MEGAlib default materials have been changed to the new format
  ("XYZ.ComponentByAtoms Si 1") which is based on natural isotope distributions
  in Geant4. Thus the cross sections changed slightly. You also get a warning now
  when you use the old format.
  
Reponse:
+ Improved binned Compton imaging response creation
  
Revan:
+ New multi-purpose spectral generator

Mimrec:

Realta:

Spectralizer:

Examples:
+ The Max.geo.setup examples has been modified to illustrate the use of the 
  new boolean shapes

... plus many, many smaller things I already forgot about :)


*** Important bug fixes:
+ Various...




******************************************************************************


Version 2.27/2.28
=================

*** Important:
+ Compatibility with Geant4 9.6: Unit tests have revealed subtle differences
  They are not big enough to raise concerns, but just don't mix 9.5 & 9.6 sims
+ If you have detectors which only do vetoes, it is now required to set the
  "NoiseThresholdEqualsTriggerThreshold true" flag
+ If you do electron tracking it is now required to set the detectors in which 
  the electron tracking is performed
  
*** Significant new features & improvements:

General:
+ New MEGAlib icon!
+ Improved automated setup and more compiler options (e.g. clang support)
+ Coincidence window passthrough from revan to mimrec

Cosima:
+ Performance improvements: Only load materials which are really used, etc.
  Significant (0..90%) speed up of load times, especially in hadronics case,
  and roughly 8% overall performance improvement
+ Compatibility with Geant 9.6
+ New unit test for cosima

Sivan:

Geomega:
+ Veto-only detectors require the flag "NoiseThresholdEqualsTriggerThreshold 
  true" to be set

Revan:
+ New option requires the detector in which electron tracking is perfromed to be
  set
+ A long standing limitation not allowing "Scintillator/ACS/Simple" detectors
  for event reconstruction has been eliminated

Mimrec:

Realta:

Spectralizer:

Examples:
+ Improved TGRS example

... plus many, many smaller things I already forgot about :)


*** Important bug fixes:




******************************************************************************



Version 2.25/2.26
=================

*** Important:

THIS VERSION CONTAINS SIGNIFICANT CHANGES TO ONE OF THE CORE COMPONENTS OF
MEGALIB. AS CONSEQUENCE, THIS VERSION IS MORE EXPERIMENTAL AS USUAL!

+ Test if your detector effect engine still works!
  For the introduction of named detectors a partial redesign of the detector
  effects engine was necessary.
+ Check if you still use the Compton reponse, which you want to use, in the 
  mimrec UI, since a new (actually an old) one was re-added.

  
*** Significant new features & improvements:

General:
+ New website: megalibtoolkit.com
+ New public repository: https://github.com/zoglauer/megalib
+ One step setup script for MEGAlib
+ Added installation scripts for ROOT, Geant4 (9.5 and higher), and HEAsoft.
  They can be found in the config directory, e.g. build-root.sh
+ Improved configuration script: "./configure" should be all you need to do
+ The change log and license are now displayed when one of the GUI tools.
  This adds a new configuration file called .megalib.cfg storing hashes
  of both files.

Cosima:
+ Compatibility with 9.5, dropped compatibility with 9.3
+ Updated hadronic physics-lists 

Sivan:

Geomega:
+ The preferred way to define components of materials is now via
  MyMaterial.ComponentBy[Atoms/Mass] Cs 1
  This way Geant4 can give the correct atomic mass and isotope composition 
  from its data bases.
  This definition is expected for activation simulations, where cross-sections
  per isotope are present
+ Named detectors: It is now possible to derive named detectors from normal
  detectors, which inhert all their properties except those explictly overwritten
  by the named detector. This allows to give detectors consisting of identical
  volumes different detector characteristics such as energy resolution

Revan:

Mimrec:
+ The response which caluclated the width of the Compton cones from uncertainties
  has been reintroduced. Check if you still use the Compton reponse, which you 
  want to use, in the mimrec UI

Realta:

Spectralizer:

Examples:
+ DetectorEffectEngine: Show all options of the detector effects engine and
  serves as unit test
+ Hadron therapy example
+ Graded Z-example

... plus many, many smaller things I already forgot about :)


*** Important bug fixes:




******************************************************************************



Version 2.23/2.24
=================

*** Important:

+ If no depth resolution was present, the depth resolution in the calorimeters
  was ideal instead of centered in the voxel
  This bug was there for a long time...


*** Significant new features & improvements:

General:
+ Changes throughout MEGAlib to enable multi-threading
+ Replacement of TString with new thread-safe MString class
+ Redesign of GuiData/Setting-classes to allow reuse in different projects
+ There are a set of advanced examples in resource/examples/advanced
+ Improved support for Windows

Cosima:
+ Updates for Geant4 9.4 (this is now the requirement) 
+ New beam: FarFieldNormalizedEnergyBeamFlux combination

Sivan:
+ New plot: Incidence vs measured energy
+ New plot: Energy loss by material

Revan:
+ Significant improvements in the interface to use Revan as a library

Mimrec:
+ Significant improvements in the interface to use Mimrec as a library
+ Absorptions are working correctly again in combination with Comption
  mode to allow Compton+coded imaging

Realta:
+ Complete reimplementation:
  Allow real time analysis of Compton events

Spectralizer:
+ Initial version of a spectral analysis package by Michelle!

... plus many, many smaller things I already forgot about :)


*** Important bug fixes:

+ If no depth resolution was present, the depth resolution in the calorimeters
  was ideal instead of centered in the voxel
  This bug was there a long time...



******************************************************************************



Version 2.21/2.22
=================

*** Important:

+ From now on uneven minor releases are development versions, even ones are 
  releases (similar to ROOT)
+ Mark Kippen dropped his G4LECS support, thus Geant4 9.2 is required
+ There was a problem when you have copies of scintillator detectors with 
  multiple sensitive volumes resulting in hits not always being put into the same
  detector. This resulted in a complex fix with several restrictions when you
  can use multiple sensitive volumes in one scintillator detector.
+ Mimrec has been partly rewritten - perform tests if everything still works
+ Partial Windows support means changes in many classes
+ Cosima now uses the trigger criteria from Geomega - check if your triggers
  are still OK


*** New features & improvements:

General:
+ Partial support for Windows
+ Changes in MGUIMain
+ New configuration option --optimizehard
+ Configuration: Check for additional programs: doxygen, expect, convert
+ Update check implemented
+ make update now (1) updates (2) reconfigures (3) compiles

Geomega:
+ Added new system object with the characteristic to noise the event time.
+ Under certain circumstances the IsDetector characteristics was wrong and 
  thus the volume sequence (but this always resulted in error messages)

Cosima:
+ Mark Kippen dropped his G4LECS supported, thus Geant4 9.2 is required and
  the G4LECS part of Cosima is removed
+ Prevent against negative energies during application of energy loss map
+ Cosima now uses the trigger criteria from Geomega
+ Added a black absorber

Sivan:
+ None

Revan:
+ Added option for coincidence search
+ Added option for exporting the spectrum as ASCII
+ Experimental new version of CSR with ToF and energy recovery from 
  Vincent Tatischeff and Clarisse Hamadache
+ Significant change in the interfaces to allow processing in external pipeline

Mimrec:
+ Improved GUI
+ Speed improvements (switch between Fast & accurate maths, slow and fast 
  tra file parsing)
+ Code clean up - several antique classes have been removed
+ Improved options for image display
+ HX & HZ keywords for detector orientation in horizon coordiante system:
  This coordinate system is used for Earth horizon cuts
+ Source selection works now also in galactic coordinates
+ Possibility to record animations of the ietartion/backprojection 
  process as animated gif's
+ Significant change in the interfaces to allow processing in external pipeline


*** Important bug fixes:

+ There was a problem when you have copies of scintillator detectors with 
  multiple sensitive volumes resulting in hits not always being put into the same
  detector. This resulted in a complex fix with several restrictions when you
  can use multiple sensitive volumes in one scintillator detector
+ TI was not correctly read in if format differed from MEGAlib sim format
+ Cosima: DECA was in nanosec instead of sec 
+ Previoulsy, if you had galactic coordinates then the rotation is also 
  applied in spherical and Certesian coordinates, now it is distinguished
  between detector rotation and galactic pointing - you can have both
+ The polarization angle reported in Mimrec's polarization analysis was off 
  by 90-(pi/2) degrees...


******************************************************************************


Version 2.20
============

*** Important:

+ Known bug (fixed only in 2.21):
  If you have galactic coordinates then the rotation is also applied in 
  spherical coordinates
+ Backport fix:
  There was a problem when you have copies of scintillator detectors with 
  multiple sensitive volumes resulting in hits not always being put into the same
  detector. This resulted in a complex fix with several restrictions when you
  can use multiple sensitive volumes in one scintillator detector.
+ Due to problems with case-invariance of MacOSX only "cosima" is availble 
  and no longer "Cosima" to start Cosima
+ The energy resolution interface bhas been updated. Verify is your spectra 
  are still identical.


*** New features & improvements:

Geomega:
+ Append lines with "\\" keyword as last keyword
+ If-clauses
+ ForVector loop & (Position/Value-) Vector-class
+ EnergyLoss, EnergyResolution, EnergyCalibration update

Cosima:
+ Included TS "total started events" and SA "start area" into file
+ Possibility to restrict to one run in the source file
+ DiffractionPointSource
+ StoreOneHitPerEvent
+ Launch mutliple instances of cosima with mcosima

Sivan:
+ Parse observation time and simulated events in MFileSimEvents

Mimrec:
+ SIMPLE coded-mask imaging 


*** Important bug fixes:

+ TT was not correctly handled if files were concatenated via NF
+ Configuration problems on Mac OSX
+ In Function2D was a copy paste error always using the x axis and not the 
  y-axis, which lead to a wrong symmetry assumption
+ There was a problem when you have copies of scintillator detectors with 
  multiple sensitive volumes resulting in hits not always being put into the same
  detector. This resulted in a complex fix with several restrictions when you
  can use multiple sensitive volumes in one scintillator detector
+ TI was not read in correctly if format differed from sim format


******************************************************************************


Version 2.19
============

*** Important:

+ If you update from a previous version, you need to reconfigure MEGAlib!
+ This version integrates many of the response related changes intended for 
  3.0 into the 2.x branch. Thus test this version thoroughly.
+ The sim event storing routines have been rewritten. If there are problems
  reading older files, let me know.
+ The IA & SimEvent interfaces have been renamed. The old ones are still 
  available but should give a depreciated warning. Please update your 
  interfaces!
+ Partial rewrite of MFile & MFileEvents classes and all files based on it.
  This is another big change thus check if all files can be opened correctly.
+ In Cosima replaced the keywords SpectralType, Energy, Position with the 
  keyword based Spectrum and Energy, i.e. you now don't give numbers such as 
  "1 1" any mode but say FarFieldPointSource!
+ Don't use the Penelope code for Compton detector event reconstruction 
  responses and always turn of fluorescence, since the code is not ready to 
  handle more than one generated particle during Compton scattering


*** New features & improvements:

General:
+ SensitivityOptimizer capable of calculating sensitivity per steradian
+ Partial rewrite of MFile & MFileEvents 
+ MParser, MTokenizer interface remodelling

Response:
+ Completed switch to new response classes  

Cosima:
+ Radioactive build-up simulation (e.g. via proton irradiation) including 
  examples and documentation is now much closer to usability
+ Improved integration of Geant4 visualization features
+ New beams: Conic beam with homogenous or gaussian distribution (from Georg)
  and RadialProfileBeam
+ Replaced the keywords SpectralType, Energy, Position with the keyword based 
  Spectrum and Energy, i.e. you now don't give numbers such as "1 1" any mode 
  but say FarFieldPointSource
+ New examples
+ More input sanity checks
+ Spectums loaded by file now allow for lin-lin, lin-log, log-lin, log-log 
  interpolation

Sivan:
+ The sim event storing routines have been rewritten (only latest sim format 
  is written, new write routines allowing scientific notation. If there are 
  problems reading older files, let me know.
+ The IA & SimEvent interfaces have been renamed. The old ones are still 
  available but should give a depreciated warning. Please update your 
  interfaces
+ Eliminated ECs (are IAs since a long time now)
+ New option: Show secondary generation pattern (=locations)

Revan:
+ New option: Show spatial energy distribution (not only hit distribution)

Mimrec:
+ OS-EM is available again


*** Bug fixes:

Revan:
+ The TI was not always read in correctly leading to jumps in the time sequence
+ The NF keyword was not honoured

Mimrec:
+ The excluded detectors were not read in correctly in the new Xml format

Cosima:
+ The x-y-axes of the ProfiledBeam/MapProfileBeam beam were not scaled to cm, 
  thus the beam was a factor of 10 too narrow

General:
+ Increased stability of multi-threading

Many minor ones, segfaults and other crashes




******************************************************************************



Version 2.18
============

*** Important:

+ If you update from a previous version, you need to reconfigure MEGAlib!
+ Due to a switch to XML in the configuration files, you have to check if they
  are still consistent 
+ In old configuration files the standard maximum amount for RAM for the 
  response slices ("back projections") was 1 GB. You should check if you do not
  want a larger value (mimrec -> imaging -> memory management)!
+ The new automatic calculation of cross section files invalidates all old 
  cross section files since they do not have a hash value linked to the 
  materials


*** New features & improvements:

General:
+ Integrated Cosima into MEGAlib
+ Improved configuration script
+ Mimrec/Revan/Sivan/Geomega configuration files are now XML based

Geomega:
+ Added Geant4 based overlap search
+ Added automatic cross-section generation based on Geant4
+ New detector type Voxel3D

Mimrec:
+ Galactic coordinates
+ List-mode response calculation is now multi threaded
+ Out-of-memory handling for 32-bit systems
+ Imaging can be stopped after a certain amount of RAM is consumed

Cosima:
+ Allow to store entries and exists of particles in certain volumes

Plus many, many minor improvements


*** Bug fixes:

Revan (back ported to the latest version):
+ The TI was not always read in correctly leading to jumps in the time sequence
+ The NF keyword was not honoured

Mimrec (back ported to the latest version):
+ The excluded detectors were not read in correctly in the new Xml format

Many minor ones, segfaults and other crashes




******************************************************************************


