Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FCALRunAction.cc
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 // $Id: FCALRunAction.cc 69896 2013-05-17 09:57:59Z gcosmo $
27 //
28 //
29 
30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
32 
33 //#ifndef G4ANALYSIS_USE
34 
35 #include "FCALRunAction.hh"
36 
37 #include "G4Run.hh"
38 #include "G4RunManager.hh"
39 #include "G4UImanager.hh"
40 #include "G4VVisManager.hh"
41 #include "G4ios.hh"
42 
43 #include "Randomize.hh"
44 #include "FCALAnalysisManager.hh"
45 //#include <AIDA/AIDA.h>
46 
47 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
48 
50 {
51 }
52 
53 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
54 
56 {
57 
58  // cleanHisto();
59 
60 }
61 
62 
63 //void FCALRunAction::bookHisto(){
64 //
65 // AIDA::IAnalysisFactory* af = AIDA_createAnalysisFactory();
66 //
67 // // Creating the tree factory
68 // AIDA::ITreeFactory* tf = af->createTreeFactory();
69 //
70 // // Creating a tree mapped to an hbook file.
71 // tree = tf->create("fcal.paw", "hbook", false, true);
72 //
73 // // Creating a histogram factory, whose histograms will be handled by the tree
74 // AIDA::IHistogramFactory* hf = af->createHistogramFactory(*tree);
75 //
76 // // Creating a ntuple factory.
77 //
78 // AIDA::ITupleFactory* nf = af->createTupleFactory(*tree);
79 //
80 // // Creating ntuples
81 //
82 // ntuple[1] = nf->create("100","Number Out of World","float OutOfWorld, i, j");
83 //
84 // ntuple[2] = nf->create("200","Secondary Info","float Secondary, i, j");
85 //
86 // ntuple[3] = nf->create("300","Energy Deposits","float EmEdep, HadEdep");
87 //
88 // // Creating Histograms
89 //
90 // histo[1] = hf->createHistogram1D("1","Number of OutOfWorld",100, 0., 100.);
91 // histo[2] = hf->createHistogram1D("2","Number of Secondaries",100, 0., 100.);
92 // histo[3] = hf->createHistogram1D("3","Electromagnetic Energy / MeV",100, 0., 100.);
93 // histo[4] = hf->createHistogram1D("4","Hadronic Energy / MeV",100, 0., 100.);
94 //
95 // delete hf;
96 // delete tf;
97 // delete af;
98 // delete nf;
99 //
100 //}
101 //
103 //
104 //void FCALRunAction::cleanHisto()
105 //{
106 //
107 // tree->commit(); // Writing the histograms to the file
108 // tree->close(); // and closing the tree (and the file)
109 //
110 // delete tree;
111 //
112 //
113 //}
114 //
115 
116 
117 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
118 
120 {
121 
122  G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl;
123 
124  // if (aRun->GetRunID() == 0) bookHisto();
125 
127  {
129  UI->ApplyCommand("/vis/scene/notifyHandlers");
130  }
131 
132 #ifdef G4ANALYSIS_USE
133 
134  // book histograms and ntuples
135 
136  FCALAnalysisManager * analysis = FCALAnalysisManager::getInstance();
137  analysis->book();
138 
139 #endif
140 
141 }
142 
143 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
144 
146 {
147 
148 #ifdef G4ANALYSIS_USE
149  FCALAnalysisManager* analysis = FCALAnalysisManager::getInstance();
150 #endif
151 
153  G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/update");
154  }
155 
156 #ifdef G4ANALYSIS_USE
157  analysis->finish();
158 #endif
159 
160 }
161 
162 //#endif
163 
164 
165 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
166 
167 
168 
169 
170 
171