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 // $Id: TransitionRadiationPhysics.cc 85047 2014-10-23 13:06:38Z maire $ 26 // 27 // 27 //....oooOO0OOooo........oooOO0OOooo........oo 28 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 28 //....oooOO0OOooo........oooOO0OOooo........oo 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 29 30 30 #include "TransitionRadiationPhysics.hh" 31 #include "TransitionRadiationPhysics.hh" 31 << 32 #include "DetectorConstruction.hh" 32 #include "DetectorConstruction.hh" 33 #include "XTRTransparentRegRadModel.hh" << 33 #include "G4VXTRenergyLoss.hh" 34 << 34 #include "G4ProcessManager.hh" 35 #include "G4Electron.hh" 35 #include "G4Electron.hh" 36 #include "G4GammaXTRadiator.hh" << 37 #include "G4Positron.hh" 36 #include "G4Positron.hh" 38 #include "G4ProcessManager.hh" << 37 >> 38 #include "G4VXTRenergyLoss.hh" 39 #include "G4RegularXTRadiator.hh" 39 #include "G4RegularXTRadiator.hh" 40 #include "G4StrawTubeXTRadiator.hh" << 41 #include "G4TransparentRegXTRadiator.hh" 40 #include "G4TransparentRegXTRadiator.hh" 42 #include "G4VXTRenergyLoss.hh" << 41 #include "G4GammaXTRadiator.hh" >> 42 #include "G4StrawTubeXTRadiator.hh" >> 43 43 #include "G4XTRGammaRadModel.hh" 44 #include "G4XTRGammaRadModel.hh" 44 #include "G4XTRRegularRadModel.hh" 45 #include "G4XTRRegularRadModel.hh" 45 #include "G4XTRTransparentRegRadModel.hh" 46 #include "G4XTRTransparentRegRadModel.hh" >> 47 #include "XTRTransparentRegRadModel.hh" 46 48 47 G4ThreadLocal G4VXTRenergyLoss* TransitionRadi << 49 G4ThreadLocal >> 50 G4VXTRenergyLoss* TransitionRadiationPhysics::fXTRProcess = nullptr; 48 51 49 //....oooOO0OOooo........oooOO0OOooo........oo 52 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 50 53 51 TransitionRadiationPhysics::TransitionRadiatio << 54 TransitionRadiationPhysics::TransitionRadiationPhysics(G4int verb, 52 : G4VPhysicsConstructor("XTR"), fDetector(pt << 55 DetectorConstruction* ptr) >> 56 : G4VPhysicsConstructor("XTR"), >> 57 fDetector(ptr), >> 58 fVerbose(verb), >> 59 fXTRModel("transpM") 53 {} 60 {} 54 61 55 //....oooOO0OOooo........oooOO0OOooo........oo 62 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 56 63 57 TransitionRadiationPhysics::~TransitionRadiati << 64 TransitionRadiationPhysics::~TransitionRadiationPhysics() >> 65 {} 58 66 59 //....oooOO0OOooo........oooOO0OOooo........oo 67 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 60 68 61 void TransitionRadiationPhysics::ConstructProc 69 void TransitionRadiationPhysics::ConstructProcess() 62 { 70 { 63 if ("dummy" == fXTRModel) { << 71 if("dummy" == fXTRModel) { return; } 64 return; << 72 if(0 < fVerbose) { 65 } << 73 G4cout<< "TransitionRadiationPhysics: XTR model <" << fXTRModel 66 if (0 < fVerbose) { << 74 << ">" <<G4endl; 67 G4cout << "TransitionRadiationPhysics: XTR << 68 } 75 } 69 RadiatorDescription* rDescription = fDetecto 76 RadiatorDescription* rDescription = fDetector->GetRadiatorDescription(); 70 77 71 if (fXTRModel == "gammaR") { << 78 if(fXTRModel == "gammaR" ) { 72 fXTRProcess = new G4GammaXTRadiator(rDescr << 79 73 rDescr << 80 fXTRProcess = new G4GammaXTRadiator(rDescription->fLogicalVolume, 74 rDescr << 81 100., 100., 75 rDescr << 82 rDescription->fFoilMaterial, 76 } << 83 rDescription->fGasMaterial, 77 else if (fXTRModel == "gammaM") { << 84 rDescription->fFoilThickness, 78 fXTRProcess = new G4XTRGammaRadModel(rDesc << 85 rDescription->fGasThickness, 79 rDesc << 86 rDescription->fFoilNumber, 80 rDesc << 87 "GammaXTRadiator"); 81 rDesc << 88 } 82 } << 89 else if(fXTRModel == "gammaM" ) 83 else if (fXTRModel == "strawR") { << 90 { 84 fXTRProcess = new G4StrawTubeXTRadiator( << 91 fXTRProcess = new G4XTRGammaRadModel(rDescription->fLogicalVolume, 85 rDescription->fLogicalVolume, rDescripti << 92 100., 100., 86 3.14159, fDetector->GetAbsorberMaterial( << 93 rDescription->fFoilMaterial, 87 } << 94 rDescription->fGasMaterial, 88 else if (fXTRModel == "regR") { << 95 rDescription->fFoilThickness, 89 fXTRProcess = new G4RegularXTRadiator(rDes << 96 rDescription->fGasThickness, 90 rDes << 97 rDescription->fFoilNumber, 91 rDes << 98 "GammaXTRadiator"); 92 "Reg << 99 } 93 } << 100 else if(fXTRModel == "strawR" ) 94 else if (fXTRModel == "transpR") { << 101 { 95 // G4TransparentRegXTRadiator* << 102 fXTRProcess = new G4StrawTubeXTRadiator(rDescription->fLogicalVolume, 96 fXTRProcess = new G4TransparentRegXTRadiat << 103 rDescription->fFoilMaterial, 97 rDescription->fLogicalVolume, rDescripti << 104 rDescription->fGasMaterial, 98 rDescription->fFoilThickness, rDescripti << 105 0.53, 99 "RegularXTRadiator"); << 106 3.14159, 100 } << 107 fDetector->GetAbsorberMaterial(), 101 else if (fXTRModel == "regM") { << 108 true, 102 fXTRProcess = new G4XTRRegularRadModel( << 109 "strawXTRadiator"); 103 rDescription->fLogicalVolume, rDescripti << 110 } 104 rDescription->fFoilThickness, rDescripti << 111 else if(fXTRModel == "regR" ) 105 "RegularXTRadiator"); << 112 { 106 } << 113 fXTRProcess = new G4RegularXTRadiator(rDescription->fLogicalVolume, 107 else if (fXTRModel == "transpM") { << 114 rDescription->fFoilMaterial, 108 fXTRProcess = new XTRTransparentRegRadMode << 115 rDescription->fGasMaterial, 109 rDescription->fLogicalVolume, rDescripti << 116 rDescription->fFoilThickness, 110 rDescription->fFoilThickness, rDescripti << 117 rDescription->fGasThickness, 111 "RegularXTRadiator"); << 118 rDescription->fFoilNumber, 112 } << 119 "RegularXTRadiator"); 113 if (!fXTRProcess) { << 120 } 114 if (0 < fVerbose) { << 121 else if(fXTRModel == "transpR" ) 115 G4cout << "TransitionRadiationPhysics: X << 122 { 116 << "> is not known - no XTR proce << 123 // G4TransparentRegXTRadiator* >> 124 fXTRProcess = new G4TransparentRegXTRadiator(rDescription->fLogicalVolume, >> 125 rDescription->fFoilMaterial, >> 126 rDescription->fGasMaterial, >> 127 rDescription->fFoilThickness, >> 128 rDescription->fGasThickness, >> 129 rDescription->fFoilNumber, >> 130 "RegularXTRadiator"); >> 131 } >> 132 else if(fXTRModel == "regM" ) >> 133 { >> 134 fXTRProcess = new G4XTRRegularRadModel(rDescription->fLogicalVolume, >> 135 rDescription->fFoilMaterial, >> 136 rDescription->fGasMaterial, >> 137 rDescription->fFoilThickness, >> 138 rDescription->fGasThickness, >> 139 rDescription->fFoilNumber, >> 140 "RegularXTRadiator"); >> 141 >> 142 } >> 143 else if(fXTRModel == "transpM" ) >> 144 { >> 145 fXTRProcess = new XTRTransparentRegRadModel(rDescription->fLogicalVolume, >> 146 rDescription->fFoilMaterial, >> 147 rDescription->fGasMaterial, >> 148 rDescription->fFoilThickness, >> 149 rDescription->fGasThickness, >> 150 rDescription->fFoilNumber, >> 151 "RegularXTRadiator"); >> 152 } >> 153 if(!fXTRProcess) { >> 154 if(0 < fVerbose) { >> 155 G4cout<< "TransitionRadiationPhysics: XTR model <" << fXTRModel >> 156 << "> is not known - no XTR process defined" <<G4endl; 117 } 157 } 118 return; << 158 return; 119 } 159 } 120 160 121 fXTRProcess->SetVerboseLevel(fVerbose); 161 fXTRProcess->SetVerboseLevel(fVerbose); 122 162 123 G4Electron* elec = G4Electron::Electron(); 163 G4Electron* elec = G4Electron::Electron(); 124 G4ProcessManager* manager = elec->GetProcess 164 G4ProcessManager* manager = elec->GetProcessManager(); 125 manager->AddDiscreteProcess(fXTRProcess); 165 manager->AddDiscreteProcess(fXTRProcess); 126 166 127 G4Positron* posi = G4Positron::Positron(); 167 G4Positron* posi = G4Positron::Positron(); 128 manager = posi->GetProcessManager(); 168 manager = posi->GetProcessManager(); 129 manager->AddDiscreteProcess(fXTRProcess); 169 manager->AddDiscreteProcess(fXTRProcess); 130 } 170 } 131 171 132 //....oooOO0OOooo........oooOO0OOooo........oo 172 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 173 133 174