Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
XrayTelAnalysis.hh
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 // $Id$
28 //
29 // Author: A. Pfeiffer (Andreas.Pfeiffer@cern.ch)
30 // (copy of his UserAnalyser class)
31 //
32 // History:
33 // -----------
34 // 7 Nov 2001 MGP Implemented according to A. Pfeiffer's instructions
35 //
36 // -------------------------------------------------------------------
37 // Class description:
38 // Example of analysis in a simulation application (histograms, ntuples etc.)
39 // This class follows the singleton design pattern;
40 // it is responsible for the analysis management and algorithms
41 // Histograms are compliant with AIDA 1.0 (the header files are
42 // copies from the Anaphe Interfaces directory), except for the usage of
43 // IHistoManager which is Anaphe/Lizard-specific
44 // For ntuples, for which the AIDA interfaces and compliant implementations
45 // are still in progress at the time of the current Geant4 release,
46 // an implementation with Anaphe/Lizard is shown
47 // Other implementations specific to an analysis system are possible too
48 // (see, for instance, JAS and OpenScientist documentation from the links
49 // in http://aida.freehep.org/)
50 // The implementation of the usage of ntuples shown in this example
51 // is expected to change in future Geant4 releases, when AIDA interfaces
52 // and related implementations would be available
53 // Further documentation is available from: http://www.ge.infn.it/geant4/lowE/
54 // http://aida.freehep.org/
55 // http://cern.ch/anaphe/
56 
57 // -------------------------------------------------------------------
58 
59 #ifndef G4PROCESSTESTANALYSIS_HH
60 #define G4PROCESSTESTANALYSIS_HH
61 
62 #include "globals.hh"
63 #include "G4ios.hh"
64 
65 #ifdef G4ANALYSIS_USE
66 #include "AIDA/IAnalysisFactory.h"
67 
68 #include "AIDA/ITreeFactory.h"
69 #include "AIDA/ITree.h"
70 
71 #include "AIDA/IHistogramFactory.h"
72 #include "AIDA/IHistogram1D.h"
73 #include "AIDA/IHistogram2D.h"
74 #include "AIDA/IHistogram3D.h"
75 
76 #include "AIDA/IPlotterFactory.h"
77 #include "AIDA/IPlotterRegion.h"
78 #include "AIDA/IPlotter.h"
79 
80 #include "AIDA/ITupleFactory.h"
81 #include "AIDA/ITuple.h"
82 
83 #include "AIDA/IManagedObject.h"
84 
85 // Histogramming from AIDA
86 class IAnalysisFactory;
87 class ITree;
88 class IHistogramFactory;
89 class ITupleFactory;
90 class ITuple;
91 #endif
92 
93 class G4Track;
94 
96 {
97 public:
98 
100 
101  void book();
102 
103  void finish();
104 
105  void analyseStepping(const G4Track& track, G4bool entering);
106 
107  static XrayTelAnalysis* getInstance();
108 
109 private:
110 
111  XrayTelAnalysis();
112 
113 // #ifdef G4ANALYSIS_USE_PLOTTER
114 // void plotAll();
115 // #endif
116  static XrayTelAnalysis* instance;
117 
118 #ifdef G4ANALYSIS_USE
119  AIDA::IAnalysisFactory *analysisFactory;
120  AIDA::ITree *tree;
121  AIDA::IHistogramFactory *histoFactory;
122  AIDA::ITupleFactory *tupleFactory;
123 // #ifdef G4ANALYSIS_USE_PLOTTER
124 // AIDA::IPlotterFactory *plotterFactory;
125 // AIDA::IPlotter *plotter;
126 // #endif
127 #endif
128  // Quantities for the ntuple
129  G4double eKin;
130  G4double x;
131  G4double y;
132  G4double z;
133  G4double dirX;
134  G4double dirY;
135  G4double dirZ;
136 
137  G4String asciiFileName;
138  G4String histFileName;
139  G4String histFileType;
140 
141 #ifdef G4ANALYSIS_USE
142  AIDA::IHistogram1D *h1;
143  AIDA::IHistogram2D *h2;
144  AIDA::IHistogram1D *h3;
145  AIDA::IHistogram2D *h4;
146  AIDA::ITuple * ntuple;
147 #endif
148  // std::ofstream asciiFile;
149 
150 };
151 
152 #endif