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 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /examples/extended/electromagnetic/TestEm10/src/DetectorALICE06.cc (Version 11.3.0) and /examples/extended/electromagnetic/TestEm10/src/DetectorALICE06.cc (Version 10.5)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
 26 /// \file electromagnetic/TestEm10/src/Detecto     26 /// \file electromagnetic/TestEm10/src/DetectorALICE06.cc
 27 /// \brief Implementation of the DetectorALICE     27 /// \brief Implementation of the DetectorALICE06 class
 28 //                                                 28 //
 29 //                                                 29 //
 30 //                                                 30 //
 31 //                                                 31 //
 32                                                    32 
 33 #include "DetectorALICE06.hh"                      33 #include "DetectorALICE06.hh"
 34                                                << 
 35 #include "Materials.hh"                        << 
 36 #include "SensitiveDetector.hh"                    34 #include "SensitiveDetector.hh"
                                                   >>  35 #include "Materials.hh"
 37                                                    36 
                                                   >>  37 #include "G4Material.hh"
 38 #include "G4Box.hh"                                38 #include "G4Box.hh"
 39 #include "G4FieldManager.hh"                   << 
 40 #include "G4LogicalVolume.hh"                      39 #include "G4LogicalVolume.hh"
 41 #include "G4Material.hh"                       << 
 42 #include "G4PVPlacement.hh"                        40 #include "G4PVPlacement.hh"
 43 #include "G4Region.hh"                         << 
 44 #include "G4SDManager.hh"                      << 
 45 #include "G4SystemOfUnits.hh"                  << 
 46 #include "G4TransportationManager.hh"          << 
 47 #include "G4UniformMagField.hh"                    41 #include "G4UniformMagField.hh"
                                                   >>  42 #include "G4FieldManager.hh"
                                                   >>  43 #include "G4TransportationManager.hh"
                                                   >>  44 #include "G4SDManager.hh"
                                                   >>  45 
                                                   >>  46 #include "G4Region.hh"
                                                   >>  47 
 48 #include "G4UnitsTable.hh"                         48 #include "G4UnitsTable.hh"
                                                   >>  49 #include "G4SystemOfUnits.hh"
 49 #include "G4ios.hh"                                50 #include "G4ios.hh"
 50                                                    51 
 51 #include <cmath>                                   52 #include <cmath>
 52                                                    53 
 53 //....oooOO0OOooo........oooOO0OOooo........oo     54 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 54                                                    55 
 55 DetectorALICE06::DetectorALICE06() : fRadiator <<  56 DetectorALICE06::DetectorALICE06()
                                                   >>  57   : fRadiatorDescription(0)
                                                   >>  58 {}
 56                                                    59 
 57 //....oooOO0OOooo........oooOO0OOooo........oo     60 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 58                                                    61 
 59 DetectorALICE06::~DetectorALICE06()                62 DetectorALICE06::~DetectorALICE06()
 60 {                                                  63 {
 61   // delete fRadiatorDescription;                  64   // delete fRadiatorDescription;
 62   // the description is deleted in detector co <<  65         // the description is deleted in detector construction
 63 }                                                  66 }
 64                                                    67 
 65 //....oooOO0OOooo........oooOO0OOooo........oo     68 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 66                                                    69 
 67 G4VPhysicalVolume* DetectorALICE06::Construct(     70 G4VPhysicalVolume* DetectorALICE06::Construct()
 68 {                                                  71 {
 69   // Geometry parameters                           72   // Geometry parameters
 70   //                                               73   //
 71                                                    74 
 72   G4cout << "DetectorALICE06 setup" << G4endl;     75   G4cout << "DetectorALICE06 setup" << G4endl;
 73                                                    76 
 74   G4double worldSizeZ = 600. * cm;             <<  77   G4double worldSizeZ = 600.*cm;
 75   G4double worldSizeR = 22. * cm;              <<  78   G4double worldSizeR = 22.*cm;
 76                                                    79 
 77   // Radiator and detector parameters              80   // Radiator and detector parameters
 78                                                    81 
 79   G4double radThickness = 0.020 * mm;          <<  82   G4double radThickness = 0.020*mm;
 80   G4double gasGap = 0.500 * mm;                <<  83   G4double gasGap       = 0.500*mm;  
 81   G4double foilGasRatio = radThickness / (radT <<  84   G4double foilGasRatio = radThickness/(radThickness+gasGap);
 82   G4int foilNumber = 120;                      <<  85   G4int foilNumber      = 120;
 83                                                <<  86 
 84   G4double absorberThickness = 37 * mm;        <<  87   G4double absorberThickness = 37*mm;
 85   G4double absorberRadius = 100. * mm;         <<  88   G4double absorberRadius    = 100.*mm;
 86                                                <<  89 
 87   G4double electrodeThick = 100.0 * micrometer <<  90   G4double electrodeThick = 100.0*micrometer;
 88   G4double pipeLength = 160.0 * cm;            <<  91   G4double pipeLength     = 160.0*cm;
 89   G4double mylarThick = 20.0 * micrometer;     <<  92   G4double mylarThick     = 20.0*micrometer;
 90   G4double detGap = 0.01 * mm;                 <<  93   G4double detGap         = 0.01*mm;
 91                                                    94 
 92   G4double startZ = 100.0 * mm;                <<  95   G4double startZ = 100.0*mm;
 93                                                    96 
 94   // Materials                                     97   // Materials
 95   //                                               98   //
 96                                                    99 
 97   // Change to create materials using NIST        100   // Change to create materials using NIST
 98   G4Material* air = Materials::GetInstance()-> << 101   G4Material* air   = Materials::GetInstance()->GetMaterial("Air");
 99   G4Material* ch2 = Materials::GetInstance()-> << 102   G4Material* ch2   = Materials::GetInstance()->GetMaterial("CH2");
100   G4Material* xe15CO2 = Materials::GetInstance    103   G4Material* xe15CO2 = Materials::GetInstance()->GetMaterial("Xe15CO2");
101                                                   104 
102   G4double foilDensity = ch2->GetDensity();       105   G4double foilDensity = ch2->GetDensity();
103   G4double gasDensity = air->GetDensity();     << 106   G4double gasDensity  = air->GetDensity();  
104   G4double totDensity = foilDensity * foilGasR << 107   G4double totDensity  = foilDensity*foilGasRatio 
                                                   >> 108                        + gasDensity*(1.0-foilGasRatio);
105                                                   109 
106   G4double fractionFoil = foilDensity * foilGa << 110   G4double fractionFoil =  foilDensity*foilGasRatio/totDensity;
107   G4double fractionGas = 1.0 - fractionFoil;   << 111   G4double fractionGas  =  1.0 - fractionFoil;
108   G4Material* radiatorMat = new G4Material("ra    112   G4Material* radiatorMat = new G4Material("radiatorMat", totDensity, 2);
109   radiatorMat->AddMaterial(ch2, fractionFoil);    113   radiatorMat->AddMaterial(ch2, fractionFoil);
110   radiatorMat->AddMaterial(air, fractionGas);     114   radiatorMat->AddMaterial(air, fractionGas);
111                                                   115 
112   // Radiator description                         116   // Radiator description
113   fRadiatorDescription = new RadiatorDescripti    117   fRadiatorDescription = new RadiatorDescription;
114   fRadiatorDescription->fFoilMaterial = ch2;   << 118   fRadiatorDescription->fFoilMaterial  = ch2;   // CH2; // Kapton; // Mylar ; // Li ; // CH2 ;
115   fRadiatorDescription->fGasMaterial = air;  / << 119   fRadiatorDescription->fGasMaterial   = air;   // CO2; // He; //
116   fRadiatorDescription->fFoilThickness = radTh    120   fRadiatorDescription->fFoilThickness = radThickness;
117   fRadiatorDescription->fGasThickness = gasGap << 121   fRadiatorDescription->fGasThickness  = gasGap;
118   fRadiatorDescription->fFoilNumber = foilNumb    122   fRadiatorDescription->fFoilNumber = foilNumber;
119                                                << 123   
120   G4Material* worldMaterial = air;  // CO2;    << 124   G4Material* worldMaterial    = air; // CO2;
121   G4Material* absorberMaterial = xe15CO2;         125   G4Material* absorberMaterial = xe15CO2;
122                                                   126 
123   // Volumes                                      127   // Volumes
124   //                                              128   //
                                                   >> 129  
                                                   >> 130   G4VSolid* solidWorld 
                                                   >> 131     = new G4Box("World", worldSizeR, worldSizeR, worldSizeZ/2.);
                                                   >> 132  
                                                   >> 133   G4LogicalVolume* logicWorld 
                                                   >> 134     = new G4LogicalVolume(solidWorld,  worldMaterial,  "World");
125                                                   135 
126   G4VSolid* solidWorld = new G4Box("World", wo << 136   G4VPhysicalVolume* physicsWorld 
127                                                << 137     = new G4PVPlacement(0, G4ThreeVector(), "World", logicWorld, 0,  false, 0);
128   G4LogicalVolume* logicWorld = new G4LogicalV << 
129                                                << 
130   G4VPhysicalVolume* physicsWorld =            << 
131     new G4PVPlacement(0, G4ThreeVector(), "Wor << 
132                                                   138 
133   // TR radiator envelope                         139   // TR radiator envelope
134                                                   140 
135   G4double radThick = foilNumber * (radThickne << 141   G4double radThick = foilNumber*(radThickness + gasGap) - gasGap + detGap;
136   G4double radZ = startZ + 0.5 * radThick;     << 142   G4double radZ = startZ + 0.5*radThick;
137                                                << 
138   G4VSolid* solidRadiator =                    << 
139     new G4Box("Radiator", 1.1 * absorberRadius << 
140                                                << 
141   G4LogicalVolume* logicRadiator = new G4Logic << 
142                                                   143 
143   new G4PVPlacement(0, G4ThreeVector(0, 0, rad << 144   G4VSolid* solidRadiator 
144                     0);                        << 145     = new G4Box("Radiator", 1.1*absorberRadius, 1.1*absorberRadius, 0.5*radThick);
145                                                   146 
                                                   >> 147   G4LogicalVolume* logicRadiator 
                                                   >> 148     = new G4LogicalVolume(solidRadiator, radiatorMat, "Radiator");
                                                   >> 149  
                                                   >> 150   new G4PVPlacement(0, G4ThreeVector(0, 0, radZ),
                                                   >> 151                     "Radiator", logicRadiator, physicsWorld, false, 0 );
                                                   >> 152   
146   fRadiatorDescription->fLogicalVolume = logic    153   fRadiatorDescription->fLogicalVolume = logicRadiator;
147                                                   154 
148   // Create region for radiator                   155   // Create region for radiator
149                                                   156 
150   G4Region* radRegion = new G4Region("XTRradia    157   G4Region* radRegion = new G4Region("XTRradiator");
151   radRegion->AddRootLogicalVolume(logicRadiato    158   radRegion->AddRootLogicalVolume(logicRadiator);
152                                                   159 
153   // Drift Electrode on both sides of Radiator    160   // Drift Electrode on both sides of Radiator
154   // (not placed)                                 161   // (not placed)
155                                                   162 
156   G4double zElectrode1 = radZ - radThick / 2.  << 163   G4double zElectrode1 = radZ - radThick/2. - electrodeThick/2.;
157   G4double zElectrode2 = radZ + radThick / 2.  << 164   G4double zElectrode2 = radZ + radThick/2. + electrodeThick/2.;
158                                                   165 
159   G4cout << "zElectrode1 = " << zElectrode1 /  << 166   G4cout << "zElectrode1 = " << zElectrode1/mm << " mm" <<G4endl;
160   G4cout << "zElectrode2 = " << zElectrode2 /  << 167   G4cout << "zElectrode2 = " << zElectrode2/mm << " mm" <<G4endl;
161   G4cout << "fElectrodeThick = " << electrodeT << 168   G4cout << "fElectrodeThick = " << electrodeThick/mm << " mm" << G4endl <<G4endl;
162                                                   169 
163   // Helium Pipe                                  170   // Helium Pipe
164   // (not placed)                                 171   // (not placed)
165                                                   172 
166   // Distance between pipe and radiator / abso << 173   //Distance between pipe and radiator / absorber
167   G4double pipeDist = 1. * cm;                 << 174   G4double pipeDist      = 1.*cm;
168   G4double zPipe = zElectrode2 + electrodeThic << 175   G4double zPipe = zElectrode2 + electrodeThick/2. + pipeDist/2. + pipeLength/2.;
169                                                   176 
170   G4cout << "zPipe = " << zPipe / mm << " mm"  << 177   G4cout << "zPipe = " << zPipe/mm << " mm" << G4endl;
171   G4cout << "pipeLength = " << pipeLength / mm << 178   G4cout << "pipeLength = " << pipeLength/mm <<" mm" << G4endl << G4endl;
172                                                   179 
173   // Mylar Foil on both sides of helium pipe      180   // Mylar Foil on both sides of helium pipe
174   // (not placed)                                 181   // (not placed)
175                                                   182 
176   G4double zMylar1 = zPipe - pipeLength / 2. - << 183   G4double zMylar1 = zPipe - pipeLength/2. - mylarThick/2. - 0.001*mm;
177   G4double zMylar2 = zPipe + pipeLength / 2. + << 184   G4double zMylar2 = zPipe + pipeLength/2. + mylarThick/2. + 0.001*mm;
178                                                   185 
179   G4cout << "zMylar1 = " << zMylar1 / mm << "  << 186   G4cout << "zMylar1 = " << zMylar1/mm << " mm" << G4endl;
180   G4cout << "zMylar2 = " << zMylar2 / mm << "  << 187   G4cout << "zMylar2 = " << zMylar2/mm << " mm" << G4endl;
181   G4cout << "fMylarThick = " << mylarThick / m << 188   G4cout << "fMylarThick = " << mylarThick/mm << " mm" << G4endl << G4endl;
182                                                   189 
183   // Mylar Foil on Chamber                        190   // Mylar Foil on Chamber
184   // (not placed)                                 191   // (not placed)
185                                                   192 
186   G4double zMylar = zElectrode2 + electrodeThi << 193   G4double zMylar = zElectrode2 + electrodeThick/2. + mylarThick/2. + 1.0*mm;
187   zMylar += (pipeLength + pipeDist);           << 194   zMylar += ( pipeLength + pipeDist );
188                                                   195 
189   G4cout << "zMylar = " << zMylar / mm << " mm << 196   G4cout << "zMylar = " << zMylar/mm <<" mm" <<G4endl;
190   G4cout << "mylarThick = " << mylarThick / mm << 197   G4cout << "mylarThick = " << mylarThick/mm << " mm" << G4endl << G4endl;
191                                                   198 
192   // Absorber                                     199   // Absorber
193                                                   200 
194   G4double absorberZ = zMylar + mylarThick + a << 201   G4double absorberZ = zMylar + mylarThick + absorberThickness/2.;
195                                                   202 
196   G4VSolid* solidAbsorber = new G4Box("Absorbe << 203   G4VSolid* solidAbsorber 
                                                   >> 204     = new G4Box("Absorber", absorberRadius, 10.*mm, absorberThickness/2.);
197                                                   205 
198   G4LogicalVolume* logicAbsorber = new G4Logic << 206   G4LogicalVolume* logicAbsorber 
                                                   >> 207     = new G4LogicalVolume(solidAbsorber, absorberMaterial, "Absorber");
199                                                   208 
200   new G4PVPlacement(0, G4ThreeVector(0., 0., a << 209   new G4PVPlacement(0, G4ThreeVector(0., 0., absorberZ),
201                     false, 0);                 << 210                     "Absorber", logicAbsorber, physicsWorld, false, 0);
202                                                   211 
203   G4Region* regGasDet = new G4Region("XTRdEdxD    212   G4Region* regGasDet = new G4Region("XTRdEdxDetector");
204   regGasDet->AddRootLogicalVolume(logicAbsorbe    213   regGasDet->AddRootLogicalVolume(logicAbsorber);
205                                                   214 
206   // Sensitive Detectors: Absorber                215   // Sensitive Detectors: Absorber
207                                                   216 
208   SensitiveDetector* sd = new SensitiveDetecto    217   SensitiveDetector* sd = new SensitiveDetector("AbsorberSD");
209   G4SDManager::GetSDMpointer()->AddNewDetector << 218   G4SDManager::GetSDMpointer()->AddNewDetector(sd );
210   logicAbsorber->SetSensitiveDetector(sd);        219   logicAbsorber->SetSensitiveDetector(sd);
211                                                   220 
212   // Print geometry parameters                    221   // Print geometry parameters
213                                                   222 
214   G4cout << "\n The  WORLD   is made of " << w << 223   G4cout << "\n The  WORLD   is made of "
215          << worldMaterial->GetName();          << 224          << worldSizeZ/mm << "mm of " << worldMaterial->GetName();
216   G4cout << ", the transverse size (R) of the  << 225   G4cout << ", the transverse size (R) of the world is " 
217   G4cout << " The ABSORBER is made of " << abs << 226          << worldSizeR/mm << " mm. " << G4endl;
218          << absorberMaterial->GetName();       << 227   G4cout << " The ABSORBER is made of "
219   G4cout << ", the transverse size (R) is " << << 228          << absorberThickness/mm << "mm of " << absorberMaterial->GetName();
220   G4cout << " Z position of the (middle of the << 229   G4cout << ", the transverse size (R) is " 
                                                   >> 230          << absorberRadius/mm << " mm. " << G4endl;
                                                   >> 231   G4cout << " Z position of the (middle of the) absorber " 
                                                   >> 232          << absorberZ/mm << "  mm." << G4endl;
221                                                   233 
222   G4cout << "radZ = " << radZ / mm << " mm" << << 234   G4cout << "radZ = " << radZ/mm << " mm" << G4endl;
223   G4cout << "startZ = " << startZ / mm << " mm << 235   G4cout << "startZ = " << startZ/mm<< " mm" << G4endl;
224                                                   236 
225   G4cout << "fRadThick = " << radThick / mm << << 237   G4cout << "fRadThick = " << radThick/mm << " mm"<<G4endl;
226   G4cout << "fFoilNumber = " << foilNumber <<     238   G4cout << "fFoilNumber = " << foilNumber << G4endl;
227   G4cout << "fRadiatorMat = " << radiatorMat->    239   G4cout << "fRadiatorMat = " << radiatorMat->GetName() << G4endl;
228   G4cout << "WorldMaterial = " << worldMateria    240   G4cout << "WorldMaterial = " << worldMaterial->GetName() << G4endl;
229   G4cout << G4endl;                               241   G4cout << G4endl;
230                                                   242 
231   return physicsWorld;                            243   return physicsWorld;
232 }                                                 244 }
233                                                   245 
234 //....oooOO0OOooo........oooOO0OOooo........oo    246 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
235                                                   247