File indexing completed on 2026-06-03 07:55:38
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 #include "DetectorSimpleALICE.hh"
0030
0031 #include "Materials.hh"
0032 #include "SensitiveDetector.hh"
0033
0034 #include "G4Box.hh"
0035 #include "G4FieldManager.hh"
0036 #include "G4LogicalVolume.hh"
0037 #include "G4Material.hh"
0038 #include "G4PVPlacement.hh"
0039 #include "G4Region.hh"
0040 #include "G4SDManager.hh"
0041 #include "G4SystemOfUnits.hh"
0042 #include "G4TransportationManager.hh"
0043 #include "G4UniformMagField.hh"
0044 #include "G4UnitsTable.hh"
0045 #include "G4ios.hh"
0046
0047
0048
0049 DetectorSimpleALICE::DetectorSimpleALICE() : fRadiatorDescription(0) {}
0050
0051
0052
0053 DetectorSimpleALICE::~DetectorSimpleALICE()
0054 {
0055
0056
0057 }
0058
0059
0060
0061 G4VPhysicalVolume* DetectorSimpleALICE::Construct()
0062 {
0063
0064
0065
0066 G4cout << "DetectorSimpleALICE setup" << G4endl;
0067
0068 G4double worldSizeZ = 400. * cm;
0069 G4double worldSizeR = 20. * cm;
0070
0071
0072
0073 G4double radThickness = 0.020 * mm;
0074 G4double gasGap = 0.250 * mm;
0075 G4double foilGasRatio = radThickness / (radThickness + gasGap);
0076 G4int foilNumber = 220;
0077
0078 G4double absorberThickness = 38.3 * mm;
0079 G4double absorberRadius = 100. * mm;
0080
0081 G4double windowThick = 51.0 * micrometer;
0082 G4double electrodeThick = 10.0 * micrometer;
0083 G4double gapThick = 10.0 * cm;
0084 G4double detGap = 0.01 * mm;
0085
0086 G4double startZ = 100.0 * mm;
0087
0088
0089
0090
0091
0092 G4Material* air = Materials::GetInstance()->GetMaterial("Air");
0093 G4Material* mylar = Materials::GetInstance()->GetMaterial("Mylar");
0094 G4Material* xe15CO2 = Materials::GetInstance()->GetMaterial("Xe15CO2");
0095
0096 G4double foilDensity = mylar->GetDensity();
0097 G4double gasDensity = air->GetDensity();
0098 G4double totDensity = foilDensity * foilGasRatio + gasDensity * (1.0 - foilGasRatio);
0099
0100 G4double fractionFoil = foilDensity * foilGasRatio / totDensity;
0101 G4double fractionGas = gasDensity * (1.0 - foilGasRatio) / totDensity;
0102
0103 G4Material* radiatorMat = new G4Material("radiatorMat", totDensity, 2);
0104 radiatorMat->AddMaterial(mylar, fractionFoil);
0105 radiatorMat->AddMaterial(air, fractionGas);
0106
0107
0108 fRadiatorDescription = new RadiatorDescription;
0109 fRadiatorDescription->fFoilMaterial = mylar;
0110
0111 fRadiatorDescription->fGasMaterial = air;
0112 fRadiatorDescription->fFoilThickness = radThickness;
0113 fRadiatorDescription->fGasThickness = gasGap;
0114 fRadiatorDescription->fFoilNumber = foilNumber;
0115
0116 G4Material* worldMaterial = air;
0117 G4Material* absorberMaterial = xe15CO2;
0118
0119
0120
0121
0122 G4VSolid* solidWorld = new G4Box("World", worldSizeR, worldSizeR, worldSizeZ / 2.);
0123
0124 G4LogicalVolume* logicWorld = new G4LogicalVolume(solidWorld, worldMaterial, "World");
0125
0126 G4VPhysicalVolume* physicsWorld =
0127 new G4PVPlacement(0, G4ThreeVector(), "World", logicWorld, 0, false, 0);
0128
0129
0130
0131 G4double radThick = foilNumber * (radThickness + gasGap) - gasGap + detGap;
0132 G4double radZ = startZ + 0.5 * radThick;
0133
0134 G4VSolid* solidRadiator =
0135 new G4Box("Radiator", 1.1 * absorberRadius, 1.1 * absorberRadius, 0.5 * radThick);
0136
0137 G4LogicalVolume* logicRadiator = new G4LogicalVolume(solidRadiator, radiatorMat, "Radiator");
0138
0139 new G4PVPlacement(0, G4ThreeVector(0, 0, radZ), "Radiator", logicRadiator, physicsWorld, false,
0140 0);
0141
0142 fRadiatorDescription->fLogicalVolume = logicRadiator;
0143
0144
0145
0146 G4Region* radRegion = new G4Region("XTRradiator");
0147 radRegion->AddRootLogicalVolume(logicRadiator);
0148
0149
0150
0151 G4VSolid* solidAbsorber =
0152 new G4Box("Absorber", absorberRadius, absorberRadius, absorberThickness / 2.);
0153
0154 G4LogicalVolume* logicAbsorber = new G4LogicalVolume(solidAbsorber, absorberMaterial, "Absorber");
0155
0156 G4double windowZ = startZ + radThick + windowThick / 2. + 15.0 * mm;
0157 G4double gapZ = windowZ + windowThick / 2. + gapThick / 2. + 0.01 * mm;
0158 G4double electrodeZ = gapZ + gapThick / 2. + electrodeThick / 2. + 0.01 * mm;
0159 G4double absorberZ = electrodeZ + electrodeThick / 2. + absorberThickness / 2. + 0.01 * mm;
0160
0161 new G4PVPlacement(0, G4ThreeVector(0., 0., absorberZ), "Absorber", logicAbsorber, physicsWorld,
0162 false, 0);
0163
0164 G4Region* regGasDet = new G4Region("XTRdEdxDetector");
0165 regGasDet->AddRootLogicalVolume(logicAbsorber);
0166
0167
0168
0169 SensitiveDetector* sd = new SensitiveDetector("AbsorberSD");
0170 G4SDManager::GetSDMpointer()->AddNewDetector(sd);
0171 logicAbsorber->SetSensitiveDetector(sd);
0172
0173
0174
0175 G4cout << "\n The WORLD is made of " << worldSizeZ / mm << "mm of "
0176 << worldMaterial->GetName();
0177 G4cout << ", the transverse size (R) of the world is " << worldSizeR / mm << " mm. " << G4endl;
0178 G4cout << " The ABSORBER is made of " << absorberThickness / mm << "mm of "
0179 << absorberMaterial->GetName();
0180 G4cout << ", the transverse size (R) is " << absorberRadius / mm << " mm. " << G4endl;
0181 G4cout << " Z position of the (middle of the) absorber " << absorberZ / mm << " mm." << G4endl;
0182
0183 G4cout << "radZ = " << radZ / mm << " mm" << G4endl;
0184 G4cout << "startZ = " << startZ / mm << " mm" << G4endl;
0185
0186 G4cout << "fRadThick = " << radThick / mm << " mm" << G4endl;
0187 G4cout << "fFoilNumber = " << foilNumber << G4endl;
0188 G4cout << "fRadiatorMat = " << radiatorMat->GetName() << G4endl;
0189 G4cout << "WorldMaterial = " << worldMaterial->GetName() << G4endl;
0190 G4cout << G4endl;
0191
0192 return physicsWorld;
0193 }
0194
0195