Import Geant4 8.0.0 source tree
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
|
||||
*************************************************************
|
||||
Geant4 version $Name: geant4-07-01 $ (25-June-2004)
|
||||
Geant4 version $Name: geant4-08-00 $ (25-June-2004)
|
||||
Copyright : Geant4 Collaboration
|
||||
Reference : NIM A 506 (2003), 250-303
|
||||
WWW : http://cern.ch/geant4
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01.cc,v 1.9 2003/12/03 10:33:39 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// $Id: AnaEx01.cc,v 1.13 2005/12/06 11:07:17 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
@@ -37,14 +37,19 @@
|
||||
// See the README file within the same directory to have more infos.
|
||||
// --------------------------------------------------------------
|
||||
|
||||
// Geant4 :
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4UIterminal.hh"
|
||||
|
||||
#include "Randomize.hh"
|
||||
|
||||
#include "AnaEx01AnalysisManager.hh"
|
||||
// AIDA :
|
||||
#ifdef G4ANALYSIS_USE
|
||||
#include <AIDA/IAnalysisFactory.h>
|
||||
#endif
|
||||
|
||||
// AnaEx01 :
|
||||
#include "AnaEx01AnalysisManager.hh"
|
||||
#include "AnaEx01DetectorConstruction.hh"
|
||||
#include "AnaEx01PhysicsList.hh"
|
||||
#include "AnaEx01PrimaryGeneratorAction.hh"
|
||||
@@ -56,7 +61,7 @@
|
||||
int main(int,char**) {
|
||||
|
||||
// choose the Random engine
|
||||
HepRandom::setTheEngine(new RanecuEngine);
|
||||
CLHEP::HepRandom::setTheEngine(new CLHEP::RanecuEngine);
|
||||
|
||||
//my Verbose output class
|
||||
G4VSteppingVerbose::SetInstance(new AnaEx01SteppingVerbose);
|
||||
@@ -71,16 +76,14 @@ int main(int,char**) {
|
||||
|
||||
runManager->SetUserAction(new AnaEx01PrimaryGeneratorAction(detector));
|
||||
|
||||
AnaEx01AnalysisManager* analysisManager = 0;
|
||||
#ifdef G4ANALYSIS_USE
|
||||
AnaEx01AnalysisManager* analysisManager = new AnaEx01AnalysisManager();
|
||||
AIDA::IAnalysisFactory* aida = AIDA_createAnalysisFactory();
|
||||
analysisManager = new AnaEx01AnalysisManager(aida);
|
||||
#endif
|
||||
runManager->SetUserAction(new AnaEx01RunAction(analysisManager));
|
||||
runManager->SetUserAction(new AnaEx01EventAction(analysisManager));
|
||||
runManager->SetUserAction(new AnaEx01SteppingAction(analysisManager));
|
||||
#else
|
||||
runManager->SetUserAction(new AnaEx01RunAction());
|
||||
runManager->SetUserAction(new AnaEx01EventAction());
|
||||
runManager->SetUserAction(new AnaEx01SteppingAction());
|
||||
#endif
|
||||
|
||||
//Initialize G4 kernel
|
||||
runManager->Initialize();
|
||||
@@ -97,6 +100,10 @@ int main(int,char**) {
|
||||
#endif
|
||||
delete runManager;
|
||||
|
||||
#ifdef G4ANALYSIS_USE
|
||||
delete aida;
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
$Id: History,v 1.9 2005/05/03 10:05:48 allison Exp $
|
||||
$Id: History,v 1.14 2005/12/06 11:07:17 gcosmo Exp $
|
||||
--------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -15,6 +15,22 @@ track of all tags.
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
6th December 2005 Gabriele Cosmo
|
||||
- Trivial change in main() for support of CLHEP-2.0.X series.
|
||||
|
||||
15th November 2005 Guy Barrand (AnaEx01-V07-01-01)
|
||||
- Tagged all changes.
|
||||
|
||||
25th October 2005 Guy Barrand
|
||||
- Have .aida as a default file format.
|
||||
|
||||
24th October 2005 Guy Barrand
|
||||
- Put AIDA_createAnalysisFactory() in the main in order
|
||||
to be able to instrumenet easily this example with G4Lab::UIOnX.
|
||||
|
||||
31th August 2005 Guy Barrand
|
||||
- Update README, analyis/Lab/AnaEx01.py to work with OpenScientist-v14r0.
|
||||
|
||||
3rd May 2005 John Allison (examples-V07-00-03)
|
||||
- Replaced vis manager with G4VisExecutive.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
$Id: README,v 1.12 2003/06/20 14:55:44 gbarrand Exp $
|
||||
$Id: README,v 1.14 2005/10/25 13:45:42 gbarrand Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -37,6 +37,66 @@ $Id: README,v 1.12 2003/06/20 14:55:44 gbarrand Exp $
|
||||
For info, the CPP macros G4ANALYSIS_*_AIDA_* are used in the
|
||||
config/analysis.gmk file of the Geant4 GNUmakefile system.
|
||||
|
||||
Working with the OpenScientist/Lab package :
|
||||
------------------------------------------
|
||||
To reconstruct this example by using the OpenScientist/Lab
|
||||
package (assuming that OpenScientist is installed ! ) you have
|
||||
first to "setup" the environment of the Lab package and Geant4.
|
||||
The Lab package (and all OpenScientist packages) being handled
|
||||
by the CMT tools, you may have to setup the environment
|
||||
variable "CMTSITE" to execute site specific things in the chain
|
||||
of setup files of the OpenScientist packages. Then for example at CERN :
|
||||
csh> setenv CMTSITE CERN
|
||||
(DOS> set CMTSITE=CERN_WIN32 (for Windows))
|
||||
When done then do :
|
||||
csh> source <some directory>/Lab/<version>/cmt/setup.csh
|
||||
csh> source <your Geant4 setup script>.csh
|
||||
csh> setenv G4ANALYSIS_USE 1
|
||||
csh> setenv G4ANALYSIS_AIDA_CONFIG_CFLAGS `aida-config --cflags`
|
||||
csh> setenv G4ANALYSIS_AIDA_CONFIG_LIBS `aida-config --libs`
|
||||
csh> cd $G4INSTALL/examples/extended/analysis/AnaEx01
|
||||
csh> gmake
|
||||
|
||||
To run :
|
||||
csh> cd analyis/Lab
|
||||
csh> $G4WORKDIR/bin/$G4SYSTEM/AnaEx01
|
||||
|
||||
It must produce an AnaEx01.aida file that contains some histograms
|
||||
and a tuple.
|
||||
|
||||
To plot some histograms, spawn the Lab interactive tool with :
|
||||
csh> onx
|
||||
(DOS> onx (for Windows))
|
||||
click in 'File/Open AIDA file...' to map a file chooser,
|
||||
then choose AnaEx01.aida. The file name should appear in the left
|
||||
tree widget beside the plotting area. Use the tree widget to browse
|
||||
the file. You can visualize histos by selecting them with the mouse.
|
||||
|
||||
If the OpenScientist/OnX and Lab Python drivers had been
|
||||
reconstructed at installation of OpenScientist, then
|
||||
you can also work with the OpenScientist/Lab/AIDA Python API.
|
||||
You can execute AnaEx01.py by doing :
|
||||
OS> python AnaEx01.py
|
||||
or :
|
||||
OS> python
|
||||
(>>> import AIDA)
|
||||
>>> import AnaEx01
|
||||
The AnaEx01 file contains a Python script that
|
||||
does some analysis over the AnaEx01.aida file by using the AIDA interfaces.
|
||||
This script gets an histo (EAbs) and plots it in a first drawing region.
|
||||
Then it gets the 'AnaEx01' tuple, books and fills another histo
|
||||
from the tuple colum 'EAbs' and plots it a secon drawing region.
|
||||
|
||||
If exporting a AnaEx01.root file (see src/AnaEx01AnalysisManager.cc),
|
||||
the AnaEx01.C file could also be used, within the ROOT tool.
|
||||
To see a projection of the first column of the tuple contained
|
||||
in the AnaEx01.root file. For example :
|
||||
csh> root
|
||||
root[0] .X AnaEx01.C
|
||||
|
||||
The OpenScientist URL is : http://OpenScientist.lal.in2p3.fr.
|
||||
OpenScientist is installed at CERN under /afs/cern.ch/sw/contrib.
|
||||
|
||||
Working with the Falsetto package :
|
||||
---------------------------------
|
||||
Falsetto is a little package containing a dummy
|
||||
@@ -63,54 +123,3 @@ $Id: README,v 1.12 2003/06/20 14:55:44 gbarrand Exp $
|
||||
The Falsetto URL is : http://www.lal.in2p3.fr/SI/Falsetto
|
||||
Falsetto is installed at CERN under /afs/cern.ch/sw/contrib.
|
||||
|
||||
Working with the OpenScientist/Lab package :
|
||||
------------------------------------------
|
||||
To reconstruct this example by using the OpenScientist/Lab
|
||||
package (assuming that OpenScientist is installed ! ) you have
|
||||
first to "setup" the environment of the Lab package and Geant4.
|
||||
The Lab package (and all OpenScientist packages) being handled
|
||||
by the CMT tools, you may have to setup the environment
|
||||
variable "CMTSITE" to execute site specific things in the chain
|
||||
of setup files of the OpenScientist packages. Then for example at CERN :
|
||||
csh> setenv CMTSITE CERN
|
||||
(DOS> set CMTSITE=CERN_WIN32 (for Windows))
|
||||
When done then do :
|
||||
csh> source <some directory>/Lab/<version>/cmt/setup.csh
|
||||
csh> source <your Geant4 setup script>.csh
|
||||
csh> setenv G4ANALYSIS_USE 1
|
||||
csh> setenv G4ANALYSIS_AIDA_CONFIG_CFLAGS `aida-config --cflags`
|
||||
csh> setenv G4ANALYSIS_AIDA_CONFIG_LIBS `aida-config --libs`
|
||||
csh> cd $G4INSTALL/examples/extended/analysis/AnaEx01
|
||||
csh> gmake
|
||||
|
||||
To run :
|
||||
csh> cd analyis/Lab
|
||||
csh> $G4WORKDIR/bin/$G4SYSTEM/AnaEx01
|
||||
|
||||
It must produce an AnaEx01.root file that contains
|
||||
some HCL histograms and a Lab tuple (stored as a ROOT/TTree).
|
||||
|
||||
To plot some histograms, spawn the Lab interactive tool with :
|
||||
csh> onx
|
||||
(DOS> onx (for Windows))
|
||||
click in 'File/File/import' to map a file chooser, choose AnaEx01.py
|
||||
to execute the AnaEx01.py. You can also execute this script by issuing an :
|
||||
import AnaEx01
|
||||
in the command prompt.
|
||||
This file contains a Python script that
|
||||
do some analysis over the AnaEx01.root file by using the AIDA interfaces.
|
||||
This script gets an histo (EAbs) and plots it in a first drawing region.
|
||||
Then it gets the 'AnaEx01' tuple, books and fills another histo
|
||||
from the tuple colum 'EAbs' and plots it a secon drawing region.
|
||||
|
||||
The AnaEx01.C file could also be used, within the ROOT tool,
|
||||
to see a projection of the first column of the tuple contained
|
||||
in the AnaEx01.root file. For example :
|
||||
csh> root
|
||||
root[0] .X AnaEx01.C
|
||||
Note that the HCL 'EAbs' histogram could not be seen with ROOT.
|
||||
|
||||
The OpenScientist URL is : http://www.lal.in2p3.fr/OpenScientist
|
||||
OpenScientist is installed at CERN under /afs/cern.ch/sw/contrib.
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
//
|
||||
// To do some analysis over the AnaEx01.root file with the ROOT tool.
|
||||
//
|
||||
// Note that .root is not the default file format and that someone has
|
||||
// to ask for an export of a ROOT file in the AnaEx01AnalysisManager.cc
|
||||
// constructor.
|
||||
//
|
||||
// Usage :
|
||||
// UNIX> root
|
||||
// root[0] .X AnaEx01.C
|
||||
|
||||
@@ -24,17 +24,27 @@
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
#
|
||||
# Example of a Python script using the AnaEx01.root file.
|
||||
# Example of a Python script using the AnaEx01.aida file.
|
||||
#
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
from Lab import *
|
||||
#
|
||||
# To be executed from the Python shell :
|
||||
# OS> <setup Lab>
|
||||
# OS> python
|
||||
# (>>> import AIDA)
|
||||
# >>> import AnaEx01
|
||||
#
|
||||
|
||||
from AIDA import AIDA_createAnalysisFactory
|
||||
|
||||
aida = AIDA_createAnalysisFactory()
|
||||
|
||||
# Get some AIDA factories :
|
||||
plotterFactory = aida.createPlotterFactory()
|
||||
treeFactory = aida.createTreeFactory()
|
||||
memoryTree = treeFactory.createDefault()
|
||||
histogramFactory = aida.createHistogramFactory(memoryTree)
|
||||
functionFactory = aida.createFunctionFactory(memoryTree)
|
||||
|
||||
# Attach the current plotter :
|
||||
plotter = plotterFactory.create('')
|
||||
@@ -42,50 +52,50 @@ plotter = plotterFactory.create('')
|
||||
plotter.createRegions(1,2,0)
|
||||
plotter.setParameter('title','AnaEx01 analysis')
|
||||
|
||||
# If already loaded close (not delete) the file :
|
||||
fileName='AnaEx01.root'
|
||||
session.destroyManager(fileName)
|
||||
|
||||
rioTree = treeFactory.create(fileName,'ROOT',1,0)
|
||||
rioTree.ls()
|
||||
tree = treeFactory.create('AnaEx01.aida','xml',1,0)
|
||||
tree.ls()
|
||||
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
# In first region, get and plot the EAbs histo :
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
rioTree.cd('histograms')
|
||||
rioTree.ls()
|
||||
tree.cd('histograms')
|
||||
tree.ls()
|
||||
|
||||
# Get some histograms with the H1Get
|
||||
# builtin Python procedure (defined in Lab/scripts/Python/Lab_init.py).
|
||||
|
||||
EAbs = IManagedObject_to_IHistogram1D(rioTree.find('EAbs'))
|
||||
# From an AIDA tree we retreive IManagedObjects, we have to cast.
|
||||
#FIXME : IManagedObject_to_IHistogram1D is not AIDA, it is OSC specific.
|
||||
from AIDA import IManagedObject_to_IHistogram1D
|
||||
EAbs = IManagedObject_to_IHistogram1D(tree.find('EAbs'))
|
||||
if EAbs == None:
|
||||
print 'EAbs not found or is not an AIDA::IHistogram1D.'
|
||||
print 'EAbs not found or is not an AIDA::IHistogram1D.'
|
||||
else :
|
||||
# Plot the histo :
|
||||
region = plotter.currentRegion()
|
||||
region.plot(EAbs)
|
||||
# Plot the histo :
|
||||
region = plotter.currentRegion()
|
||||
region.plot(EAbs)
|
||||
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
# In second region plot the EAbs histo built from the tuple :
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
rioTree.cd('..')
|
||||
rioTree.cd('tuples')
|
||||
rioTree.ls()
|
||||
tree.cd('..')
|
||||
tree.cd('tuples')
|
||||
tree.ls()
|
||||
|
||||
rioTupleFactory = aida.createTupleFactory(rioTree)
|
||||
# Get a tuple from the rioTree :
|
||||
tuple = rioTupleFactory.create('AnaEx01','AnaEx01','')
|
||||
tupleFactory = aida.createTupleFactory(tree)
|
||||
# Get a tuple from the tree :
|
||||
#tuple = tupleFactory.create('AnaEx01','AnaEx01','')
|
||||
from AIDA import IManagedObject_to_ITuple
|
||||
tuple = IManagedObject_to_ITuple(tree.find('AnaEx01'))
|
||||
if tuple == None:
|
||||
print 'Tuple AnaEx01 not found or is not an AIDA::ITuple.'
|
||||
|
||||
# Create an histo in the default memory tree :
|
||||
tuple_EAbs = histogramFactory.createHistogram1D('tuple_EAbs','AnaEx01/EAbs',100,0,100)
|
||||
|
||||
# Create an Evaluator and a Filter object :
|
||||
evaluator = rioTupleFactory.createEvaluator('EAbs')
|
||||
evaluator = tupleFactory.createEvaluator('EAbs')
|
||||
evaluator.initialize(tuple)
|
||||
filter = rioTupleFactory.createFilter('')
|
||||
filter = tupleFactory.createFilter('')
|
||||
filter.initialize(tuple)
|
||||
|
||||
# Project tuple AnaEx01/EAbs column on the tuple_EAbs histo :
|
||||
@@ -94,19 +104,20 @@ tuple.project(tuple_EAbs,evaluator,filter)
|
||||
plotter.next()
|
||||
region = plotter.currentRegion()
|
||||
region.plot(tuple_EAbs)
|
||||
region.setParameter('histogramContext','color red modeling solid')
|
||||
|
||||
plotter.show()
|
||||
plotter.interact()
|
||||
|
||||
del evaluator
|
||||
del filter
|
||||
|
||||
print 'The two histos must give the same information !'
|
||||
|
||||
del rioTupleFactory
|
||||
del tupleFactory
|
||||
|
||||
del rioTree
|
||||
del tree
|
||||
del plotter
|
||||
del region
|
||||
del plotterFactory
|
||||
del treeFactory
|
||||
del histogramFactory
|
||||
del functionFactory
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01AnalysisManager.hh,v 1.6 2003/06/20 14:55:44 gbarrand Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// $Id: AnaEx01AnalysisManager.hh,v 1.8 2005/10/25 13:46:11 gbarrand Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace AIDA {
|
||||
|
||||
class AnaEx01AnalysisManager {
|
||||
public:
|
||||
AnaEx01AnalysisManager();
|
||||
AnaEx01AnalysisManager(AIDA::IAnalysisFactory*);
|
||||
virtual ~AnaEx01AnalysisManager();
|
||||
public:
|
||||
virtual void BeginOfRun(const G4Run*);
|
||||
@@ -54,7 +54,7 @@ public:
|
||||
virtual void Step(const G4Step*);
|
||||
private:
|
||||
int fCalorimeterCollID;
|
||||
AIDA::IAnalysisFactory* fAnalysisFactory;
|
||||
AIDA::IAnalysisFactory* fAIDA;
|
||||
AIDA::ITree* fTree;
|
||||
AIDA::IHistogram1D* fEAbs;
|
||||
AIDA::IHistogram1D* fLAbs;
|
||||
@@ -63,6 +63,10 @@ private:
|
||||
AIDA::ITuple* fTuple;
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
class AnaEx01AnalysisManager;
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01CalorHit.hh,v 1.3 2003/06/20 14:55:44 gbarrand Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01CalorimeterSD.hh,v 1.3 2003/06/20 14:55:44 gbarrand Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01DetectorConstruction.hh,v 1.3 2003/06/20 14:55:44 gbarrand Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01DetectorMessenger.hh,v 1.3 2003/06/20 14:55:45 gbarrand Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01EventAction.hh,v 1.5 2003/06/20 14:55:45 gbarrand Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01PhysicsList.hh,v 1.3 2003/06/20 14:55:45 gbarrand Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01PrimaryGeneratorAction.hh,v 1.3 2003/06/20 14:55:45 gbarrand Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01PrimaryGeneratorMessenger.hh,v 1.3 2003/06/20 14:55:45 gbarrand Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01RunAction.hh,v 1.5 2003/06/20 14:55:45 gbarrand Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01SteppingAction.hh,v 1.5 2003/06/20 14:55:45 gbarrand Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01SteppingVerbose.hh,v 1.3 2003/06/20 14:55:45 gbarrand Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01AnalysisManager.cc,v 1.12 2003/06/20 14:55:45 gbarrand Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// $Id: AnaEx01AnalysisManager.cc,v 1.15 2005/10/25 18:19:56 gbarrand Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
// Guy Barrand 14th Septembre 2000.
|
||||
@@ -46,9 +46,9 @@
|
||||
#include "AnaEx01CalorHit.hh"
|
||||
#include "AnaEx01AnalysisManager.hh"
|
||||
|
||||
AnaEx01AnalysisManager::AnaEx01AnalysisManager()
|
||||
AnaEx01AnalysisManager::AnaEx01AnalysisManager(AIDA::IAnalysisFactory* aAIDA)
|
||||
:fCalorimeterCollID(-1)
|
||||
,fAnalysisFactory(0)
|
||||
,fAIDA(aAIDA)
|
||||
,fTree(0)
|
||||
,fEAbs(0)
|
||||
,fLAbs(0)
|
||||
@@ -56,41 +56,35 @@ AnaEx01AnalysisManager::AnaEx01AnalysisManager()
|
||||
,fLGap(0)
|
||||
,fTuple(0)
|
||||
{
|
||||
fAnalysisFactory = AIDA_createAnalysisFactory();
|
||||
|
||||
// Could fail if no AIDA implementation found :
|
||||
if(!fAnalysisFactory) {
|
||||
if(!fAIDA) {
|
||||
G4cout << "AIDA analysis factory not found." << G4endl;
|
||||
return;
|
||||
}
|
||||
|
||||
AIDA::ITreeFactory* treeFactory = fAnalysisFactory->createTreeFactory();
|
||||
if(!treeFactory) {
|
||||
delete fAnalysisFactory;
|
||||
fAnalysisFactory = 0;
|
||||
return;
|
||||
}
|
||||
AIDA::ITreeFactory* treeFactory = fAIDA->createTreeFactory();
|
||||
if(!treeFactory) return;
|
||||
|
||||
// Create a "tree" to handle histograms.
|
||||
// This tree is associated to a writable ROOT "store".
|
||||
fTree = treeFactory->create("AnaEx01.root","ROOT",0,1);
|
||||
// Create a tree-like container to handle histograms.
|
||||
// This tree is associated to a AnaEx01.aida file.
|
||||
//std::string opts = "compress=yes";
|
||||
std::string opts = "compress=no";
|
||||
fTree = treeFactory->create("AnaEx01.aida","xml",false,true,opts);
|
||||
//std::string opts = "export=root";
|
||||
//fTree = treeFactory->create("AnaEx01.root","ROOT",false,true,opts);
|
||||
|
||||
// Factories are not "managed" by an AIDA analysis system.
|
||||
// They must be deleted by the AIDA user code.
|
||||
delete treeFactory;
|
||||
|
||||
if(!fTree) {
|
||||
delete fAnalysisFactory;
|
||||
fAnalysisFactory = 0;
|
||||
return;
|
||||
}
|
||||
if(!fTree) return;
|
||||
|
||||
fTree->mkdir("histograms");
|
||||
fTree->cd("histograms");
|
||||
|
||||
// Create an histo factory that will create histo in the tree :
|
||||
AIDA::IHistogramFactory* histoFactory =
|
||||
fAnalysisFactory->createHistogramFactory(*fTree);
|
||||
fAIDA->createHistogramFactory(*fTree);
|
||||
if(histoFactory) {
|
||||
fEAbs = histoFactory->createHistogram1D("EAbs",100,0,100);
|
||||
fLAbs = histoFactory->createHistogram1D("LAbs",100,0,100);
|
||||
@@ -104,19 +98,18 @@ AnaEx01AnalysisManager::AnaEx01AnalysisManager()
|
||||
fTree->cd("tuples");
|
||||
|
||||
// Get a tuple factory :
|
||||
AIDA::ITupleFactory* tupleFactory =
|
||||
fAnalysisFactory->createTupleFactory(*fTree);
|
||||
AIDA::ITupleFactory* tupleFactory = fAIDA->createTupleFactory(*fTree);
|
||||
if(tupleFactory) {
|
||||
|
||||
// Create a tuple :
|
||||
fTuple = tupleFactory->create("AnaEx01","AnaEx01","EAbs LAbs EGap LGap");
|
||||
fTuple = tupleFactory->create("AnaEx01","AnaEx01",
|
||||
"double EAbs,double LAbs,double EGap,double LGap");
|
||||
|
||||
delete tupleFactory;
|
||||
}
|
||||
|
||||
}
|
||||
AnaEx01AnalysisManager::~AnaEx01AnalysisManager() {
|
||||
delete fAnalysisFactory;
|
||||
}
|
||||
|
||||
void AnaEx01AnalysisManager::BeginOfRun(const G4Run* aRun){
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01CalorHit.cc,v 1.5 2003/12/03 10:33:21 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01CalorimeterSD.cc,v 1.4 2003/12/03 10:33:21 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01DetectorConstruction.cc,v 1.4 2003/06/20 14:55:45 gbarrand Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01DetectorMessenger.cc,v 1.4 2002/12/05 00:24:22 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01EventAction.cc,v 1.5 2001/11/16 14:31:12 barrand Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01PhysicsList.cc,v 1.4 2003/06/20 14:55:45 gbarrand Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01PrimaryGeneratorAction.cc,v 1.4 2003/06/20 14:55:45 gbarrand Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01PrimaryGeneratorMessenger.cc,v 1.4 2002/12/05 00:24:22 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01RunAction.cc,v 1.6 2003/06/20 14:55:45 gbarrand Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01SteppingAction.cc,v 1.6 2003/06/20 14:55:45 gbarrand Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: AnaEx01SteppingVerbose.cc,v 1.6 2003/06/20 14:55:45 gbarrand Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user