source: trunk/examples/advanced/underground_physics/include/DMXAnalysisManager.hh@ 808

Last change on this file since 808 was 807, checked in by garnier, 17 years ago

update

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