Geant4 Cross Reference |
1 // 1 2 // ******************************************* 3 // * License and Disclaimer 4 // * 5 // * The Geant4 software is copyright of th 6 // * the Geant4 Collaboration. It is provided 7 // * conditions of the Geant4 Software License 8 // * LICENSE and available at http://cern.ch/ 9 // * include a list of copyright holders. 10 // * 11 // * Neither the authors of this software syst 12 // * institutes,nor the agencies providing fin 13 // * work make any representation or warran 14 // * regarding this software system or assum 15 // * use. Please see the license in the file 16 // * for the full disclaimer and the limitatio 17 // * 18 // * This code implementation is the result 19 // * technical work of the GEANT4 collaboratio 20 // * By using, copying, modifying or distri 21 // * any work based on the software) you ag 22 // * use in resulting scientific publicati 23 // * acceptance of all terms of the Geant4 Sof 24 // ******************************************* 25 // 26 /// \file electromagnetic/TestEm10/src/Detecto 27 /// \brief Implementation of the DetectorBarr9 28 // 29 // 30 // 31 // 32 33 #include "DetectorBarr90.hh" 34 35 #include "Materials.hh" 36 #include "SensitiveDetector.hh" 37 38 #include "G4Box.hh" 39 #include "G4FieldManager.hh" 40 #include "G4LogicalVolume.hh" 41 #include "G4Material.hh" 42 #include "G4PVPlacement.hh" 43 #include "G4Region.hh" 44 #include "G4SDManager.hh" 45 #include "G4SystemOfUnits.hh" 46 #include "G4TransportationManager.hh" 47 #include "G4UniformMagField.hh" 48 #include "G4UnitsTable.hh" 49 #include "G4ios.hh" 50 51 //....oooOO0OOooo........oooOO0OOooo........oo 52 53 DetectorBarr90::DetectorBarr90() : fRadiatorDe 54 55 //....oooOO0OOooo........oooOO0OOooo........oo 56 57 DetectorBarr90::~DetectorBarr90() 58 { 59 // delete fRadiatorDescription; 60 // the description is deleted in detector co 61 } 62 63 //....oooOO0OOooo........oooOO0OOooo........oo 64 65 G4VPhysicalVolume* DetectorBarr90::Construct() 66 { 67 // Geometry parameters 68 // 69 70 G4cout << "DetectorBarr90 setup" << G4endl; 71 72 G4double worldSizeZ = 400. * cm; 73 G4double worldSizeR = 20. * cm; 74 75 // Radiator and detector parameters 76 77 G4double radThickness = 0.019 * mm; 78 G4double gasGap = 0.6 * mm; 79 G4double foilGasRatio = radThickness / (radT 80 G4double foilNumber = 350; 81 82 G4double absorberThickness = 50.0 * mm; 83 G4double absorberRadius = 100. * mm; 84 85 G4double electrodeThick = 10.0 * micrometer; 86 G4double windowThick = 51.0 * micrometer; 87 G4double gapThick = 10.0 * cm; 88 G4double detGap = 0.01 * mm; 89 90 G4double startZ = 100.0 * mm; 91 92 // Materials 93 // 94 95 // Change to create materials using NIST 96 G4Material* air = Materials::GetInstance()-> 97 G4Material* ch2 = Materials::GetInstance()-> 98 G4Material* co2 = Materials::GetInstance()-> 99 G4Material* xe55he15ch4 = Materials::GetInst 100 101 G4double foilDensity = ch2->GetDensity(); 102 G4double gasDensity = co2->GetDensity(); 103 G4double totDensity = foilDensity * foilGasR 104 105 G4double fractionFoil = foilDensity * foilGa 106 G4double fractionGas = gasDensity * (1.0 - f 107 G4Material* radiatorMat = new G4Material("ra 108 radiatorMat->AddMaterial(ch2, fractionFoil); 109 radiatorMat->AddMaterial(co2, fractionGas); 110 111 // Radiator description 112 fRadiatorDescription = new RadiatorDescripti 113 fRadiatorDescription->fFoilMaterial = ch2; 114 fRadiatorDescription->fGasMaterial = co2; / 115 fRadiatorDescription->fFoilThickness = radTh 116 fRadiatorDescription->fGasThickness = gasGap 117 fRadiatorDescription->fFoilNumber = foilNumb 118 119 G4Material* worldMaterial = air; // CO2; 120 G4Material* absorberMaterial = xe55he15ch4; 121 122 // Volumes 123 // 124 125 G4VSolid* solidWorld = new G4Box("World", wo 126 127 G4LogicalVolume* logicWorld = new G4LogicalV 128 129 G4VPhysicalVolume* physicsWorld = 130 new G4PVPlacement(0, G4ThreeVector(), "Wor 131 132 // TR radiator envelope 133 134 G4double radThick = foilNumber * (radThickne 135 G4double radZ = startZ + 0.5 * radThick; 136 137 G4VSolid* solidRadiator = 138 new G4Box("Radiator", 1.1 * absorberRadius 139 140 G4LogicalVolume* logicRadiator = new G4Logic 141 142 new G4PVPlacement(0, G4ThreeVector(0, 0, rad 143 0); 144 145 fRadiatorDescription->fLogicalVolume = logic 146 147 // create region for radiator 148 149 G4Region* radRegion = new G4Region("XTRradia 150 radRegion->AddRootLogicalVolume(logicRadiato 151 152 G4double windowZ = startZ + radThick + windo 153 154 G4double gapZ = windowZ + windowThick / 2. + 155 156 G4double electrodeZ = gapZ + gapThick / 2. + 157 158 // Absorber 159 160 G4double absorberZ = electrodeZ + electrodeT 161 162 G4VSolid* solidAbsorber = 163 new G4Box("Absorber", absorberRadius, abso 164 165 G4LogicalVolume* logicAbsorber = new G4Logic 166 167 new G4PVPlacement(0, G4ThreeVector(0., 0., a 168 false, 0); 169 170 G4Region* regGasDet = new G4Region("XTRdEdxD 171 regGasDet->AddRootLogicalVolume(logicAbsorbe 172 173 // Sensitive Detectors: Absorber 174 175 SensitiveDetector* sd = new SensitiveDetecto 176 G4SDManager::GetSDMpointer()->AddNewDetector 177 logicAbsorber->SetSensitiveDetector(sd); 178 179 // Print geometry parameters 180 181 G4cout << "\n The WORLD is made of " << w 182 << worldMaterial->GetName(); 183 G4cout << ", the transverse size (R) of the 184 G4cout << " The ABSORBER is made of " << abs 185 << absorberMaterial->GetName(); 186 G4cout << ", the transverse size (R) is " << 187 G4cout << " Z position of the (middle of the 188 189 G4cout << "radZ = " << radZ / mm << " mm" << 190 G4cout << "startZ = " << startZ / mm << " mm 191 192 G4cout << "fRadThick = " << radThick / mm << 193 G4cout << "fFoilNumber = " << foilNumber << 194 G4cout << "fRadiatorMat = " << radiatorMat-> 195 G4cout << "WorldMaterial = " << worldMateria 196 G4cout << G4endl; 197 198 return physicsWorld; 199 } 200 201 //....oooOO0OOooo........oooOO0OOooo........oo 202