21 #include "G4Material.hh" 25 #include "G4LogicalVolume.hh" 26 #include "G4PVPlacement.hh" 27 #include "G4RotationMatrix.hh" 28 #include "G4VisAttributes.hh" 29 #include "G4Colour.hh" 30 #include "G4RunManager.hh" 31 #include "G4Transform3D.hh" 35 #include "G4PhysicalConstants.hh" 36 #include "G4SystemOfUnits.hh" 43 : detConstruction(det){
98 G4LogicalVolume* gasLog(0);
99 G4VPhysicalVolume* gasPhys(0);
102 G4cout <<
"##################################################################" << G4endl
103 <<
"###### ActarSimGasDetectorConstruction::ConstructActarTPC() #######" << G4endl
104 <<
" Box-like gas geometry." << G4endl;
105 G4cout <<
" Box Parameters: " << G4endl
108 <<
" mm, gasBoxSizeZ = " <<
gasBoxSizeZ/mm <<
" mm" << G4endl
111 <<
" mm, gasBoxCenterZ = " <<
gasBoxCenterZ <<
" mm" << G4endl
113 G4cout <<
"##################################################################"<< G4endl;
149 gasLog =
new G4LogicalVolume(gasBox,
gasMaterial,
"gasLog");
151 gasPhys =
new G4PVPlacement(0,
153 gasLog,
"gasPhys",chamberLog,
false,0);
177 G4cout <<
"##################################################################" << G4endl
178 <<
"######## ActarSimGasDetectorConstruction::ConstructActarTPC() ########" << G4endl
179 <<
" Tube-like gas geometry." << G4endl;
180 G4cout <<
" Tube Parameters: " << G4endl
182 <<
" mm, lengthGasTub = " <<
lengthGasTub/mm <<
" mm" << G4endl
184 G4cout <<
"##################################################################" << G4endl;
193 gasLog =
new G4LogicalVolume(gasTub,
gasMaterial,
"gasLog");
195 gasPhys =
new G4PVPlacement(0,
197 gasLog,
"gasPhys",chamberLog,
false,0);
201 <<
" ERROR in ActarSimGasDetectorConstruction::ConstructActarTPC(). No valid volume type defined " 205 G4LogicalVolume* beamShieldLog(0);
206 G4VPhysicalVolume* beamShieldPhys;
211 G4cout <<
"##################################################################" << G4endl
212 <<
"######## ActarSimGasDetectorConstruction::ConstructActarTPC() ########" << G4endl
213 <<
" Beam shielding geometry." << G4endl;
214 G4cout <<
" Tube Parameters: " << G4endl
219 G4cout <<
"##################################################################" << G4endl;
221 G4Tubs* beamShieldTub;
225 beamShieldLog =
new G4LogicalVolume(beamShieldTub,
beamShieldMaterial,
"beamShieldLog");
227 beamShieldPhys =
new G4PVPlacement(0,
229 beamShieldLog,
"beamShieldPhys",gasLog,
false,0);
241 G4VisAttributes* gasVisAtt =
new G4VisAttributes(G4Colour(1.0,1.0,0.0));
242 G4VisAttributes* beamShieldVisAtt =
new G4VisAttributes(G4Colour(1.0,0.0,1.0));
243 gasVisAtt->SetVisibility(
true);
244 gasLog->SetVisAttributes(gasVisAtt);
268 G4Element* ele_H =
new G4Element(
"Hydrogen" ,
"H" , z= 1., a= 1.00794*g/mole);
271 G4Element* ele_C =
new G4Element(
"Carbon" ,
"C", z=6., a= 12.0107*g/mole);
274 G4Element* ele_F =
new G4Element(
"Fluorine" ,
"F", z=9., a=18.9984032*g/mole);
295 G4int ncomponents, natoms;
296 G4double fractionmass, abundance;
298 G4double Vm=0.08206*temperature*atmosphere/(pressure*kelvin);
300 G4Isotope* iso_H2=
new G4Isotope(
"iso_H2",z=1,n=2, a=2.0140*g/mole);
301 G4Element* ele_D=
new G4Element(
"Deuterium",
"D" , ncomponents=1);
302 ele_D->AddIsotope(iso_H2, abundance = 100.*perCent);
308 density = (2*1.00794/Vm)*mg/cm3;
310 new G4Material(
"H2", density, ncomponents=2, kStateGas, temperature, pressure);
311 H2->AddElement(ele_H, natoms=1);
312 H2->AddElement(ele_H, natoms=1);
316 density = (2*2.0140/Vm)*mg/cm3;
318 new G4Material(
"D2", density, ncomponents=2, kStateGas, temperature, pressure);
319 D2->AddElement(ele_D, natoms=1);
320 D2->AddElement(ele_D, natoms=1);
324 density = (4.0026/Vm)*mg/cm3;
326 new G4Material(
"He", z=2, a=4.0026*g/mole, density, kStateGas, temperature, pressure);
330 density = (39.9481/Vm)*mg/cm3;
332 new G4Material(
"Ar", z=2, a=39.9481*g/mole, density, kStateGas, temperature, pressure);
336 density = ((12.0107+4*18.9984032)/Vm)*mg/cm3;
338 new G4Material(
"CF4", density, ncomponents=2, kStateGas, temperature, pressure);
339 CF4->AddElement(ele_C, natoms=1);
340 CF4->AddElement(ele_F, natoms=4);
344 density = ((12.0107+4*1.00794)/Vm)*mg/cm3;
346 new G4Material(
"CH4", density, ncomponents=2, kStateGas, temperature, pressure) ;
347 CH4->AddElement(ele_C,1);
348 CH4->AddElement(ele_H,4);
352 density = ((4*12.0107+10*1.00794)/Vm)*mg/cm3;
354 new G4Material(
"iC4H10", density, ncomponents=2, kStateGas, temperature, pressure) ;
355 iC4H10->AddElement(ele_C,4);
356 iC4H10->AddElement(ele_H,10);
382 else if(mat==
"iC4H10"){
386 else if(mat==
"GasMix"){
389 G4double DensitySum=0;
391 G4double FractionMass[10];
393 G4Material *pttoMaterial[10];
405 density+= ((
gasMixRatio[i]*pttoMaterial[i]->GetDensity()));
407 DensitySum+=pttoMaterial[i]->GetDensity();
411 FractionMass[i]=pttoMaterial[i]->GetDensity()/DensitySum;
415 new G4Material(
"GasMix", density, ncomponents=NumberOfGasMix, kStateGas, temperature, pressure);
418 GasMix->AddMaterial( pttoMaterial[i], fractionmass = FractionMass[i] ) ;
429 G4Material* pttoMaterial = G4Material::GetMaterial(mat);
452 G4RunManager::GetRunManager()->
459 G4cout <<
"##################################################################" << G4endl
460 <<
"## ActarSimGasDetectorConstruction::PrintDetectorParameters() ###" << G4endl
461 <<
" The gas volume is a " ;
463 G4cout <<
"box; its parameters are:" << G4endl;
465 G4cout <<
"tube; its parameters are:" << G4endl;
466 G4cout <<
" The gas material is: " <<
gasMaterial << G4endl;
469 <<
"x" <<
gasBoxSizeZ/mm <<
" mm3 " << G4endl << G4endl ;
471 G4cout <<
" The gasTube parameters are: " << G4endl
473 <<
"mm, lengthGasTub = " <<
lengthGasTub/mm <<
" mm" << G4endl ;
475 G4cout <<
" The beam shielding parameters are:" << G4endl
481 G4cout <<
"##################################################################" G4double lengthGasTub
Length of the Gas Tube.
G4double gasBoxCenterY
Gas Box Y center.
G4double gasBoxCenterZ
Gas Box Z center.
void SetUpdateChamberMaterial(G4Material *)
G4int NumberOfGasMix
Number of gases in the gas mix (maximum 10)
void SetGasPressure(G4double val)
G4VPhysicalVolume * ConstructGas(G4LogicalVolume *)
Constructs the Gas volume detector elements.
G4String GetACTARTPCDEMOGeoIncludedFlag(void)
void SetBeamShieldMaterial(G4String)
Sets the material the medium is made of.
void SetGasMaterial(G4String)
G4LogicalVolume * GetChamberLogicalVolume()
void PrintDetectorParameters()
Prints Gas volume detector parameters.
G4double innerRadiusBeamShieldTub
Inner radius of the beam shielding tube.
G4double GetGasPressure(void)
G4double outerRadiusBeamShieldTub
Outer radius of the beam shielding tube.
G4VPhysicalVolume * Construct(G4LogicalVolume *)
Wrap for the construction functions within the TOF.
ActarSimGasDetectorConstruction(ActarSimDetectorConstruction *)
G4String GetACTARTPCGeoIncludedFlag(void)
void SetBeamShieldGeometry(G4String)
Sets the geometry of the detector (box or tube)
G4double gasBoxSizeY
Gas Box Y half-lengths.
G4String gasMixMaterial[10]
List of gas materials.
G4double GetGasBoxSizeY(void)
~ActarSimGasDetectorConstruction()
Destructor.
G4double GetGasBoxCenterX(void)
void SetDetectorGeometry(G4String)
Sets the geometry of the detector (box or tube)
void UpdateGeometry()
Updates Gas detector.
G4Material * gasMaterial
Pointer to the gas material.
ActarSimGasSD * GetGasSD(void)
ActarSimGasDetectorMessenger * gasMessenger
Pointer to the Messenger.
G4double gasBoxCenterX
Gas Box X center.
G4double gasMixRatio[10]
List of gas ratios in the mix.
G4double GetGasBoxCenterY(void)
G4double gasBoxSizeZ
Gas Box Z half-lengths.
G4double GetGasBoxSizeX(void)
void SetGasTemperature(G4double val)
G4double radiusGasTub
Radius of the Gas Tube.
G4double gasBoxSizeX
Gas Box X half-lengths.
G4VPhysicalVolume * GetChamberPhysicalVolume()
G4double GetGasBoxCenterZ(void)
G4double GetGasTemperature(void)
G4double lengthBeamShieldTub
Length of the beam shielding tube.
G4Material * beamShieldMaterial
Pointer to the beam shield material.
G4double GetGasBoxSizeZ(void)
ActarSimDetectorConstruction * detConstruction
Pointer to the global detector construction.
G4String beamShieldGeometry
Type of the detector geometry (tube)
G4String detectorGeometry
Type of the detector geometry (box or tube)