Index: trunk/examples/extended/analysis/AnaEx01/AnaEx01.cc
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/AnaEx01.cc	(revision 812)
+++ trunk/examples/extended/analysis/AnaEx01/AnaEx01.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01.cc,v 1.14 2006/06/29 16:33:13 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/GNUmakefile
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/GNUmakefile	(revision 812)
+++ trunk/examples/extended/analysis/AnaEx01/GNUmakefile	(revision 1230)
@@ -1,3 +1,3 @@
-# $Id: GNUmakefile,v 1.2 2003/12/03 10:34:02 gcosmo Exp $
+# $Id: GNUmakefile,v 1.3 2009/03/05 09:20:52 gbarrand Exp $
 # --------------------------------------------------------------
 # GNUmakefile for examples module.  Gabriele Cosmo, 06/04/98.
@@ -16,9 +16,2 @@
 
 include $(G4INSTALL)/config/binmake.gmk
-
-ifdef G4ANALYSIS_USE
- CPPFLAGS += `aida-config --include`
- LDFLAGS  += `aida-config --lib`
- LOADLIBS += `aida-config --lib`
-endif
-
Index: trunk/examples/extended/analysis/AnaEx01/include/AnaEx01AnalysisManager.hh
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/include/AnaEx01AnalysisManager.hh	(revision 812)
+++ trunk/examples/extended/analysis/AnaEx01/include/AnaEx01AnalysisManager.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01AnalysisManager.hh,v 1.9 2006/06/29 16:33:15 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/include/AnaEx01CalorHit.hh
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/include/AnaEx01CalorHit.hh	(revision 812)
+++ trunk/examples/extended/analysis/AnaEx01/include/AnaEx01CalorHit.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01CalorHit.hh,v 1.4 2006/06/29 16:33:17 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/include/AnaEx01CalorimeterSD.hh
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/include/AnaEx01CalorimeterSD.hh	(revision 812)
+++ trunk/examples/extended/analysis/AnaEx01/include/AnaEx01CalorimeterSD.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01CalorimeterSD.hh,v 1.4 2006/06/29 16:33:19 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/include/AnaEx01DetectorConstruction.hh
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/include/AnaEx01DetectorConstruction.hh	(revision 812)
+++ trunk/examples/extended/analysis/AnaEx01/include/AnaEx01DetectorConstruction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01DetectorConstruction.hh,v 1.4 2006/06/29 16:33:22 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/include/AnaEx01DetectorMessenger.hh
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/include/AnaEx01DetectorMessenger.hh	(revision 812)
+++ trunk/examples/extended/analysis/AnaEx01/include/AnaEx01DetectorMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01DetectorMessenger.hh,v 1.4 2006/06/29 16:33:25 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/include/AnaEx01EventAction.hh
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/include/AnaEx01EventAction.hh	(revision 812)
+++ trunk/examples/extended/analysis/AnaEx01/include/AnaEx01EventAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01EventAction.hh,v 1.6 2006/06/29 16:33:27 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/include/AnaEx01PhysicsList.hh
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/include/AnaEx01PhysicsList.hh	(revision 812)
+++ trunk/examples/extended/analysis/AnaEx01/include/AnaEx01PhysicsList.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01PhysicsList.hh,v 1.4 2006/06/29 16:33:29 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/include/AnaEx01PrimaryGeneratorAction.hh
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/include/AnaEx01PrimaryGeneratorAction.hh	(revision 812)
+++ trunk/examples/extended/analysis/AnaEx01/include/AnaEx01PrimaryGeneratorAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01PrimaryGeneratorAction.hh,v 1.4 2006/06/29 16:33:31 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/include/AnaEx01PrimaryGeneratorMessenger.hh
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/include/AnaEx01PrimaryGeneratorMessenger.hh	(revision 812)
+++ trunk/examples/extended/analysis/AnaEx01/include/AnaEx01PrimaryGeneratorMessenger.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01PrimaryGeneratorMessenger.hh,v 1.4 2006/06/29 16:33:33 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/include/AnaEx01RunAction.hh
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/include/AnaEx01RunAction.hh	(revision 812)
+++ trunk/examples/extended/analysis/AnaEx01/include/AnaEx01RunAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01RunAction.hh,v 1.6 2006/06/29 16:33:36 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/include/AnaEx01SteppingAction.hh
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/include/AnaEx01SteppingAction.hh	(revision 812)
+++ trunk/examples/extended/analysis/AnaEx01/include/AnaEx01SteppingAction.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01SteppingAction.hh,v 1.6 2006/06/29 16:33:38 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/include/AnaEx01SteppingVerbose.hh
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/include/AnaEx01SteppingVerbose.hh	(revision 812)
+++ trunk/examples/extended/analysis/AnaEx01/include/AnaEx01SteppingVerbose.hh	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01SteppingVerbose.hh,v 1.4 2006/06/29 16:33:40 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //  
Index: trunk/examples/extended/analysis/AnaEx01/src/AnaEx01AnalysisManager.cc
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/src/AnaEx01AnalysisManager.cc	(revision 812)
+++ trunk/examples/extended/analysis/AnaEx01/src/AnaEx01AnalysisManager.cc	(revision 1230)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: AnaEx01AnalysisManager.cc,v 1.16 2006/06/29 16:33:42 gunter Exp $
-// GEANT4 tag $Name:  $
+// $Id: AnaEx01AnalysisManager.cc,v 1.18 2009/05/13 08:33:17 gbarrand Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
@@ -70,10 +70,47 @@
 
   // 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);
+  // This tree is associated to a AnaEx01.<format> file.  
+
+  std::string h_name_EAbs("EAbs");
+  std::string h_name_LAbs("LAbs");
+  std::string h_name_EGap("EGap");
+  std::string h_name_LGap("LGap");
+  std::string t_name("AnaEx01");
+
+  // File format :
+  std::string format("xml");
+  //std::string format("hbook");
+  //std::string format("root");
+
+  std::string file("AnaEx01");
+  std::string ext;
+  ext = "."+format;
+
+  std::string opts;
+  if(format=="hbook") {
+    opts = "compress=no";
+
+    h_name_EAbs = "1";
+    h_name_LAbs = "2";
+    h_name_EGap = "3";
+    h_name_LGap = "4";
+    t_name = "101";
+
+  } else if(format=="root") {
+    opts = "compress=yes";
+
+  } else if(format=="xml") {
+    ext = ".aida";
+    opts = "compress=no";
+
+  } else {
+    G4cout << "storage format \"" << format << "\""
+           << " not handled in this example."
+           << G4endl;
+    return;
+  }
+
+  file += ext;
+  fTree = treeFactory->create(file,format,false,true,opts);
 
   // Factories are not "managed" by an AIDA analysis system.
@@ -81,5 +118,9 @@
   delete treeFactory; 
 
-  if(!fTree) return;
+  if(!fTree) {
+    G4cout << "can't create tree associated to file \"" << file << "\"."
+           << G4endl;
+    return;
+  }
 
   fTree->mkdir("histograms");
@@ -90,8 +131,12 @@
     fAIDA->createHistogramFactory(*fTree);
   if(histoFactory) {
-    fEAbs = histoFactory->createHistogram1D("EAbs",100,0,100);
-    fLAbs = histoFactory->createHistogram1D("LAbs",100,0,100);
-    fEGap = histoFactory->createHistogram1D("EGap",100,0,10);
-    fLGap = histoFactory->createHistogram1D("LGap",100,0,100);
+    fEAbs = histoFactory->createHistogram1D(h_name_EAbs,"EAbs",100,0,100);
+    if(!fEAbs) G4cout << "can't create histo EAbs." << G4endl;
+    fLAbs = histoFactory->createHistogram1D(h_name_LAbs,"LAbs",100,0,100);
+    if(!fLAbs) G4cout << "can't create histo LAbs." << G4endl;
+    fEGap = histoFactory->createHistogram1D(h_name_EGap,"EGap",100,0,10);
+    if(!fEGap) G4cout << "can't create histo EGap." << G4endl;
+    fLGap = histoFactory->createHistogram1D(h_name_LGap,"LGap",100,0,100);
+    if(!fLGap) G4cout << "can't create histo LGap." << G4endl;
     delete histoFactory;
   }
@@ -106,10 +151,12 @@
     
     // Create a tuple :
-    fTuple = tupleFactory->create("AnaEx01","AnaEx01",
+    fTuple = tupleFactory->create(t_name,"AnaEx01",
       "double EAbs,double LAbs,double EGap,double LGap");
+    if(!fTuple) G4cout << "can't create tuple." << G4endl;
     
     delete tupleFactory;
   }
 
+  fTree->cd("..");
 }
 AnaEx01AnalysisManager::~AnaEx01AnalysisManager() {
Index: trunk/examples/extended/analysis/AnaEx01/src/AnaEx01CalorHit.cc
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/src/AnaEx01CalorHit.cc	(revision 812)
+++ trunk/examples/extended/analysis/AnaEx01/src/AnaEx01CalorHit.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01CalorHit.cc,v 1.6 2006/06/29 16:33:44 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/src/AnaEx01CalorimeterSD.cc
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/src/AnaEx01CalorimeterSD.cc	(revision 812)
+++ trunk/examples/extended/analysis/AnaEx01/src/AnaEx01CalorimeterSD.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01CalorimeterSD.cc,v 1.5 2006/06/29 16:33:46 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/src/AnaEx01DetectorConstruction.cc
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/src/AnaEx01DetectorConstruction.cc	(revision 812)
+++ trunk/examples/extended/analysis/AnaEx01/src/AnaEx01DetectorConstruction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01DetectorConstruction.cc,v 1.5 2006/06/29 16:33:49 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/src/AnaEx01DetectorMessenger.cc
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/src/AnaEx01DetectorMessenger.cc	(revision 812)
+++ trunk/examples/extended/analysis/AnaEx01/src/AnaEx01DetectorMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01DetectorMessenger.cc,v 1.5 2006/06/29 16:33:51 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/src/AnaEx01EventAction.cc
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/src/AnaEx01EventAction.cc	(revision 812)
+++ trunk/examples/extended/analysis/AnaEx01/src/AnaEx01EventAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01EventAction.cc,v 1.6 2006/06/29 16:33:53 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/src/AnaEx01PhysicsList.cc
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/src/AnaEx01PhysicsList.cc	(revision 812)
+++ trunk/examples/extended/analysis/AnaEx01/src/AnaEx01PhysicsList.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01PhysicsList.cc,v 1.5 2006/06/29 16:33:55 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/src/AnaEx01PrimaryGeneratorAction.cc
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/src/AnaEx01PrimaryGeneratorAction.cc	(revision 812)
+++ trunk/examples/extended/analysis/AnaEx01/src/AnaEx01PrimaryGeneratorAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01PrimaryGeneratorAction.cc,v 1.5 2006/06/29 16:33:57 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/src/AnaEx01PrimaryGeneratorMessenger.cc
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/src/AnaEx01PrimaryGeneratorMessenger.cc	(revision 812)
+++ trunk/examples/extended/analysis/AnaEx01/src/AnaEx01PrimaryGeneratorMessenger.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01PrimaryGeneratorMessenger.cc,v 1.5 2006/06/29 16:33:59 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/src/AnaEx01RunAction.cc
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/src/AnaEx01RunAction.cc	(revision 812)
+++ trunk/examples/extended/analysis/AnaEx01/src/AnaEx01RunAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01RunAction.cc,v 1.7 2006/06/29 16:34:01 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/src/AnaEx01SteppingAction.cc
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/src/AnaEx01SteppingAction.cc	(revision 812)
+++ trunk/examples/extended/analysis/AnaEx01/src/AnaEx01SteppingAction.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01SteppingAction.cc,v 1.7 2006/06/29 16:34:03 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // 
Index: trunk/examples/extended/analysis/AnaEx01/src/AnaEx01SteppingVerbose.cc
===================================================================
--- trunk/examples/extended/analysis/AnaEx01/src/AnaEx01SteppingVerbose.cc	(revision 812)
+++ trunk/examples/extended/analysis/AnaEx01/src/AnaEx01SteppingVerbose.cc	(revision 1230)
@@ -26,5 +26,5 @@
 //
 // $Id: AnaEx01SteppingVerbose.cc,v 1.7 2006/06/29 16:34:05 gunter Exp $
-// GEANT4 tag $Name:  $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //
