75 G4String xtrModel = radiatorDescription->
GetXtrModel();
77 auto foilLayer = radiatorDescription->
GetLayer(0);
78 auto gasLayer = radiatorDescription->
GetLayer(1);
81 if (xtrModel ==
"strawR" && (!std::get<0>(strawTube).size())) {
82 TString text =
"Straw tube parameters are not defined.";
85 TString(
"The XTR process is not created."));
89 G4Material* foilMaterial = G4Material::GetMaterial(std::get<0>(foilLayer));
92 TString(
"Foil material ") + std::get<0>(foilLayer).data() +
94 TString(
"The XTR process is not created."));
98 G4Material* gasMaterial = G4Material::GetMaterial(std::get<0>(gasLayer));
101 TString(
"Gas material ") + std::get<0>(gasLayer).data() +
103 TString(
"The XTR process is not created."));
107 G4Material* strawTubeMaterial = 0;
108 if (std::get<0>(strawTube).size()) {
109 strawTubeMaterial = G4Material::GetMaterial(std::get<0>(strawTube));
110 if (!strawTubeMaterial) {
112 TString(
"Straw tube material ") + std::get<0>(strawTube).data() +
114 TString(
"The XTR process is not created."));
121 G4double foilThickness, foilFluctuation;
122 G4double gasThickness, gasFluctuation;
123 std::tie(std::ignore, foilThickness, foilFluctuation) = foilLayer;
124 std::tie(std::ignore, gasThickness, gasFluctuation) = gasLayer;
127 if ((xtrModel ==
"gammaR" || xtrModel ==
"gammaM") &&
128 (foilFluctuation * gasFluctuation == 0.)) {
130 TString(
"The gamma-distributed thickness parameter must be defined for "
131 "both radiator layers") +
133 TString(
"when gammaR or gammaM model is selected.") +
138 G4bool isXtrProcess =
false;
140 G4LogicalVolumeStore* lvStore = G4LogicalVolumeStore::GetInstance();
141 for (G4int i = 0; i < G4int(lvStore->size()); ++i) {
142 G4LogicalVolume* logicalVolume = (*lvStore)[i];
144 if (logicalVolume->GetName() != volumeName)
continue;
146 G4VXTRenergyLoss* xtrProcess = 0;
147 if (xtrModel ==
"gammaR") {
148 xtrProcess =
new G4GammaXTRadiator(logicalVolume, foilFluctuation,
149 gasFluctuation, foilMaterial, gasMaterial, foilThickness, gasThickness,
150 foilNumber,
"GammaXTRadiator");
152 else if (xtrModel ==
"gammaM") {
153 xtrProcess =
new G4XTRGammaRadModel(logicalVolume, foilFluctuation,
154 gasFluctuation, foilMaterial, gasMaterial, foilThickness, gasThickness,
155 foilNumber,
"GammaXTRadiator");
157 else if (xtrModel ==
"strawR") {
158 xtrProcess =
new G4StrawTubeXTRadiator(logicalVolume, foilMaterial,
159 gasMaterial, std::get<1>(strawTube), std::get<2>(strawTube),
160 strawTubeMaterial,
true,
"StrawXTRadiator");
162 else if (xtrModel ==
"regR") {
164 new G4RegularXTRadiator(logicalVolume, foilMaterial, gasMaterial,
165 foilThickness, gasThickness, foilNumber,
"RegularXTRadiator");
167 else if (xtrModel ==
"transpR") {
169 new G4TransparentRegXTRadiator(logicalVolume, foilMaterial, gasMaterial,
170 foilThickness, gasThickness, foilNumber,
"RegularXTRadiator");
172 else if (xtrModel ==
"regM") {
174 new G4XTRRegularRadModel(logicalVolume, foilMaterial, gasMaterial,
175 foilThickness, gasThickness, foilNumber,
"RegularXTRadiator");
178 TString text =
"XTR model <";
179 text += xtrModel.data();
180 text +=
" is not defined.";
182 "TG4TransitionRadiationPhysics",
"CreateXTRProcess", text);
191 G4Electron::Electron()->GetProcessManager()->AddDiscreteProcess(
193 G4Positron::Positron()->GetProcessManager()->AddDiscreteProcess(
202 TString(
"Volume ") + volumeName.data() + TString(
" does not exist.") +