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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/DetectorWatase86.cc (Version 11.3.0) and /examples/extended/electromagnetic/TestEm10/src/DetectorWatase86.cc (Version 10.6.p2)


  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/DetectorWatase86.cc
 27 /// \brief Implementation of the DetectorWatas     27 /// \brief Implementation of the DetectorWatase86 class
 28 //                                                 28 //
 29 //                                                 29 //
 30 //                                                 30 //
 31 //                                                 31 //
 32                                                    32 
 33 #include "DetectorWatase86.hh"                     33 #include "DetectorWatase86.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 //....oooOO0OOooo........oooOO0OOooo........oo     52 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 52                                                    53 
 53 DetectorWatase86::DetectorWatase86() : fRadiat <<  54 DetectorWatase86::DetectorWatase86()
                                                   >>  55   : fRadiatorDescription(0) 
                                                   >>  56 {}
 54                                                    57 
 55 //....oooOO0OOooo........oooOO0OOooo........oo     58 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 56                                                    59 
 57 DetectorWatase86::~DetectorWatase86()              60 DetectorWatase86::~DetectorWatase86()
 58 {                                                  61 {
 59   // delete fRadiatorDescription;                  62   // delete fRadiatorDescription;
 60   // the description is deleted in detector co <<  63         // the description is deleted in detector construction
 61 }                                                  64 }
 62                                                    65 
 63 //....oooOO0OOooo........oooOO0OOooo........oo     66 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 64                                                    67 
 65 G4VPhysicalVolume* DetectorWatase86::Construct     68 G4VPhysicalVolume* DetectorWatase86::Construct()
 66 {                                                  69 {
 67   // Geometry parameters                           70   // Geometry parameters
 68   //                                               71   //
 69                                                    72 
 70   G4cout << "DetectorWatase86 setup" << G4endl     73   G4cout << "DetectorWatase86 setup" << G4endl;
 71                                                    74 
 72   G4double worldSizeZ = 400. * cm;             <<  75   G4double worldSizeZ = 400.*cm;
 73   G4double worldSizeR = 20. * cm;              <<  76   G4double worldSizeR = 20.*cm;
 74                                                    77 
 75   // Radiator and detector parameters              78   // Radiator and detector parameters
 76                                                    79 
 77   G4double radThickness = 0.04 * mm;           <<  80   G4double radThickness = 0.04*mm;
 78   G4double gasGap = 0.126 * mm;                <<  81   G4double gasGap       = 0.126*mm;
 79   G4double foilGasRatio = radThickness / (radT <<  82   G4double foilGasRatio = radThickness/(radThickness+gasGap);
 80   G4double foilNumber = 300;                   <<  83   G4double foilNumber   = 300;
 81                                                <<  84 
 82   G4double absorberThickness = 30.0 * mm;      <<  85   G4double absorberThickness = 30.0*mm;
 83   G4double absorberRadius = 100. * mm;         <<  86   G4double absorberRadius   = 100.*mm;
 84                                                <<  87 
 85   G4double windowThick = 51.0 * micrometer;    <<  88   G4double windowThick    = 51.0*micrometer;
 86   G4double electrodeThick = 10.0 * micrometer; <<  89   G4double electrodeThick = 10.0*micrometer;
 87   G4double gapThick = 10.0 * cm;               <<  90   G4double gapThick       = 10.0*cm;
 88   G4double detGap = 0.01 * mm;                 <<  91   G4double detGap         = 0.01*mm;
 89                                                    92 
 90   G4double startZ = 100.0 * mm;                <<  93   G4double startZ       = 100.0*mm;
 91                                                    94 
 92   // Materials                                     95   // Materials
 93   //                                               96   //
 94                                                    97 
 95   // Change to create materials using NIST         98   // Change to create materials using NIST
 96   G4Material* li = Materials::GetInstance()->G     99   G4Material* li = Materials::GetInstance()->GetMaterial("Li");
 97   G4Material* he = Materials::GetInstance()->G    100   G4Material* he = Materials::GetInstance()->GetMaterial("He");
 98   G4Material* xe10CH4 = Materials::GetInstance    101   G4Material* xe10CH4 = Materials::GetInstance()->GetMaterial("Xe10CH4");
 99                                                   102 
100   G4double foilDensity = li->GetDensity();        103   G4double foilDensity = li->GetDensity();
101   G4double gasDensity = he->GetDensity();      << 104   G4double gasDensity  = he->GetDensity();  
102   G4double totDensity = foilDensity * foilGasR << 105   G4double totDensity  = foilDensity*foilGasRatio
                                                   >> 106                        + gasDensity*(1.0-foilGasRatio);
103                                                   107 
104   G4double fractionFoil = foilDensity * foilGa << 108   G4double fractionFoil =  foilDensity*foilGasRatio/totDensity;
105   G4double fractionGas = gasDensity * (1.0 - f << 109   G4double fractionGas  =  gasDensity*(1.0-foilGasRatio)/totDensity;
106   G4Material* radiatorMat = new G4Material("ra    110   G4Material* radiatorMat = new G4Material("radiatorMat", totDensity, 2);
107   radiatorMat->AddMaterial(li, fractionFoil);     111   radiatorMat->AddMaterial(li, fractionFoil);
108   radiatorMat->AddMaterial(he, fractionGas);      112   radiatorMat->AddMaterial(he, fractionGas);
109                                                   113 
110   // Radiator description                         114   // Radiator description
111   fRadiatorDescription = new RadiatorDescripti    115   fRadiatorDescription = new RadiatorDescription;
112   fRadiatorDescription->fFoilMaterial = li;  / << 116   fRadiatorDescription->fFoilMaterial  = li; // CH2; // Kapton; // Mylar ; // Li ; // CH2 ;
113   fRadiatorDescription->fGasMaterial = he;  // << 117   fRadiatorDescription->fGasMaterial   = he; // CO2; // He; //
114   fRadiatorDescription->fFoilThickness = radTh    118   fRadiatorDescription->fFoilThickness = radThickness;
115   fRadiatorDescription->fGasThickness = gasGap << 119   fRadiatorDescription->fGasThickness  = gasGap;
116   fRadiatorDescription->fFoilNumber = foilNumb    120   fRadiatorDescription->fFoilNumber = foilNumber;
117                                                   121 
118   G4Material* worldMaterial = he;  // CO2;     << 122   G4Material* worldMaterial    = he; // CO2;
119   G4Material* absorberMaterial = xe10CH4;         123   G4Material* absorberMaterial = xe10CH4;
120                                                   124 
121   // Volumes                                      125   // Volumes
122   //                                              126   //
                                                   >> 127  
                                                   >> 128   G4VSolid* solidWorld 
                                                   >> 129     = new G4Box("World", worldSizeR, worldSizeR, worldSizeZ/2.);
                                                   >> 130  
                                                   >> 131   G4LogicalVolume* logicWorld 
                                                   >> 132     = new G4LogicalVolume(solidWorld,  worldMaterial,  "World");
123                                                   133 
124   G4VSolid* solidWorld = new G4Box("World", wo << 134   G4VPhysicalVolume* physicsWorld 
125                                                << 135     = new G4PVPlacement(0, G4ThreeVector(), "World", logicWorld, 0,  false, 0);
126   G4LogicalVolume* logicWorld = new G4LogicalV << 
127                                                << 
128   G4VPhysicalVolume* physicsWorld =            << 
129     new G4PVPlacement(0, G4ThreeVector(), "Wor << 
130                                                   136 
131   // TR radiator envelope                         137   // TR radiator envelope
132                                                   138 
133   G4double radThick = foilNumber * (radThickne << 139   G4double radThick = foilNumber*(radThickness + gasGap) - gasGap + detGap;
134   G4double radZ = startZ + 0.5 * radThick;     << 140   G4double radZ = startZ + 0.5*radThick;
135                                                   141 
136   G4VSolid* solidRadiator =                    << 142   G4VSolid* solidRadiator 
137     new G4Box("Radiator", 1.1 * absorberRadius << 143     = new G4Box("Radiator", 1.1*absorberRadius, 1.1*absorberRadius, 0.5*radThick);
138                                                   144 
139   G4LogicalVolume* logicRadiator = new G4Logic << 145   G4LogicalVolume* logicRadiator 
140                                                << 146     = new G4LogicalVolume(solidRadiator, radiatorMat, "Radiator");
141   new G4PVPlacement(0, G4ThreeVector(0, 0, rad << 147  
142                     0);                        << 148   new G4PVPlacement(0, G4ThreeVector(0, 0, radZ),
                                                   >> 149                     "Radiator", logicRadiator, physicsWorld, false, 0 );
143                                                   150 
144   fRadiatorDescription->fLogicalVolume = logic    151   fRadiatorDescription->fLogicalVolume = logicRadiator;
145                                                   152 
146   // create region for radiator                   153   // create region for radiator
147                                                   154 
148   G4Region* radRegion = new G4Region("XTRradia    155   G4Region* radRegion = new G4Region("XTRradiator");
149   radRegion->AddRootLogicalVolume(logicRadiato    156   radRegion->AddRootLogicalVolume(logicRadiator);
150                                                   157 
151   G4double windowZ = startZ + radThick + windo << 158   G4double windowZ = startZ + radThick + windowThick/2. + 15.0*mm;
152                                                   159 
153   G4double gapZ = windowZ + windowThick / 2. + << 160   G4double gapZ = windowZ + windowThick/2. + gapThick/2. + 0.01*mm;
154                                                   161 
155   G4double electrodeZ = gapZ + gapThick / 2. + << 162   G4double electrodeZ = gapZ + gapThick/2. + electrodeThick/2. + 0.01*mm;
156                                                   163 
157   // Absorber                                     164   // Absorber
158                                                   165 
159   G4double absorberZ = electrodeZ + electrodeT << 166   G4double absorberZ = electrodeZ + electrodeThick/2.
                                                   >> 167                      + absorberThickness/2. + 0.01*mm;
160                                                   168 
161   G4VSolid* solidAbsorber =                    << 169   G4VSolid* solidAbsorber 
162     new G4Box("Absorber", absorberRadius, abso << 170     = new G4Box("Absorber", absorberRadius, absorberRadius, absorberThickness/2.);
163                                                   171 
164   G4LogicalVolume* logicAbsorber = new G4Logic << 172   G4LogicalVolume* logicAbsorber 
                                                   >> 173     = new G4LogicalVolume(solidAbsorber, absorberMaterial, "Absorber");
165                                                   174 
166   new G4PVPlacement(0, G4ThreeVector(0., 0., a << 175   new G4PVPlacement(0, G4ThreeVector(0., 0., absorberZ),
167                     false, 0);                 << 176                     "Absorber", logicAbsorber, physicsWorld, false, 0);
168                                                   177 
169   G4Region* regGasDet = new G4Region("XTRdEdxD    178   G4Region* regGasDet = new G4Region("XTRdEdxDetector");
170   regGasDet->AddRootLogicalVolume(logicAbsorbe    179   regGasDet->AddRootLogicalVolume(logicAbsorber);
171                                                   180 
172   // Sensitive Detectors: Absorber                181   // Sensitive Detectors: Absorber
173                                                   182 
174   SensitiveDetector* sd = new SensitiveDetecto    183   SensitiveDetector* sd = new SensitiveDetector("AbsorberSD");
175   G4SDManager::GetSDMpointer()->AddNewDetector << 184   G4SDManager::GetSDMpointer()->AddNewDetector(sd );
176   logicAbsorber->SetSensitiveDetector(sd);        185   logicAbsorber->SetSensitiveDetector(sd);
177                                                   186 
178   // Print geometry parameters                    187   // Print geometry parameters
179                                                   188 
180   G4cout << "\n The  WORLD   is made of " << w << 189   G4cout << "\n The  WORLD   is made of "
181          << worldMaterial->GetName();          << 190          << worldSizeZ/mm << "mm of " << worldMaterial->GetName();
182   G4cout << ", the transverse size (R) of the  << 191   G4cout << ", the transverse size (R) of the world is " 
183   G4cout << " The ABSORBER is made of " << abs << 192          << worldSizeR/mm << " mm. " << G4endl;
184          << absorberMaterial->GetName();       << 193   G4cout << " The ABSORBER is made of "
185   G4cout << ", the transverse size (R) is " << << 194          << absorberThickness/mm << "mm of " << absorberMaterial->GetName();
186   G4cout << " Z position of the (middle of the << 195   G4cout << ", the transverse size (R) is " 
                                                   >> 196          << absorberRadius/mm << " mm. " << G4endl;
                                                   >> 197   G4cout << " Z position of the (middle of the) absorber " 
                                                   >> 198          << absorberZ/mm << "  mm." << G4endl;
187                                                   199 
188   G4cout << "radZ = " << radZ / mm << " mm" << << 200   G4cout << "radZ = " << radZ/mm << " mm" << G4endl;
189   G4cout << "startZ = " << startZ / mm << " mm << 201   G4cout << "startZ = " << startZ/mm<< " mm" << G4endl;
190                                                   202 
191   G4cout << "fRadThick = " << radThick / mm << << 203   G4cout << "fRadThick = " << radThick/mm << " mm"<<G4endl;
192   G4cout << "fFoilNumber = " << foilNumber <<     204   G4cout << "fFoilNumber = " << foilNumber << G4endl;
193   G4cout << "fRadiatorMat = " << radiatorMat->    205   G4cout << "fRadiatorMat = " << radiatorMat->GetName() << G4endl;
194   G4cout << "WorldMaterial = " << worldMateria    206   G4cout << "WorldMaterial = " << worldMaterial->GetName() << G4endl;
195   G4cout << G4endl;                               207   G4cout << G4endl;
196                                                   208 
197   return physicsWorld;                            209   return physicsWorld;
198 }                                                 210 }
199                                                   211 
200 //....oooOO0OOooo........oooOO0OOooo........oo    212 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
                                                   >> 213 
201                                                   214