Skip to content
Snippets Groups Projects
Commit 371ecfe7 authored by Yessica Dominguez's avatar Yessica Dominguez
Browse files

Delete construction.cc

parent 37aeec5f
No related branches found
No related tags found
No related merge requests found
#include "construction.hh"
MyDetectorConstruction::MyDetectorConstruction()
{
//************************//
// Number of layer //
nCols = 10;
nRows = 10;
fMessenger = new G4GenericMessenger(this, "/detector/", "Detector Construction");
fMessenger->DeclareProperty("nCols", nCols, "Number of cols");
fMessenger->DeclareProperty("nRows", nRows, "Number of rows");
fMessenger->DeclareProperty("atmosphere", isAtmosphere, "Construct Atmosphere");
DefineMaterials();
isAtmosphere = true;
//************************//
//Dimensions of Atmosphere//
xWorld = 1000.*m;
yWorld = 1000.*m;
zWorld = 1000.*m;
}
MyDetectorConstruction::~MyDetectorConstruction()
{}
//***********************************//
// Materials //
void MyDetectorConstruction::DefineMaterials()
{
G4NistManager* nist = G4NistManager::Instance();
worldMat = nist->FindOrBuildMaterial("G4_AIR");
//**********************//
G4double density0 = 1.29*kg/m3;
//Set it molar mass of elemets in the Atmosphere//
G4double aN = 14.01*g/mole;
G4double aO = 16.00*g/mole;
G4double aAr = 39.95*g/mole;
//************************//
//G4Element("Name of element", "Abreviation", atomic number, atomic masa) //
G4Element *elN = new G4Element("Nitrogen", "N", 7, aN);
G4Element *elO = new G4Element("Oxygen", "O", 8, aO);
G4Element* elAr = new G4Element("Argon", "Ar", 18, aAr);
//**********************//
//Set it Constants //
G4double f = 3; //degrees of freedom
G4double R = 8.3144626181532; // Universal constant of gas
G4double g0 = 9.81; // Gravity
G4double kappa = (f + 2) / f; // parametrization
G4double T = 293.15; // Standard temperatur at sea level
G4double M = (0.23 * 14.01 + 0.76 * 16.0 + 0.01 * 39.95 ) / 1000.; // Average molar mass of atmosphere
//*****************************//
// Creating the air
for (G4int i = 0; i < 10; i++)
{
std::stringstream stri;
stri << i;
G4double h = 2.e3 / 10. * i;
//h is the heught of each layer
//Divide by 5 because is the number of layers
G4double density = density0 * pow((1 - (kappa - 1) / kappa * M * g0 * h / (R * T)), (1 / (kappa - 1)));
Air[i] = new G4Material("G4_AIR_" + stri.str(), density, 3);
//("G4_AIR_" + stri.str() is the name of the material. It uses a string that combines "G4_AIR_" with the value of stri.str() to create unique names for each material.)
// Add the elements and their amount
Air[i]->AddElement(elN, 76 * perCent);
Air[i]->AddElement(elO, 23 * perCent);
Air[i]->AddElement(elAr, 1 * perCent);
}
}
//MATERIAL SESSION END
//********************************//
//ATMOSPHERE SET UP
void MyDetectorConstruction::ConstructAtmosphere()
{
solidAir = new G4Box("solidAir", xWorld, yWorld, zWorld/10.);
//*********************************//
// IT create layer : Air[0],Air[1]..., Air[4]
for(G4int i = 0; i < 10; i++)
{
logicAir[i] = new G4LogicalVolume(solidAir, Air[i], "logicAir");
physAir[i] = new G4PVPlacement(0, G4ThreeVector(0, 0, zWorld/10.*2.*i - zWorld + zWorld/10.), logicAir[i], "physAir", logicWorld, false, i, true);
}
}
//********************************//
//END ATMOSPHERE
//
//************************************//
G4VPhysicalVolume *MyDetectorConstruction::Construct()
{
// CREATE THE WORLD
solidWorld = new G4Box("solidWorld", xWorld, yWorld, zWorld);
logicWorld = new G4LogicalVolume(solidWorld, worldMat, "logicWorld");
physWorld = new G4PVPlacement(0, G4ThreeVector(0., 0., 0.), logicWorld, "physWorld", 0, false, 0, true);
// CREATE ATMOSPHERE
if(isAtmosphere)
ConstructAtmosphere();
return physWorld;
}
void MyDetectorConstruction::ConstructSDandField()
{}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment