Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
hadronic/Hadr01/include/Histo.hh
이 파일의 문서화 페이지로 가기
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 // $Id: Histo.hh 107541 2017-11-22 08:24:57Z gcosmo $
30 
31 #ifndef Histo_h
32 #define Histo_h 1
33 
34 //---------------------------------------------------------------------------
35 //
36 // ClassName: Histo
37 //
38 // Description: Utility class to hold and manipulate histograms/nTuples
39 //
40 // Author: V.Ivanchenko 30/10/03
41 //
42 //----------------------------------------------------------------------------
43 //
44 
45 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
46 
47 #include "globals.hh"
48 #include "G4DataVector.hh"
49 #include <vector>
50 
51 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
52 
54 class HistoMessenger;
55 
56 class Histo
57 {
58 public:
59 
60  Histo();
61 
62  ~Histo();
63 
64  // Book predefined histogramms
65  void Book();
66 
67  // Save histogramms to file
68  void Save();
69 
70  // In this method 1-D histogramms are predefined
71  void Add1D(const G4String&, const G4String&, G4int nb, G4double x1,
72  G4double x2, G4double u=1.);
73 
74  // It change bins and boundaries
76 
77  // Histogram activation/deactivation
78  void Activate(G4int, G4bool);
79 
80  // Histogramms are filled
81  void Fill(G4int, G4double, G4double);
82 
83  // Histogramms are scaled
84  void ScaleH1(G4int, G4double);
85 
86  // In this method nTuple is booked
87  void AddTuple(const G4String&);
88 
89  // In this method nTuple is booked
90  void AddTupleI(const G4String&);
91  void AddTupleF(const G4String&);
92  void AddTupleD(const G4String&);
93 
94  // Fill nTuple parameter
95  void FillTupleI(G4int, G4int);
96  void FillTupleF(G4int, G4float);
97  void FillTupleD(G4int, G4double);
98 
99  // Save tuple event
100  void AddRow();
101 
102  // Set output file
103  void SetFileName(const G4String&);
104 
105  inline void SetVerbose(G4int val) { fVerbose = val; };
106 
107  inline G4bool IsActive() const { return fHistoActive; };
108 
109 private:
110 
113 
117  G4int fNHisto;
118  G4int fVerbose;
122 
123  std::vector<G4int> fHisto;
124  std::vector<G4int> fTupleI;
125  std::vector<G4int> fTupleF;
126  std::vector<G4int> fTupleD;
127  std::vector<G4int> fBins;
128  std::vector<G4bool> fActive;
129  std::vector<G4double> fXmin;
130  std::vector<G4double> fXmax;
131  std::vector<G4double> fUnit;
132  std::vector<G4String> fIds;
133  std::vector<G4String> fTitles;
134  std::vector<G4String> fNtupleI;
135  std::vector<G4String> fNtupleF;
136  std::vector<G4String> fNtupleD;
137 
138 };
139 
140 #endif
std::vector< G4int > fHisto
void SetHisto1D(G4int, G4int, G4double, G4double, G4double)
std::vector< G4String > fTitles
Float_t x1[n_points_granero]
Definition: compare.C:5
float G4float
Definition: G4Types.hh:77
G4RootAnalysisManager * fManager
void Fill(G4int, G4double, G4double)
std::vector< G4double > fXmax
std::vector< G4double > fUnit
void FillTupleF(G4int, G4float)
std::vector< G4String > fIds
void AddTupleI(const G4String &)
double G4double
Definition: G4Types.hh:76
bool G4bool
Definition: G4Types.hh:79
std::vector< G4String > fNtupleF
void AddTupleF(const G4String &)
void SetFileName(const G4String &)
void SetVerbose(G4int val)
std::vector< G4int > fTupleF
std::vector< G4String > fNtupleI
int G4int
Definition: G4Types.hh:78
void ScaleH1(G4int, G4double)
void FillTupleD(G4int, G4double)
std::vector< G4int > fTupleD
std::vector< G4String > fNtupleD
G4bool IsActive() const
std::vector< G4double > fXmin
void FillTupleI(G4int, G4int)
void Activate(G4int, G4bool)
std::vector< G4int > fBins
Float_t x2[n_points_geant4]
Definition: compare.C:26
void Add1D(const G4String &, const G4String &, G4int nb, G4double x1, G4double x2, G4double u=1.)
void AddTupleD(const G4String &)
std::vector< G4int > fTupleI
std::vector< G4bool > fActive
void AddTuple(const G4String &)