Geant4  10.02.p01
Em10DetectorConstruction.cc
Go to the documentation of this file.
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 //
28 //
29 //
30 // $Id: Em10DetectorConstruction.cc 73033 2013-08-15 09:24:45Z gcosmo $
31 //
32 //
33 
35 #include "Em10DetectorMessenger.hh"
36 #include "Em10CalorimeterSD.hh"
37 #include "Em10Materials.hh"
38 
39 #include "G4Material.hh"
40 #include "G4Box.hh"
41 #include "G4LogicalVolume.hh"
42 #include "G4PVPlacement.hh"
43 #include "G4UniformMagField.hh"
44 #include "G4FieldManager.hh"
46 #include "G4SDManager.hh"
47 #include "G4GeometryManager.hh"
48 #include "G4RunManager.hh"
49 
50 #include "G4Region.hh"
51 #include "G4RegionStore.hh"
52 #include "G4PhysicalVolumeStore.hh"
53 #include "G4LogicalVolumeStore.hh"
54 #include "G4SolidStore.hh"
55 #include "G4ProductionCuts.hh"
56 
57 #include "G4VisAttributes.hh"
58 #include "G4Colour.hh"
59 
60 #include "G4UnitsTable.hh"
61 #include "G4SystemOfUnits.hh"
62 #include "G4ios.hh"
63 
64 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
65 
68  fWorldChanged(false), fAbsorberMaterial(0), fGapMat(0), fSetUp("simpleALICE"),
69  fWorldMaterial(0), fSolidWorld(0), fLogicWorld(0), fPhysicsWorld(0),
70 // fSolidRadSlice(0), fLogicRadSlice(0), fPhysicRadSlice(0),
71  fSolidRadiator(0), fLogicRadiator(0), fPhysicsRadiator(0),
72  fRadiatorMat(0), fPipe(false), fPipeField(false),
73  fSolidAbsorber(0), fLogicAbsorber(0), fPhysicsAbsorber(0),
74  fMagField(0), fCalorimeterSD(0), fRegGasDet(0),
75  fRadRegion(0), fMat(0)
76 {
78  fMat = new Em10Materials();
79 }
80 
81 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
82 
84 {
85  delete fDetectorMessenger;
86  delete fMat;
87 }
88 
89 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
90 
92 {
93  return ConstructDetectorXTR();
94 }
95 
96 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
97 
99 {
100  // Cleanup old geometry
101 
106 
107  if( fSetUp == "simpleALICE" )
108  {
109  return SimpleSetUpALICE();
110  }
111  else if( fSetUp == "alice06" )
112  {
113  return SetUpALICE06();
114  }
115  else if( fSetUp == "bari05" )
116  {
117  return SetUpBari05();
118  }
119  else if( fSetUp == "harris73" )
120  {
121  return SetUpHarris73();
122  }
123  else if( fSetUp == "watase86" )
124  {
125  return SetUpWatase86();
126  }
127  else if( fSetUp == "barr90" )
128  {
129  return SetUpBarr90();
130  }
131  else
132  {
133  G4cout <<
134  "Experimental setup is unsupported. Check /XTRdetector/setup " <<G4endl;
135  G4cout<<"Run default: barr90 "<<G4endl;
136  return SetUpBarr90();
137 
138  // return 0;
139  }
140 }
141 
142 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
143 
144 // Simplified setup for ALICE XTR test beam (~2004).
145 // Runs by : TestEm10 salice.mac
146 
148 {
149  fWorldSizeZ = 400.*cm;
150  fWorldSizeR = 20.*cm;
151 
152  // Radiator and detector parameters
153 
154  fRadThickness = 0.020*mm;
155  fGasGap = 0.250*mm;
157 
158  fFoilNumber = 220;
159 
160  fAbsorberThickness = 38.3*mm;
161 
162  fAbsorberRadius = 100.*mm;
163  fAbsorberZ = 136.*cm;
164 
165  fWindowThick = 51.0*micrometer;
167  fGapThick = 10.0*cm;
168 
169  fDetThickness = 40.0*mm;
170  fDetLength = 200.0*cm;
171  fDetGap = 0.01*mm;
172 
173  fStartR = 40*cm;
174  fStartZ = 100.0*mm;
175 
176  fModuleNumber = 1;
177 
178  // Preparation of mixed radiator material
179 
180  G4Material* Mylar = fMat->GetMaterial("Mylar");
181  G4Material* Air = fMat->GetMaterial("Air");
182  G4Material* Al = fMat->GetMaterial("Al");
183 
184  G4double foilDensity = 1.39*g/cm3;
185  // Mylar // 0.91*g/cm3; // CH2 0.534*g/cm3; //Li
186  G4double gasDensity = 1.2928*mg/cm3;
187  // Air // 1.977*mg/cm3; // CO2 0.178*mg/cm3; //He
188  G4double totDensity = foilDensity*foilGasRatio +
189  gasDensity*(1.0-foilGasRatio);
190 
191  G4double fractionFoil = foilDensity*foilGasRatio/totDensity;
192  G4double fractionGas = gasDensity*(1.0-foilGasRatio)/totDensity;
193 
194  G4Material* radiatorMat = new G4Material("radiatorMat" , totDensity,
195  2);
196  radiatorMat->AddMaterial( Mylar, fractionFoil );
197  radiatorMat->AddMaterial( Air, fractionGas );
198 
199  // default materials of the detector and TR radiator
200 
201  fRadiatorMat = radiatorMat;
202  fFoilMat = Mylar; // CH2; // Kapton; // Mylar ; // Li ; // CH2 ;
203  fGasMat = Air; // CO2; // He; //
204 
205  fWindowMat = Mylar;
206  fElectrodeMat = Al;
207 
208  fAbsorberMaterial = fMat->GetMaterial("Xe15CO2");
209 
211 
212  fWorldMaterial = Air; // CO2;
213 
215 
217 
218  fPhysicsWorld = new G4PVPlacement(0, G4ThreeVector(), "World",
219  fLogicWorld, 0, false, 0);
220 
221  // TR radiator envelope
222 
224 
225  fRadZ = fStartZ + 0.5*fRadThick;
226 
227  fSolidRadiator = new G4Box("Radiator",1.1*fAbsorberRadius ,
228  1.1*fAbsorberRadius, 0.5*fRadThick );
229 
231  "Radiator");
232 
234  G4ThreeVector(0,0,fRadZ),
235  "Radiator", fLogicRadiator,
236  fPhysicsWorld, false, 0 );
237 
238  // create region for window inside windowR for
239 
240  if( fRadRegion != 0 ) delete fRadRegion;
241  if( fRadRegion == 0 ) fRadRegion = new G4Region("XTRradiator");
243 
244  fWindowZ = fStartZ + fRadThick + fWindowThick/2. + 15.0*mm;
245 
246  // G4Box* solidWindowR = new G4Box("WindowR",fAbsorberRadius+0.001,
247  // fAbsorberRadius+0.001,
248  // fWindowThick/2.+0.001 );
249 
250  // G4LogicalVolume* logicWindowR = new G4LogicalVolume(solidWindowR,
251  // fWorldMaterial, "WindowR");
252 
253  // G4VPhysicalVolume* physiWindowR = new G4PVPlacement(0,
254  // G4ThreeVector(0.,0.,fWindowZ),
255  // "WindowR",logicWindowR,fPhysicsWorld,false,0);
256  // window
257 
258  // G4Box* solidWindow = new G4Box("Window",fAbsorberRadius,
259  // fAbsorberRadius, fWindowThick/2.);
260 
261  // G4LogicalVolume* logicWindow = new G4LogicalVolume(solidWindow,
262  // fWindowMat, "Window");
263 
264  // G4VPhysicalVolume* physiWindow =
265  // new G4PVPlacement(0, G4ThreeVector(0.,0.,0.),
266  // "Window", logicWindow, physiWindowR, false, 0);
267 
268  fGapZ = fWindowZ + fWindowThick/2. + fGapThick/2. + 0.01*mm;
269 
270  fElectrodeZ = fGapZ + fGapThick/2. + fElectrodeThick/2. + 0.01*mm;
271 
272  // Absorber
273 
275  fAbsorberThickness/2. + 0.01*mm;
276 
277  fSolidAbsorber = new G4Box("Absorber", fAbsorberRadius,
279 
281  "Absorber");
282 
284  "Absorber", fLogicAbsorber,
285  fPhysicsWorld, false, 0);
286 
287  if( fRegGasDet != 0 ) delete fRegGasDet;
288  if( fRegGasDet == 0 ) fRegGasDet = new G4Region("XTRdEdxDetector");
290 
291  // Sensitive Detectors: Absorber
292 
294 
295  if(!fCalorimeterSD)
296  {
297  fCalorimeterSD = new Em10CalorimeterSD("CalorSD",this);
298  SDman->AddNewDetector( fCalorimeterSD );
299  }
301 
303 
304  return fPhysicsWorld;
305 }
306 
307 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
308 
309 // Setup for ALICE XTR test beam (~2004). With He beam-pipe
310 // Runs by : TestEm10 alice06.mac
311 
313 {
314  fWorldSizeZ = 600.*cm;
315  fWorldSizeR = 22.*cm;
316 
317  // Radiator and detector parameters
318 
319  //fRadThickness = 0.01*mm; // Gamma XTR (malz: 0.01)
320  //fGasGap = 0.19*mm; // Gamma XTR (malz: 0.09)
321  //fFoilNumber = 240; // Gamma XTR (malz: 480)
322 
323  fRadThickness = 0.020*mm; // Reg1
324  fGasGap = 0.500*mm; // Reg1
325  fFoilNumber = 120; // Reg1
326 
327  //fRadThickness = 0.013*mm; // Anton
328  //fGasGap = 0.060*mm; // Anton
329  //fFoilNumber = 550; // Anton
330 
331  // fRadThickness = 0.020*mm; // Reg2
332  // fGasGap = 0.250*mm; // Reg2
333  // fFoilNumber = 220; // Reg2
334 
336 
337  fAbsorberThickness = 37.*mm; // 38.3*mm;
338 
339  fAbsorberRadius = 100.*mm;
340  fAbsorberZ = 136.*cm;
341 
342  fPipeLength = 160.0*cm;
343  fMylarThick = 20.0*micrometer;
344 
345  fWindowThick = 51.0*micrometer;
346  fElectrodeThick = 100.0*micrometer;
347  fGapThick = 10.0*cm;
348 
349  fDetThickness = 40.0*mm;
350  fDetLength = 200.0*cm;
351  fDetGap = 0.01*mm;
352 
353  fStartR = 40*cm;
354  fStartZ = 100.0*mm;
355 
356  fModuleNumber = 1;
357 
358  // Preparation of mixed radiator material
359 
360  G4Material* Mylar = fMat->GetMaterial("Mylar");
361  G4Material* Air = fMat->GetMaterial("Air");
362  G4Material* Al = fMat->GetMaterial("Al");
363  G4Material* CH2 = fMat->GetMaterial("CH2");
364  G4Material* He = fMat->GetMaterial("He");
365 
366  G4double foilDensity = CH2->GetDensity();
367  G4double gasDensity = Air->GetDensity();
368  G4double totDensity = foilDensity*foilGasRatio +
369  gasDensity*(1.0-foilGasRatio);
370 
371  G4double fractionFoil = foilDensity*foilGasRatio/totDensity;
372  G4double fractionGas = 1.0 - fractionFoil;
373 // gasDensity*(1.0-foilGasRatio)/totDensity ;
374 
375  G4Material* radiatorMat = new G4Material("radiatorMat" , totDensity,
376  2);
377  radiatorMat->AddMaterial( CH2, fractionFoil );
378  radiatorMat->AddMaterial( Air, fractionGas );
379 
380  // default materials of the detector and TR radiator
381 
382  fRadiatorMat = radiatorMat;
383  fFoilMat = CH2; // Kapton; // Mylar ; // Li ; // CH2 ;
384  fGasMat = Air; // CO2; // He; //
385 
386  fWindowMat = Mylar;
387  fElectrodeMat = Al;
388 
389  fAbsorberMaterial = fMat->GetMaterial("Xe15CO2");
390 
391  // pipe material is assumed to be He + small admixture of air
392  /*
393  foilGasRatio = 0.000001;
394  foilDensity = Air->GetDensity();
395  gasDensity = He->GetDensity();
396  totDensity = foilDensity*foilGasRatio + gasDensity*( 1.0 - foilGasRatio );
397 
398  fractionFoil = foilDensity*foilGasRatio/totDensity;
399  fractionGas = 1.0 - fractionFoil;
400  // gasDensity*(1.0 - foilGasRatio)/totDensity;
401 
402  fPipeMat = new G4Material("pipeMat" , totDensity, 2);
403  fPipeMat->AddMaterial( Air, fractionFoil );
404  fPipeMat->AddMaterial( He, fractionGas );
405  */
406  fPipeMat = He;
407 
409 
411 
412  fSolidWorld = new G4Box("World", fWorldSizeR, fWorldSizeR, fWorldSizeZ/2.);
413 
415 
416  fPhysicsWorld = new G4PVPlacement(0, G4ThreeVector(), "World",
417  fLogicWorld, 0, false, 0);
418 
419  // TR radiator envelope
420 
422 
423  fRadZ = fStartZ + 0.5*fRadThick;
424 
425  // fRadZ = -fRadThick/2. - fElectrodeThick;
426  // if ( fabs(pipe) > 1.e-15 ) fRadZ -= ( fPipeLength/2. + pipeDist );
427 
428  fSolidRadiator = new G4Box("Radiator",1.1*fAbsorberRadius ,
429  1.1*fAbsorberRadius, 0.5*fRadThick );
430 
432  "Radiator");
433 
435  G4ThreeVector(0,0,fRadZ),
436  "Radiator", fLogicRadiator,
437  fPhysicsWorld, false, 0 );
438 
439  // create region for radiator
440 
441  if( fRadRegion != 0 ) delete fRadRegion;
442  if( fRadRegion == 0 ) fRadRegion = new G4Region("XTRradiator");
444 
445  // Drift Electrode on both sides of Radiator:
446 
447  G4double zElectrode1 = fRadZ - fRadThick/2. - fElectrodeThick/2.;
448  G4double zElectrode2 = fRadZ + fRadThick/2. + fElectrodeThick/2.;
449  /*
450  G4Box* solidElectrode = new G4Box("Electrode",fAbsorberRadius*1.1,
451  fAbsorberRadius*1.1,
452  fElectrodeThick/2.);
453 
454  G4LogicalVolume* logicElectrode = new G4LogicalVolume(solidElectrode,
455  fElectrodeMat,
456  "Electrode");
457 
458  G4VPhysicalVolume* physiElectrode1 = new G4PVPlacement(0,
459  G4ThreeVector(0.,0.,zElectrode1),
460  "Electrode1",logicElectrode,
461  fPhysicsWorld,false,0);
462 
463  G4VPhysicalVolume* physiElectrode2 = new G4PVPlacement(0,
464  G4ThreeVector(0.,0.,zElectrode2),
465  "Electrode1",logicElectrode,
466  fPhysicsWorld,false,0);
467  */
468  G4cout<<"zElectrode1 = "<<zElectrode1/mm<<" mm"<<G4endl;
469  G4cout<<"zElectrode2 = "<<zElectrode2/mm<<" mm"<<G4endl;
470  G4cout<<"fElectrodeThick = "<<fElectrodeThick/mm<<" mm"<<G4endl<<G4endl;
471 
472  // Helium Pipe:
473 
474  //Distance between pipe and radiator / absorber
475  G4double pipeDist = 1.*cm;
476  G4double fieldStrength = 1.0*tesla; // 0.01*tesla; // field strength in pipe
477  G4double alphaB = 90.*degree;
478  fPipe = true; // 0.; // use helium pipe is setup
479 
480  fPipeField = true; // field in helium pipe used?
481 
482  G4double zPipe = zElectrode2 + fElectrodeThick/2. +
483  pipeDist/2. + fPipeLength/2.;
484 
485  if ( fPipe )
486  {
487 
488  G4Box* solidPipe = new G4Box("Pipe",fAbsorberRadius*0.5,
489  fAbsorberRadius*0.5,
490  fPipeLength/2. );
491 
492  G4LogicalVolume* logicPipe = new G4LogicalVolume(solidPipe,
493  fPipeMat, //fWorldMaterial
494  "Pipe");
495 
496  // G4VPhysicalVolume* physiPipe = new G4PVPlacement(0,
497  // G4ThreeVector(0., 0., zPipe),
498  // "Pipe1",logicPipe,
499  // fPhysicsWorld,false,0);
500 
501  G4cout<<"zPipe = "<<zPipe/mm<<" mm"<<G4endl;
502  G4cout<<"fPipeLength = "<<fPipeLength/mm<<" mm"<<G4endl<<G4endl;
503 
504  // magnetic field in Pipe:
505 
506  if ( fPipeField )
507  {
508  if( fMagField ) delete fMagField; //delete the existing mag field
509 
510  fMagField =
511  new G4UniformMagField(G4ThreeVector(fieldStrength*std::sin(alphaB),
512  0., fieldStrength*std::cos(alphaB)));
513  // fMagField = new G4UniformMagField(G4ThreeVector(fieldStrength,0.,0.));
514  // fMagField = new G4UniformMagField(G4ThreeVector(0.,0.,fieldStrength));
515  G4FieldManager* fieldMgr = new G4FieldManager(fMagField);
516  fieldMgr->SetDetectorField(fMagField);
517  fieldMgr->CreateChordFinder(fMagField);
518  logicPipe->SetFieldManager(fieldMgr, true);
519  }
520 
521  }
522  else G4cout<<"No Helium pipe is used"<<G4endl<<G4endl;
523 
524  // Mylar Foil on both sides of helium pipe:
525 
526  G4double zMylar1 = zPipe - fPipeLength/2. - fMylarThick/2. - 0.001*mm;
527  G4double zMylar2 = zPipe + fPipeLength/2. + fMylarThick/2. + 0.001*mm;
528 
529  // G4Box* solidMylar = new G4Box("MylarB",fAbsorberRadius*0.6,
530  // fAbsorberRadius*0.6,
531  // fMylarThick/2.);
532 
533  // G4LogicalVolume* logicMylar = new G4LogicalVolume(solidMylar,
534  // fWindowMat,
535  // "MylarL");
536 
537  if ( fPipe )
538  {
539 
540  // G4VPhysicalVolume* physiMylar1 = new G4PVPlacement(0,
541  // G4ThreeVector( 0., 0., zMylar1),
542  // "Mylar1", logicMylar, fPhysicsWorld,
543  // false, 0);
544 
545  // G4VPhysicalVolume* physiMylar2 = new G4PVPlacement(0,
546  // G4ThreeVector(0., 0., zMylar2),
547  // "Mylar2", logicMylar, fPhysicsWorld,
548  // false, 0);
549 
550  G4cout<<"zMylar1 = "<<zMylar1/mm<<" mm"<<G4endl;
551  G4cout<<"zMylar2 = "<<zMylar2/mm<<" mm"<<G4endl;
552  G4cout<<"fMylarThick = "<<fMylarThick/mm<<" mm"<<G4endl<<G4endl;
553  }
554 
555  // Mylar Foil on Chamber:
556 
557  G4double zMylar = zElectrode2 + fElectrodeThick/2. + fMylarThick/2. + 1.0*mm;
558 
559  // if ( fPipe )
560  {
561  zMylar += ( fPipeLength + pipeDist );
562  }
563  // G4VPhysicalVolume* physiMylar = new G4PVPlacement(0,
564  // G4ThreeVector(0., 0., zMylar),
565  // "Mylar",logicMylar,fPhysicsWorld,false,0);
566 
567  G4cout<<"zMylar = "<<zMylar/mm<<" mm"<<G4endl;
568  G4cout<<"fMylarThick = "<<fMylarThick/mm<<" mm"<<G4endl<<G4endl;
569 
570  // Absorber
571 
572  fAbsorberZ = zMylar + fMylarThick + fAbsorberThickness/2.;
573 
574  fSolidAbsorber = new G4Box("Absorber",
576  // fAbsorberRadius,
577  // 10.*mm,
578  10.*mm,
579  fAbsorberThickness/2.);
580 
582  "Absorber");
583 
585  G4ThreeVector(0., 0., fAbsorberZ),
586  "Absorber", fLogicAbsorber,
587  fPhysicsWorld, false, 0);
588 
589  if( fRegGasDet != 0 ) delete fRegGasDet;
590  if( fRegGasDet == 0 ) fRegGasDet = new G4Region("XTRdEdxDetector");
592 
593  // Sensitive Detectors: Absorber
594 
596 
597  if(!fCalorimeterSD)
598  {
599  fCalorimeterSD = new Em10CalorimeterSD("CalorSD",this);
600  SDman->AddNewDetector( fCalorimeterSD );
601  }
603 
605 
606  return fPhysicsWorld;
607 }
608 
609 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
610 
611 // Setup for Bari INFN XTR test beam (~2004) at CERN. With He beam-pipe
612 // M. Brigida et al, NIM A550 (2005) 157-168
613 // Runs by : TestEm10 bari05.mac
614 
616 {
617  fWorldSizeZ = 600.*cm;
618  fWorldSizeR = 22.*cm;
619 
620  // Radiator and detector parameters
621 
622  //fRadThickness = 0.01*mm; // Gamma XTR (malz: 0.01)
623  //fGasGap = 0.19*mm; // Gamma XTR (malz: 0.09)
624  //fFoilNumber = 240; // Gamma XTR (malz: 480)
625 
626  //fRadThickness = 0.020*mm; // Reg1
627  //fGasGap = 0.500*mm; // Reg1
628  //fFoilNumber = 120; // Reg1
629 
630  //fRadThickness = 0.013*mm; // Anton
631  //fGasGap = 0.230*mm; // Anton
632  //fFoilNumber = 550; // Anton
633 
634  fRadThickness = 0.0055*mm; // Reg2
635  fGasGap = 0.23*mm; // Reg2
636  fFoilNumber = 191; // Reg2
637 
639 
640  fAbsorberThickness = 0.4*mm;
641 
642  fAbsorberRadius = 100.*mm;
643  fAbsorberZ = 136.*cm;
644 
645  fPipeLength = 50.0*cm;
646  fMylarThick = 20.0*micrometer;
647 
648  fWindowThick = 51.0*micrometer;
649  fElectrodeThick = 100.0*micrometer;
650  fGapThick = 10.0*cm;
651 
652  fDetThickness = 40.0*mm;
653  fDetLength = 200.0*cm;
654  fDetGap = 0.01*mm;
655 
656  fStartR = 40*cm;
657  fStartZ = 100.0*mm;
658 
659  fModuleNumber = 1;
660 
661  // Preparation of mixed radiator material
662 
663  G4Material* Mylar = fMat->GetMaterial("Mylar");
664  G4Material* Air = fMat->GetMaterial("Air");
665  G4Material* Al = fMat->GetMaterial("Al");
666  G4Material* CH2 = fMat->GetMaterial("CH2");
667  G4Material* He = fMat->GetMaterial("He");
668 
669  G4double foilDensity = 0.91*g/cm3;
670  // CH2 1.39*g/cm3; // Mylar // 0.534*g/cm3; //Li
671  G4double gasDensity = 1.2928*mg/cm3;
672  // Air // 1.977*mg/cm3; // CO2 0.178*mg/cm3; // He
673  G4double totDensity = foilDensity*foilGasRatio +
674  gasDensity*(1.0-foilGasRatio);
675 
676  G4double fractionFoil = foilDensity*foilGasRatio/totDensity;
677  G4double fractionGas = gasDensity*(1.0-foilGasRatio)/totDensity;
678 
679  G4Material* radiatorMat = new G4Material("radiatorMat" , totDensity,
680  2);
681  radiatorMat->AddMaterial( CH2, fractionFoil );
682  radiatorMat->AddMaterial( Air, fractionGas );
683 
684  // default materials of the detector and TR radiator
685 
686  fRadiatorMat = radiatorMat;
687  fFoilMat = CH2; // Kapton; // Mylar ; // Li ; // CH2 ;
688  fGasMat = Air; // CO2; // He; //
689 
690  fWindowMat = Mylar;
691  fElectrodeMat = Al;
692 
694 
695  // pipe material is assumed to be He + small admixture of air
696 
697  foilGasRatio = 0.99999;
698  foilDensity = 1.2928*mg/cm3; // Air
699  gasDensity = 0.178*mg/cm3; // He
700  totDensity = foilDensity*foilGasRatio + gasDensity*(1.0-foilGasRatio);
701 
702  fractionFoil = foilDensity*foilGasRatio/totDensity;
703  fractionGas = gasDensity*(1.0-foilGasRatio)/totDensity;
704 
705  fPipeMat = new G4Material("pipeMat" , totDensity, 2);
706  fPipeMat->AddMaterial( Air, fractionFoil );
707  fPipeMat->AddMaterial( He, fractionGas );
708 
709  // fPipeMat = He;
710 
712 
714 
716 
718 
719  fPhysicsWorld = new G4PVPlacement(0, G4ThreeVector(), "World",
720  fLogicWorld, 0, false, 0);
721 
722  // TR radiator envelope
723 
725 
726  fRadZ = fStartZ + 0.5*fRadThick;
727  // fRadZ = -fRadThick/2. - fElectrodeThick;
728  // if ( fabs(pipe) > 1.e-15 ) fRadZ -= ( fPipeLength/2. + pipeDist );
729 
730  fSolidRadiator = new G4Box("Radiator",1.1*fAbsorberRadius ,
731  1.1*fAbsorberRadius, 0.5*fRadThick );
732 
734  "Radiator");
735 
737  G4ThreeVector(0,0,fRadZ),
738  "Radiator", fLogicRadiator,
739  fPhysicsWorld, false, 0 );
740 
741  // create region for radiator
742 
743  if( fRadRegion != 0 ) delete fRadRegion;
744  if( fRadRegion == 0 ) fRadRegion = new G4Region("XTRradiator");
746 
747  // Drift Electrode on both sides of Radiator:
748 
749  // G4Box* solidElectrode = new G4Box("Electrode",fAbsorberRadius*1.1,
750  // fAbsorberRadius*1.1,
751  // fElectrodeThick/2.);
752 
753  // G4LogicalVolume* logicElectrode = new G4LogicalVolume(solidElectrode,
754  // fElectrodeMat,
755  // "Electrode");
756 
757  G4double zElectrode1 = fRadZ - fRadThick/2. - fElectrodeThick/2.;
758  G4double zElectrode2 = fRadZ + fRadThick/2. + fElectrodeThick/2.;
759 
760  // G4VPhysicalVolume* physiElectrode1 = new G4PVPlacement(0,
761  // G4ThreeVector(0.,0.,zElectrode1),
762  // "Electrode1",logicElectrode,
763  // fPhysicsWorld,false,0);
764 
765  // G4VPhysicalVolume* physiElectrode2 = new G4PVPlacement(0,
766  // G4ThreeVector(0.,0.,zElectrode2),
767  // "Electrode1",logicElectrode,
768  // fPhysicsWorld,false,0);
769 
770  G4cout<<"zElectrode1 = "<<zElectrode1/mm<<" mm"<<G4endl;
771  G4cout<<"zElectrode2 = "<<zElectrode2/mm<<" mm"<<G4endl;
772  G4cout<<"fElectrodeThick = "<<fElectrodeThick/mm<<" mm"<<G4endl<<G4endl;
773 
774  // Helium Pipe:
775 
776  G4double pipe = 1.0; // use helium pipe is setup
777 
778  G4double pipeDist = 1.*cm; //Distance between pipe and radiator / absorber
779 
780  G4double zPipe = zElectrode2 + fElectrodeThick/2. +
781  fPipeLength/2. + pipeDist/2.;
782 
783  // G4double field = 1.0; // field in helium pipe used?
784  // G4double fieldStrength = 1.0*tesla; // field strength in pipe
785 
786  if ( std::fabs(pipe) > 1.e-15 )
787  {
788 
789  // G4Box* solidPipe = new G4Box("Pipe",fAbsorberRadius*0.5,
790  // fAbsorberRadius*0.5,
791  // fPipeLength/2. );
792 
793  // G4LogicalVolume* logicPipe = new G4LogicalVolume(solidPipe,
794  // fPipeMat,
795  // "Pipe");
796 
797  // magnetic field in Pipe:
798  // if( fMagField ) delete fMagField; //delete the existing mag field
799  // fMagField = new G4UniformMagField(G4ThreeVector(fieldStrength,0.,0.));
800  // G4FieldManager* fieldMgr= new G4FieldManager(fMagField);
801  // fieldMgr->SetDetectorField(fMagField);
802  // fieldMgr->CreateChordFinder(fMagField);
803  // if ( fabs(field) > 1.e-15 ) logicPipe->SetFieldManager(fieldMgr, true);
804 
805  // G4VPhysicalVolume* physiPipe = new G4PVPlacement(0,
806  // G4ThreeVector(0.,0.,zPipe),
807  // "Pipe1",logicPipe,
808  // fPhysicsWorld,false,0);
809 
810  G4cout<<"zPipe = "<<zPipe/mm<<" mm"<<G4endl;
811  G4cout<<"fPipeLength = "<<fPipeLength/mm<<" mm"<<G4endl<<G4endl;
812 
813  }
814  else G4cout<<"No Helium pipe is used"<<G4endl<<G4endl;
815 
816  // Mylar Foil on both sides of helium pipe:
817 
818  G4double zMylar1 = zPipe - fPipeLength/2. - fMylarThick/2 - 0.01*mm;
819  G4double zMylar2 = zPipe + fPipeLength/2. + fMylarThick/2 + 0.01*mm;
820 
821  // G4Box* solidMylar = new G4Box("Mylar",fAbsorberRadius*0.6,
822  // fAbsorberRadius*0.6,
823  // fMylarThick/2.);
824 
825  // G4LogicalVolume* logicMylar = new G4LogicalVolume(solidMylar,
826  // fWindowMat,
827  // "Mylar");
828 
829  if ( std::fabs(pipe) > 1.e-15 )
830  {
831 
832  // G4VPhysicalVolume* physiMylar1 = new G4PVPlacement(0,
833  // G4ThreeVector( 0., 0., zMylar1),
834  // "Mylar1", logicMylar, fPhysicsWorld,
835  // false, 0);
836 
837  // G4VPhysicalVolume* physiMylar2 = new G4PVPlacement(0,
838  // G4ThreeVector(0.,0.,zMylar2),
839  // "Mylar2", logicMylar, fPhysicsWorld,
840  // false, 0);
841 
842  G4cout<<"zMylar1 = "<<zMylar1/mm<<" mm"<<G4endl;
843  G4cout<<"zMylar2 = "<<zMylar2/mm<<" mm"<<G4endl;
844  G4cout<<"fMylarThick = "<<fMylarThick/mm<<" mm"<<G4endl<<G4endl;
845 
846  }
847 
848  // Mylar Foil on Chamber:
849 
850  G4double zMylar = zElectrode2 + fElectrodeThick/2. + fMylarThick/2. + 1.0*mm;
851 
852  if ( std::fabs(pipe) > 1.e-15 ) zMylar += ( fPipeLength + pipeDist );
853 
854  // G4VPhysicalVolume* physiMylar = new G4PVPlacement(0,
855  // G4ThreeVector(0.,0.,zMylar),
856  // "Mylar",logicMylar,fPhysicsWorld,false,0);
857 
858  G4cout<<"zMylar = "<<zMylar/mm<<" mm"<<G4endl;
859  G4cout<<"fMylarThick = "<<fMylarThick/mm<<" mm"<<G4endl<<G4endl;
860 
861  // Absorber
862 
863  fAbsorberZ = zMylar + fMylarThick/2. + fAbsorberThickness/2.;
864 
865  fSolidAbsorber = new G4Box("Absorber",
866  // fAbsorberRadius, fAbsorberRadius,
867  10.*mm,10.*mm,
868  fAbsorberThickness/2.);
869 
871  "Absorber");
872 
874  "Absorber", fLogicAbsorber,
875  fPhysicsWorld, false, 0);
876 
877  if( fRegGasDet != 0 ) delete fRegGasDet;
878  if( fRegGasDet == 0 ) fRegGasDet = new G4Region("XTRdEdxDetector");
880 
881  // Sensitive Detectors: Absorber
882 
884 
885  if(!fCalorimeterSD)
886  {
887  fCalorimeterSD = new Em10CalorimeterSD("CalorSD",this);
888  SDman->AddNewDetector( fCalorimeterSD );
889  }
891 
893 
894  return fPhysicsWorld;
895 }
896 
897 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
898 
899 // Setuo from F. Harris et al NIM 107 (1973) 413-422 (fig.5b)
900 
902 {
903  fWorldSizeZ = 400.*cm;
904  fWorldSizeR = 20.*cm;
905 
906  // Radiator and detector parameters
907 
908  fRadThickness = 0.0127*mm;
909  fGasGap = 0.762*mm;
911 
912  fFoilNumber = 100;
913 
914  fAbsorberThickness = 15.0*mm;
915 
916  fAbsorberRadius = 100.*mm;
917  fAbsorberZ = 136.*cm;
918 
919  fWindowThick = 51.0*micrometer;
921  fGapThick = 10.0*cm;
922 
923  fDetThickness = 40.0*mm;
924  fDetLength = 200.0*cm;
925  fDetGap = 0.01*mm;
926 
927  fStartR = 40*cm;
928  fStartZ = 100.0*mm;
929 
930  fModuleNumber = 1;
931 
932  // Preparation of mixed radiator material
933 
934  G4Material* Mylar = fMat->GetMaterial("Mylar");
935  G4Material* Air = fMat->GetMaterial("Air");
936  G4Material* Al = fMat->GetMaterial("Al");
937 
938  G4double foilDensity = 1.39*g/cm3;
939  // Mylar // 0.91*g/cm3; // CH2 0.534*g/cm3; //Li
940  G4double gasDensity = 1.2928*mg/cm3;
941  // Air // 1.977*mg/cm3; // CO2 0.178*mg/cm3; // He
942 
943  G4double totDensity = foilDensity*foilGasRatio +
944  gasDensity*(1.0-foilGasRatio);
945 
946  G4double fractionFoil = foilDensity*foilGasRatio/totDensity;
947  G4double fractionGas = gasDensity*(1.0-foilGasRatio)/totDensity;
948 
949  G4Material* radiatorMat = new G4Material("radiatorMat" , totDensity,
950  2);
951  radiatorMat->AddMaterial( Mylar, fractionFoil );
952  radiatorMat->AddMaterial( Air, fractionGas );
953 
954  // default materials of the detector and TR radiator
955 
956  fRadiatorMat = radiatorMat;
957  fFoilMat = Mylar;
958  fGasMat = Air;
959 
960  fWindowMat = Mylar;
961  fElectrodeMat = Al;
962 
963  fAbsorberMaterial = fMat->GetMaterial("Kr7CH4");
964 
966 
967  fWorldMaterial = Air; // CO2;
968 
970 
972 
973  fPhysicsWorld = new G4PVPlacement(0, G4ThreeVector(), "World",
974  fLogicWorld, 0, false, 0);
975 
976  // TR radiator envelope
977 
979 
980  fRadZ = fStartZ + 0.5*fRadThick;
981 
982  fSolidRadiator = new G4Box("Radiator",1.1*fAbsorberRadius ,
983  1.1*fAbsorberRadius, 0.5*fRadThick );
984 
986  "Radiator");
987 
989  G4ThreeVector(0,0,fRadZ),
990  "Radiator", fLogicRadiator,
991  fPhysicsWorld, false, 0 );
992 
993  // create region for window inside windowR for
994 
995  if( fRadRegion != 0 ) delete fRadRegion;
996  if( fRadRegion == 0 ) fRadRegion = new G4Region("XTRradiator");
998 
999  fWindowZ = fStartZ + fRadThick + fWindowThick/2. + 15.0*mm;
1000 
1001  // G4Box* solidWindowR = new G4Box("WindowR",fAbsorberRadius+0.001,
1002  // fAbsorberRadius+0.001,
1003  // fWindowThick/2.+0.001 );
1004 
1005  // G4LogicalVolume* logicWindowR = new G4LogicalVolume(solidWindowR,
1006  // fWorldMaterial, "WindowR");
1007 
1008  // G4VPhysicalVolume* physiWindowR = new G4PVPlacement(0,
1009  // G4ThreeVector(0.,0.,fWindowZ),
1010  // "WindowR",logicWindowR,fPhysicsWorld,false,0);
1011  // window
1012 
1013  // G4Box* solidWindow = new G4Box("Window",fAbsorberRadius,
1014  // fAbsorberRadius, fWindowThick/2.);
1015 
1016  // G4LogicalVolume* logicWindow = new G4LogicalVolume(solidWindow,
1017  // fWindowMat, "Window");
1018 
1019  // G4VPhysicalVolume* physiWindow =
1020  // new G4PVPlacement(0, G4ThreeVector(0.,0.,0.),
1021  // "Window", logicWindow, physiWindowR, false, 0);
1022 
1023  fGapZ = fWindowZ + fWindowThick/2. + fGapThick/2. + 0.01*mm;
1024 
1025  fElectrodeZ = fGapZ + fGapThick/2. + fElectrodeThick/2. + 0.01*mm;
1026 
1027  // Absorber
1028 
1030  fAbsorberThickness/2. + 0.01*mm;
1031 
1032  fSolidAbsorber = new G4Box("Absorber", fAbsorberRadius,
1034 
1036  "Absorber");
1037 
1039  "Absorber", fLogicAbsorber,
1040  fPhysicsWorld, false, 0);
1041 
1042  if( fRegGasDet != 0 ) delete fRegGasDet;
1043  if( fRegGasDet == 0 ) fRegGasDet = new G4Region("XTRdEdxDetector");
1045 
1046  // Sensitive Detectors: Absorber
1047 
1049 
1050  if(!fCalorimeterSD)
1051  {
1052  fCalorimeterSD = new Em10CalorimeterSD("CalorSD",this);
1053  SDman->AddNewDetector( fCalorimeterSD );
1054  }
1056 
1058 
1059  return fPhysicsWorld;
1060 }
1061 
1062 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
1063 
1064 // Setuo from Y. Watase et al, NIM A248 (1986) 379-388 (fig.7; Li, e-, 2 Gev/c)
1065 
1067 {
1068  fWorldSizeZ = 400.*cm;
1069  fWorldSizeR = 20.*cm;
1070 
1071  // Radiator and detector parameters
1072 
1073  fRadThickness = 0.04*mm;
1074  fGasGap = 0.126*mm;
1076 
1077  fFoilNumber = 300;
1078 
1079  fAbsorberThickness = 30.0*mm;
1080 
1081  fAbsorberRadius = 100.*mm;
1082  fAbsorberZ = 136.*cm;
1083 
1084  fWindowThick = 51.0*micrometer;
1085  fElectrodeThick = 10.0*micrometer;
1086  fGapThick = 10.0*cm;
1087 
1088  fDetThickness = 30.0*mm;
1089  fDetLength = 200.0*cm;
1090  fDetGap = 0.01*mm;
1091 
1092  fStartR = 40*cm;
1093  fStartZ = 100.0*mm;
1094 
1095  fModuleNumber = 1;
1096 
1097  // Preparation of mixed radiator material
1098 
1099  G4Material* Li = fMat->GetMaterial("Li");
1100  // G4Material* Air = fMat->GetMaterial("Air");
1101  G4Material* He = fMat->GetMaterial("He");
1102  G4Material* Al = fMat->GetMaterial("Al");
1103  G4Material* Mylar = fMat->GetMaterial("Mylar");
1104 
1105  G4double foilDensity = 0.534*g/cm3;
1106  //Li 1.39*g/cm3; // Mylar 0.91*g/cm3; // CH2
1107  G4double gasDensity = 0.178*mg/cm3;
1108  // He 1.2928*mg/cm3; // Air // 1.977*mg/cm3; // CO2
1109 
1110  G4double totDensity = foilDensity*foilGasRatio +
1111  gasDensity*(1.0-foilGasRatio);
1112 
1113  G4double fractionFoil = foilDensity*foilGasRatio/totDensity;
1114  G4double fractionGas = gasDensity*(1.0-foilGasRatio)/totDensity;
1115 
1116  G4Material* radiatorMat = new G4Material("radiatorMat" , totDensity,
1117  2);
1118  radiatorMat->AddMaterial( Li, fractionFoil );
1119  radiatorMat->AddMaterial( He, fractionGas );
1120 
1121  // default materials of the detector and TR radiator
1122 
1123  fRadiatorMat = radiatorMat;
1124  fFoilMat = Li;
1125  fGasMat = He;
1126 
1127  fWindowMat = Mylar;
1128  fElectrodeMat = Al;
1129 
1130  fAbsorberMaterial = fMat->GetMaterial("Xe10CH4");
1131 
1133 
1134  fWorldMaterial = He; // Air; // CO2 ;
1135 
1137 
1139 
1140  fPhysicsWorld = new G4PVPlacement(0, G4ThreeVector(), "World",
1141  fLogicWorld, 0, false, 0);
1142 
1143  // TR radiator envelope
1144 
1146 
1147  fRadZ = fStartZ + 0.5*fRadThick;
1148 
1149  fSolidRadiator = new G4Box("Radiator",1.1*fAbsorberRadius ,
1150  1.1*fAbsorberRadius, 0.5*fRadThick );
1151 
1153  "Radiator");
1154 
1156  G4ThreeVector(0,0,fRadZ),
1157  "Radiator", fLogicRadiator,
1158  fPhysicsWorld, false, 0 );
1159 
1160  // create region for window inside windowR for
1161 
1162  if( fRadRegion != 0 ) delete fRadRegion;
1163  if( fRadRegion == 0 ) fRadRegion = new G4Region("XTRradiator");
1165 
1166  fWindowZ = fStartZ + fRadThick + fWindowThick/2. + 15.0*mm;
1167 
1168  // G4Box* solidWindowR = new G4Box("WindowR",fAbsorberRadius+0.001,
1169  // fAbsorberRadius+0.001,
1170  // fWindowThick/2.+0.001 );
1171 
1172  // G4LogicalVolume* logicWindowR = new G4LogicalVolume(solidWindowR,
1173  // fWorldMaterial, "WindowR");
1174 
1175  // G4VPhysicalVolume* physiWindowR = new G4PVPlacement(0,
1176  // G4ThreeVector(0.,0.,fWindowZ),
1177  // "WindowR",logicWindowR,fPhysicsWorld,false,0);
1178  // window
1179 
1180  // G4Box* solidWindow = new G4Box("Window",fAbsorberRadius,
1181  // fAbsorberRadius, fWindowThick/2.);
1182 
1183  // G4LogicalVolume* logicWindow = new G4LogicalVolume(solidWindow,
1184  // fWindowMat, "Window");
1185 
1186  // G4VPhysicalVolume* physiWindow =
1187  // new G4PVPlacement(0, G4ThreeVector(0.,0.,0.),
1188  // "Window", logicWindow, physiWindowR, false, 0);
1189 
1190  fGapZ = fWindowZ + fWindowThick/2. + fGapThick/2. + 0.01*mm;
1191 
1192  fElectrodeZ = fGapZ + fGapThick/2. + fElectrodeThick/2. + 0.01*mm;
1193 
1194  // Absorber
1195 
1197  fAbsorberThickness/2. + 0.01*mm;
1198 
1199  fSolidAbsorber = new G4Box("Absorber", fAbsorberRadius,
1201 
1203  "Absorber");
1204 
1206  "Absorber", fLogicAbsorber,
1207  fPhysicsWorld, false, 0);
1208 
1209  if( fRegGasDet != 0 ) delete fRegGasDet;
1210  if( fRegGasDet == 0 ) fRegGasDet = new G4Region("XTRdEdxDetector");
1212 
1213  // Sensitive Detectors: Absorber
1214 
1216 
1217  if(!fCalorimeterSD)
1218  {
1219  fCalorimeterSD = new Em10CalorimeterSD("CalorSD",this);
1220  SDman->AddNewDetector( fCalorimeterSD );
1221  }
1223 
1225 
1226  return fPhysicsWorld;
1227 }
1228 
1229 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
1230 
1231 // Setuo from G.D. Barr et al NIM A294 (1990) 465-472 (fig.11)
1232 
1234 {
1235  fWorldSizeZ = 400.*cm;
1236  fWorldSizeR = 20.*cm;
1237 
1238  // Radiator and detector parameters
1239 
1240  fRadThickness = 0.019*mm;
1241  fGasGap = 0.6*mm;
1243 
1244  fFoilNumber = 350;
1245 
1246  fAbsorberThickness = 50.0*mm;
1247 
1248  fAbsorberRadius = 100.*mm;
1249  fAbsorberZ = 136.*cm;
1250 
1251  fWindowThick = 51.0*micrometer;
1252  fElectrodeThick = 10.0*micrometer;
1253  fGapThick = 10.0*cm;
1254 
1255  fDetThickness = 50.0*mm;
1256  fDetLength = 200.0*cm;
1257  fDetGap = 0.01*mm;
1258 
1259  fStartR = 40*cm;
1260  fStartZ = 100.0*mm;
1261 
1262  fModuleNumber = 1;
1263 
1264  // Preparation of mixed radiator material
1265 
1266  G4Material* CH2 = fMat->GetMaterial("CH2");
1267  G4Material* CO2 = fMat->GetMaterial("CO2");
1268  G4Material* Air = fMat->GetMaterial("Air");
1269  G4Material* Al = fMat->GetMaterial("Al");
1270  G4Material* Mylar = fMat->GetMaterial("Mylar");
1271 
1272  G4double foilDensity = 0.91*g/cm3;
1273  // CH21.39*g/cm3; // Mylar // 0.534*g/cm3; //Li
1274  G4double gasDensity = 1.977*mg/cm3;
1275  // CO2 1.2928*mg/cm3; // Air // 0.178*mg/cm3; // He
1276 
1277  G4double totDensity = foilDensity*foilGasRatio +
1278  gasDensity*(1.0-foilGasRatio);
1279 
1280  G4double fractionFoil = foilDensity*foilGasRatio/totDensity;
1281  G4double fractionGas = gasDensity*(1.0-foilGasRatio)/totDensity;
1282 
1283  G4Material* radiatorMat = new G4Material("radiatorMat" , totDensity,
1284  2);
1285  radiatorMat->AddMaterial( CH2, fractionFoil );
1286  radiatorMat->AddMaterial( CO2, fractionGas );
1287 
1288  // default materials of the detector and TR radiator
1289 
1290  fRadiatorMat = radiatorMat;
1291  fFoilMat = CH2;
1292  fGasMat = CO2;
1293 
1294  fWindowMat = Mylar;
1295  fElectrodeMat = Al;
1296 
1297  fAbsorberMaterial = fMat->GetMaterial("Xe55He15CH4");
1298 
1300 
1301  fWorldMaterial = Air; // CO2; //
1302 
1304 
1306 
1307  fPhysicsWorld = new G4PVPlacement(0, G4ThreeVector(), "World",
1308  fLogicWorld, 0, false, 0);
1309 
1310  // TR radiator envelope
1311 
1313 
1314  fRadZ = fStartZ + 0.5*fRadThick;
1315 
1316  fSolidRadiator = new G4Box("Radiator",1.1*fAbsorberRadius ,
1317  1.1*fAbsorberRadius, 0.5*fRadThick );
1318 
1320  "Radiator");
1321 
1323  G4ThreeVector(0,0,fRadZ),
1324  "Radiator", fLogicRadiator,
1325  fPhysicsWorld, false, 0 );
1326 
1327  // create region for window inside windowR for
1328 
1329  if( fRadRegion != 0 ) delete fRadRegion;
1330  if( fRadRegion == 0 ) fRadRegion = new G4Region("XTRradiator");
1332 
1333  fWindowZ = fStartZ + fRadThick + fWindowThick/2. + 15.0*mm;
1334 
1335  // G4Box* solidWindowR = new G4Box("WindowR",fAbsorberRadius+0.001,
1336  // fAbsorberRadius+0.001,
1337  // fWindowThick/2.+0.001 );
1338 
1339  // G4LogicalVolume* logicWindowR = new G4LogicalVolume(solidWindowR,
1340  // fWorldMaterial, "WindowR");
1341  //
1342  // G4VPhysicalVolume* physiWindowR = new G4PVPlacement(0,
1343  // G4ThreeVector(0.,0.,fWindowZ),
1344  // "WindowR",logicWindowR,fPhysicsWorld,false,0);
1345  // window
1346 
1347  // G4Box* solidWindow = new G4Box("Window",fAbsorberRadius,
1348  // fAbsorberRadius, fWindowThick/2.);
1349 
1350  // G4LogicalVolume* logicWindow = new G4LogicalVolume(solidWindow,
1351  // fWindowMat, "Window");
1352 
1353  // G4VPhysicalVolume* physiWindow =
1354  // new G4PVPlacement(0, G4ThreeVector(0.,0.,0.),
1355  // "Window", logicWindow, physiWindowR, false, 0);
1356 
1357  fGapZ = fWindowZ + fWindowThick/2. + fGapThick/2. + 0.01*mm;
1358 
1359  fElectrodeZ = fGapZ + fGapThick/2. + fElectrodeThick/2. + 0.01*mm;
1360 
1361  // Absorber
1362 
1364  fAbsorberThickness/2. + 0.01*mm;
1365 
1366  fSolidAbsorber = new G4Box("Absorber", fAbsorberRadius,
1368 
1370  "Absorber");
1371 
1373  "Absorber", fLogicAbsorber,
1374  fPhysicsWorld, false, 0);
1375 
1376  if( fRegGasDet != 0 ) delete fRegGasDet;
1377  if( fRegGasDet == 0 ) fRegGasDet = new G4Region("XTRdEdxDetector");
1379 
1380  // Sensitive Detectors: Absorber
1381 
1383 
1384  if(!fCalorimeterSD)
1385  {
1386  fCalorimeterSD = new Em10CalorimeterSD("CalorSD",this);
1387  SDman->AddNewDetector( fCalorimeterSD );
1388  }
1390 
1392 
1393  return fPhysicsWorld;
1394 }
1395 
1396 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
1397 
1399 {
1400  // G4double inch = 2.54*cm;
1401  // G4double mil = inch/1000.0;
1402  // G4double GetzstartAbs() {return zstartAbs;};
1403  // G4double GetzendAbs() {return zendAbs;};
1404  // void ComputeCalorParameters();
1405 
1406  // void SetGammaCut(G4double cut){fGammaCut = cut;};
1407  // void SetElectronCut(G4double cut){fElectronCut = cut;};
1408  // void SetPositronCut(G4double cut){fPositronCut = cut;};
1409  // G4int fModelNumber ; // selection of parametrisation model1-10
1410  // void SetAlphaPlate (G4double val){fAlphaPlate = val;};
1411  // void SetAlphaGas (G4double val){fAlphaGas = val;};
1412 
1413  // G4double fAlphaPlate ;
1414  // G4double fAlphaGas ;
1415 
1416  // fAlphaPlate = 160.0;
1417  // fAlphaGas = 160.0;
1418  // fModelNumber = 0;
1419 
1420  // create commands for interactive definition of the calorimeter
1421 
1422  // fGammaCut = 23*mm;
1423  // fElectronCut = 23*mm;
1424  // fPositronCut = 23*mm;
1425 
1426  // G4cout << *(G4Material::GetMaterialTable()) << G4endl;
1427 
1428  // G4int i, j ;
1429  // G4int j ;
1430  // G4double zModule, zRadiator, rModule, rRadiator ;
1431 
1432  // complete the Calor parameters definition and Print
1433 
1434  //ComputeCalorParameters();
1435 
1436  // zRadiator ;
1437 
1438  // World
1439 
1440  // if(solidWorld) delete solidWorld ;
1441  // if(logicWorld) delete logicWorld ;
1442  // if(physiWorld) delete physiWorld ;
1443 
1444  // if(solidRadiator) delete solidRadiator;
1445  // if(logicRadiator) delete logicRadiator;
1446  // if(physiRadiator) delete physiRadiator;
1447 
1448  // radThick *= 1.02 ;
1449 
1450  // if(fSolidRadSlice) delete fSolidRadSlice;
1451  // if(fLogicRadSlice) delete fLogicRadSlice;
1452  // if(fPhysicRadSlice) delete fPhysicRadSlice;
1453  // fSolidRadSlice = new G4Box("RadSlice",fAbsorberRadius,
1454  // fAbsorberRadius,0.5*fRadThickness );
1455 
1456  // fLogicRadSlice = new G4LogicalVolume(fSolidRadSlice,fRadiatorMat,
1457  // "RadSlice",0,0,0);
1458 
1459 // for(j=0;j<fFoilNumber;j++)
1460 // {
1461 //
1462 // zRadiator = zModule + j*(fRadThickness + fGasGap) ;
1463 // G4cout<<zRadiator/mm<<" mm"<<"\t" ;
1464 // // G4cout<<"j = "<<j<<"\t" ;
1465 //
1466 // fPhysicRadSlice =
1467 // new G4PVPlacement(0,G4ThreeVector(0.,0.,zRadiator-zRad),
1468 // "RadSlice",fLogicRadSlice,
1469 // physiRadiator,false,j);
1470 // }
1471 // G4cout<<G4endl ;
1472 
1473  // fRadRegion->RemoveRootLogicalVolume(logicWindowR);
1474  // G4ProductionCuts* cutsR = 0;
1475  // cutsR = new G4ProductionCuts();
1476  // fRadRegion->SetProductionCuts(cutsR);
1477 
1478  // else // Second time - get a cut object from region
1479  {
1480  // cutsR = fRadRegion->GetProductionCuts();
1481  }
1482 
1483  // cutsR->SetProductionCut(fGammaCut,"gamma");
1484  // cutsR->SetProductionCut(fElectronCut,"e-");
1485  // cutsR->SetProductionCut(fPositronCut,"e+");
1486  // G4Box* solidGap = new G4Box("Gap",fAbsorberRadius, fAbsorberRadius,
1487  // fGapThick/2. ) ;
1488 
1489  // G4LogicalVolume* logicGap = new G4LogicalVolume(solidGap,fGapMat, "Gap");
1490 
1491  // G4VPhysicalVolume* physiGap = new G4PVPlacement(0,
1492  // G4ThreeVector(0.,0.,zGap),
1493  // "Gap",logicGap,physiWorld,false,0);
1494 
1495  // G4Box* solidElectrode = new G4Box("Electrode",fAbsorberRadius,
1496  // fAbsorberRadius, fElectrodeThick/2. );
1497 
1498  // G4LogicalVolume* logicElectrode = new G4LogicalVolume(solidElectrode,
1499  // fElectrodeMat, "Electrode");
1500 
1501  // G4VPhysicalVolume* physiElectrode = new G4PVPlacement(0,
1502  // G4ThreeVector(0.,0.,zElectrode),
1503  // "Electrode",logicElectrode,
1504  // physiWorld,false,0);
1505  // if(solidAbsorber) delete solidAbsorber;
1506  // if(logicAbsorber) delete logicAbsorber;
1507  // if(physiAbsorber) delete physiAbsorber;
1508 // if (fAbsorberThickness > 0.)
1509 // {
1510 // }
1511 
1512  // fRegGasDet->RemoveRootLogicalVolume(logicAbsorber);
1513  // G4ProductionCuts* cuts = 0;
1514  // cuts = new G4ProductionCuts();
1515  // fRegGasDet->SetProductionCuts(cuts);
1516  // else // Second time - get a cut object from region
1517  {
1518  // cuts = fRegGasDet->GetProductionCuts();
1519  }
1520 
1521  // cuts->SetProductionCut(fGammaCut,"gamma");
1522  // cuts->SetProductionCut(fElectronCut,"e-");
1523  // cuts->SetProductionCut(fPositronCut,"e+");
1524 
1525 }
1526 
1527 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
1528 
1530 {
1531  G4cout << "\n The WORLD is made of "
1532  << fWorldSizeZ/mm << "mm of " << fWorldMaterial->GetName();
1533  G4cout << ", the transverse size (R) of the world is " <<
1534  fWorldSizeR/mm << " mm. " << G4endl;
1535  G4cout << " The ABSORBER is made of "
1536  << fAbsorberThickness/mm << "mm of " << fAbsorberMaterial->GetName();
1537  G4cout << ", the transverse size (R) is " << fAbsorberRadius/mm <<
1538  " mm. " << G4endl;
1539  G4cout << " Z position of the (middle of the) absorber "
1540  << fAbsorberZ/mm << " mm." << G4endl;
1541 
1542  G4cout<<"fRadZ = "<<fRadZ/mm<<" mm"<<G4endl;
1543 
1544  G4cout<<"fStartZ = "<<fStartZ/mm<<" mm"<<G4endl;
1545 
1546  G4cout<<"fRadThick = "<<fRadThick/mm<<" mm"<<G4endl;
1547  G4cout<<"fFoilNumber = "<<fFoilNumber<<G4endl;
1548  G4cout<<"fRadiatorMat = "<<fRadiatorMat->GetName()<<G4endl;
1549  G4cout<<"WorldMaterial = "<<fWorldMaterial->GetName()<<G4endl;
1550  // G4cout<<"fAbsorberZ = "<<fAbsorberZ/mm<<" mm"<<G4endl;
1551  G4cout << G4endl;
1552 }
1553 
1554 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
1555 
1557 {
1558  // get the pointer to the material table
1559  const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
1560 
1561  // search the material by its name
1562  G4Material* pttoMaterial;
1563 
1564  for (size_t J=0 ; J<theMaterialTable->size() ; J++)
1565  {
1566  pttoMaterial = (*theMaterialTable)[J];
1567 
1568  if(pttoMaterial->GetName() == materialChoice)
1569  {
1570  fAbsorberMaterial = pttoMaterial;
1571  fLogicAbsorber->SetMaterial(pttoMaterial);
1572  // PrintCalorParameters();
1573  }
1574  }
1575 }
1576 
1577 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
1578 
1580 {
1581  // get the pointer to the material table
1582 
1583  const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
1584 
1585  // search the material by its name
1586 
1587  G4Material* pttoMaterial;
1588  for (size_t J=0 ; J<theMaterialTable->size() ; J++)
1589  {
1590  pttoMaterial = (*theMaterialTable)[J];
1591 
1592  if(pttoMaterial->GetName() == materialChoice)
1593  {
1594  fRadiatorMat = pttoMaterial;
1595 // fLogicRadSlice->SetMaterial(pttoMaterial);
1596  // PrintCalorParameters();
1597  }
1598  }
1599 }
1600 
1601 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
1602 
1604 {
1605  // get the pointer to the material table
1606  const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
1607 
1608  // search the material by its name
1609  G4Material* pttoMaterial;
1610 
1611  for (size_t J=0 ; J<theMaterialTable->size() ; J++)
1612  {
1613  pttoMaterial = (*theMaterialTable)[J];
1614 
1615  if(pttoMaterial->GetName() == materialChoice)
1616  {
1617  fWorldMaterial = pttoMaterial;
1618  fLogicWorld->SetMaterial(pttoMaterial);
1619  // PrintCalorParameters();
1620  }
1621  }
1622 }
1623 
1624 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
1625 
1627 {
1628  // change Absorber thickness and recompute the calorimeter parameters
1629  fAbsorberThickness = val;
1630  // ComputeCalorParameters();
1631 }
1632 
1633 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
1634 
1636 {
1637  // change XTR radiator thickness and recompute the calorimeter parameters
1638  fRadThickness = val;
1639  // ComputeCalorParameters();
1640 }
1641 
1642 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
1643 
1645 {
1646  // change XTR gas gap thickness and recompute the calorimeter parameters
1647  fGasGap = val;
1648  // ComputeCalorParameters();
1649 }
1650 
1651 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
1652 
1654 {
1655  // change the transverse size and recompute the calorimeter parameters
1656  fAbsorberRadius = val;
1657  // ComputeCalorParameters();
1658 }
1659 
1660 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
1661 
1663 {
1664  fWorldChanged=true;
1665  fWorldSizeZ = val;
1666  // ComputeCalorParameters();
1667 }
1668 
1669 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
1670 
1672 {
1673  fWorldChanged=true;
1674  fWorldSizeR = val;
1675  // ComputeCalorParameters();
1676 }
1677 
1678 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
1679 
1681 {
1682  fAbsorberZ = val;
1683  // ComputeCalorParameters();
1684 }
1685 
1686 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
1687 
1689 {
1690  //apply a global uniform magnetic field along X axis
1691 
1692  /* *********************************************************
1693 
1694  G4FieldManager* fieldMgr
1695  = G4TransportationManager::GetTransportationManager()->GetFieldManager();
1696 
1697  if(magField) delete magField; //delete the existing magn field
1698 
1699  if(fieldValue!=0.) // create a new one if non null
1700  {
1701  magField = new G4UniformMagField(G4ThreeVector(fieldValue,0.,0.));
1702  fieldMgr->SetDetectorField(magField);
1703  fieldMgr->CreateChordFinder(magField);
1704  }
1705  else
1706  {
1707  magField = 0;
1708  fieldMgr->SetDetectorField(magField);
1709  }
1710 
1711  *************************************************************** */
1712 
1713 }
1714 
1715 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
1716 
1718 {
1720 }
static const double cm
Definition: G4SIunits.hh:118
G4Material * Air
Definition: TRTMaterials.hh:57
CLHEP::Hep3Vector G4ThreeVector
void AddRootLogicalVolume(G4LogicalVolume *lv)
Definition: G4Region.cc:254
G4bool SetDetectorField(G4Field *detectorField)
void AddMaterial(G4Material *material, G4double fraction)
Definition: G4Material.cc:469
Definition: G4Box.hh:64
const G4String & GetName() const
Definition: G4Material.hh:178
static G4MaterialTable * GetMaterialTable()
Definition: G4Material.cc:589
std::vector< G4Material * > G4MaterialTable
G4double GetDensity() const
Definition: G4Material.hh:180
static void Clean()
Definition: G4SolidStore.cc:79
static const double mg
Definition: G4SIunits.hh:181
Definition of the Em10Materials class.
void SetFieldManager(G4FieldManager *pFieldMgr, G4bool forceToAllDaughters)
virtual void DefineWorldVolume(G4VPhysicalVolume *worldVol, G4bool topologyIsChanged=true)
Definition of the Em10CalorimeterSD class.
static G4PhysicalVolumeStore * GetInstance()
G4GLOB_DLL std::ostream G4cout
Em10DetectorMessenger * fDetectorMessenger
static G4LogicalVolumeStore * GetInstance()
static const double cm3
Definition: G4SIunits.hh:120
static G4SolidStore * GetInstance()
G4Material * GetMaterial(const G4String &)
static G4GeometryManager * GetInstance()
G4VPhysicalVolume * SetUpHarris73()
void AddNewDetector(G4VSensitiveDetector *aSD)
Definition: G4SDManager.cc:67
G4VPhysicalVolume * SimpleSetUpALICE()
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
static const double micrometer
Definition: G4SIunits.hh:99
static const double g
Definition: G4SIunits.hh:180
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
Definition of the Em10DetectorMessenger class.
Definition of the Em10DetectorConstruction class.
G4VPhysicalVolume * SetUpALICE06()
static const double degree
Definition: G4SIunits.hh:143
#define G4endl
Definition: G4ios.hh:61
void OpenGeometry(G4VPhysicalVolume *vol=0)
static const double tesla
Definition: G4SIunits.hh:265
double G4double
Definition: G4Types.hh:76
void CreateChordFinder(G4MagneticField *detectorMagField)
G4Material * CO2
Definition: TRTMaterials.hh:81
void SetMaterial(G4Material *pMaterial)
G4VPhysicalVolume * ConstructDetectorXTR()
static const double mm
Definition: G4SIunits.hh:114
void SetSensitiveDetector(G4VSensitiveDetector *pSDetector)
G4Material * Al
Definition: TRTMaterials.hh:74