File indexing completed on 2026-09-10 08:28:16
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 "DetectorBari05.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 DetectorBari05::DetectorBari05() : fRadiatorDescription(0) {}
0050
0051
0052
0053 DetectorBari05::~DetectorBari05()
0054 {
0055
0056
0057 }
0058
0059
0060
0061 G4VPhysicalVolume* DetectorBari05::Construct()
0062 {
0063
0064
0065
0066 G4cout << "DetectorBari05 setup" << G4endl;
0067
0068 G4double worldSizeZ = 600. * cm;
0069 G4double worldSizeR = 22. * cm;
0070
0071
0072
0073 G4double radThickness = 0.0055 * mm;
0074 G4double gasGap = 0.23 * mm;
0075 G4double foilGasRatio = radThickness / (radThickness + gasGap);
0076 G4double foilNumber = 191;
0077
0078 G4double absorberThickness = 0.4 * mm;
0079 G4double absorberRadius = 100. * mm;
0080
0081 G4double electrodeThick = 100.0 * micrometer;
0082 G4double pipeLength = 50.0 * cm;
0083 G4double mylarThick = 20.0 * micrometer;
0084 G4double detGap = 0.01 * mm;
0085
0086 G4double startZ = 100.0 * mm;
0087
0088
0089
0090
0091
0092
0093
0094 G4Material* air = Materials::GetInstance()->GetMaterial("Air");
0095 G4Material* ch2 = Materials::GetInstance()->GetMaterial("CH2");
0096 G4Material* he = Materials::GetInstance()->GetMaterial("He");
0097 G4Material* si = Materials::GetInstance()->GetMaterial("Si");
0098
0099 G4double foilDensity = ch2->GetDensity();
0100 G4double gasDensity = air->GetDensity();
0101 G4double totDensity = foilDensity * foilGasRatio + gasDensity * (1.0 - foilGasRatio);
0102
0103 G4double fractionFoil = foilDensity * foilGasRatio / totDensity;
0104 G4double fractionGas = gasDensity * (1.0 - foilGasRatio) / totDensity;
0105 G4Material* radiatorMat = new G4Material("radiatorMat", totDensity, 2);
0106 radiatorMat->AddMaterial(ch2, fractionFoil);
0107 radiatorMat->AddMaterial(air, fractionGas);
0108
0109
0110 fRadiatorDescription = new RadiatorDescription;
0111 fRadiatorDescription->fFoilMaterial = ch2;
0112 fRadiatorDescription->fGasMaterial = air;
0113 fRadiatorDescription->fFoilThickness = radThickness;
0114 fRadiatorDescription->fGasThickness = gasGap;
0115 fRadiatorDescription->fFoilNumber = foilNumber;
0116
0117
0118 foilGasRatio = 0.99999;
0119 foilDensity = 1.2928 * mg / cm3;
0120 gasDensity = 0.178 * mg / cm3;
0121 totDensity = foilDensity * foilGasRatio + gasDensity * (1.0 - foilGasRatio);
0122
0123 fractionFoil = foilDensity * foilGasRatio / totDensity;
0124 fractionGas = gasDensity * (1.0 - foilGasRatio) / totDensity;
0125
0126 G4Material* pipeMat = new G4Material("pipeMat", totDensity, 2);
0127 pipeMat->AddMaterial(air, fractionFoil);
0128 pipeMat->AddMaterial(he, fractionGas);
0129
0130 G4Material* worldMaterial = air;
0131 G4Material* absorberMaterial = si;
0132
0133
0134
0135
0136 G4VSolid* solidWorld = new G4Box("World", worldSizeR, worldSizeR, worldSizeZ / 2.);
0137
0138 G4LogicalVolume* logicWorld = new G4LogicalVolume(solidWorld, worldMaterial, "World");
0139
0140 G4VPhysicalVolume* physicsWorld =
0141 new G4PVPlacement(0, G4ThreeVector(), "World", logicWorld, 0, false, 0);
0142
0143
0144
0145 G4double radThick = foilNumber * (radThickness + gasGap) - gasGap + detGap;
0146 G4double radZ = startZ + 0.5 * radThick;
0147
0148 G4VSolid* solidRadiator =
0149 new G4Box("Radiator", 1.1 * absorberRadius, 1.1 * absorberRadius, 0.5 * radThick);
0150
0151 G4LogicalVolume* logicRadiator = new G4LogicalVolume(solidRadiator, radiatorMat, "Radiator");
0152
0153 new G4PVPlacement(0, G4ThreeVector(0, 0, radZ), "Radiator", logicRadiator, physicsWorld, false,
0154 0);
0155
0156 fRadiatorDescription->fLogicalVolume = logicRadiator;
0157
0158
0159
0160 G4Region* radRegion = new G4Region("XTRradiator");
0161 radRegion->AddRootLogicalVolume(logicRadiator);
0162
0163
0164
0165
0166 G4double zElectrode1 = radZ - radThick / 2. - electrodeThick / 2.;
0167 G4double zElectrode2 = radZ + radThick / 2. + electrodeThick / 2.;
0168
0169 G4cout << "zElectrode1 = " << zElectrode1 / mm << " mm" << G4endl;
0170 G4cout << "zElectrode2 = " << zElectrode2 / mm << " mm" << G4endl;
0171 G4cout << "electrodeThick = " << electrodeThick / mm << " mm" << G4endl << G4endl;
0172
0173
0174
0175
0176 G4double pipeDist = 1. * cm;
0177 G4double zPipe = zElectrode2 + electrodeThick / 2. + pipeLength / 2. + pipeDist / 2.;
0178
0179 G4cout << "zPipe = " << zPipe / mm << " mm" << G4endl;
0180 G4cout << "pipeLength = " << pipeLength / mm << " mm" << G4endl << G4endl;
0181
0182
0183
0184
0185 G4double zMylar1 = zPipe - pipeLength / 2. - mylarThick / 2 - 0.01 * mm;
0186 G4double zMylar2 = zPipe + pipeLength / 2. + mylarThick / 2 + 0.01 * mm;
0187
0188 G4cout << "zMylar1 = " << zMylar1 / mm << " mm" << G4endl;
0189 G4cout << "zMylar2 = " << zMylar2 / mm << " mm" << G4endl;
0190 G4cout << "fMylarThick = " << mylarThick / mm << " mm" << G4endl << G4endl;
0191
0192
0193
0194
0195 G4double zMylar = zElectrode2 + electrodeThick / 2. + mylarThick / 2. + 1.0 * mm;
0196 zMylar += (pipeLength + pipeDist);
0197
0198 G4cout << "zMylar = " << zMylar / mm << " mm" << G4endl;
0199 G4cout << "mylarThick = " << mylarThick / mm << " mm" << G4endl << G4endl;
0200
0201
0202
0203 G4double absorberZ = zMylar + mylarThick / 2. + absorberThickness / 2.;
0204
0205 G4VSolid* solidAbsorber = new G4Box("Absorber", 10. * mm, 10. * mm, absorberThickness / 2.);
0206
0207 G4LogicalVolume* logicAbsorber = new G4LogicalVolume(solidAbsorber, absorberMaterial, "Absorber");
0208
0209 new G4PVPlacement(0, G4ThreeVector(0., 0., absorberZ), "Absorber", logicAbsorber, physicsWorld,
0210 false, 0);
0211
0212
0213
0214 G4Region* regGasDet = new G4Region("XTRdEdxDetector");
0215 regGasDet->AddRootLogicalVolume(logicAbsorber);
0216
0217
0218
0219 SensitiveDetector* sd = new SensitiveDetector("AbsorberSD");
0220 G4SDManager::GetSDMpointer()->AddNewDetector(sd);
0221 logicAbsorber->SetSensitiveDetector(sd);
0222
0223
0224
0225 G4cout << "\n The WORLD is made of " << worldSizeZ / mm << "mm of "
0226 << worldMaterial->GetName();
0227 G4cout << ", the transverse size (R) of the world is " << worldSizeR / mm << " mm. " << G4endl;
0228 G4cout << " The ABSORBER is made of " << absorberThickness / mm << "mm of "
0229 << absorberMaterial->GetName();
0230 G4cout << ", the transverse size (R) is " << absorberRadius / mm << " mm. " << G4endl;
0231 G4cout << " Z position of the (middle of the) absorber " << absorberZ / mm << " mm." << G4endl;
0232
0233 G4cout << "radZ = " << radZ / mm << " mm" << G4endl;
0234 G4cout << "startZ = " << startZ / mm << " mm" << G4endl;
0235
0236 G4cout << "fRadThick = " << radThick / mm << " mm" << G4endl;
0237 G4cout << "fFoilNumber = " << foilNumber << G4endl;
0238 G4cout << "fRadiatorMat = " << radiatorMat->GetName() << G4endl;
0239 G4cout << "WorldMaterial = " << worldMaterial->GetName() << G4endl;
0240 G4cout << G4endl;
0241
0242 return physicsWorld;
0243 }
0244
0245