Import Geant4 10.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-10 11:51:14 +02:00
parent e2d2f9810a
commit 286caacf06
12421 changed files with 730077 additions and 502383 deletions
+9 -5
View File
@@ -71,10 +71,14 @@
- histo 3 : total track length of charged particles in absorber per event
- histo 4 : total track length of charged particles in gap per event
And 1 Ntuple :
- one row per event : EnergyAbs EnergyGap TrackLAbs TrackLGap
And 2 Ntuples :
- ntuple 1:
- one row per event : EnergyAbs EnergyGap
- ntuple 1:
- one row per event : TrackLAbs TrackLGap
These histos are booked in HistoManager and filled from EventAction.
These histos and ntuples are booked in HistoManager and filled from
EventAction.
One can control the name of the histograms file and its format:
- default name : AnaEx03
@@ -87,8 +91,8 @@
\section AnaEx03_s4 AIDA and OpenScientist
See the pages \link ExampleA01AIDA README.AIDA \endlink and
\link ExampleA01OpenScientist README.OpenScientist \endlink in \ref ExampleA01
See the pages \link ExampleAnaEx03AIDA README.AIDA \endlink and
\link ExampleAnaEx03OpenScientist README.OpenScientist \endlink
for more indications how to use this system to visualize and handle
histogram files.
@@ -0,0 +1,74 @@
//$Id$
///\file "analysis/AnaEx03/.README.AIDA"
///\brief Example AnaEx03 README.AIDA page
/*! \page ExampleAnaEx03AIDA Example AnaEx03 - Install AIDA
To use histograms, at least one of the AIDA implementations should be
available.
You can use various file formats to write histograms (hbook, root, AIDA-XML).
\section ExampleAnaEx03AIDA_s1 OpenScientist (lal/in2p3)
OpenScientist is available at http://OpenScientist.lal.in2p3.fr.
osc_batch is a small package ( ~ 6MB), easy to install.
It provides an AIDA interface to write files in ROOT or HBOOK formats.
See the specific \link ExampleAnaEx03OpenScientist README.OpenScientist \endlink
page for more.
\section ExampleAnaEx03AIDA_s2 RAIDA (desy)
It is a ROOT based AIDA interface. It can be downloaded from
http://ilcsoft.desy.de/portal/software_packages/raida/index_eng.html
\section ExampleAnaEx03AIDA_s3 iAIDA
Another package including AIDA (an evolution of the former cern PI project)
is the iAIDA package: http://iaida.dynalias.net
Once you have installed iAIDA in a specified local area $MYIAIDA, it is
required to add the installation path to $PATH, i.e. for example, for
release 1.0.11 of iAIDA:
\verbatim
setenv PATH ${PATH}:$MYIAIDA/bin
\endverbatim
Before running the example the command should be issued:
\verbatim
eval `aida-config --runtime csh`
\endverbatim
\section ExampleAnaEx03AIDA_s4 JAIDA (slac)
JAIDA is an implementation of AIDA in Java. To use it, one needs Java
as well as AIDAJNI, a connector between AIDA-C++ and AIDA-Java.
Available for: Linux-g++2, Linux-g++3, WIN32-VC, SUN-CC,
Darwin-g++2, Darwin-g++3
To compile and link with JAIDA using AIDAJNI, make sure you have:
-# JAIDA: see http://java.freehep.org/jaida
-# set enviroment variable JAIDA_HOME to your JAIDA installation
-# source the aida-setup script $JAIDA_HOME/bin/aida-setup.[sh|csh|win32] \n\n
-# AIDAJNI: see http://java.freehep.org/aidajni
-# set environment variable AIDAJNI_HOME to your AIDAJNI installation
-# set environment variable JDK_HOME to your Java Standard Development Kit (1.4.x or up).
-# source the aidajni-setup script $AIDAJNI_HOME/bin/$G4SYSTEM/aidajni-setup.[sh|csh|win32]
Last tested versions (with Geant4 examples): JAIDA 3.2.0, AIDAJNI 3.2.0.
Now execute:
\verbatim
source setup-analysis (.csh, .sh, .win32)
gmake clean
gmake
\endverbatim
*/
@@ -0,0 +1,56 @@
//$Id$
///\file "analysis/AnaEx03/.README.OpenScientist"
///\brief Example AnaEx03 README.OpenScientist page
/*! \page ExampleAnaEx03OpenScientist Example AnaEx03 - Working with the OpenScientist packages
To create the analysis file, you can install the light "osc_batch"
binary kit (See http://OpenScientist.lal.in2p3.fr ). For example
from a UNIX sh flavoured shell :
\verbatim
sh> cd /usr/local
sh> <arrange to be su>
sh> <get an osc_batch binary kit>
sh> unzip -q osc_batch<platform>.zip
sh> cd osc_batch/<version>
sh> ./install
\endverbatim
Then before building the example you have to source the OpenScientist
environment with :
\verbatim
<create another terminal>
sh> . /usr/local/osc_batch/<version>/aida-setup.sh
or
csh> source /usr/local/osc_batch/<version>/aida-setup.csh
\endverbatim
Depending of the file format, you can visualize the produced
file with various interactive tools (CERN/PAW, CERN/ROOT, jas).
But if installing also an OpenScientist osc_vis binary kit,
you shall be able to visualize all formats by using
the osc-plot program. To install an osc_vis kit :
\verbatim
sh> cd /usr/local
sh> <arrange to be su>
sh> <get an osc_vis binary kit>
sh> unzip -q osc_vis<platform>.zip
sh> cd osc_vis/<version>
sh> ./install
\endverbatim
Then to browse the AnaEx03.<format> file (for exa from an UNIX sh shell) :
\verbatim
<create another terminal>
sh> . /usr/local/osc_vis/<version>/setup.sh
sh> <setenv DISPLAY if needed>
sh> osc-plot AnaEx03.[aida,root,hbook]
\endverbatim
The OpenScientist URL is :
- http://OpenScientist.lal.in2p3.fr.
Note that OpenScientist is installed on CERN/lxplus under :
- /afs/cern.ch/sw/contrib/[osc_batch,osc_vis].
*/
@@ -28,7 +28,6 @@
//
//
// $Id: AnaEx01.cc,v 1.15 2010-11-08 10:38:44 maire Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,13 +23,8 @@ include(${Geant4_USE_FILE})
#----------------------------------------------------------------------------
# Find AIDA (required package)
#
find_package(AIDA QUIET)
if(NOT AIDA_FOUND)
message(STATUS "G4 Examples: AIDA package not found. --> AnaEx03 example disabled")
return()
else()
add_definitions(-DG4ANALYSIS_USE)
endif()
find_package(AIDA REQUIRED)
add_definitions(-DG4ANALYSIS_USE)
#----------------------------------------------------------------------------
# Locate sources and headers for this project
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.4 2010-11-08 10:38:44 maire Exp $
# $Id: GNUmakefile 68015 2013-03-13 13:27:27Z gcosmo $
# --------------------------------------------------------------
# GNUmakefile for examples module. Gabriele Cosmo, 06/04/98.
# --------------------------------------------------------------
+5 -1
View File
@@ -1,4 +1,4 @@
$Id: History,v 1.19 2010-11-08 10:38:44 maire Exp $
$Id: History 68776 2013-04-05 12:50:38Z gcosmo $
--------------------------------------------------
=========================================================
@@ -15,6 +15,10 @@ track of all tags.
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
02-04-13 I. Hrivnacova (AnaEx03-V09-06-00)
- Create two ntuples instead of one in order to demonstrate
how to do this with all tools.
13-11-12 I. Hrivnacova (AnaEx03-V09-05-05)
- Fixed order of instatiating G4VisExecutive and G4UIExecutive
(required when Qt driver is activated).
+10 -7
View File
@@ -1,4 +1,4 @@
$Id: README,v 1.17 2010-11-08 10:38:44 maire Exp $
$Id: README 74821 2013-10-22 14:40:25Z gcosmo $
--------------------------------------------------
=========================================================
@@ -74,10 +74,14 @@ $Id: README,v 1.17 2010-11-08 10:38:44 maire Exp $
histo 3 : total track length of charged particles in absorber per event
histo 4 : total track length of charged particles in gap per event
And 1 Ntuple :
one row per event : EnergyAbs EnergyGap TrackLAbs TrackLGap
And 2 Ntuples :
- ntuple 1:
- one row per event : EnergyAbs EnergyGap
- ntuple 1:
- one row per event : TrackLAbs TrackLGap
These histos are booked in HistoManager and filled from EventAction.
These histos and ntuples are booked in HistoManager and filled from
EventAction.
One can control the name of the histograms file and its format:
default name : AnaEx03
@@ -91,7 +95,6 @@ $Id: README,v 1.17 2010-11-08 10:38:44 maire Exp $
4- OpenScientist
----------------
See the files README.AIDA and README.OpenScientist in A01 example
for more indications how to use this system to visualize and handle
histogram files.
See the files README.AIDA and README.OpenScientist for more indications
how to use this system to visualize and handle histogram files.
@@ -0,0 +1,69 @@
$Id: InstallAida.txt,v 1.1 2010-11-08 10:38:44 maire Exp $
-----------------------------------------------------------
--------------
Install AIDA
--------------
To use histograms, at least one of the AIDA implementations should be
available.
You can use various file formats to write histograms (hbook, root, AIDA-XML).
1 - OpenScientist (lal/in2p3)
-------------------------
OpenScientist is available at http://OpenScientist.lal.in2p3.fr.
osc_batch is a small package ( ~ 6MB), easy to install.
It provides an AIDA interface to write files in ROOT or HBOOK formats.
See the specific UseOpenScientist.txt file for more.
2 - RAIDA (desy)
------------
It is a ROOT based AIDA interface. It can be downloaded from
http://ilcsoft.desy.de/portal/software_packages/raida/index_eng.html
3 - iAIDA
-----
Another package including AIDA (an evolution of the former cern PI project)
is the iAIDA package: http://iaida.dynalias.net
Once you have installed iAIDA in a specified local area $MYIAIDA, it is
required to add the installation path to $PATH, i.e. for example, for
release 1.0.11 of iAIDA:
setenv PATH ${PATH}:$MYIAIDA/bin
Before running the example the command should be issued:
eval `aida-config --runtime csh`
4 - JAIDA (slac)
------------
JAIDA is an implementation of AIDA in Java. To use it, one needs Java
as well as AIDAJNI, a connector between AIDA-C++ and AIDA-Java.
Available for: Linux-g++2, Linux-g++3, WIN32-VC, SUN-CC,
Darwin-g++2, Darwin-g++3
To compile and link with JAIDA using AIDAJNI, make sure you have:
1. JAIDA version 3.2.0, see http://java.freehep.org/jaida
2. set enviroment variable JAIDA_HOME to your JAIDA installation
3. source the aida-setup script $JAIDA_HOME/bin/aida-setup.[sh|csh|win32]
4. AIDAJNI version 3.0.4 or 3.2.0, or better: see http://java.freehep.org/aidajni
5. set environment variable AIDAJNI_HOME to your AIDAJNI installation
6. set environment variable JDK_HOME to your Java Standard Development Kit (1.4.x or up).
7. source the aidajni-setup script $AIDAJNI_HOME/bin/$G4SYSTEM/aidajni-setup.[sh|csh|win32]
Last tested versions (with Geant4 examples): JAIDA 3.2.0, AIDAJNI 3.2.0.
Now execute:
source setup-analysis (.csh, .sh, .win32)
gmake clean
gmake
@@ -0,0 +1,44 @@
Working with the OpenScientist packages :
---------------------------------------
To create the analysis file, you can install the light "osc_batch"
binary kit (See http://OpenScientist.lal.in2p3.fr ). For example
from a UNIX sh flavoured shell :
sh> cd /usr/local
sh> <arrange to be su>
sh> <get an osc_batch binary kit>
sh> unzip -q osc_batch<platform>.zip
sh> cd osc_batch/<version>
sh> ./install
Then before building the example you have to source the OpenScientist
environment with :
<create another terminal>
sh> . /usr/local/osc_batch/<version>/aida-setup.sh
or
csh> source /usr/local/osc_batch/<version>/aida-setup.csh
Depending of the file format, you can visualize the produced
file with various interactive tools (CERN/PAW, CERN/ROOT, jas).
But if installing also an OpenScientist osc_vis binary kit,
you shall be able to visualize all formats by using
the osc-plot program. To install an osc_vis kit :
sh> cd /usr/local
sh> <arrange to be su>
sh> <get an osc_vis binary kit>
sh> unzip -q osc_vis<platform>.zip
sh> cd osc_vis/<version>
sh> ./install
Then to browse the AnaEx03.<format> file (for exa from an UNIX sh shell) :
<create another terminal>
sh> . /usr/local/osc_vis/<version>/setup.sh
sh> <setenv DISPLAY if needed>
sh> osc-plot AnaEx03.[aida,root,hbook]
The OpenScientist URL is :
http://OpenScientist.lal.in2p3.fr.
Note that OpenScientist is installed on CERN/lxplus under :
/afs/cern.ch/sw/contrib/[osc_batch,osc_vis].
@@ -26,7 +26,7 @@
/// \file analysis/AnaEx03/include/HistoManager.hh
/// \brief Definition of the HistoManager class
//
// $Id$
// $Id: HistoManager.hh 74272 2013-10-02 14:48:50Z gcosmo $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -68,11 +68,12 @@ class HistoManager
private:
AIDA::IAnalysisFactory* af;
AIDA::ITree* tree;
AIDA::IAnalysisFactory* fAF;
AIDA::ITree* fTree;
AIDA::IHistogram1D* histo[MaxHisto];
AIDA::ITuple* ntupl;
AIDA::IHistogram1D* fHisto[MaxHisto];
AIDA::ITuple* fNtuple1;
AIDA::ITuple* fNtuple2;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+1 -1
View File
@@ -1,4 +1,4 @@
# $Id: run.mac,v 1.5 2010-11-08 11:01:47 maire Exp $
# $Id: run.mac 68015 2013-03-13 13:27:27Z gcosmo $
#
# Macro file for "AnaEx03.cc"
#
@@ -26,7 +26,7 @@
/// \file analysis/AnaEx03/src/HistoManager.cc
/// \brief Implementation of the HistoManager class
//
// $Id$
// $Id: HistoManager.cc 74272 2013-10-02 14:48:50Z gcosmo $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -42,13 +42,13 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
HistoManager::HistoManager()
:af(0),tree(0)
:fAF(0),fTree(0), fNtuple1(0), fNtuple2(0)
{
#ifdef G4ANALYSIS_USE
// Creating the analysis factory
//
af = AIDA_createAnalysisFactory();
if(!af) {
fAF = AIDA_createAnalysisFactory();
if(!fAF) {
G4cout << " HistoManager::HistoManager :"
<< " problem creating the AIDA analysis factory."
<< G4endl;
@@ -56,10 +56,7 @@ HistoManager::HistoManager()
#endif
// histograms
for (G4int k=0; k<MaxHisto; k++) histo[k] = 0;
// ntuple
ntupl = 0;
for (G4int k=0; k<MaxHisto; k++) fHisto[k] = 0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -67,7 +64,7 @@ HistoManager::HistoManager()
HistoManager::~HistoManager()
{
#ifdef G4ANALYSIS_USE
delete af;
delete fAF;
#endif
}
@@ -76,7 +73,7 @@ HistoManager::~HistoManager()
void HistoManager::book()
{
#ifdef G4ANALYSIS_USE
if(!af) return;
if(!fAF) return;
// Creating a tree container to handle histograms and ntuples.
// This tree is associated to an output file.
@@ -90,10 +87,10 @@ void HistoManager::book()
fileName = fileName + "." + fileType;
G4bool readOnly = false;
G4bool createNew = true;
AIDA::ITreeFactory* tf = af->createTreeFactory();
tree = tf->create(fileName, fileType, readOnly, createNew, fileOption);
AIDA::ITreeFactory* tf = fAF->createTreeFactory();
fTree = tf->create(fileName, fileType, readOnly, createNew, fileOption);
delete tf;
if(!tree) {
if(!fTree) {
G4cout << " HistoManager::book :"
<< " problem creating the AIDA tree with "
<< " storeName = " << fileName
@@ -107,38 +104,39 @@ void HistoManager::book()
// Creating a histogram factory, whose histograms will be handled by the tree
//
AIDA::IHistogramFactory* hf = af->createHistogramFactory(*tree);
AIDA::IHistogramFactory* hf = fAF->createHistogramFactory(*fTree);
// create histos in subdirectory "histograms"
//
tree->mkdir("histograms");
tree->cd("histograms");
fTree->mkdir("histograms");
fTree->cd("histograms");
histo[1] = hf->createHistogram1D("1", "Edep in absorber", 100, 0., 800*MeV);
if (!histo[1]) G4cout << "\n can't create histo 1" << G4endl;
histo[2] = hf->createHistogram1D("2", "Edep in gap", 100, 0., 100*MeV);
if (!histo[2]) G4cout << "\n can't create histo 2" << G4endl;
histo[3] = hf->createHistogram1D("3", "trackL in absorber", 100, 0., 1*m);
if (!histo[3]) G4cout << "\n can't create histo 3" << G4endl;
histo[4] = hf->createHistogram1D("4", "trackL in gap", 100, 0., 50*cm);
if (!histo[4]) G4cout << "\n can't create histo 4" << G4endl;
fHisto[1] = hf->createHistogram1D("1", "Edep in absorber", 100, 0., 800*MeV);
if (!fHisto[1]) G4cout << "\n can't create histo 1" << G4endl;
fHisto[2] = hf->createHistogram1D("2", "Edep in gap", 100, 0., 100*MeV);
if (!fHisto[2]) G4cout << "\n can't create histo 2" << G4endl;
fHisto[3] = hf->createHistogram1D("3", "trackL in absorber", 100, 0., 1*m);
if (!fHisto[3]) G4cout << "\n can't create histo 3" << G4endl;
fHisto[4] = hf->createHistogram1D("4", "trackL in gap", 100, 0., 50*cm);
if (!fHisto[4]) G4cout << "\n can't create histo 4" << G4endl;
delete hf;
tree->cd("..");
fTree->cd("..");
// Creating a ntuple factory, handled by the tree
//
AIDA::ITupleFactory* ntf = af->createTupleFactory(*tree);
AIDA::ITupleFactory* ntf = fAF->createTupleFactory(*fTree);
// create 1 ntuple in subdirectory "tuples"
//
tree->mkdir("tuples");
tree->cd("tuples");
fTree->mkdir("tuples");
fTree->cd("tuples");
ntupl = ntf->create("101", "Edep and TrackL", "double Eabs, Egap, Labs, Lgap");
fNtuple1 = ntf->create("101", "Edep", "double Eabs, Egap");
fNtuple2 = ntf->create("102", "TrackL", "double Labs, Lgap");
delete ntf;
tree->cd("..");
fTree->cd("..");
G4cout << "\n----> Histogram Tree is opened in " << fileName << G4endl;
#endif
@@ -149,13 +147,13 @@ void HistoManager::book()
void HistoManager::save()
{
#ifdef G4ANALYSIS_USE
if (af && tree) {
tree->commit(); // Writing the histograms to the file
tree->close(); // and closing the tree (and the file)
if (fAF && fTree) {
fTree->commit(); // Writing the histograms to the file
fTree->close(); // and closing the tree (and the file)
G4cout << "\n----> Histogram Tree is saved \n" << G4endl;
delete tree;
tree = 0;
delete fTree;
fTree = 0;
}
#endif
}
@@ -171,7 +169,7 @@ void HistoManager::FillHisto(G4int ih, G4double xbin, G4double weight)
return;
}
#ifdef G4ANALYSIS_USE
if (histo[ih]) histo[ih]->fill(xbin, weight);
if (fHisto[ih]) fHisto[ih]->fill(xbin, weight);
#endif
}
@@ -185,7 +183,7 @@ void HistoManager::Normalize(G4int ih, G4double fac)
return;
}
#ifdef G4ANALYSIS_USE
if (histo[ih]) histo[ih]->scale(fac);
if (fHisto[ih]) fHisto[ih]->scale(fac);
#endif
}
@@ -195,12 +193,15 @@ void HistoManager::Normalize(G4int ih, G4double fac)
void HistoManager::FillNtuple(G4double energyAbs, G4double energyGap,
G4double trackLAbs, G4double trackLGap)
{
if (ntupl) {
ntupl->fill(0, energyAbs);
ntupl->fill(1, energyGap);
ntupl->fill(2, trackLAbs);
ntupl->fill(3, trackLGap);
ntupl->addRow();
if (fNtuple1) {
fNtuple1->fill(0, energyAbs);
fNtuple1->fill(1, energyGap);
fNtuple1->addRow();
}
if (fNtuple2) {
fNtuple2->fill(0, trackLAbs);
fNtuple2->fill(1, trackLGap);
fNtuple2->addRow();
}
}
#else
@@ -213,21 +214,21 @@ void HistoManager::FillNtuple(G4double, G4double, G4double, G4double)
void HistoManager::PrintStatistic()
{
#ifdef G4ANALYSIS_USE
if(histo[1]) {
if(fHisto[1]) {
G4cout << "\n ----> print histograms statistic \n" << G4endl;
G4cout
<< " EAbs : mean = " << G4BestUnit(histo[1]->mean(), "Energy")
<< " rms = " << G4BestUnit(histo[1]->rms(), "Energy") << G4endl;
<< " EAbs : mean = " << G4BestUnit(fHisto[1]->mean(), "Energy")
<< " rms = " << G4BestUnit(fHisto[1]->rms(), "Energy") << G4endl;
G4cout
<< " EGap : mean = " << G4BestUnit(histo[2]->mean(), "Energy")
<< " rms = " << G4BestUnit(histo[2]->rms(), "Energy") << G4endl;
<< " EGap : mean = " << G4BestUnit(fHisto[2]->mean(), "Energy")
<< " rms = " << G4BestUnit(fHisto[2]->rms(), "Energy") << G4endl;
G4cout
<< " LAbs : mean = " << G4BestUnit(histo[3]->mean(), "Length")
<< " rms = " << G4BestUnit(histo[3]->rms(), "Length") << G4endl;
<< " LAbs : mean = " << G4BestUnit(fHisto[3]->mean(), "Length")
<< " rms = " << G4BestUnit(fHisto[3]->rms(), "Length") << G4endl;
G4cout
<< " LGap : mean = " << G4BestUnit(histo[4]->mean(), "Length")
<< " rms = " << G4BestUnit(histo[4]->rms(), "Length") << G4endl;
<< " LGap : mean = " << G4BestUnit(fHisto[4]->mean(), "Length")
<< " rms = " << G4BestUnit(fHisto[4]->rms(), "Length") << G4endl;
}
#endif