/[PAMELA software]/PamVMC/PamG4RunConfiguration/src/PamG4RangeCutsPhysics.cxx
ViewVC logotype

Contents of /PamVMC/PamG4RunConfiguration/src/PamG4RangeCutsPhysics.cxx

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Fri Jun 12 20:19:57 2009 UTC (15 years, 6 months ago) by pam-rm2
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
FILE REMOVED
*** empty log message ***

1 #include "PamG4RangeCutsPhysics.h"
2
3 #include <G4Material.hh>
4 #include <G4ParticleDefinition.hh>
5 #include <G4Electron.hh>
6 #include <G4ProcessManager.hh>
7 #include <G4ProductionCuts.hh>
8 #include <G4LogicalVolume.hh>
9 #include <G4VPhysicalVolume.hh>
10 #include <G4Region.hh>
11 #include <G4RegionStore.hh>
12 #include <G4ProductionCutsTable.hh>
13 #include <G4EmCalculator.hh>
14
15 #include <TGeoManager.h>
16 #include <TGeoVolume.h>
17 #include <TObjArray.h>
18 #include <TG4GeometryServices.h>
19 #include <TG4Limits.h>
20 PamG4RangeCutsPhysics::PamG4RangeCutsPhysics(
21 const G4String& name):
22 TG4VPhysicsConstructor(name)
23 {
24 /// Standard constructor
25 }
26
27 PamG4RangeCutsPhysics::PamG4RangeCutsPhysics(
28 G4int verboseLevel,
29 const G4String& name):
30 TG4VPhysicsConstructor(name, verboseLevel)
31 {
32 /// Destructor
33 }
34
35 void PamG4RangeCutsPhysics::ConstructParticle()
36 {
37 /// The particles are constructed in the physics list.
38 }
39
40 void PamG4RangeCutsPhysics::ConstructProcess()
41 {
42
43 if (VerboseLevel() > 0) {
44 G4cout << "### RANGE Cuts constructed. " << G4endl;
45 }
46
47 G4Region* IRONreg = new G4Region("IRON_reg");
48 G4Region* TUNGAreg = new G4Region("TUNGA_reg");
49 G4Region* He3reg = new G4Region("He3_reg");
50 G4Region* ALUMINIUMreg = new G4Region("ALUMINIUM_reg");
51 G4Region* N2GASreg = new G4Region("N2GAS_reg");
52 G4Region* SCINTreg = new G4Region("SCINT_reg");
53 G4Region* PLASTreg = new G4Region("PLAST_reg");
54 G4Region* CADMIUMreg = new G4Region("CADMIUM_reg");
55 G4Region* SICALOreg = new G4Region("SICALO_reg");
56 G4Region* SITRreg = new G4Region("SITR_reg");
57 G4Region* CERAMICreg = new G4Region("CERAMIC_reg");
58 G4Region* G10Creg = new G4Region("G10C_reg");
59 G4Region* POLYSTYRENEreg = new G4Region("POLYSTYRENE_reg");
60 G4Region* MYLARreg = new G4Region("MYLAR_reg");
61 G4Region* TIALVAreg = new G4Region("TIALVA_reg");
62 G4Region* POLYETHYLENEreg = new G4Region("POLYETHYLENE_reg");
63 G4Region* AMG6Mreg = new G4Region("AMG6M_reg");
64 G4Region* NYLON6reg = new G4Region("NYLON6_reg");
65
66
67 G4ProductionCuts* IRONcuts = new G4ProductionCuts();
68 G4ProductionCuts* TUNGAcuts = new G4ProductionCuts();
69 G4ProductionCuts* He3cuts = new G4ProductionCuts();
70 G4ProductionCuts* ALUMINIUMcuts = new G4ProductionCuts();
71 G4ProductionCuts* N2GAScuts = new G4ProductionCuts();
72 G4ProductionCuts* SCINTcuts = new G4ProductionCuts();
73 G4ProductionCuts* PLASTcuts = new G4ProductionCuts();
74 G4ProductionCuts* CADMIUMcuts = new G4ProductionCuts();
75 G4ProductionCuts* SICALOcuts = new G4ProductionCuts();
76 G4ProductionCuts* SITRcuts = new G4ProductionCuts();
77 G4ProductionCuts* CERAMICcuts = new G4ProductionCuts();
78 G4ProductionCuts* G10Ccuts = new G4ProductionCuts();
79 G4ProductionCuts* POLYSTYRENEcuts = new G4ProductionCuts();
80 G4ProductionCuts* MYLARcuts = new G4ProductionCuts();
81 G4ProductionCuts* TIALVAcuts = new G4ProductionCuts();
82 G4ProductionCuts* POLYETHYLENEcuts = new G4ProductionCuts();
83 G4ProductionCuts* AMG6Mcuts = new G4ProductionCuts();
84 G4ProductionCuts* NYLON6cuts = new G4ProductionCuts();
85
86 TObjArray * VolArr = gGeoManager->GetListOfVolumes();
87 TIterator *n= (TIterator *)VolArr->MakeIterator();
88 TGeoVolume *vol = 0;
89 G4LogicalVolume *tmpLV;
90
91
92 TString volname="";
93 TString matname="";
94
95
96
97 while(vol=(TGeoVolume*)n->Next()){
98 volname = vol->GetName();
99 matname = vol->GetMaterial()->GetName();
100 tmpLV = 0;
101 tmpLV = TG4GeometryServices::Instance()->FindLogicalVolume((G4String)volname);
102 LoopDaughters(tmpLV);
103 }
104
105 //++++10 keV+++//
106 //IRONcuts->SetProductionCut(246*um,"gamma"); // 127.8mm = 994.863 keV 128mm = 1.03095eV
107 //IRONcuts->SetProductionCut(1.4267*um,"e-"); // 0.737mm=988.422keV 0.739mm=1.00067MeV
108 //IRONcuts->SetProductionCut(1.45494*um,"e+"); // 0.787mm=988.422keV 0.788mm=1.00067MeV
109 //IRONreg->SetProductionCuts(IRONcuts);
110 //++++10 keV+++//
111
112 //++++100 keV+++//
113 IRONcuts->SetProductionCut(28*mm,"gamma"); // 127.8mm = 994.863 keV 128mm = 1.03095eV
114 IRONcuts->SetProductionCut(25.5*um,"e-"); // 0.737mm=988.422keV 0.739mm=1.00067MeV
115 IRONcuts->SetProductionCut(26.*um,"e+"); // 0.787mm=988.422keV 0.788mm=1.00067MeV
116 IRONreg->SetProductionCuts(IRONcuts);
117 //++++100 keV+++//
118
119 TUNGAcuts->SetProductionCut(16.1*um,"gamma"); // 16.11=10.0745 16.10=9.99505
120 TUNGAcuts->SetProductionCut(815.075*nm,"e-"); // 815.075=9.99908 815.0752=10.096
121 TUNGAcuts->SetProductionCut(819.1*nm,"e+"); // 819.100=9.92394 819.105=10.0197
122 TUNGAreg->SetProductionCuts(TUNGAcuts);
123
124 He3cuts->SetProductionCut(278*m,"gamma"); // 278m=99.0295 keV 279m=109.225keV
125 He3cuts->SetProductionCut(79.2*mm,"e-"); // 79.2mm=99.5054mm 79.3mm=100.12keV
126 He3cuts->SetProductionCut(81*mm,"e+"); // 81mm=99.5054 81.5mm=100.12
127 He3reg->SetProductionCuts(He3cuts);
128
129
130 //++++10 keV+++//
131 //ALUMINIUMcuts->SetProductionCut(2.205*mm,"gamma");
132 //ALUMINIUMcuts->SetProductionCut(3.74902*um,"e-");
133 //ALUMINIUMcuts->SetProductionCut(3.77205*um,"e+");
134 //ALUMINIUMreg->SetProductionCuts(ALUMINIUMcuts);
135 //++++10 keV+++//
136
137 //++++100 keV+++//
138 ALUMINIUMcuts->SetProductionCut(12.3922*cm,"gamma");
139 ALUMINIUMcuts->SetProductionCut(64*um,"e-");
140 ALUMINIUMcuts->SetProductionCut(65.6*um,"e+");
141 ALUMINIUMreg->SetProductionCuts(ALUMINIUMcuts);
142 //++++100 keV+++//
143
144 //++++10 keV+++//
145 //N2GAScuts->SetProductionCut(19.6*m,"gamma"); // 278m=99.0295 keV 279m=109.225keV
146 //N2GAScuts->SetProductionCut(7.3365*mm,"e-"); // 79.2mm=99.5054mm 79.3mm=100.12keV
147 //N2GAScuts->SetProductionCut(7.40701*mm,"e+"); // 81mm=99.5054 81.5mm=100.12
148 //N2GASreg->SetProductionCuts(N2GAScuts);
149 //++++10 keV+++//
150
151 //++++100 keV+++//
152 N2GAScuts->SetProductionCut(277*m,"gamma"); // 278m=99.0295 keV 279m=109.225keV
153 N2GAScuts->SetProductionCut(12.3*cm,"e-"); // 79.2mm=99.5054mm 79.3mm=100.12keV
154 N2GAScuts->SetProductionCut(12.6*cm,"e+"); // 81mm=99.5054 81.5mm=100.12
155 N2GASreg->SetProductionCuts(N2GAScuts);
156 //++++100 keV+++//
157
158 //++++10 keV+++//
159 // SCINTcuts->SetProductionCut(42.02*mm,"gamma"); // 278m=99.0295 keV 42mm=10.0695
160 //SCINTcuts->SetProductionCut(8.07562*um,"e-"); // .04mm=99.5054mm 79.3mm=100.12keV
161 //SCINTcuts->SetProductionCut(8.1409*um,"e+"); // 4.27 mm=9.18.046 81.5mm=100.12
162 //SCINTreg->SetProductionCuts(SCINTcuts);
163 //++++10 keV+++//
164
165 //++++100 keV+++//
166 SCINTcuts->SetProductionCut(33.8*cm,"gamma"); // 278m=99.0295 keV 42mm=10.0695
167 SCINTcuts->SetProductionCut(133.*um,"e-"); // .04mm=99.5054mm 79.3mm=100.12keV
168 SCINTcuts->SetProductionCut(136.*um,"e+"); // 4.27 mm=9.18.046 81.5mm=100.12
169 SCINTreg->SetProductionCuts(SCINTcuts);
170 //++++100 keV+++//
171
172 //++++10 keV+++//
173 // PLASTcuts->SetProductionCut(39.6*mm,"gamma"); // 278m=99.0295 keV 42mm=10.0695
174 // PLASTcuts->SetProductionCut(8.59*um,"e-"); // .04mm=99.5054mm 79.3mm=100.12keV
175 // PLASTcuts->SetProductionCut(8.71872*um,"e+"); // 4.27 mm=9.18.046 81.5mm=100.12
176 // PLASTreg->SetProductionCuts(PLASTcuts);
177 //++++10 keV+++//
178
179 //++++100 keV+++//
180 PLASTcuts->SetProductionCut(34.2*cm,"gamma"); // 278m=99.0295 keV 42mm=10.0695
181 PLASTcuts->SetProductionCut(145.*um,"e-"); // .04mm=99.5054mm 79.3mm=100.12keV
182 PLASTcuts->SetProductionCut(149.*um,"e+"); // 4.27 mm=9.18.046 81.5mm=100.12
183 PLASTreg->SetProductionCuts(PLASTcuts);
184 //++++100 keV+++//
185
186 //++++10 keV+++//
187 //CADMIUMcuts->SetProductionCut(73.1*um,"gamma"); // 278m=99.0295 keV 42mm=10.0695
188 //CADMIUMcuts->SetProductionCut(1.52008*um,"e-"); // .04mm=99.5054mm 79.3mm=100.12keV
189 //CADMIUMcuts->SetProductionCut(1.55468*um,"e+"); // 4.27 mm=9.18.046 81.5mm=100.12
190 //CADMIUMreg->SetProductionCuts(CADMIUMcuts);
191 //++++10 keV+++//
192
193 //++++100 keV+++//
194 CADMIUMcuts->SetProductionCut(6.79*mm,"gamma"); // 278m=99.0295 keV 42mm=10.0695
195 CADMIUMcuts->SetProductionCut(27.5*um,"e-"); // .04mm=99.5054mm 79.3mm=100.12keV
196 CADMIUMcuts->SetProductionCut(28.5*um,"e+"); // 4.27 mm=9.18.046 81.5mm=100.12
197 CADMIUMreg->SetProductionCuts(CADMIUMcuts);
198 //++++100 keV+++//
199
200 SICALOcuts->SetProductionCut(2.172*mm,"gamma"); // 278m=99.0295 keV 42mm=10.0695
201 SICALOcuts->SetProductionCut(4.257*um,"e-"); // .04mm=99.5054mm 79.3mm=100.12keV
202 SICALOcuts->SetProductionCut(4.331*um,"e+"); // 4.27 mm=9.18.046 81.5mm=100.12
203 SICALOreg->SetProductionCuts(SICALOcuts);
204
205 //++++10 keV+++//
206 //SITRcuts->SetProductionCut(2.172*mm,"gamma"); // 278m=99.0295 keV 42mm=10.0695
207 //++++10 keV+++//
208
209 //++++100 keV+++//
210 SITRcuts->SetProductionCut(13.6*cm,"gamma"); // 278m=99.0295 keV 42mm=10.0695
211 //++++100 keV+++//
212 SITRcuts->SetProductionCut(4.257*um,"e-"); // .04mm=99.5054mm 79.3mm=100.12keV
213 SITRcuts->SetProductionCut(4.331*um,"e+"); // 4.27 mm=9.18.046 81.5mm=100.12
214 SITRreg->SetProductionCuts(SITRcuts);
215 //SITRreg->SetUserLimits(new G4UserLimits(1.0*um));
216
217 CERAMICcuts->SetProductionCut(3.436*mm,"gamma"); // 278m=99.0295 keV 42mm=10.0695
218 CERAMICcuts->SetProductionCut(3.6067*um,"e-"); // .04mm=99.5054mm 79.3mm=100.12keV
219 CERAMICcuts->SetProductionCut(3.6654*um,"e+"); // 4.27 mm=9.18.046 81.5mm=100.12
220 CERAMICreg->SetProductionCuts(CERAMICcuts);
221
222 G10Ccuts->SetProductionCut(4.63*mm,"gamma"); // 278m=99.0295 keV 42mm=10.0695
223 G10Ccuts->SetProductionCut(5.45129*um,"e-"); // .04mm=99.5054mm 79.3mm=100.12keV
224 G10Ccuts->SetProductionCut(5.5422*um,"e+"); // 4.27 mm=9.18.046 81.5mm=100.12
225 G10Creg->SetProductionCuts(G10Ccuts);
226
227 //++++10 keV+++/
228 // POLYSTYRENEcuts->SetProductionCut(1.239*m,"gamma"); // 278m=99.0295 keV 42mm=10.0695
229 //POLYSTYRENEcuts->SetProductionCut(238.07*um,"e-"); // .04mm=99.5054mm 79.3mm=100.12keV
230 //POLYSTYRENEcuts->SetProductionCut(240.04*um,"e+"); // 4.27 mm=9.18.046 81.5mm=100.12
231 //POLYSTYRENEreg->SetProductionCuts(POLYSTYRENEcuts);
232 //++++10 keV+++/
233
234 //++++100 keV+++/
235 POLYSTYRENEcuts->SetProductionCut(1.239*m,"gamma"); // 278m=99.0295 keV 42mm=10.0695
236 POLYSTYRENEcuts->SetProductionCut(238.07*um,"e-"); // .04mm=99.5054mm 79.3mm=100.12keV
237 POLYSTYRENEcuts->SetProductionCut(240.04*um,"e+"); // 4.27 mm=9.18.046 81.5mm=100.12
238 POLYSTYRENEreg->SetProductionCuts(POLYSTYRENEcuts);
239 //++++100 keV+++/
240
241 MYLARcuts->SetProductionCut(24.94*cm,"gamma"); // 278m=99.0295 keV 42mm=10.0695
242 MYLARcuts->SetProductionCut(102.9*um,"e-"); // .04mm=99.5054mm 79.3mm=100.12keV
243 MYLARcuts->SetProductionCut(105.6*um,"e+"); // 4.27 mm=9.18.046 81.5mm=100.12
244 MYLARreg->SetProductionCuts(MYLARcuts);
245
246 //++++100 keV+++//
247 TIALVAcuts->SetProductionCut(61.4*mm,"gamma"); // 278m=99.0295 keV 42mm=10.0695
248 TIALVAcuts->SetProductionCut(43.05*um,"e-"); // .04mm=99.5054mm 79.3mm=100.12keV
249 TIALVAcuts->SetProductionCut(44.5*um,"e+"); // 4.27 mm=9.18.046 81.5mm=100.12
250 TIALVAreg->SetProductionCuts(TIALVAcuts);
251 //++++100 keV+++//
252
253 POLYETHYLENEcuts->SetProductionCut(37.3*cm,"gamma"); // 278m=99.0295 keV 42mm=10.0695
254 POLYETHYLENEcuts->SetProductionCut(135.05*um,"e-"); // .04mm=99.5054mm 79.3mm=100.12keV
255 POLYETHYLENEcuts->SetProductionCut(138*um,"e+"); // 4.27 mm=9.18.046 81.5mm=100.12
256 POLYETHYLENEreg->SetProductionCuts(POLYETHYLENEcuts);
257
258 //++++10 keV+++//
259 //AMG6Mcuts->SetProductionCut(2.3*mm,"gamma");
260 //AMG6Mcuts->SetProductionCut(3.8694*um,"e-");
261 //AMG6Mcuts->SetProductionCut(3.9021*um,"e+");
262 //AMG6Mreg->SetProductionCuts(AMG6Mcuts);
263
264 //NYLON6cuts->SetProductionCut(2.945*cm,"gamma");
265 //NYLON6cuts->SetProductionCut(7.1689*um,"e-");
266 //NYLON6cuts->SetProductionCut(7.276*um,"e+");
267 //NYLON6reg->SetProductionCuts(NYLON6cuts);
268 //++++10 keV+++//
269
270 //++++100 keV+++//
271 AMG6Mcuts->SetProductionCut(12.8*cm,"gamma");
272 AMG6Mcuts->SetProductionCut(67*um,"e-");
273 AMG6Mcuts->SetProductionCut(69*um,"e+");
274 AMG6Mreg->SetProductionCuts(AMG6Mcuts);
275
276 NYLON6cuts->SetProductionCut(30.378*cm,"gamma");
277 NYLON6cuts->SetProductionCut(117*um,"e-");
278 NYLON6cuts->SetProductionCut(120*um,"e+");
279 NYLON6reg->SetProductionCuts(NYLON6cuts);
280 //++++100 keV+++//
281
282
283 // TG4GeometryServices::Instance()->PrintLogicalVolumeStore(); //leave for check
284
285
286 }
287
288 void PamG4RangeCutsPhysics::LoopDaughters(G4LogicalVolume * vol){
289
290 size_t noDaughters = vol->GetNoDaughters();
291
292 if(noDaughters==0) { SetCuts(vol); return; }
293
294 for (register size_t i=0; i<noDaughters; i++)
295 {
296 G4LogicalVolume* daughterLVol = vol->GetDaughter(i)->GetLogicalVolume();
297 LoopDaughters(daughterLVol);
298 }
299 SetCuts(vol);
300 }
301
302 void PamG4RangeCutsPhysics::SetCuts(G4LogicalVolume * vol){
303
304
305 G4Region* tmpreg =0;
306
307 G4String matname = vol->GetMaterial()->GetName();
308 if(matname=="IRON"){
309 tmpreg = G4RegionStore::GetInstance()->GetRegion("IRON_reg");
310 tmpreg->AddRootLogicalVolume(vol);
311 }
312 if(matname=="TUNGA"){
313 tmpreg = G4RegionStore::GetInstance()->GetRegion("TUNGA_reg");
314 tmpreg->AddRootLogicalVolume(vol);
315 }
316 if(matname=="He3"){
317 tmpreg = G4RegionStore::GetInstance()->GetRegion("He3_reg");
318 tmpreg->AddRootLogicalVolume(vol);
319 }
320 if(matname=="ALUMINIUM"){
321 tmpreg = G4RegionStore::GetInstance()->GetRegion("ALUMINIUM_reg");
322 tmpreg->AddRootLogicalVolume(vol);
323 }
324
325 if(matname=="SCINT"){
326 tmpreg = G4RegionStore::GetInstance()->GetRegion("SCINT_reg");
327 tmpreg->AddRootLogicalVolume(vol);
328 }
329 if(matname=="N2GAS"){
330 tmpreg = G4RegionStore::GetInstance()->GetRegion("N2GAS_reg");
331 tmpreg->AddRootLogicalVolume(vol);
332 }
333 if(matname=="PLAST"){
334 tmpreg = G4RegionStore::GetInstance()->GetRegion("PLAST_reg");
335 tmpreg->AddRootLogicalVolume(vol);
336 }
337 if(matname=="CADMIUM"){
338 tmpreg = G4RegionStore::GetInstance()->GetRegion("CADMIUM_reg");
339 tmpreg->AddRootLogicalVolume(vol);
340 }
341 if(matname=="SILICON CA"){
342 tmpreg = G4RegionStore::GetInstance()->GetRegion("SICALO_reg");
343 tmpreg->AddRootLogicalVolume(vol);
344 }
345 if(matname=="SILICON TR"){
346 //G4UserLimits * lim = new G4UserLimits();
347 //lim->SetMaxAllowedStep(10*um);
348 // vol->SetUserLimits(new G4UserLimits(10*um));
349 tmpreg = G4RegionStore::GetInstance()->GetRegion("SITR_reg");
350 tmpreg->AddRootLogicalVolume(vol);
351 //std::cout<<"ulim "<<vol->GetUserLimits()<<" "<<vol->GetName()<<std::endl;
352 }
353 if(matname=="CERAMIC"){
354 tmpreg = G4RegionStore::GetInstance()->GetRegion("CERAMIC_reg");
355 tmpreg->AddRootLogicalVolume(vol);
356 }
357
358 if(matname=="G10C"){
359 tmpreg = G4RegionStore::GetInstance()->GetRegion("G10C_reg");
360 tmpreg->AddRootLogicalVolume(vol);
361 }
362 if(matname=="POLYSTYRENE"){
363 tmpreg = G4RegionStore::GetInstance()->GetRegion("POLYSTYRENE_reg");
364 tmpreg->AddRootLogicalVolume(vol);
365 }
366 if(matname=="MYLAR"){
367 tmpreg = G4RegionStore::GetInstance()->GetRegion("MYLAR_reg");
368 tmpreg->AddRootLogicalVolume(vol);
369 }
370 if(matname=="TIALVA"){
371 tmpreg = G4RegionStore::GetInstance()->GetRegion("TIALVA_reg");
372 tmpreg->AddRootLogicalVolume(vol);
373 }
374 if(matname=="POLYETHYLENE"){
375 tmpreg = G4RegionStore::GetInstance()->GetRegion("POLYETHYLENE_reg");
376 tmpreg->AddRootLogicalVolume(vol);
377 }
378 if(matname=="AMG6M"){
379 tmpreg = G4RegionStore::GetInstance()->GetRegion("AMG6M_reg");
380 tmpreg->AddRootLogicalVolume(vol);
381 }
382 if(matname=="NYLON6"){
383 tmpreg = G4RegionStore::GetInstance()->GetRegion("NYLON6_reg");
384 tmpreg->AddRootLogicalVolume(vol);
385 }
386 }
387
388
389
390
391

  ViewVC Help
Powered by ViewVC 1.1.23