Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
LXeHistoManager.cc
이 파일의 문서화 페이지로 가기
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 //
28 //
29 //
30 // $Id: LXeHistoManager.cc
31 //
32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
34 
35 #include "LXeHistoManager.hh"
36 #include "G4UnitsTable.hh"
37 
38 //#include<vector>
39 
40 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
41 
43  : fFileName("lxe")
44 {
45  Book();
46 }
47 
48 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
49 
51 {
52  delete G4AnalysisManager::Instance();
53 }
54 
55 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
56 
58 {
59  // Create or get analysis manager
60  // The choice of analysis technology is done via selection of a namespace
61  // in LXeHistoManager.hh
62  G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
63  analysisManager->SetFileName(fFileName);
64  analysisManager->SetVerboseLevel(1);
65  analysisManager->SetActivation(true); // enable inactivation of histograms
66 
67  // Define histogram indices, titles
68  std::vector<std::pair<G4String, G4String> > histograms =
69  { std::pair<G4String, G4String>("0", "dummy"),
70  std::pair<G4String, G4String>("1", "hits per event"),
71  std::pair<G4String, G4String>("2", "hits per event above threshold"),
72  std::pair<G4String, G4String>("3", "scintillation photons per event"),
73  std::pair<G4String, G4String>("4", "Cerenkov photons per event"),
74  std::pair<G4String, G4String>("5", "absorbed photons per event"),
75  std::pair<G4String, G4String>
76  ("6", "photons absorbed at boundary per event"),
77  std::pair<G4String, G4String>
78  ("7", "energy deposition in scintillator per event"),
79  };
80 
81  // Default values (to be reset via /analysis/h1/set command)
82  G4int nbins = 100;
83  G4double vmin = 0.;
84  G4double vmax = 100.;
85 
86  // Create all histograms as inactivated
87  // as we have not yet set nbins, vmin, vmax
88  for (auto histogram : histograms) {
89  G4int ih = analysisManager->
90  CreateH1("h" + histogram.first, histogram.second, nbins, vmin, vmax);
91  analysisManager->SetH1Activation(ih, false);
92  }
93 }
G4bool SetFileName(const G4String &fileName)
void SetActivation(G4bool activation)
double G4double
Definition: G4Types.hh:76
void SetVerboseLevel(G4int verboseLevel)
void SetH1Activation(G4bool activation)
int G4int
Definition: G4Types.hh:78
Definition of the LXeHistoManager class.