Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 // G4ProcessManager inline function members im << 27 // 26 // 28 // - 02.12.1995, G.Cosmo - First implementatio << 27 // $Id: G4ProcessManager.icc,v 1.6 2007/03/30 01:02:28 kurasige Exp $ 29 // ------------------------------------------- << 28 // GEANT4 tag $Name: geant4-09-01-patch-03 $ >> 29 // >> 30 // >> 31 >> 32 #include "G4ProcessAttribute.hh" 30 33 >> 34 // ----------------------------------------- >> 35 // inlined function members implementation >> 36 // ----------------------------------------- 31 inline 37 inline 32 void G4ProcessManager::SetParticleType(const G << 38 void G4ProcessManager::SetParticleType(const G4ParticleDefinition* aParticle) 33 { 39 { 34 theParticleType = aParticle; 40 theParticleType = aParticle; 35 } 41 } 36 42 37 inline 43 inline 38 G4ProcessVector* G4ProcessManager::GetProcessL << 44 G4ProcessVector* G4ProcessManager::GetProcessList() const 39 { 45 { 40 return theProcessList; 46 return theProcessList; 41 } 47 } 42 48 43 inline 49 inline 44 G4int G4ProcessManager::GetProcessListLength() << 50 G4int G4ProcessManager::GetProcessListLength() const 45 { 51 { 46 return numberOfProcesses; 52 return numberOfProcesses; 47 } 53 } 48 54 49 inline 55 inline 50 G4int G4ProcessManager::GetProcessIndex(G4VPro << 56 G4int G4ProcessManager::GetProcessIndex(G4VProcess* aProcess) const 51 { 57 { 52 G4int idx = G4int(theProcessList->index(aPro << 58 G4int idx = theProcessList->index(aProcess); 53 if (idx>=numberOfProcesses) idx = -1; 59 if (idx>=numberOfProcesses) idx = -1; 54 return idx; 60 return idx; 55 } 61 } 56 62 57 inline 63 inline 58 G4int G4ProcessManager::GetProcessVectorId(G4P << 64 G4int G4ProcessManager::GetProcessVectorId(G4ProcessVectorDoItIndex idx, 59 G4P << 65 G4ProcessVectorTypeIndex typ) const 60 { 66 { 61 if ( idx == idxAtRest ) << 67 if ( idx == idxAtRest ) { 62 { << 63 if (typ == typeGPIL) { return 0; } 68 if (typ == typeGPIL) { return 0; } 64 else { return 1; } 69 else { return 1; } 65 } << 70 } else if ( idx == idxAlongStep ) { 66 else if ( idx == idxAlongStep ) << 67 { << 68 if (typ == typeGPIL) { return 2; } 71 if (typ == typeGPIL) { return 2; } 69 else { return 3; } 72 else { return 3; } 70 } << 73 } else if ( idx == idxPostStep ) { 71 else if ( idx == idxPostStep ) << 72 { << 73 if (typ == typeGPIL) { return 4; } 74 if (typ == typeGPIL) { return 4; } 74 else { return 5; } 75 else { return 5; } 75 } << 76 } else { 76 else << 77 { << 78 return -1; 77 return -1; 79 } 78 } 80 } 79 } 81 80 82 inline 81 inline 83 G4ProcessVector* G4ProcessManager::GetProcessV << 82 G4ProcessVector* G4ProcessManager::GetProcessVector( 84 G4Proce << 83 G4ProcessVectorDoItIndex idx, 85 G4Proce << 84 G4ProcessVectorTypeIndex typ 86 ) const 85 ) const 87 { 86 { 88 G4int ivec = GetProcessVectorId(idx, typ); 87 G4int ivec = GetProcessVectorId(idx, typ); 89 if ( ivec >=0 ) << 88 if ( ivec >=0 ) { 90 { << 91 return theProcVector[ivec]; 89 return theProcVector[ivec]; 92 } << 90 } else { 93 else << 91 return 0; 94 { << 95 return nullptr; << 96 } 92 } 97 } 93 } 98 94 99 inline 95 inline 100 G4ProcessVector* << 96 G4ProcessVector* G4ProcessManager::GetAtRestProcessVector(G4ProcessVectorTypeIndex typ) const 101 G4ProcessManager::GetAtRestProcessVector(G4Pro << 102 { 97 { 103 if (typ == typeGPIL) { return theProcVector[ 98 if (typ == typeGPIL) { return theProcVector[0]; } 104 else { return theProcVector[ << 99 else { return theProcVector[1]; } 105 } 100 } 106 101 107 inline 102 inline 108 G4ProcessVector* << 103 G4ProcessVector* G4ProcessManager::GetAlongStepProcessVector(G4ProcessVectorTypeIndex typ) const 109 G4ProcessManager::GetAlongStepProcessVector(G4 << 110 { 104 { 111 if (typ == typeGPIL) { return theProcVector[ 105 if (typ == typeGPIL) { return theProcVector[2]; } 112 else { return theProcVector[ << 106 else { return theProcVector[3]; } 113 } 107 } 114 108 115 inline 109 inline 116 G4ProcessVector* << 110 G4ProcessVector* G4ProcessManager::GetPostStepProcessVector(G4ProcessVectorTypeIndex typ) const 117 G4ProcessManager::GetPostStepProcessVector(G4P << 118 { 111 { 119 if (typ == typeGPIL) { return theProcVector[ 112 if (typ == typeGPIL) { return theProcVector[4]; } 120 else { return theProcVector[ << 113 else { return theProcVector[5]; } 121 } 114 } 122 115 123 inline 116 inline 124 G4int G4ProcessManager::GetAtRestIndex( << 117 G4int G4ProcessManager::GetAtRestIndex( 125 G4VProcess* aProcess << 118 G4VProcess* aProcess, 126 G4ProcessVectorTypeI << 119 G4ProcessVectorTypeIndex typ 127 ) const << 120 ) const 128 { 121 { 129 return GetProcessVectorIndex(aProcess, idxAt 122 return GetProcessVectorIndex(aProcess, idxAtRest, typ); 130 } 123 } 131 124 132 inline 125 inline 133 G4int G4ProcessManager::GetAlongStepIndex( << 126 G4int G4ProcessManager::GetAlongStepIndex( 134 G4VProcess* aProcess << 127 G4VProcess* aProcess, 135 G4ProcessVectorTypeI << 128 G4ProcessVectorTypeIndex typ 136 ) const << 129 ) const 137 { 130 { 138 return GetProcessVectorIndex(aProcess, idxAl 131 return GetProcessVectorIndex(aProcess, idxAlongStep, typ); 139 } 132 } 140 133 141 inline 134 inline 142 G4int G4ProcessManager::GetPostStepIndex( << 135 G4int G4ProcessManager::GetPostStepIndex( 143 G4VProcess* aProcess << 136 G4VProcess* aProcess, 144 G4ProcessVectorTypeI << 137 G4ProcessVectorTypeIndex typ 145 ) const << 138 ) const 146 { 139 { 147 return GetProcessVectorIndex(aProcess, idxPo 140 return GetProcessVectorIndex(aProcess, idxPostStep, typ); 148 } 141 } 149 142 150 inline 143 inline 151 G4int G4ProcessManager::AddRestProcess(G4VProc << 144 G4int G4ProcessManager::AddRestProcess(G4VProcess *aProcess,G4int ord) 152 { 145 { 153 return AddProcess(aProcess, ord, ordInActive 146 return AddProcess(aProcess, ord, ordInActive, ordInActive); 154 } 147 } 155 148 156 inline 149 inline 157 G4int G4ProcessManager::AddContinuousProcess(G << 150 G4int G4ProcessManager::AddContinuousProcess(G4VProcess *aProcess,G4int ord) 158 { 151 { 159 return AddProcess(aProcess, ordInActive, ord 152 return AddProcess(aProcess, ordInActive, ord, ordInActive); 160 } 153 } 161 154 162 inline 155 inline 163 G4int G4ProcessManager::AddDiscreteProcess(G4V << 156 G4int G4ProcessManager::AddDiscreteProcess(G4VProcess *aProcess,G4int ord) 164 { 157 { 165 return AddProcess(aProcess, ordInActive, ord 158 return AddProcess(aProcess, ordInActive, ordInActive, ord); 166 } 159 } 167 160 168 inline 161 inline 169 G4ParticleDefinition* G4ProcessManager::GetPar << 162 G4ParticleDefinition* G4ProcessManager::GetParticleType() const 170 { 163 { 171 return (G4ParticleDefinition*)theParticleTyp << 164 return (G4ParticleDefinition* )theParticleType; 172 } 165 } 173 166 >> 167 174 inline 168 inline 175 void G4ProcessManager::SetVerboseLevel(G4int v << 169 void G4ProcessManager::SetVerboseLevel(G4int value) 176 { 170 { 177 verboseLevel = value; 171 verboseLevel = value; 178 } 172 } 179 173 180 inline 174 inline 181 G4int G4ProcessManager::GetVerboseLevel() cons << 175 G4int G4ProcessManager::GetVerboseLevel() const 182 { 176 { 183 return verboseLevel; << 177 return verboseLevel; 184 } 178 } >> 179 185 180