Geant4  10.01.p03
G4HnInformation.hh
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: G4HnInformation.hh 83599 2014-09-03 09:14:50Z gcosmo $
27 
28 // Data class for the added Hn/Pn information (not available in g4tools).
29 //
30 // Author: Ivana Hrivnacova, 04/07/2012 (ivana@ipno.in2p3.fr)
31 
32 #ifndef G4HnInformation_h
33 #define G4HnInformation_h 1
34 
35 #include "globals.hh"
36 #include "G4Fcn.hh"
37 #include "G4BinScheme.hh"
38 
39 // The additional Hn information per dimension
40 
42 {
44  const G4String& unitName,
45  const G4String& fcnName,
46  G4double unit,
47  G4Fcn fcn,
48  G4BinScheme binScheme)
49  : fUnitName(unitName),
50  fFcnName(fcnName),
51  fUnit(unit),
52  fFcn(fcn),
53  fBinScheme(binScheme)
54  {}
55 
57  : fUnitName(rhs.fUnitName),
58  fFcnName(rhs.fFcnName),
59  fUnit(rhs.fUnit),
60  fFcn(rhs.fFcn),
62  {}
63 
65  {
66  // check assignment to self
67  if (this == &rhs) return *this;
68 
69  fUnitName = rhs.fUnitName;
70  fFcnName = rhs.fFcnName;
71  fUnit = rhs.fUnit;
72  fFcn = rhs.fFcn;
73  fBinScheme = rhs.fBinScheme;
74 
75  return *this;
76  }
77 
78  //G4String fName;
84 };
85 
87 {
88  public:
89  enum {
90  kX = 0,
91  kY = 1,
92  kZ = 2
93  };
94 
95  public:
96  G4HnInformation(const G4String& name, G4int nofDimensions)
97  : fName(name),
99  fActivation(true),
100  fAscii(false) {fHnDimensionInformations.reserve(nofDimensions); }
101 
102  // Set methods
104  const G4HnDimensionInformation& hnDimensionInformation);
105  void SetActivation(G4bool activation);
106  void SetAscii(G4bool ascii);
107 
108  // Get methods
109  G4String GetName() const;
111  G4bool GetActivation() const;
112  G4bool GetAscii() const;
113 
114  private:
115  // Disabled default constructor
116  G4HnInformation();
117 
118  // Data members
120  std::vector<G4HnDimensionInformation> fHnDimensionInformations;
123 };
124 
125 // inline functions
126 
128  const G4HnDimensionInformation& hnDimensionInformation)
129 { fHnDimensionInformations.push_back(hnDimensionInformation); }
130 
131 inline void G4HnInformation::SetActivation(G4bool activation)
132 { fActivation = activation; }
133 
135 { fAscii = ascii; }
136 
138 { return fName; }
139 
141 { return &(fHnDimensionInformations[dimension]); }
142 
144 { return fActivation; }
145 
147 { return fAscii; }
148 
149 #endif
G4HnDimensionInformation & operator=(const G4HnDimensionInformation &rhs)
G4HnDimensionInformation(const G4HnDimensionInformation &rhs)
G4bool GetActivation() const
void SetActivation(G4bool activation)
G4String name
Definition: TRTMaterials.hh:40
G4double(* G4Fcn)(G4double)
Definition: G4Fcn.hh:36
void SetAscii(G4bool ascii)
void AddHnDimensionInformation(const G4HnDimensionInformation &hnDimensionInformation)
int G4int
Definition: G4Types.hh:78
G4HnDimensionInformation(const G4String &unitName, const G4String &fcnName, G4double unit, G4Fcn fcn, G4BinScheme binScheme)
bool G4bool
Definition: G4Types.hh:79
G4HnDimensionInformation * GetHnDimensionInformation(G4int dimension)
G4bool GetAscii() const
std::vector< G4HnDimensionInformation > fHnDimensionInformations
G4String GetName() const
G4BinScheme
Definition: G4BinScheme.hh:40
double G4double
Definition: G4Types.hh:76
G4HnInformation(const G4String &name, G4int nofDimensions)