///\file "parameterisations/gflash/gflasha/.README.txt"
///\brief Example gflasha README page

/*! \page Examplegflasha Example gflasha

This example demonstrating usage 'gflash' shower parameterisation
in homogeneous calorimeter. Compare with glash1,2,3 the histograms
have been added in this example. This makes it possible to use this
example for fine tuning of GFLASH parameters.

This example allows to compare the shower profiles from fast simulation
with full simulation by histograming of longitudinal (slice)
and radial profiles with different "binning".
Then GFlash fast simulation can be "tuned" via modification
of the model parameters file:

include/ExGflashHomoShowerTuning.hh

in this example.

\section gflasha_s0 Physics List


The Physics list factory is used in this example.
The default physics list is FTFP_BERT which has EM opt0.
Additionally, the G4FastSimulationPhysics physics
constructor was created to insert the G4FastSimulationManagerProcess
that is making the interface between the fast simulation and the tracking.

The default PHYSICS list may be changed via setting of the PHYSLIST environment
variable, e.g.:

\verbatim
export PHYSLIST=FTFP_BERT_EMZ # for FTFP_BERT with opt 4 EM physics
\endverbatim

\section gflasha_s1 Geometry Definition

In this example the calorimeter is a simple cube,
which consists of 10 x 10 crystals of PbWO4 (CMS like).

Geometry, sensitive detector and hits are defined respectively in:
- ExGflashDetectorConstruction
- ExGflashSensitiveDetector
- ExGflashHit

The geometry can be redefined in PreInit state via commands:

\verbatim
/exgflash/det/setNbCrys ncrys
/exgflash/det/setCrysWidth width [cm]
/exgflash/det/setCrysLength length [cm]
\endverbatim

Materials can be chosen from Nist Materials: G4_Air G4_WATER ...
e.g.:
\verbatim
/exgflash/det/setMat G4_PbWO4
\endverbatim
see also: csi1.mac

\section gflasha_s2 Hit Scoring

The virtual cylinder sliced longitudinally (slice) and radially (ring) was used.
The size of the slices and rings are expressed in radiation
length units and Moliere radius (Rm) units for rings. The number
of division and division size in fraction of units and can be changed.
e.g.:
\verbatim
/exgflash/det/setLbin 20   1.    ---> 20 slices of 1. radl
/exgflash/det/setRbin  5   0.25  --->  5 rings of 0.25 Rm
     (MaxBin = 500 in both directions)
\endverbatim

In ExGflashEventAction class the arrays corresponded slices and rings was
created and filled with hists information. These arrays where use to fill
histograms later.

\section gflasha_s3 Visualization

The Visualization Manager is set in the main().
The initialization of the drawing is done via the commands /vis/...
in the macro vis.mac. To get visualization use:
\verbatim
/control/execute vis.mac
\endverbatim

\section gflasha_s4 How to start ?

- Execute ExGflasha in 'batch' mode from macro files
\verbatim
 % ExGflasha   test.mac
\endverbatim

- Execute ExGflasha in 'interactive mode' with visualization
\verbatim
 % ExGflasha
   ....
  Idle> type your commands
  ....
  Idle> exit
\endverbatim

The GFLASH activated via:
\verbatim
/GFlash/flag 1
\endverbatim

\section gflasha_s5 Histograms

ExGflasha produces several histograms:
The histograms defined in ExGflashHistoManager class

Content of these histo:

- h0 : energy deposit       per event
- h1 : the number of hits  per event
- h2 : the energy per hit ( in MeV )

- p0 : longitudinal energy profile
- p1 : radial energy profile

- p2 : cumulated longitudinal energy profile
- p3 : cumulated radial energy profile

To define the output file name with histograms, use the UI command :
\verbatim
/analysys/setFileName name
\endverbatim

\section gflasha_s6 Macros

The macros to run in batch mode:

- test.mac - default macro for example testing, it show how to use different application commands: redefine the histograms and profiles, change the geometry and material, etc

- csi.mac - like test.mac but produce profiles in CsI Material

- testLong.mac - make the runs with more statistics using default geometry and histograms setting, the material is G4_PbWO4

- csiLong.mac - show how to run testLong.mac with different material (CsI)

Each macro executes two runs with fast simulation flag ON (the output file
name is set to gflash01.root ) and OFF (the output file name is set to gflash00.root )

In addition, the ROOT macros cmpL.C, cmpR.C and cmpE.C file are provided,
which can be used to draw superimposed full and fast histograms for radial
and lateral profiles and also the normalized total energy deposition
in calorimeter.

*/
