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 | #ifndef hTestHisto_h |
---|
27 | #define hTestHisto_h 1 |
---|
28 | |
---|
29 | //--------------------------------------------------------------------------- |
---|
30 | // |
---|
31 | // ClassName: hTestHisto |
---|
32 | // |
---|
33 | // Description: Singleton class to hold Emc geometry parameters. |
---|
34 | // User cannot access to the constructor. |
---|
35 | // The pointer of the only existing object can be got via |
---|
36 | // hTestHisto::GetPointer() static method. |
---|
37 | // The first invokation of this static method makes |
---|
38 | // the singleton object. |
---|
39 | // |
---|
40 | // Author: V.Ivanchenko 27/09/00 |
---|
41 | // |
---|
42 | //---------------------------------------------------------------------------- |
---|
43 | // |
---|
44 | |
---|
45 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
46 | |
---|
47 | #include "globals.hh" |
---|
48 | #include <vector> |
---|
49 | #include "G4DynamicParticle.hh" |
---|
50 | |
---|
51 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
52 | |
---|
53 | class AIDA::IHistogram1D; |
---|
54 | class AIDA::ITuple; |
---|
55 | class AIDA::ITree; |
---|
56 | |
---|
57 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
58 | |
---|
59 | class hTestHisto |
---|
60 | { |
---|
61 | |
---|
62 | public: |
---|
63 | // With description |
---|
64 | |
---|
65 | static hTestHisto* GetPointer(); |
---|
66 | |
---|
67 | hTestHisto(); |
---|
68 | |
---|
69 | ~hTestHisto(); |
---|
70 | |
---|
71 | void BeginOfHisto(G4int); |
---|
72 | // In this method histogramms are booked |
---|
73 | |
---|
74 | void EndOfHisto(); |
---|
75 | // In this method bookHisto method is called in which histogramms are filled |
---|
76 | |
---|
77 | public: // Without description |
---|
78 | |
---|
79 | void SetHistoName(const G4String& name) {histName = name;}; |
---|
80 | void bookHisto(); |
---|
81 | inline ITuple* GetNtuple() const {return ntup;}; |
---|
82 | void SaveToTuple(const G4String&, G4double); |
---|
83 | void SaveToTuple(const G4String&, G4double, G4double); |
---|
84 | void SaveEvent(); |
---|
85 | G4double GetTrackLength() const {return trackLength;}; |
---|
86 | void ResetTrackLength() {trackLength = 0.0, trackAbs = true;}; |
---|
87 | void SetTrackOutAbsorber() {trackAbs = false;}; |
---|
88 | G4bool GetTrackInAbsorber() const {return trackAbs;}; |
---|
89 | void AddTrackLength(G4double x) {trackLength += x;}; |
---|
90 | void AddEndPoint(G4double); |
---|
91 | void AddEnergy(G4double, G4double); |
---|
92 | void AddDeltaElectron(const G4DynamicParticle*); |
---|
93 | void AddPhoton(const G4DynamicParticle*); |
---|
94 | void SetVerbose(G4int val) {verbose = val;}; |
---|
95 | G4int GetVerbose() const {return verbose;}; |
---|
96 | void SetHistoNumber(G4int val) {nHisto = val;}; |
---|
97 | void SetNtuple(G4bool val) {nTuple = val;}; |
---|
98 | |
---|
99 | void SetNumberOfAbsorbers(G4int val) {NumberOfAbsorbers = val;}; |
---|
100 | G4int GetNumberOfAbsorbers() const {return NumberOfAbsorbers;}; |
---|
101 | void SetAbsorberThickness(G4double val) {AbsorberThickness = val;}; |
---|
102 | G4double GetAbsorberThickness() const {return AbsorberThickness;}; |
---|
103 | void SetGap(G4double val) {gap = val;}; |
---|
104 | G4double GetGap() const {return gap;}; |
---|
105 | void SetNumAbsorbersSaved(G4int val) {nAbsSaved = val;}; |
---|
106 | G4int GetNumAbsorbersSaved() const {return nAbsSaved;}; |
---|
107 | void SetMaxEnergy(G4double val) {maxEnergy = val;}; |
---|
108 | G4double GetMaxEnergy() const {return maxEnergy;}; |
---|
109 | |
---|
110 | private: |
---|
111 | |
---|
112 | hTestHisto(hTestHisto&); |
---|
113 | const hTestHisto& operator=(const hTestHisto&); |
---|
114 | |
---|
115 | // MEMBERS |
---|
116 | static hTestHisto* fManager; |
---|
117 | |
---|
118 | G4String histName; |
---|
119 | G4String theName; |
---|
120 | std::vector<AIDA::IHistogram1D*> histo; |
---|
121 | AIDA::ITuple* ntup; |
---|
122 | AIDA::ITree* tree; |
---|
123 | G4int nHisto; |
---|
124 | G4int verbose; |
---|
125 | G4double zend; |
---|
126 | G4double zend2; |
---|
127 | G4double zEvt; |
---|
128 | G4double AbsorberThickness; |
---|
129 | G4double gap; |
---|
130 | G4int NumberOfAbsorbers; |
---|
131 | G4int nAbsSaved; |
---|
132 | G4double maxEnergy; |
---|
133 | G4double trackLength; |
---|
134 | G4bool trackAbs; |
---|
135 | G4bool nTuple; |
---|
136 | }; |
---|
137 | |
---|
138 | #endif |
---|