Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DMXAnalysisManager.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: DMXAnalysisManager.hh
28 // GEANT4 tag $Name:
29 //
30 // Author: Alex Howard (alexander.howard@cern.ch)
31 //
32 // History:
33 // -----------
34 // 16 Jan 2002 Alex Howard Created
35 // 22 Oct 2009 Luciano Pandola Added TreeFactory, removed ntuple4
36 //
37 // -------------------------------------------------------------------
38 
39 
40 
41 #ifdef G4ANALYSIS_USE
42 #ifndef DMXAnalysisManager_h
43 #define DMXAnalysisManager_h 1
44 
45 #include "globals.hh"
46 
47 // Histogramming from AIDA
48 
49 
50 #include "AIDA/IAnalysisFactory.h"
51 
52 #include "AIDA/ITreeFactory.h"
53 #include "AIDA/ITree.h"
54 
55 #include "AIDA/IHistogramFactory.h"
56 #include "AIDA/IHistogram1D.h"
57 #include "AIDA/IHistogram2D.h"
58 #include "AIDA/IHistogram3D.h"
59 
60 // #include "AIDA/IPlotterFactory.h"
61 // #include "AIDA/IPlotterRegion.h"
62 // #include "AIDA/IPlotter.h"
63 
64 #include "AIDA/ITupleFactory.h"
65 #include "AIDA/ITuple.h"
66 
67 #include "AIDA/IManagedObject.h"
68 
69 // # include "AIDA/IFitter.h"
70 // # include "AIDA/IFitResult.h"
71 // # include "AIDA/IFitData.h"
72 // # include "AIDA/IRangeSet.h"
73 // # include "AIDA/IFitParameterSettings.h"
74 // # include "AIDA/IFunctionFactory.h"
75 // # include "AIDA/IFunction.h"
76 // # include "AIDA/IFitFactory.h"
77 
78 namespace AIDA {
79  class IAnalysisFactory;
80  class ITree;
81  class ITreeFactory;
82  class IHistogramFactory;
83  class ITupleFactory;
84  class ITuple;
85  class IHistogram1D;
86  class IHistogram2D;
87  //class IPlotter;
88  // class IFitter;
89  //class IFitResult;
90  //class IFitData;
91  //class IRangeSet;
92  //class IFitParameterSettings;
93  //class IFunctionFactory;
94  //class IFunction;
95  //class IFitFactory;
96 }
97 
98 
99 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
100 
101 class DMXAnalysisManager
102 {
103 public:
104 
105  virtual ~DMXAnalysisManager();
106 
107  // void book();
108  void book(G4String, G4bool);
109 
110  void Init();
111  void Finish();
112 
113  //fill histograms with SHC (Scint Hits) data from DMXEventAction
114  void analyseScintHits(G4int event_id, G4double energy_pri, G4double totEnergy, G4int S_hits, G4double firstLXeHitTime, G4int P_hits, G4double aveTimePmtHits, G4String firstparticleName, G4double firstParticleE, G4bool gamma_ev, G4bool neutron_ev, G4bool positron_ev, G4bool electron_ev, G4bool other_ev, long seed1, long seed2);
115 
116  //fill histograms with PHC (Pmt Hits) data from DMXEventAction
117  void analysePMTHits(G4int, G4int, G4double, G4double, G4double);
118 
119  //fill histograms with data from DMXParticleSource / secondary history
120  void analyseParticleSource(G4double, G4String);
121 
122  //fill histograms with data from DMXPrimaryGenerator
123  void analysePrimaryGenerator(G4double);
124 
125  //fill histograms with data from DMXPrimaryGenerator
126  void HistTime(G4double);
127 
128  //fit exponential decay time of scintillation time:
129  void PulseTimeFit();
130 
131  //Method to interactively display histograms
132  void PlotHistos(G4bool);
133 
134  //Method to interactively display histograms
135  void PlotHistosInit();
136  //Method to interactively display histograms
137  void PlotHistosInter(G4int flag);
138 
139  //method to call to create an instance of this class
140  static DMXAnalysisManager* getInstance();
141 
142 
143 private:
144 
145  //private constructor in order to create a singleton
146  DMXAnalysisManager();
147 
148  static DMXAnalysisManager* instance;
149 
150  // Quantities for the ntuple
151 
152 
153  G4int event_id;
154  G4double energy_pri;
155  G4double totEnergy;
156  G4int S_hits;
157  G4double firstLXeHitTime;
158  G4int P_hits;
159  G4double aveTimePmtHits;
160  G4String firstparticleName;
161  G4double firstParticleE;
162  G4bool gamma_ev;
163  G4bool neutron_ev;
164  G4bool positron_ev;
165  G4bool electron_ev;
166  G4bool other_ev;
167  long seed1; long seed2;
168 
170 
172 
173  G4double time;
174 
175  G4bool interactive;
176 
177  AIDA::IAnalysisFactory *af;
178  AIDA::ITreeFactory *tf;
179  AIDA::ITree *tree;
180  AIDA::IHistogramFactory *hf;
181  AIDA::ITupleFactory *tpf;
182  AIDA::ITuple *ntuple1;
183  AIDA::ITuple *ntuple2;
184  AIDA::ITuple *ntuple3;
185 
186 
187  AIDA::IHistogram1D* hEsourcep;
188  AIDA::IHistogram1D* hEdepp;
189  AIDA::IHistogram1D* hEdepRecoil;
190  AIDA::IHistogram1D* hNumPhLow;
191  AIDA::IHistogram1D* hNumPhHigh;
192  AIDA::IHistogram1D* hAvPhArrival;
193  AIDA::IHistogram1D* hPhArrival;
194  AIDA::IHistogram2D* hPMTHits;
195  AIDA::IHistogram2D* h1stPMTHit;
196  AIDA::IHistogram1D* hGammaEdep;
197  AIDA::IHistogram1D* hNeutronEdep;
198  AIDA::IHistogram1D* hElectronEdep;
199  AIDA::IHistogram1D* hPositronEdep;
200  AIDA::IHistogram1D* hOtherEdep;
201 
202  //AIDA::IFunctionFactory *funFact;
203  //AIDA::IFitFactory *fitFact;
204  //AIDA::IFunction *exponFun;
205  //AIDA::IFunction *gaussFun;
206  //AIDA::IFitter *e_fitter;
208 };
209 #endif
210 #endif
211 
212 
213