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