ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4ProductionCuts.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4ProductionCuts.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 //
26 //
27 //
28 //
29 // ------------------------------------------------------------
30 // GEANT 4 class header file
31 //
32 //
33 // Class Description
34 // This class is
35 //
36 // ------------------------------------------------------------
37 // First Implementation 17 Sep. 2002 H.Kurahige
38 // Add cuts for proton 28 Jul. 2009 H.Kurashige
39 // ------------------------------------------------------------
40 
41 #ifndef G4ProductionCuts_h
42 #define G4ProductionCuts_h 1
43 
44 #include "globals.hh"
45 #include "G4ios.hh"
46 #include <vector>
47 #include "G4ParticleDefinition.hh"
48 
50 {
54 
55  idxG4ProtonCut, // for proton
56 
58 };
59 
61 {
62  public: // with description
63  // constructor
65 
66  // copy constructor
68 
70 
71  public:
72  // destructor
73  virtual ~G4ProductionCuts();
74 
75  // equal opperators
76  G4bool operator==(const G4ProductionCuts &right) const;
77  G4bool operator!=(const G4ProductionCuts &right) const;
78 
79  public: // with description
80  // Set Cuts methods
81  void SetProductionCut(G4double cut, G4int index = -1);
83  void SetProductionCut(G4double cut, const G4String& pName);
84  // Set the productionCut in range with an index to particle type
85  // if index is omitted, the value is applied to all particles
86 
87  G4double GetProductionCut(G4int index) const;
88  // Get the productionCut in range with an index to particle type
89 
90  G4double GetProductionCut(const G4String& name) const;
91  // Get the productionCut in range with a name of particle type
92 
93  void SetProductionCuts(std::vector<G4double>&);
94  // Set the vector of production cuts in range for all particles
95 
96  const std::vector<G4double>& GetProductionCuts() const;
97  // Get the vector of production cuts in range for all particles
98 
99  G4bool IsModified() const;
100  // return true if any cut value has been modified
101  // after last calculation of PhysicsTable
102 
103  void PhysicsTableUpdated();
104  // inform end of calculation of PhysicsTable to ProductionCut
105 
106  public:
107  static G4int GetIndex(const G4String& name);
108  static G4int GetIndex(const G4ParticleDefinition* ptcl);
109 
110  protected:
111  std::vector<G4double> fRangeCuts;
113 
114  private:
118 
120 
121 };
122 
123 
124 inline
126 {
127  if (index<0) {
128  for(G4int i = 0; i < NumberOfG4CutIndex; i++) {
129  fRangeCuts[i] = cut;
130  }
131  isModified = true;
132 
133  } else if (index < NumberOfG4CutIndex) {
134  fRangeCuts[index] = cut;
135  isModified = true;
136  }
137 }
138 
139 inline
141 {
142  G4int idx = -1;
143  if(ptcl) idx = GetIndex(ptcl);
144  if(idx>=0) SetProductionCut(cut,idx);
145 }
146 
147 inline
149 {
150  G4int idx = GetIndex(pName);
151  if(idx>=0) SetProductionCut(cut,idx);
152 }
153 
154 inline
156 {
157  G4double cut=-1.0;
158  if ( (index>=0) && (index<NumberOfG4CutIndex) ) {
159  cut = fRangeCuts[index];
160  }
161  return cut;
162 }
163 
164 inline
166 {
167  return GetProductionCut(GetIndex(name));
168 }
169 
170 
171 inline
172 const std::vector<G4double>& G4ProductionCuts::GetProductionCuts() const
173 {
174  return fRangeCuts;
175 }
176 
177 inline
179 {
180  return isModified;
181 }
182 
183 inline
185 {
186  isModified = false;
187 }
188 
189 #endif
190 
191 
192 
193 
194 
195 
196 
197 
198 
199 
200