Geant4  10.00.p03
GammaRayTelAnalysis.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 #ifdef G4ANALYSIS_USE
27 //
28 // $Id: GammaRayTelAnalysis.hh 68794 2013-04-05 13:23:26Z gcosmo $
29 // ------------------------------------------------------------
30 // GEANT 4 class header file
31 // CERN Geneva Switzerland
32 //
33 //
34 // ------------ GammaRayTelAnalysis ------
35 // by R.Giannitrapani, F. Longo & G.Santin (30 nov 2000)
36 //
37 // 03.04.2013 F.Longo and L.Pandola
38 // - migrated to G4AnalysisManager
39 //
40 // 07.12.2001 A.Pfeiffer
41 // - integrated Guy's addition of the ntuple
42 //
43 // 06.12.2001 A.Pfeiffer
44 // - updating to new design (singleton)
45 //
46 // 22.11.2001 G.Barrand
47 // - Adaptation to AIDA
48 // -------------------------------------------------------------------
49 // Class description:
50 // Example of analysis in a simulation application (histograms, ntuples etc.)
51 // This class follows the singleton design pattern;
52 // it is responsible for the analysis management and algorithms
53 //
54 // -------------------------------------------------------------------//
55 
56 #ifndef GammaRayTelAnalysis_h
57 #define GammaRayTelAnalysis_h 1
58 
59 #include "globals.hh"
60 #include <vector>
61 #include "G4ThreeVector.hh"
62 
63 // uncomment g4xml.hh and comment g4root.hh for a XML-based output file
64 
65 #include "g4root.hh"
66 //#include "g4xml.hh"
67 
68 
69 class GammaRayTelAnalysisMessenger;
71 
72 class GammaRayTelAnalysis {
73 public:
74  virtual ~GammaRayTelAnalysis();
75 
76 public:
77 
78 
79  // void BeginOfRun(G4int n);
80 
81  void BeginOfRun();
82  void EndOfRun();
83  void EndOfEvent(G4int flag);
84 
85  void Init();
86  void Finish();
87 
88  void SetHisto2DMode(G4String str) {histo2DMode = str;};
89  G4String GetHisto2DMode() {return histo2DMode;};
90 
91  void InsertPositionXZ(double x, double z);
92  void InsertPositionYZ(double y, double z);
93  void InsertEnergy(double en);
94  void InsertHits(int nplane);
95 
96  void setNtuple(float E, float p, float x, float y, float z);
97 
98  static GammaRayTelAnalysis* getInstance();
99 
100 private:
101 
102  GammaRayTelAnalysis();
103 
104  //void plot1D(IHistogram1D* histo);
105  //void plot2D(IHistogram2D* histo);
106  void Plot();
107 
108 private:
109  static GammaRayTelAnalysis* instance;
110 
111  GammaRayTelDetectorConstruction* GammaRayTelDetector;
112 
113  G4String histo2DMode;
114  G4String histoFileName;
115 
116  GammaRayTelAnalysisMessenger* analysisMessenger;
117 };
118 
119 
120 #endif
121 #endif
void Init()
Definition: G4IonTable.cc:89
G4double z
Definition: TRTMaterials.hh:39
int G4int
Definition: G4Types.hh:78
static MCTruthManager * instance